03 Control Systems · #13 of 46

State-Space

Stop chasing one output at a time. Describe the whole machine as a single vector that knows where it's going next

A transfer function is a confession that you only care about one input and one output. The moment your robot has six joints, three accelerometers, and two wheels that talk to each other, that single fraction collapses under its own algebra.

So the 1960s threw it out and started over with a sentence: here is everything the machine remembers, and here is the rule for what it does next.

That "everything it remembers" is a list of numbers (position, velocity, angle, current) stacked into one vector called the state, written xx. Instead of asking "what comes out when I poke this input," state-space asks a humbler, deeper question: given exactly where the system is right now, which direction is it about to move? The answer is one matrix multiply.

Watch a system decide where to go

The picture below is that rule made visible. Every tiny arrow shows the direction the state would slide from that point; long arrows mean fast motion, short ones mean slow. The four sliders are the entries of the AA matrix: change them and the entire arrow field re-flows. Tap anywhere to drop an initial condition, and the trajectory is integrated forward, obediently following the arrows. Drop several and watch the whole plane reveal its personality.

Tap to plant a trajectory

eigenvalues
tr(A)
det(A)
type
what to try
  • Press the "damped spring" preset. Then tap a few spots far from the origin. Every trajectory spirals inward and eventually dies at . The eigenvalues in the metric row are a conjugate pair with negative real part: the classic stable-spiral signature.
  • Slide A₂₂ from −0.4 toward zero. Watch the spiraling slow down. At A₂₂ = 0, trajectories are perfect closed circles, no decay, no growth. The eigenvalues just crossed the imaginary axis: real part = 0. Keep going past zero, and trajectories now spiral outward: same shape, opposite time direction. The system became unstable.
  • Try the "saddle" preset. The eigenvalues are now one positive, one negative. There are two special directions (eigenvectors): trajectories along one come into the origin, along the other they run away. Generic trajectories follow a hyperbola-like path. This is the textbook unstable-equilibrium shape, like a ball on a saddle.
  • Watch the metrics as you slide. Notice that and are the same numbers that decide the transfer-function pole locations.

The four presets are the canonical shapes you meet in any dynamics textbook: pure oscillation (a spring that never tires), a damped spiral (a spring with friction), a saddle (a ball balanced on a horse's saddle), and an unstable spiral (the same spring, run backward, flying apart). The eigenvalues in the metrics row are the system's fingerprint: their real part says how fast trajectories grow or decay, their imaginary part says how fast they spin.

The core idea is almost embarrassingly compact. A system is just a state vector xx evolving by a rule that says given where you are, here's the direction you must move. Inputs uu nudge that motion; outputs yy are whatever you happen to be able to measure. That is the entire grammar of modern control: four matrices, AA, BB, CC, DD, and a vector that remembers. It was Rudolf Kálmán who, in the 1960s, recast control around this state-vector equation.

A Boeing 747-400 cockpit instrument panel showing attitude, heading, airspeed, altitude, and navigation displays.
An aircraft's state vector at a glance: attitude, heading, airspeed, altitude, and position, all tracked at once. · Saschaporsche, CC BY-SA 4.0
The math: ẋ = A x + B u, eigenvalues, and the trace-determinant shortcut

A linear system is described entirely by two equations: a state equation that says how the internal state evolves, and an output equation that says what you can observe:

x˙=Ax+Bu,y=Cx+Du\dot{x} = A x + B u, \qquad y = C x + D u

Here xx is the state vector, uu the inputs, yy the outputs, and AA, BB, CC, DD are matrices sized to fit. A second-order ODE like q¨+0.4q˙+q=u\ddot{q} + 0.4\,\dot{q} + q = u becomes this form by naming x1=qx_1 = q (position) and x2=q˙x_2 = \dot{q} (velocity), giving a 2×22 \times 2 matrix AA, exactly the four sliders in the demo.

For a 2×22 \times 2 matrix AA, the eigenvalues are the roots of the characteristic polynomial

λ2tr(A)λ+det(A)=0\lambda^2 - \operatorname{tr}(A)\,\lambda + \det(A) = 0

which is why the trace and determinant alone fix the dynamics: tr(A)=λ1+λ2\operatorname{tr}(A) = \lambda_1 + \lambda_2 and det(A)=λ1λ2\det(A) = \lambda_1 \lambda_2. The real part of an eigenvalue sets how fast trajectories grow or decay; the imaginary part sets how fast they spin. So the same numbers that read "spiral inward" in this phase plane read "underdamped, stable" in the transfer-function picture. They are two languages for one elephant; we just point at different parts of it.

Once you write a system as AA, BB, CC, DD, two new questions become askable that the old fraction could not even phrase. Can my inputs actually reach every corner of the state, or are some directions locked away where no control can push them? And can my sensors actually see every corner, or do some states stay hidden no matter how long I watch the output? Kálmán gave both questions crisp yes-or-no tests, and they turned out to be mirror images of each other.

Controllability and observability: two tests that are secretly the same test

Controllability asks whether your inputs can steer the state anywhere you like. With admissible inputs you should be able to drive the system from any starting point to any target in a finite time. The test is a rank check on a matrix built from AA and BB:

rank[BABA2BAn1B]=n\operatorname{rank}\begin{bmatrix} B & AB & A^2 B & \cdots & A^{n-1} B \end{bmatrix} = n

If that stack of columns has full rank nn (the number of states), every direction is reachable.

Observability asks the opposite: watching only the output yy, can you back out the full internal state you never measured directly? Same flavor of test, now built from AA and CC:

rank[CCACAn1]=n\operatorname{rank}\begin{bmatrix} C \\ CA \\ \vdots \\ CA^{n-1} \end{bmatrix} = n

The pretty part is that these two are mathematical duals. Controllability says an input exists that brings any state to any other state; observability says an output history carries enough information to reconstruct the starting state. Swap "push the state" for "read the state" and one test becomes the other. This is exactly the property a Kalman filter leans on: it can only estimate the hidden state if the system is observable, and a controller can only place the poles where it wants if the system is controllable.

Key takeaways

A transfer function watches one door. State-space watches the entire house at once: every room, every occupant, all evolving by a single rule you can write on a napkin, x˙=Ax+Bu\dot{x} = A x + B u.

That napkin took control theory to the Moon and gave it the vocabulary to estimate what it cannot directly see. The next time you tap the plane and watch a trajectory spiral home to the origin, remember: you are reading the same sentence Apollo read, and the same one the Kalman filter is about to whisper back.

full glossary →