Skip to content

6.7 — State Space: The Modern View

A transfer function relates one input to one output. A helicopter has four controls and six degrees of freedom, all coupled. A chemical reactor has a dozen valves and twenty measured variables. Transfer functions handle those badly, because a system with m inputs and p outputs needs mp transfer functions and none of them shows the internal coupling.

State space handles it naturally, using matrices instead of ratios of polynomials. It became the standard approach from the 1960s, driven initially by aerospace and by the fact that computers could suddenly do matrix arithmetic.

This chapter replaces the transfer function of Chapter 6.2 with a matrix description, so the linear algebra of Volume II Part 4 does the work that polynomial algebra did before. Eigenvalues will turn out to be the poles under a different name, which section 3 proves.

1. The state

The state of a system is the smallest set of numbers that, together with the future input, determines the future completely.

The practical rule: one state variable per independent energy store. A capacitor's voltage, an inductor's current, a mass's position and velocity, a tank's level, a body's temperature.

Why energy stores? Because energy cannot change instantaneously, so those quantities are exactly the ones that carry the past forward. Everything else in the system is determined by them plus the current input.

The standard form:

\dot{\mathbf x}=\mathbf{Ax}+\mathbf{Bu}

\mathbf y=\mathbf{Cx}+\mathbf{Du}

with

  • \mathbf x — the state vector, n elements.
  • \mathbf u — the input vector, m elements.
  • \mathbf y — the output vector, p elements.
  • \mathbf A (n\times n) — the system matrix, containing all the internal dynamics.
  • \mathbf B (n\times m) — how inputs affect states.
  • \mathbf C (p\times n) — which states you can measure.
  • \mathbf D (p\times m) — direct feedthrough, usually zero.

Read the first equation in words: the rate of change of every state is a linear combination of all the states and all the inputs. That is all it says, and it is enough.

2. Building the model

An RLC circuit

Series R, L, C with input voltage v_{in}. Two energy stores: the inductor's current and the capacitor's voltage. So two states.

x_1=i_L, \qquad x_2=v_C

From KVL: v_{in}=Ri_L+L\dot i_L+v_C, so

\dot x_1=-\frac RLx_1-\frac1Lx_2+\frac1Lv_{in}

From the capacitor: i_L=C\dot v_C, so

\dot x_2=\frac1Cx_1

In matrix form:

\begin{bmatrix}\dot x_1\\\dot x_2\end{bmatrix}=\begin{bmatrix}-R/L & -1/L\\1/C & 0\end{bmatrix}\begin{bmatrix}x_1\\x_2\end{bmatrix}+\begin{bmatrix}1/L\\0\end{bmatrix}v_{in}

Measuring the capacitor voltage:

y=\begin{bmatrix}0&1\end{bmatrix}\mathbf x

Notice what happened: two first-order equations replaced one second-order equation. That is the general pattern — an n-th order differential equation becomes n coupled first-order ones, and matrices handle coupled first-order equations far better than a single high-order one.

A mass-spring-damper

m\ddot y+b\dot y+ky=F

States: position and velocity.

x_1=y, \qquad x_2=\dot y

\dot x_1=x_2

\dot x_2=-\frac km x_1-\frac bmx_2+\frac1mF

\mathbf A=\begin{bmatrix}0&1\\-k/m&-b/m\end{bmatrix}, \qquad \mathbf B=\begin{bmatrix}0\\1/m\end{bmatrix}

This form — with a row of the identity on top and the coefficients on the bottom — is the controllable standard form, and any single-input transfer function converts into it mechanically.

The model as a picture

The two matrix equations are one loop, and the loop is easier to hold than the algebra.

uB+∫ dtx — the stateCyAẋ = Ax + Bu (the loop) y = Cx + Du (the readout)A is the only block inside the feedback path, which is why A alone decides stability.
A state-space model as a block diagram. The input is scaled by B, added to the state fed back through A, integrated to become the state, and read out through C. Every symbol in the equations appears exactly once as a block.

Read each block as a job, because that is what makes the matrices stop being abstract.

B says how the input reaches the state. It has one column per input and one row per state, and an entry is simply "how much does pushing this input change the rate of this state". A zero row means that input cannot affect that state at all, directly.

The integrator is where the state lives. \dot{x} goes in and x comes out, which is the definition of state: the thing whose rate you can write down and whose value carries the past forward.

A says how the states affect each other's rates. It is the only block inside the loop, and that is why the eigenvalues of A are the poles of the system and why stability is decided by A alone — the input and output matrices sit outside the feedback path and cannot make a stable loop unstable.

C says which combination of states you can actually see. Often you cannot see all of them; a motor's shaft angle may be measured while its current is not. That gap between what the state contains and what C reveals is the observability question of section 5, and it is why observers and Kalman filters exist.

