TactivergeLite

Lite / Textbooks / Applied Engineering Mathematics / Chapter 4

4. Differential equations and stability

Version 1 · Technically checked (automated checks only) · 4 source lessons · Full interactive version

Introduction

A second-order equation for a mass on a spring becomes two first-order equations, x′ = A·x, once you choose position and velocity as the state. Then a single matrix answers the big question: will the system settle? Its eigenvalues are the poles. Negative real parts mean decay, imaginary parts mean oscillation, and the slowest pole sets how long you wait. Power iteration shows how the dominant eigenvalue can be found by repetition alone.

Figure 4.1. Poles in the complex plane (described in words)

The complex plane with the stable left half shaded. The overdamped matrix [[0, 1], [−4, −5]] has real poles at −1 and −4. The underdamped matrix [[0, 1], [−10, −2]] has poles at −1 + 3i and −1 − 3i: it oscillates while its envelope decays like e^(−t).

Explanation

Built from 4 School lessons. Each part is the lesson's own explanation.

4.1 From one second-order equation to two first-order ones

Computers can only take small steps forward. How do you step forward an equation that talks about acceleration?

Any order, first-order steps

An nth-order equation needs n initial conditions, so it has n states. Define x₁ = y, x₂ = ẏ, …, xₙ = y⁽ⁿ⁻¹⁾. Each state's derivative is the next state, except the last, which comes from the original equation.

The A and B matrices

For linear systems the right-hand sides are weighted sums, so they fit in matrices: dx/dt = A·x + B·u. A says how the states push on each other; B says how the input pushes on each state. The same code steps any system once you supply A and B.

Eigenvalues preview

Each eigenvalue λ of A gives a mode that behaves like e^(λt). Negative real part: decays. Positive: grows. Imaginary part: oscillates. You will use this in week 15; for now, notice that the phase-plane readout's eigenvalues change exactly when the picture changes shape.

Derivation: Mass–spring–damper in state-space form
  1. Start from Newton's second law for a mass on a spring with a damper: m·ẍ = F − c·ẋ − k·x.

  2. Choose states x₁ = x (position) and x₂ = ẋ (velocity). Then ẋ₁ = x₂ by definition.

  3. Divide Newton's law by m: ẋ₂ = ẍ = −(k/m)·x₁ − (c/m)·x₂ + F/m.

  4. Stack them: d/dt [x₁; x₂] = [[0, 1], [−k/m, −c/m]]·[x₁; x₂] + [0; 1/m]·F. That is dx/dt = A·x + B·u with u = F.

  5. The eigenvalues of A solve λ² + (c/m)·λ + k/m = 0, the same characteristic equation as the original ODE: λ = −ζωn ± ωn√(ζ² − 1).

Common mix-ups

Open the Lite lesson: From one second-order equation to two first-order ones

4.2 Stable means bounded

A pencil balanced on its tip and a pencil lying flat both sit still. Only one of them is stable. What test tells them apart?

BIBO stability

A system is BIBO stable if every bounded input produces a bounded output. For linear systems this is the same as every natural mode decaying. A response that grows without limit after a small push, however slowly, is unstable.

Poles tell you

Each pole p of a linear system contributes e^(pt) to the response. Write p = σ + jω. If σ < 0 the mode decays, if σ > 0 it grows, and ω ≠ 0 makes it oscillate. So the test is simple: every pole in the left half-plane means stable.

Marginal cases

A pole exactly on the imaginary axis (σ = 0) neither grows nor decays: an undamped spring oscillates forever; a pure integrator holds its value. These are marginally stable: a bounded input at the right frequency can still make the output grow, so engineers treat them as not good enough.

Common mix-ups

Open the Lite lesson: Stable means bounded

4.3 Eigenvalues: stability from the A matrix

You have the A matrix of a robot joint but no time to simulate it. Can two numbers tell you whether it will settle?

Eigenvalues of a 2×2

For A = [[a, b], [c, d]] the eigenvalues solve λ² − (trace)·λ + det = 0, with trace = a + d and det = ad − bc. So λ = trace/2 ± √(trace²/4 − det). Complex when det > trace²/4.

