State-Space Models and Transfer Functions
The entry to control theory: the linear state-space model, the transfer function, and their equivalence. Two views of one dynamical system, the state-similarity invariance that makes the transfer function the coordinate-free object, and the discrete-time model that is exactly the MDP dynamics control assumes known.
On this page
State-Space Models and Transfer Functions
Where we are. Part I learned policies and values from interaction, with the dynamics unknown or only sampled. Part II turns to control theory, which starts from the opposite end — an explicit model of the dynamics — and asks what optimal feedback that model permits. The foundational object is the linear state-space model , $y = \outputmat\statevec
- \feedmat uH(s) = \outputmat(s I - \statemat)^-1\inputmat + \feedmat$. They are two views of one system. This chapter sets up that object — and shows its discrete-time form is exactly the known MDP dynamics that LQR (Week 13) will solve in closed form.
The linear state-space model
A continuous-time LTI system with state , input , and output is
with , , , . Its discrete-time counterpart, sampled at step , is , .
The running example is the mass–spring–damper : taking the state gives , , and if we measure position. A second-order mechanical law has become a first-order vector ODE — the form every method in Part II acts on.
The transfer function
Laplace-transforming the state equation at zero initial condition and eliminating the state gives the input–output map directly.
The transfer function of is the rational matrix
mapping input to output in the Laplace domain, . Its poles are the eigenvalues of (those not cancelled by zeros), and its zeros are the frequencies it blocks.
For the mass–spring–damper the single-input single-output transfer function is — the poles are the roots of the characteristic polynomial, i.e. the eigenvalues of , exactly the natural frequencies of the oscillator. Åström and Murray \AAström & Murray (2021) develop both views and their interplay; the state-space form carries the internal dynamics, the transfer function the external behaviour.
Two views, one system
The two representations are equivalent, with one asymmetry worth making precise: the transfer function is unique, but the state-space realization is not — any invertible change of state coordinates leaves the input–output behaviour untouched.
For any invertible , the coordinate change produces the system with the same transfer function .
Substitute into Definition 11.1: and , so the transformed matrices are as stated. Its transfer function is
The similarity transform cancels, leaving unchanged.
So the state-space model is a coordinate choice on the same dynamics, and the transfer function is the coordinate-free invariant. The reverse direction — building a state-space model from a transfer function — is realization, and its non-uniqueness (canonical forms) is the companion’s round-trip check.
Discretization: the bridge to a step map
Control plants are continuous, but computation and the MDP view are discrete. Exact zero-order-hold (ZOH) discretization at step — holding constant across the interval — gives
the matrix exponential of . The cheap alternative, forward Euler, takes — the first two terms of that exponential, accurate only for small . Either way the result is a deterministic step map.
The dynamic-programming bridge
That step map closes the loop with Part I. is precisely a Markov decision process’s transition — deterministic, linear, and known — where Chapters 1–10 had a stochastic kernel learned from samples. Control theory’s premise is that the model is in hand, so the Bellman recursion can be solved exactly rather than approximated from experience. Three threads run forward from here:
- To stability and structure (Week 12). Before designing any controller, ask what the model permits: stability from the eigenvalues of , and whether the input can steer and the output can observe the full state.
- To LQR (Week 13). Put a quadratic cost on this linear model and the Bellman equation has a closed-form solution — the Riccati equation — the exact dynamic-programming fixed point Chapter 1’s HJB aside promised.
- To SSMs (Week 24). The very same and its ZOH discretization are a structured-state-space neural layer (S4, Mamba); the control plant and the sequence model share one skeleton.
What’s next
- Week 12 asks what can be known about a state-space model before designing a controller: stability (eigenvalue locations, Lyapunov), and the structural properties of controllability and observability that decide whether control and estimation are even possible.
Exercises
-
(Derive) From with state , derive the matrices and the transfer function .
Solution
and give the stated ; measuring position gives . Then , since .
-
(Prove) Show the transfer function is invariant under a state-similarity transform (Prop. 11.1), identifying where cancels.
Solution
The transformed system is ; using and inverting, the and on either side of cancel against and , returning .
-
(Compute) For , , , , compute and its poles.
Solution
, and . Poles at — the eigenvalues of , both in the left half-plane (stable, as Week 12 will formalize).
-
(Implement) In the companion, verify the SS→TF→SS round-trip preserves the transfer function, the mass–spring–damper TF matches , and the step response settles to the DC gain .
Solution
See
experiments/python/week11/test_state_space.py:python-controlconverts SS↔TF (round-trip preserves the rational function up to a state similarity); the mass–spring–damper TF coefficients match the analytic form; and the unit-step final value equals the final-value-theorem prediction . -
(Extend) Compare exact ZOH () against forward Euler (): how does the discretization error scale with ?
Solution
ZOH is exact for piecewise-constant input; Euler is its first-order truncation, with error per step (it drops the and higher terms of the exponential). The companion shows the gap vanishing as and growing — eventually destabilizing Euler — for large .
Companion code
The Week-11 companion lives at experiments/python/week11/ and is the first control
companion (Python, on scipy + the python-control library).
state_space.py— builds the mass–spring–damper state-space model, converts SS↔TF (python-control), simulates impulse/step/forced responses, and discretizes via exact ZOH (scipy.linalg.expm) and forward Euler.test_state_space.py— mathematical-correctness tests: the SS→TF→SS round-trip preserves the transfer function; the mass–spring–damper TF equals ; the step response settles to the DC gain ; ZOH equals while Euler is its first-order truncation; and the transfer function is invariant under a random state-similarity transform (Prop. 11.1).
# core algorithms + correctness tests (scipy + python-control)
PYTHONPATH=. pytest experiments/python/week11/test_state_space.py -q
# worked mass-spring-damper SS/TF + response plots (saved locally, not committed)
PYTHONPATH=. python experiments/python/week11/state_space.py --plot