3. The connection to transfer functions

Take the Laplace transform of the state equation with zero initial conditions:

s\mathbf X=\mathbf{AX}+\mathbf{BU} \;\Rightarrow\; (s\mathbf I-\mathbf A)\mathbf X=\mathbf{BU}

\mathbf X=(s\mathbf I-\mathbf A)^{-1}\mathbf{BU}

\boxed{\mathbf G(s)=\mathbf C(s\mathbf I-\mathbf A)^{-1}\mathbf B+\mathbf D}

And the crucial consequence. The matrix inverse has \det(s\mathbf I-\mathbf A) in its denominator, so

\boxed{\text{The poles are the eigenvalues of } \mathbf A.}

Stability is therefore: every eigenvalue of \mathbf A has a negative real part. For discrete systems, every eigenvalue has magnitude less than 1.

This is the single most useful fact in state space. It reduces stability to an eigenvalue computation, which is a solved numerical problem, and it works identically for one input or twenty.

The conversion the other way is not unique. Infinitely many state-space realisations give the same transfer function, because you can transform the state vector by any invertible matrix \mathbf T:

\bar{\mathbf x}=\mathbf{Tx} \;\Rightarrow\; \bar{\mathbf A}=\mathbf{TAT}^{-1}

Different internal description, identical input-output behaviour. And \mathbf{TAT}^{-1} has the same eigenvalues as \mathbf A, so the poles are unchanged, as they must be.

4. Controllability and observability

Two questions with clean matrix answers, and both reveal things a transfer function hides.

Controllable: can the input move the state anywhere you want, in finite time?

Form the controllability matrix:

\mathcal{C}=\begin{bmatrix}\mathbf B & \mathbf{AB} & \mathbf A^2\mathbf B&\cdots&\mathbf A^{n-1}\mathbf B\end{bmatrix}

The system is controllable if and only if \mathcal C has rank n — full rank.

Read what the matrix means. \mathbf B is where the input pushes directly. \mathbf{AB} is where that push propagates after the dynamics act once. And so on. If those directions together span the whole state space, you can reach anywhere.

Observable: can you determine the state from the outputs?

\mathcal{O}=\begin{bmatrix}\mathbf C\\\mathbf{CA}\\\mathbf{CA}^2\\\vdots\\\mathbf{CA}^{n-1}\end{bmatrix}

Observable if and only if \mathcal O has rank n.

Why this matters more than it looks

A transfer function only shows the controllable and observable part of a system. Any mode that is uncontrollable or unobservable simply does not appear in it.

And that is genuinely dangerous when the hidden mode is unstable. Chapter 6.3 warned against cancelling an unstable pole with a zero; state space explains exactly what is happening. The pole is still there, still growing, merely invisible from the input and output. Any disturbance excites it, and the state runs away while the measured output looks fine — until something physically breaks.

A physical example. A flexible robot arm has a vibration mode. If the sensor happens to sit at a node of that mode, it measures zero motion there — the mode is unobservable. The controller sees nothing, does nothing, and the arm oscillates. Moving the sensor a few centimetres solves what no amount of control design could.

This is why sensor and actuator placement is a control design decision, not a mechanical one, and it is one of the clearest practical contributions of state-space thinking.

5. State feedback and pole placement

Instead of feeding back the output, feed back the whole state:

\mathbf u=-\mathbf{Kx}+\mathbf{r}

Substituting into the state equation:

\dot{\mathbf x}=\mathbf{Ax}+\mathbf B(-\mathbf{Kx}+\mathbf r)=(\mathbf A-\mathbf{BK})\mathbf x+\mathbf{Br}

The closed-loop dynamics are governed by \mathbf A - \mathbf{BK}, and you choose \mathbf K.

\boxed{\text{If the system is controllable, } \mathbf K \text{ can place the closed-loop poles anywhere you like.}}

Anywhere. That is a much stronger statement than anything in Chapters 6.4 to 6.6, where you could only slide poles along a locus that the plant's structure determined.

Worked example

\mathbf A=\begin{bmatrix}0&1\\-2&-3\end{bmatrix}, \qquad \mathbf B=\begin{bmatrix}0\\1\end{bmatrix}

Open-loop poles: \det(s\mathbf I-\mathbf A)=s^2+3s+2=(s+1)(s+2), so -1 and -2.

Wanted: poles at -4\pm j3, giving \zeta=0.8 and \omega_n=5 — settling time 4/4=1 s and about 1.5% overshoot.

Desired characteristic polynomial:

(s+4-j3)(s+4+j3)=s^2+8s+25

With \mathbf K=[k_1\ k_2]:

\mathbf A-\mathbf{BK}=\begin{bmatrix}0&1\\-2-k_1&-3-k_2\end{bmatrix}

\det(s\mathbf I-\mathbf A+\mathbf{BK})=s^2+(3+k_2)s+(2+k_1)

Match coefficients:

3+k_2=8 \;\Rightarrow\; k_2=5

2+k_1=25 \;\Rightarrow\; k_1=23

\mathbf K=\begin{bmatrix}23&5\end{bmatrix}

Check controllability first, which should have been step zero:

\mathcal C=\begin{bmatrix}\mathbf B&\mathbf{AB}\end{bmatrix}=\begin{bmatrix}0&1\\1&-3\end{bmatrix}

Determinant =-1\ne0, so rank 2 ✓ controllable, and the placement was guaranteed to be possible.

The honest caveat. "Anywhere" is a mathematical statement, not an engineering one. Placing poles far to the left requires large gains, which means large actuator effort, saturation, and amplified sensor noise. Aggressive pole placement produces a controller that works beautifully in simulation and demands 500 volts from a 12 V supply. The realistic target is poles a few times faster than the open-loop ones, not a hundred times.

6. Observers

State feedback needs the state. Usually you can only measure some of it.

An observer (or estimator) is a model of the plant, run in software, corrected by the measurement error:

\dot{\hat{\mathbf x}}=\mathbf A\hat{\mathbf x}+\mathbf{Bu}+\mathbf L(\mathbf y-\mathbf C\hat{\mathbf x})

Read it in two parts. The first two terms are simply a simulation of the plant, driven by the same input. The third term is the correction: compare the measured output with what the simulation predicts, and nudge the estimate to reduce the difference.

The estimation error \mathbf e=\mathbf x-\hat{\mathbf x} obeys:

\dot{\mathbf e}=(\mathbf A-\mathbf{LC})\mathbf e

So the error decays to zero if the eigenvalues of \mathbf A-\mathbf{LC} are all in the left half plane — and if the system is observable, \mathbf L can place them anywhere.

Design rule: make the observer 2 to 5 times faster than the controller, so the estimate has settled before the controller needs it. Faster than that and the observer amplifies measurement noise, since a fast observer trusts the measurement more and the model less.

The separation principle

A remarkable and convenient result: design the controller assuming perfect state knowledge, design the observer separately, combine them, and the closed-loop poles are exactly the union of the two sets.

The two designs do not interact. This is what makes the approach practical, and it is not obvious — it follows from the block-triangular structure of the combined system matrix.

The Kalman filter

An observer whose gain \mathbf L is chosen optimally, given statistical descriptions of the process noise and the measurement noise. It minimises the mean squared estimation error, and for a linear system with Gaussian noise it is provably the best possible estimator.

The intuition is a weighted average. The filter maintains both an estimate and a measure of its own uncertainty. At each step it predicts forward using the model, which increases the uncertainty, then corrects using the measurement, which decreases it. The gain automatically weights model and measurement according to which is currently more trustworthy.

Where it is used: every GPS receiver (Chapter 8.2), every inertial navigation system, spacecraft attitude determination, the sensor fusion in your phone, and target tracking in radar. Rudolf Kálmán's 1960 paper is one of the most-cited in engineering, and the filter flew on Apollo — the guidance computer used it to combine inertial measurements with star sightings.

The extended and unscented variants handle nonlinear systems by linearising, or by propagating a set of sample points through the nonlinearity. Both are approximations, and both are what actually runs in practice, since almost nothing real is linear.

7. Optimal control

Rather than choosing pole positions by intuition, choose them by minimising a cost.

The linear quadratic regulator minimises

J=\int_0^\infty\left(\mathbf x^T\mathbf{Qx}+\mathbf u^T\mathbf{Ru}\right)dt

Read the two terms: \mathbf Q penalises the state being away from zero, and \mathbf R penalises using control effort. The optimal gain comes from solving the algebraic Riccati equation:

\mathbf A^T\mathbf P+\mathbf{PA}-\mathbf{PBR}^{-1}\mathbf B^T\mathbf P+\mathbf Q=0, \qquad \mathbf K=\mathbf R^{-1}\mathbf B^T\mathbf P

Why this is a better design method than pole placement. You are no longer guessing where the poles should go. You are stating what you care about — this state matters ten times more than that one, and actuator effort is expensive — and the mathematics finds the pole positions that best serve it.

Tuning \mathbf Q and \mathbf R is still a judgement call, but it is a judgement about physical priorities rather than about abstract pole locations, and that is a much easier conversation to have with the people who own the machine.

And the result comes with guarantees: an LQR controller always has at least 60° of phase margin and infinite gain margin. That is a strong robustness property that no manual tuning method can promise.