Reading the result

Real part negative: that mode decays like e^(Re λ·t). Positive: grows. Imaginary part ω: oscillation at ω rad/s. For a 2×2 system, both real parts are negative exactly when trace < 0 and det > 0: a two-second stability check.

Linking back to ζ and ωn

For a mass–spring–damper, det = k/m = ωn² and trace = −c/m = −2ζωn. So the eigenvalues are −ζωn ± ωn√(ζ² − 1): the same poles as before. State-space and second-order thinking are one idea seen two ways.

Common mix-ups

Open the Lite lesson: Eigenvalues: stability from the A matrix

4.4 Power iteration: eigenvalues by repetition

Multiply a random vector by a matrix again and again. Why does it always end up pointing the same way?

The algorithm

Start with x₀ (not perpendicular to the dominant eigenvector). Repeat: y = A·xₖ, xₖ₊₁ = y/‖y‖. Estimate λ with the Rayleigh quotient r = xᵀAx / xᵀx. Normalising stops the numbers overflowing or underflowing; it does not change the direction.

Why it works and how fast

Write x₀ = c₁v₁ + c₂v₂ with |λ₁| > |λ₂|. Then Aᵏx₀ = λ₁ᵏ(c₁v₁ + c₂(λ₂/λ₁)ᵏv₂). The v₂ part dies like |λ₂/λ₁|ᵏ. For symmetric A, the Rayleigh quotient error dies even faster, like |λ₂/λ₁|²ᵏ.

Variations

If |λ₁| = |λ₂| (for example eigenvalues 2 and −2, or a complex pair), the direction never settles. Inverse iteration (apply A⁻¹, by solving with LU) finds the smallest eigenvalue; shifted inverse iteration with (A − σI)⁻¹ finds the one nearest σ. Production libraries use the QR algorithm, which is a sophisticated relative.

Common mix-ups

Open the Lite lesson: Power iteration: eigenvalues by repetition

Worked examples

From one second-order equation to two first-order ones: example 1

Write L·di/dt + R·i + q/C = V(t) with q the capacitor charge (i = dq/dt) in state-space form.

Solution

States x₁ = q, x₂ = i. Then ẋ₁ = x₂ and ẋ₂ = (V − R·x₂ − x₁/C)/L. So A = [[0, 1], [−1/(LC), −R/L]], B = [0; 1/L]. It has the same shape as the mass–spring–damper with m ↔ L, c ↔ R, k ↔ 1/C.

Stable means bounded: example 1

Poles at −2, −0.5 ± 4j. Stable? Which mode lasts longest?

Solution

All real parts are negative: stable. The pair at −0.5 decays slowest (envelope halves every ln 2/0.5 ≈ 1.4 s) and oscillates at 4 rad/s, so the response will ring for a few seconds.

Eigenvalues: stability from the A matrix: example 1

m = 1, c = 2, k = 5. Find the eigenvalues, ζ and ωn.

Solution

A = [[0, 1], [−5, −2]]: trace −2, det 5. λ = −1 ± 2j. ωn = √5 = 2.24 rad/s, ζ = 2/(2√5) = 0.447. Check: −ζωn = −1 ✓.

Power iteration: eigenvalues by repetition: example 1

One step of power iteration on A = [[2, 1], [1, 2]] from x₀ = (1, 0). Find the new estimate.

Solution

A x₀ = (2, 1); normalise: x₁ = (2, 1)/√5. Ax₁ = (5, 4)/√5. Rayleigh quotient = x₁·Ax₁ = (10 + 4)/5 = 2.8. (True λ₁ = 3.)

Interactive figures, in words

Figure 4.2 from From one second-order equation to two first-order ones

Set c = 0 and k = 4 and check the eigenvalues read 0 ± 2j. Now raise c slowly. Find the value of c where the eigenvalues stop having an imaginary part, and check it against c = 2√(km).

