0

I'm currently trying to generate a plot showing what happens to a damped oscillator when it's critically damped using the following code:

Remove["Global`*"]
DE[β_] = x''[t] + 2 β x'[t] + ω0^2*x[t] == 0;
eqnlist = {DE[β], x[0] == A0, x'[0] == 0};
soln = DSolve[eqnlist, x[t], t] // FullSimplify
xs[t_] := x[t] /. soln;
x3[t_] = xs[t] /. {β -> 2 π};
tmin = 0;
tmax = 10;
A0 = 5;
ω0 = 2 π;
Plot[x3[t], {t, tmin, tmax}]

The problem arises when ω0=β because the denominator becomes 0 at that point, and then you get Power "Infinite expression encountered" errors.

Roman
  • 47,322
  • 2
  • 55
  • 121

1 Answers1

1

take the limit $\beta\to\omega_0$:

Remove["Global`*"]
DE[β_] = x''[t] + 2 β x'[t] + ω0^2*x[t] == 0;
eqnlist = {DE[β], x[0] == A0, x'[0] == 0};
soln = DSolve[eqnlist, x[t], t] // FullSimplify;
xs[{ω0_, β_}, t_] = x[t] /. First[soln];
xscritical[ω0_, t_] = Limit[xs[{ω0, β}, t], β -> ω0]

A0 E^(-t ω0) (1 + t ω0)

Roman
  • 47,322
  • 2
  • 55
  • 121