Combining LQR with a Kalman filter gives LQG control, which was the standard modern method for decades. Its known weakness: the guaranteed margins of LQR do not survive the combination, and an LQG design can be surprisingly fragile. That discovery in the 1970s drove the development of H_\infty control, which explicitly optimises robustness rather than performance.

8. When to use which

SituationUse
One input, one output, no modelPID with experimental tuning
One input, one output, known modelRoot locus or frequency design
Several coupled inputs and outputsState space
States you cannot measureObserver or Kalman filter
Explicit performance trade-offsLQR
Hard constraints on inputs or statesModel predictive control
Robustness to model error is the priorityH_\infty

The honest summary. State space is more powerful and more demanding — it needs a model, and the model must be good. PID needs no model and is why 90% of industrial loops are PID. The methods of this Part are not a progression from primitive to advanced; they are tools matched to different amounts of knowledge about the plant.

And the most common failure in modern control is not choosing the wrong method. It is applying an advanced method with a poor model, and getting worse results than a well-tuned PID would have given. A model you have validated against the real plant is worth more than any algorithm.


Part 7 turns from controlling machines to sending information — where the signal must survive a channel that adds noise, and where the mathematics of Part 4 decides how much can get through.

Every formula above, built from scratch

None of the results in this chapter are worth memorising, because each one can be rebuilt in under a minute from something simpler. What follows is that rebuilding, one result at a time, so the formula and the reason for it sit on the same page as the explanation that needed them.

State space

\dot{\mathbf x}=\mathbf{Ax}+\mathbf{Bu}, \qquad \mathbf y=\mathbf{Cx}+\mathbf{Du}

\mathbf G(s)=\mathbf C(s\mathbf I-\mathbf A)^{-1}\mathbf B+\mathbf D

\boxed{\text{poles} = \text{eigenvalues of }\mathbf A}

Stable if all eigenvalues have negative real parts (continuous) or magnitude below 1 (discrete).

Solution of the state equation:

\mathbf x(t)=e^{\mathbf At}\mathbf x(0)+\int_0^te^{\mathbf A(t-\tau)}\mathbf{Bu}(\tau)d\tau

with the matrix exponential e^{\mathbf At}=\mathbf I+\mathbf At+\dfrac{(\mathbf At)^2}{2!}+\cdots

Controllability:

\mathcal C=[\mathbf B\ \ \mathbf{AB}\ \ \cdots\ \ \mathbf A^{n-1}\mathbf B], \qquad \text{rank }\mathcal C=n

Observability:

\mathcal O=[\mathbf C;\ \mathbf{CA};\ \cdots;\ \mathbf{CA}^{n-1}], \qquad \text{rank }\mathcal O=n

State feedback:

\mathbf u=-\mathbf{Kx} \;\Rightarrow\; \dot{\mathbf x}=(\mathbf A-\mathbf{BK})\mathbf x

If controllable, \mathbf K can place the closed-loop eigenvalues anywhere.

Observer:

\dot{\hat{\mathbf x}}=\mathbf A\hat{\mathbf x}+\mathbf{Bu}+\mathbf L(\mathbf y-\mathbf C\hat{\mathbf x})

\dot{\mathbf e}=(\mathbf A-\mathbf{LC})\mathbf e

Place the observer eigenvalues 2 to 5 times faster than the controller's.

Separation principle: closed-loop poles are the union of the controller's and the observer's, designed independently.

LQR:

J=\int_0^\infty(\mathbf x^T\mathbf{Qx}+\mathbf u^T\mathbf{Ru})dt

\mathbf A^T\mathbf P+\mathbf{PA}-\mathbf{PBR}^{-1}\mathbf B^T\mathbf P+\mathbf Q=0, \qquad \mathbf K=\mathbf R^{-1}\mathbf B^T\mathbf P

LQR guarantees at least 60° phase margin and infinite gain margin — a property no manual tuning can promise.

Common plant models

DC motor:

\frac{\Omega(s)}{V(s)}=\frac{K_t}{(Ls+R)(Js+b)+K_tK_e}

Usually reducible to first order because L/R \ll J/b.

Thermal:

\frac{T(s)}{P(s)}=\frac{R_{th}}{R_{th}Cs+1}

Dead time:

G(s)=e^{-sT_d}, \qquad \text{Padé: } e^{-sT_d}\approx\frac{1-sT_d/2}{1+sT_d/2}

The Padé approximation's right-half-plane zero correctly reproduces the initial wrong-way response that dead time produces.


Fourteen worked problems next.

What the next chapter fixes

Parts 4 to 6 have moved signals through wires and loops. Part 7 sends them through space and through cable to somewhere else, where the enemy is no longer instability but noise — and where a single equation sets a hard ceiling on how fast any channel can possibly carry information.