Transfer functions describe the input-output relationship but hide the internal state. State-space representation tracks every internal variable explicitly. It is the foundation of "modern control" since the 1960s and the dominant framework in aerospace, autonomous vehicles, and large-scale process control.
7.1 State variables
A state variable is a quantity whose value at time , together with the future input, fully determines the future behavior of the system. Equivalently: knowing the state lets you predict the future without needing past inputs.
For a mass-spring-damper, two state variables suffice: position and velocity . Knowing both at any instant, plus the future force , lets you integrate the differential equation forward indefinitely. Position alone is not enough; you need to know which way the mass is moving.
In general, an -th-order LTI system has state variables. A state vector is the minimum information needed to predict the future.
7.2 The state-space form
The state-space form for a linear time-invariant system:
Where:
- : state vector ().
- : input vector ().
- : output vector ().
- (): system matrix. Encodes the internal dynamics.
- (): input matrix. How inputs drive the state.
- (): output matrix. How states show up in outputs.
- (): feedthrough matrix. Direct input-to-output coupling.
Why this form is more general than a transfer function: state-space handles MIMO (multi-input multi-output) systems, time-varying systems, and nonlinear systems (the matrices become functions of time or of state). Transfer functions only describe LTI SISO (single-input single-output) systems.
For mass-spring-damper , define , . Then:
(Output is position; first row of .)
7.3 Solution and the matrix exponential
For LTI systems, the state evolves according to:
Where is the matrix exponential (or state transition matrix). It generalizes the scalar to matrices and can be computed by Taylor series or by diagonalizing .
The eigenvalues of are the system poles. If all eigenvalues have negative real parts, the system is stable. This connects state-space directly to the s-plane analysis we already know.
7.4 Conversion between transfer function and state space
The transfer function from input to output in state space is:
Conversely, from a transfer function, you can build a state-space realization (canonical forms: controllable, observable, modal, Jordan). In Python:
from scipy.signal import tf2ss, ss2tf
# Transfer function: 1 / (s^2 + 2s + 1)
num = [1]
den = [1, 2, 1]
A, B, C, D = tf2ss(num, den)
print(A) # state matrix
print(B) # input matrix
# Going back
num2, den2 = ss2tf(A, B, C, D)For SISO systems, transfer function and state space are equivalent. For MIMO, you need state space.
7.5 Controllability
A system is controllable if you can drive the state from any initial condition to any final condition in finite time, using only the input . The test:
The matrix in the rank test is the controllability matrix. Full rank = controllable.
Controllability is a yes-or-no property of . If a system is uncontrollable, some internal modes are "stuck": no matter what input you apply, you can never affect those modes. They are decoupled from your input.
Cruise-control example. If the only input is the throttle, you can affect the car's speed (controllable in speed). But you cannot affect its position on the road from side to side using throttle alone (uncontrollable in lateral position). The lateral position needs a different input (the steering wheel) to become controllable. In MIMO control, you choose inputs to make the states you care about controllable.
7.6 Observability
A system is observable if you can determine the entire state from output measurements alone. The test:
Full rank = observable.
If the system is unobservable, some internal states are invisible to your sensors. You can never figure out their values from outputs alone.
Hardware-security tie-in. Side-channel attacks are essentially observer construction. The attacker observes power, timing, EM emissions (the "outputs" ), and tries to estimate the internal state that contains the secret key. If the system's hidden states are observable (poorly designed crypto hardware leaks too much), the attack succeeds. If the implementation is unobservable for the secret state (constant-time, masked, with electromagnetic shielding), the attack fails. Designing for observability is good engineering; designing for unobservability of secrets is good hardware-security engineering.
7.7 Pole placement via state feedback
If the system is controllable, we can choose a state-feedback gain matrix such that the closed-loop matrix has any desired eigenvalues (pole positions). This is pole placement, the modern alternative to root-locus design.
Closed-loop dynamics with state feedback (plus a reference signal):
The eigenvalues of are the closed-loop poles. We choose to place them.
In Python with the control library, pole placement is one line:
import numpy as np
from scipy.signal import place_poles
A = np.array([[0, 1], [-1, -0.2]]) # mass-spring with light damping
B = np.array([[0], [1]])
desired_poles = [-2 + 1j, -2 - 1j] # well-damped at omega_n=sqrt(5)
result = place_poles(A, B, desired_poles)
K = result.gain_matrix
print(K)This is the modern way servo systems, autopilots, and rocket control laws are designed. Specify desired pole locations, compute , done.
7.8 Observers (state estimators)
In practice, you usually cannot measure the entire state directly. The state may be 6-dimensional (position, velocity, attitude, angular rate), but you have only a 3-dimensional output (position, attitude). What to do?
Build an observer: a dynamical system that takes the input and the output and produces an estimate of the state.
The Luenberger observer has the form:
The observer simulates the plant () and corrects its estimate based on the measurement residual (). The gain matrix is chosen so the estimation error has dynamics with all eigenvalues in the LHP. If the system is observable, can be chosen to place the observer poles anywhere we want.
Use the estimate for control: . By the separation principle, the closed-loop poles of the observer-based controller decompose into the poles you placed via and the poles you placed via , independently. Design them separately.
The Kalman filter is the statistically optimal observer for systems with Gaussian process and measurement noise. It is the backbone of:
- GPS receivers (combining noisy satellite signals into a clean position estimate).
- Inertial navigation systems (integrating accelerometers and gyros).
- Aircraft and missile guidance.
- Quadcopter attitude estimation (combining IMU + magnetometer + GPS).
- Robot localization and mapping.
In every drone you have ever seen, an extended Kalman filter is fusing accelerometer, gyroscope, magnetometer, barometer, and GPS data into a single best-estimate state vector that the controller acts on. State-space methods are not academic; they are the tools that fly drones and rockets.
7.9 LQR: optimal state feedback
When you have a good state-space model and a quadratic cost function, the Linear Quadratic Regulator (LQR) gives you the optimal feedback gain in closed form. Minimize:
Where penalizes deviation of state from zero, and penalizes control effort. The solution is where , and solves the algebraic Riccati equation:
The Riccati equation looks scary but is one line in Python:
from scipy.linalg import solve_continuous_are
P = solve_continuous_are(A, B, Q, R)
K = np.linalg.inv(R) @ B.T @ PLQR is widely used in aerospace, robotics, and process control. Combined with a Kalman filter for state estimation (the "LQG" combination), it is the workhorse of optimal-control practice.
7.10 State-space everywhere
Modern aerospace control is essentially all state-space. The Saturn V rocket, the Space Shuttle, every modern fighter aircraft, every autonomous car, SpaceX's Falcon 9 booster landing controller: all use state-space methods. The reasons are MIMO support, optimal-design machinery, and clean handling of constraints.
Classical control (Bode, root locus, PID) still dominates industrial process control, motor drives, and consumer products because it is simpler and the tuning intuition is widely understood. But for any system with more than a handful of states or with critical performance demands, state-space wins.