Lesson 10 of 15

Damped Oscillator

Damped Oscillator

Real oscillators lose energy to friction and air resistance. The damped oscillator adds a velocity-proportional damping term:

x+2ζωx+ω2x=0x'' + 2\zeta\omega\, x' + \omega^2 x = 0

  • ω\omega: natural frequency (rad/s)
  • ζ\zeta (zeta): damping ratio (dimensionless)

Three Regimes

ConditionBehavior
ζ<1\zeta < 1Underdamped: oscillates with decaying amplitude
ζ=1\zeta = 1Critically damped: fastest return to 0 without oscillating
ζ>1\zeta > 1Overdamped: slowly returns to 0 without oscillating

As a System

Let v=xv = x':

dxdt=v\frac{dx}{dt} = v dvdt=2ζωvω2x\frac{dv}{dt} = -2\zeta\omega\, v - \omega^2 x

Numerical Solution (Symplectic Euler)

a = -2*zeta*omega*v - omega**2 * x
v = v + h * a
x = x + h * v

Applications

  • Suspension systems in cars (want ζ0.7\zeta \approx 0.7 for comfortable ride)
  • Building dampers for earthquake resistance
  • RLC circuits in electronics
  • Atomic force microscopy cantilevers

Your Task

Implement damped_oscillator(omega, zeta, x0, v0, t_end, n). Return (x, v).

Pyodide loading...
Loading...
Click "Run" to execute your code.