Skip to content
Tactiverge

School/✦ Research Engineer/Week 6

Linear ODEs you can solve by hand

Tap a wine glass, pluck a guitar string, release a car's suspension: one second-order equation describes them all. What does it predict?

About 50 min · 3 goals · Checked by automated tests

1.Why should I care?

Linear ODEs with constant coefficients are the workhorses of engineering dynamics. Knowing their exact solutions gives you benchmarks to test every numerical integrator you will write.

  • ◇ Solve dx/dt = −kx and interpret the time constant 1/k.
  • ◇ Solve m x″ + c x′ + k x = 0 via the characteristic equation and classify under-, critically and over-damped motion.
  • ◇ Compute ω_n = √(k/m) and ζ = c/(2√(km)) and predict the motion from them.

2.Watch

→ Watch the phase-space picture of the pendulum: position and velocity together form the state.

Introduces differential equations through a pendulum and shows why engineers so often solve them by stepping forward in time.

Length: see YouTube · captions on YouTube · source

Nothing loads from YouTube until you press play.

The video is optional: everything you need is also in the lesson text and the interactive.

3.Predict

A 1 kg mass on a 4 N/m spring with damping c = 0.8 N·s/m is released. What does it do?

Guess first. Being wrong here is how the surprise works.

4.Discover

In 'Mass–spring–damper' mode, set k = 4 and sweep c from 0 to 6. Watch the trajectories change from circles (c = 0) to spirals to straight-in curves. Note the value of c where the eigenvalues become real, and compare with 2√k.

Loading the interactive…

Can't use the interactive? Read a description instead

The phase-portrait diagram plots velocity against position with direction arrows and six trajectories. Sliders set stiffness and damping; text gives the eigenvalues, the critical damping value and the type of equilibrium (centre, spiral or node).

5.Checkpoint: guided practice

Check what you just discovered before going on. Hints appear after a wrong answer.

Practice 1 · a fresh version every time

A mass–spring–damper has m = 2 kg, k = 8 N/m, c = 4 N·s/m. What is its damping ratio ζ?

6.Understand

First order

dx/dt = −kx has solution x(t) = x₀ e^{−kt}. The time constant τ = 1/k is the time to fall to about 37%. After 5τ it is under 1%. RC circuits, cooling and many sensor lags are first-order.

Second order

m x″ + c x′ + k x = 0 needs two initial conditions (position and velocity). Its behaviour is set by ω_n (how fast it wants to oscillate) and ζ (how strongly it is damped). Engineers often design for ζ around 0.6–0.7: quick, with little overshoot.

Benchmarks for numerics

With c = 0, m = k = 1 and x(0) = 1, x′(0) = 0, the exact solution is x = cos t and the energy ½x′² + ½x² stays at 0.5 for ever. That exact answer is what week 7 uses to measure integrator errors.

Explain it another way

Stiffness wants to bring the mass back; inertia makes it overshoot; damping drains energy. ζ is the referee: below 1 the mass swings past, above 1 it creeps home.

Derivation: Solving m x″ + c x′ + k x = 0
  1. Try x = e^{rt}. Then x′ = r e^{rt}, x″ = r² e^{rt}, and the equation becomes (m r² + c r + k) e^{rt} = 0.

  2. So r solves the characteristic equation m r² + c r + k = 0: r = (−c ± √(c² − 4mk)) / (2m).

  3. Write ω_n = √(k/m) and ζ = c/(2√(km)). Then r = −ζω_n ± ω_n√(ζ² − 1).

  4. ζ > 1 (overdamped): two negative real roots, x = A e^{r₁t} + B e^{r₂t}. ζ = 1 (critical): x = (A + Bt) e^{−ω_n t}.

  5. ζ < 1 (underdamped): r = −ζω_n ± iω_d with ω_d = ω_n√(1 − ζ²), so x = e^{−ζω_n t}(A cos ω_d t + B sin ω_d t).

  6. A and B come from the initial position and velocity. By linearity, any combination of solutions is a solution (week 1).

Worked example 1

m = 2 kg, k = 50 N/m, c = 4 N·s/m. Find ω_n, ζ and ω_d.

ω_n = √(50/2) = 5 rad/s. ζ = 4/(2√100) = 0.2. ω_d = 5√(1 − 0.04) ≈ 4.90 rad/s. Underdamped; the envelope decays like e^{−1·t}.

Common mix-ups

  • More damping always makes a system settle faster.
    ✓ Beyond critical damping, it creeps more slowly. Fastest settling without overshoot is at ζ = 1.
  • The damped frequency equals the natural frequency.
    ✓ ω_d = ω_n√(1 − ζ²) is a little lower, noticeably so for large ζ.

7.Practice on your own

Practice, not a test. Wrong answers get a hint and another try.

Practice 2

A sensor obeys dx/dt = −4x (t in seconds). What is its time constant?

s

Practice 3 · a fresh version every time

A mass–spring–damper has m = 1 kg, k = 32 N/m, c = 4 N·s/m. What is its damping ratio ζ?

Practice 4

m = 0.5 kg, k = 200 N/m. What is ω_n in rad/s?

rad/s

Practice 5

For m = 1 kg and k = 9 N/m, what damping gives critical damping?

8.Apply it

In the Code Lab, plot the exact solutions for ζ = 0.1, 0.7, 1 and 2 with ω_n = 2 rad/s and x(0) = 1, x′(0) = 0. Mark the 2% settling time on each and say which you would choose for a camera gimbal.

9.Reflect

Concepts: Ordinary differential equations and state space · Derivative action and damping