School/□ Systems Engineer/Week 11
How many numbers does a system remember?
A photo shows a swing at the bottom of its arc. Can you say where it will be one second later?
About 30 min · 3 goals · Checked by automated tests
1.Why should I care?
Choosing the state is the first design decision in any simulation or controller. Too few states and your model cannot predict; too many and it becomes slow and hard to tune. A simple rule works surprisingly often: one state per independent place energy is stored.
- ◇ Define the state as the smallest set of variables that, with future inputs, determines all future behaviour.
- ◇ Choose state variables for thermal, mechanical and electrical systems by counting independent energy stores.
- ◇ Read a phase-plane trajectory as the path of the state over time.
2.Predict
A mass bounces on a spring. What is the minimum you need to know right now to predict its whole future motion (with no new forces)?
Guess first. Being wrong here is how the surprise works.
3.Discover
Start the mass at x₀ = 1 m with v₀ = 0, then at x₀ = 0 with v₀ = 2 m/s. Both pass through x = 0 at some point, but their paths in the phase plane never cross. Why can two trajectories never cross in the phase plane?
Loading the interactive…
Can't use the interactive? Read a description instead
The phase plane plots velocity against position. With damping, a trajectory starting at position 1 and zero velocity spirals inwards to the origin; one starting at the origin with velocity 2 traces a different spiral. The paths never cross. With no damping, paths are closed ellipses.
4.Checkpoint: guided practice
Check what you just discovered before going on. Hints appear after a wrong answer.
Practice 1
A car moving along a straight road, driven by an engine force against drag. You care about position and speed. How many states?
5.Watch
→ Stretch watch (university level): notice how the whole state is written as one vector x and its rate as A times x.
A university-level look at writing a system as dx/dt = Ax and solving it; a stretch watch for the state-space lesson.
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.
6.Understand
The state is the system's memory
If you know the state now and the inputs from now on, you can predict everything. Nothing else from the past matters. For a hot cup, temperature is enough. For a swing, you need angle and angular velocity: the photo at the bottom doesn't tell you which way it is moving or how fast.
Count the energy stores
Each independent place energy is stored usually gives one state: a capacitor's voltage, an inductor's current, a mass's velocity, a spring's stretch, a body's temperature, a tank's level. A mass on a spring has two stores, so two states, position and velocity.
The phase plane
Plot one state against the other and the system's history becomes a path. Each point has exactly one direction of travel (the arrows), so paths cannot cross: if they did, the same state would have two futures. Spirals mean oscillation dying away; closed loops mean oscillation that never dies.
Explain it another way
The state is the save file of a video game: load it and the game continues exactly as before. If the save file were missing your speed, you'd restart standing still.
A state vector x(t) ∈ ℝⁿ is minimal if no component can be computed from the others. For linear systems n equals the number of independent energy storage elements, which is also the order of the differential equation.
m·ẍ + c·ẋ + k·x = F is second order, so it needs two initial conditions, x(0) and ẋ(0). With x₁ = x, x₂ = ẋ: ẋ₁ = x₂ and ẋ₂ = (F − c·x₂ − k·x₁)/m.
A balancing robot's controller uses four states: wheel position, wheel speed, tilt angle and tilt rate. Drop the tilt rate and it cannot tell whether it is falling or recovering.
Worked example 1
How many states does a circuit with one resistor, one capacitor and one inductor in series need?
Two energy stores (capacitor's electric field, inductor's magnetic field), so two states: capacitor voltage and inductor current. The resistor stores nothing, so it adds no state.
Common mix-ups
- Acceleration is a state of a mass–spring system.
✓ Acceleration is computed from the states (position and velocity) and the force. It adds no new memory. - More states always make a better model.
✓ Extra states that don't store anything independent just add parameters to tune. Use the fewest that predict well.
7.Practice on your own
Practice, not a test. Wrong answers get a hint and another try.
Practice 2
Which variable is the natural state for a resistor–capacitor circuit?
Practice 3
Why can't two trajectories cross in a phase plane of a time-invariant system?
Practice 4
In the phase plane, a trajectory spirals into the origin. What is the mass doing?
Practice 5 · a fresh version every time
A mass–spring–damper has m = 12 kg and k = 200 N/m. What is its natural frequency ωn in rad/s?
8.Apply it
Choose states for (a) a water tower filling and draining, (b) a pendulum, (c) a heated room with thick walls. Justify each by naming the energy or material store. For (c), discuss whether the walls need their own state.
9.Reflect
Concepts: States and state-space models · Second-order systems: natural frequency and damping ratio