HomeArticlesControl Systems Theory

State-Space Control: From ẋ = Ax + Bu to the Optimal Gain

Controllability and observability decide what's possible; pole placement and LQR decide what's optimal.

mysimulator teamUpdated June 2026≈ 10 min read▶ Open the simulation

Trading one equation for a system of them

A transfer function is a fine description of a single input driving a single output, but it hides the internal machinery, and it strains badly once a system has several inputs, several outputs, or genuinely coupled internal dynamics. State-space representation instead tracks a vector of internal states x — positions, velocities, currents, whatever fully determines the system's future given its future inputs — and writes the dynamics as one first-order matrix differential equation plus an output equation:

ẋ = A x + B u        state equation:  how the internal state evolves
y  = C x + D u        output equation: what you can actually measure
live demo · a state trajectory unfolding through phase space● LIVE

A is the plant's internal wiring (how each state feeds every other state), B is how the control input u enters, C is what sensors actually report, D is direct feedthrough. This single matrix equation describes MIMO systems exactly as easily as single-input single-output ones, which is why virtually all modern control theory beyond introductory PID is built on it rather than on transfer functions.

Two questions you must answer before you design anything

Controllability asks: can u actually steer x to any point in state space in finite time? Observability asks the dual question: does the output y, watched over time, contain enough information to reconstruct the full internal state x? Kalman's rank tests answer both algebraically, from A, B and C alone, with no simulation required:

controllability matrix   Wc = [B  AB  A²B  ...  A^(n-1)B]
observability matrix    Wo = [C; CA; CA²; ...; CA^(n-1)]

controllable  iff  rank(Wc) = n     (full state dimension)
observable    iff  rank(Wo) = n

An uncontrollable mode is a piece of the dynamics u simply cannot reach — no feedback law can move it, so it stays exactly as fast (or as unstable) as it already was in open loop. An unobservable mode is one the sensors are structurally blind to — it might be perfectly stable and irrelevant, or it might be an unstable mode quietly diverging in a corner of the state space you can never see in y. Checking both before designing a controller is not academic caution; it tells you whether the design problem you're about to solve is even solvable with the actuators and sensors you have.

Full-state feedback and pole placement

If every state is measurable (or estimated), the simplest control law is linear state feedback: u = -Kx, where K is a row of gains, one per state. Substituting into ẋ = Ax + Bu gives ẋ = (A - BK)x — the closed loop is still linear, but now its dynamics are governed by A - BK instead of A, and the whole point is that you get to choose K. If the system is controllable, Ackermann's formula computes the unique K that places the eigenvalues of A - BK at any set of locations you specify:

K = [0 0 ... 0 1] · Wc⁻¹ · φ_desired(A)

where φ_desired(A) is the desired characteristic polynomial evaluated
at the matrix A (Cayley-Hamilton substitution), and Wc is the
controllability matrix above — which is why controllability is a
hard prerequisite, not a formality.

Pole placement is precise but you have to pick the poles yourself, by hand, from performance requirements — exactly as much art as the damping-ratio overlays on a root locus plot, just done directly in n dimensions instead of two.

LQR: let an optimisation problem choose the gains for you

Linear-Quadratic Regulator design flips the question around: instead of specifying pole locations directly, specify what you're willing to trade off, and let the mathematics find the gain that optimises that trade-off. Define a cost that penalises both state error and control effort over all future time:

J = ∫₀^∞ ( xᵀ Q x  +  uᵀ R u ) dt

Q  (n×n, positive semi-definite)  — cost of being away from x = 0
R  (m×m, positive definite)       — cost of spending control effort

The u that minimises J is again linear state feedback, u = -Kx, but now K = R⁻¹BᵀP, where P solves the algebraic Riccati equation, AᵀP + PA - PBR⁻¹BᵀP + Q = 0 — a nonlinear matrix equation, but one with fast, reliable numerical solvers, so in practice you never solve it by hand. What you tune instead are the entries of Q and R: weight a state heavily in Q and LQR will spend more control effort keeping it near zero; weight R heavily and LQR will conserve actuator energy even at the cost of sloppier state tracking. That knob — physically interpretable, entirely in your hands — is the main reason LQR displaced ad hoc pole placement as the default full-state design method once computers made solving the Riccati equation routine.

When you can't measure every state

Full-state feedback assumes x is fully known, but most real sensors only give you y = Cx. If the system is observable, a Luenberger observer (or, for a noisy plant, a Kalman filter) runs its own copy of the plant model alongside the real one and corrects itself using the mismatch between predicted and measured output, converging its estimate x̂ toward the true x. The separation principle is the reassuring theorem that lets you design the state-feedback gain K and the observer gain L completely independently and then simply combine them — the closed-loop eigenvalues of the full observer-plus-controller system are exactly the eigenvalues of A - BK together with the eigenvalues of the observer's error dynamics, with no cross-coupling to worry about.

Frequently asked questions

What's the difference between pole placement and LQR?

Both compute a state-feedback gain K, but pole placement asks you to specify exact closed-loop eigenvalue locations directly, while LQR asks you to specify a cost trade-off between state error (Q) and control effort (R) and solves the Riccati equation for the K that optimises it. LQR is usually preferred because tuning Q and R is more physically intuitive than guessing good pole locations in high dimensions.

What does controllability actually mean?

It means the control input can, in principle, drive the state from any starting point to any other point in finite time. It's checked algebraically with the rank of the controllability matrix [B AB A²B ...]; if that rank is less than the number of states, some part of the dynamics is simply unreachable by u, no matter how the feedback gain is chosen.

Do I need an observer if I can't measure all the states?

Yes, if the system is observable. A Luenberger observer (or Kalman filter for noisy measurements) runs a model of the plant alongside the real system and corrects its state estimate from the available outputs. The separation principle guarantees you can design the state-feedback gain and the observer gain independently and combine them without the two interfering.

Try it live

Everything above runs in your browser — open State-Space Controller and change the parameters while it is running. Nothing is installed, nothing is uploaded, the whole model lives in one tab.

▶ Open State-Space Controller simulation

What did you find?

Add reproduction steps (optional)