State Space
State-space models describe systems with first-order matrix equations. Learn states, the A, B, C, D matrices, conversion to transfer functions, eigenvalues and stability, controllability, observability, pole placement, observers and LQR.
A transfer function describes only input–output behaviour. A state-space model describes what's happening inside: a set of state variables (positions, velocities, currents, temperatures) whose rates of change depend on the states and inputs, ẋ = Ax + Bu.
It handles multiple inputs and outputs naturally, works directly in the time domain and is the basis of modern control: pole placement, observers, Kalman filters, LQR and MPC.
An analogy
A state vector is like a complete snapshot of a game: positions and velocities of every piece. Given the snapshot and the next moves (inputs), you can predict everything that follows.
Choosing states
States are the minimum set of variables that, with the inputs, determine the future. For a mechanical system: position and velocity. For an electrical circuit: capacitor voltages and inductor currents (the energy-storage variables). An n-th order differential equation becomes n first-order equations.
Eigenvalues are poles
The eigenvalues of A are the poles of the system. Stability requires all eigenvalues to have negative real parts, and the eigenvectors show which combinations of states each mode moves.
Controllability and observability
Controllable: the inputs can drive the state anywhere (rank test on [B AB …]). Observable: the states can be deduced from the outputs (rank test on [C; CA; …]). Uncontrollable unstable modes can't be fixed by any controller; unobservable modes can't be estimated by any observer.
Pole placement and observers
With full state feedback u = −Kx, the closed-loop matrix A − BK can have its eigenvalues placed anywhere (if controllable) — Ackermann's formula computes K. When not all states are measured, an observer (Luenberger) estimates them; the separation principle lets controller and observer be designed independently. Make observer poles 2–5× faster than controller poles.
Optimal control: LQR and Kalman
The linear-quadratic regulator chooses K to minimise ∫(xᵀQx + uᵀRu)dt, trading state error against control effort through the Q and R weights. The Kalman filter is the optimal observer under Gaussian noise. Together (LQG) they form the backbone of aerospace and robotics control.
Formulas
- State equations:
ẋ = A·x + B·u, y = C·x + D·u - Transfer function:
G(s) = C(sI − A)⁻¹B + D - Controllability:
rank[B AB … Aⁿ⁻¹B] = n - State feedback:
u = −K·x + r → ẋ = (A − BK)x + Br - Observer:
x̂̇ = A·x̂ + B·u + L·(y − C·x̂)
Worked example: Mass–spring–damper in state space
Given: m = 1, b = 4, k = 16; states x₁ = position, x₂ = velocity; input = force
Find: A, B, C and eigenvalues.
- ẋ₁ = x₂; ẋ₂ = −16x₁ − 4x₂ + u
- A = [[0, 1], [−16, −4]], B = [0; 1], C = [1 0], D = 0
- det(sI − A) = s² + 4s + 16 → λ = −2 ± j3.46 (same poles as the transfer function)
Answer: A = [[0,1],[−16,−4]], λ = −2 ± j3.46
Worked example: Pole placement
Given: Same system; Desired poles −4 ± j4 → s² + 8s + 32
Find: K = [k₁ k₂].
- A − BK = [[0, 1], [−16 − k₁, −4 − k₂]]
- Characteristic: s² + (4 + k₂)s + (16 + k₁)
- Match: 4 + k₂ = 8 → k₂ = 4; 16 + k₁ = 32 → k₁ = 16
Answer: K = [16 4]
Common mistakes
- Wrong: Assuming any system can have its poles placed arbitrarily. — Right: Only controllable systems — check the rank of the controllability matrix first.
- Wrong: Using state feedback when states aren't measured. — Right: Estimate them with an observer or Kalman filter.
Applications
- Aerospace: Aircraft and spacecraft attitude control uses LQR/LQG and Kalman filters on state-space models.
- Robotics & drones: State estimators fuse IMU, GPS and camera data; controllers act on the estimated state.
- Battery & motor control: Kalman filters estimate battery state of charge; observers estimate rotor flux and speed in sensorless drives.
Key takeaways
- ẋ = Ax + Bu, y = Cx + Du; states are energy-storage variables.
- Eigenvalues of A are the poles; G(s) = C(sI − A)⁻¹B + D.
- Controllability enables pole placement; observability enables estimation.
- LQR, Kalman filters and MPC build on state space.
Going further
- Similarity transformations: x = Tz changes coordinates without changing eigenvalues or the transfer function. Canonical forms (controllable, observable, modal, Jordan) make particular analyses easy.
- Minimal realisations: A transfer function has infinitely many state-space realisations; a minimal one is both controllable and observable, and its order equals the number of poles after pole-zero cancellation.
- Model predictive control: MPC solves a constrained optimisation over a future horizon using the state-space model at every sample, applying only the first move — handling limits on actuators and states explicitly.