Lite / Engineering Complex Systems / 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?
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.
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)?
- Its position only
- Its position and velocity
- Its position, velocity and acceleration
- Its whole past history
Guess first, then reveal
Position and velocity. Acceleration is not extra information: the spring law gives it from the position (and the damper from the velocity). Two energy stores, spring and mass, mean two states.
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?
What the interactive shows (text version)
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.
Watch (optional)
Watch for: 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.
“Linear Systems [Control Bootcamp]” by Steve Brunton (opens YouTube; streaming video uses a lot of data)
The video is optional. Everything you need is in this lesson's text.
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
Intuitive
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.
Technical
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.
Mathematical
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.
Applied
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.
Practice
Practice, not a test. Answers are checked on our server; a wrong answer gets a hint and another try. Nothing is saved.
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.
Reflect
What would go wrong if a robot's controller forgot one of its states?
Write your answer on paper or in your own notes. Lite never stores what you write.