With damping c = 0 and stiffness 4, the phase-plane path is a closed ellipse and the eigenvalues are 0 ± 2j. As c increases the path becomes an inward spiral and the eigenvalues get a negative real part. At c = 4 (twice the square root of k times m) the imaginary part vanishes and the path slides into the origin without circling.

Figure 4.3 from Stable means bounded

Move σ from −3 to +1 with ω = 3. Note the σ where the response stops dying away. Then set ω = 0 and repeat. Describe in one sentence what σ controls and what ω controls.

The pole locator shows an s-plane with the right half shaded as unstable and a plot of e^(σt)·cos(ωt). With σ negative the oscillation dies away; at σ = 0 it keeps a constant size; with σ positive it grows. Raising ω makes the oscillation faster without changing whether it grows.

Figure 4.4 from Power iteration: eigenvalues by repetition

Step through [[2, 1], [1, 2]] and then the 'close eigenvalues' matrix. Count how many steps each needs before the estimate stops changing in the third digit, and compare with |λ₂/λ₁| in the readout.

The power-iteration animator steps a unit vector through repeated multiplication by A, plotting previous iterates as dots and the dominant eigen-line as a band. A table lists the estimate at each step; a step button works without animation, and Play is disabled under reduced motion.

The interactive versions are in the full chapter.

Laboratory

These run in a browser on the full site (they need a faster connection). Simulations are simplified educational models.

Practice

Each question links to its Lite lesson, where your answer is checked on our server and a wrong answer gets a hint. Answers are never sent to your device.

  1. In A = [[0, 1], [−k/m, −c/m]], what does the entry −c/m in the bottom-right mean?
    Answer it in “From one second-order equation to two first-order ones”
  2. How many states does d³y/dt³ + 2ÿ + 3ẏ + y = u need?
    Answer it in “From one second-order equation to two first-order ones”
  3. Which set of poles gives a stable system?
    Answer it in “Stable means bounded”
  4. Poles at −10 and −0.2. Which dominates the long-term response?
    Answer it in “Stable means bounded”
  5. A has trace −3 and determinant 2. Stable?
    Answer it in “Eigenvalues: stability from the A matrix”
  6. A = [[0, 1], [−10, −2]]. What is the size of the imaginary part of its eigenvalues (rad/s)?
    Answer it in “Eigenvalues: stability from the A matrix”
  7. With |λ₂/λ₁| = 0.5, about how many steps reduce the unwanted component by a factor of 10⁶? (Nearest whole step.)
    Answer it in “Power iteration: eigenvalues by repetition”
  8. To find the smallest-magnitude eigenvalue, you…
    Answer it in “Power iteration: eigenvalues by repetition”

Engineering applications

Suspension and mounts

A machine mount is designed by placing its poles: far enough left to settle quickly, with imaginary parts small enough that the ringing dies before the next disturbance.

Large structural models

Finite-element models of bridges have thousands of states. Engineers never factor the whole characteristic polynomial; iterative methods related to power iteration find the few modes that matter.

Watch (optional)

Streaming video uses a lot of data. Everything you need is in the text.

Summary

Glossary

Damping ratio
The damping ratio ζ describes how quickly oscillations die out in a second-order system: below 1 it oscillates, exactly 1 is critically damped, above 1 it creeps to the target without overshoot. Field Guide
First-order system and time constant
A first-order system responds to a step by approaching its new value exponentially; its time constant τ is the time to cover 63.2 % of the change. Field Guide
Overshoot
Overshoot is how far a response goes past its final value, usually given as a percentage of the step size. Field Guide
Settling time and rise time
Settling time is how long a response takes to enter and stay within a band, often 2 %, of its final value. Rise time is how long it takes to go from 10 % to 90 % of the step. Field Guide

Project: Place the poles of a mount

A 2 kg instrument sits on a spring mount. Choose stiffness and damping so that it settles within 0.5 s and overshoots by no more than 10 %. Show the A matrix, the eigenvalues and a simulated step response.

Deliverables

Write it up on paper or in your own notes. Lite never stores what you write.

References

← 3. Linearisation, Jacobians and Newton's method5. Fourier and transform thinking →