State-space representation
Writes state equations for physical systems, uses phase-variable and canonical forms, and converts between state-space models and transfer functions with G(s) = C(sI − A)⁻¹B + D.
Drafted with Aria, reviewed by the AiCanCode.org team. Spotted an error? Use Give Feedback at the bottom of the page.
Why it matters
Transfer functions describe only what goes in and what comes out. Modern instrumentation and control — multivariable process units, digital controllers, Kalman-filter sensor fusion, observers that estimate unmeasured variables — works with the internal state of the system. State-space models are also exactly what simulation software and embedded controllers use, so being able to move between a physical model, a state-space model and a transfer function is a core skill.
Key ideas
State: the smallest set of variables x1, …, xn whose values at t0, together with the input for t ≥ t0, fix the system's future completely. The natural choice is one variable per independent energy store: capacitor voltages, inductor currents, mass positions and velocities, tank levels. The number of states n is the order of the system.
State-space model of an LTI system
- State equation:
ẋ = A·x + B·u— n first-order differential equations. - Output equation:
y = C·x + D·u— algebraic. A(n×n) is the system matrix,B(n×m) the input matrix,C(p×n) the output matrix,D(p×m) the direct-transmission (feed-through) matrix, for m inputs and p outputs. For a strictly proper transfer function,D = 0.
State-space model is not unique. Any invertible change of variables x = P·z gives a new model (P⁻¹AP, P⁻¹B, CP, D) with the same transfer function and the same eigenvalues. Common standard forms:
- Phase-variable (controllable canonical) form: states are
y, ẏ, ÿ, …;Ahas 1s on the super-diagonal and the negated denominator coefficients in the last row. - Observable canonical form: the transpose (dual) of the controllable form.
- Diagonal (Jordan) canonical form: from partial fractions; each state is one mode, and
Aholds the poles on its diagonal (Jordan blocks for repeated poles).
From state space to transfer function: G(s) = C(sI − A)⁻¹B + D. The denominator is det(sI − A), so the eigenvalues of A are the poles — unless a pole-zero cancellation hides a mode. A cancelled mode is either uncontrollable or unobservable (next topic) and still exists inside the system.
Useful matrix facts: the characteristic equation is det(sI − A) = 0; the sum of the eigenvalues equals the trace of A; their product equals det A. For a 2×2 matrix, det(sI − A) = s² − (trace A)·s + det A.
State diagram: a block diagram built only from integrators, gains and summing points, with the output of each integrator being a state. It maps directly onto an analogue computer or a digital simulation.
Advantages over transfer functions: handles MIMO, time-varying and nonlinear systems; includes initial conditions; reveals hidden modes; and supports state-feedback and observer design.
Formulas
ẋ(t) = A·x(t) + B·u(t),y(t) = C·x(t) + D·u(t)G(s) = Y(s)/U(s) = C·(sI − A)⁻¹·B + D(sI − A)⁻¹ = adj(sI − A)/det(sI − A)- Characteristic equation:
det(sI − A) = 0 - 2×2 inverse:
[[a, b], [c, d]]⁻¹ = (1/(ad − bc))·[[d, −b], [−c, a]] - Phase-variable form of
G(s) = (b1·s + b0)/(s² + a1·s + a0):A = [[0, 1], [−a0, −a1]],B = [0; 1],C = [b0, b1],D = 0. - Similarity transform:
à = P⁻¹AP,B̃ = P⁻¹B,C̃ = CP,D̃ = D.
Units: each state carries its physical unit (V, A, m, m/s, …); entries of A have units of s⁻¹ times the ratio of state units; G(s) has the unit of output per unit input.
Worked examples
Example 1 — series RLC circuit in state space
Given: R = 2 Ω, L = 1 H, C = 0.5 F in series, input u = vin, output y = vC. States x1 = vC, x2 = i.
- Capacitor:
C·dvC/dt = i→ẋ1 = (1/C)·x2 = 2·x2. - KVL:
L·di/dt = vin − R·i − vC→ẋ2 = −x1 − 2·x2 + u. A = [[0, 2], [−1, −2]],B = [0; 1],C = [1, 0],D = 0.sI − A = [[s, −2], [1, s + 2]],det = s(s + 2) + 2 = s² + 2s + 2.(sI − A)⁻¹·B = [2; s]/(s² + 2s + 2); taking the first row:G(s) = 2/(s² + 2s + 2).- Check with circuit theory:
1/(LCs² + RCs + 1) = 1/(0.5s² + s + 1) = 2/(s² + 2s + 2), which matches. Poles−1 ± j1.
Result: A = [[0, 2], [−1, −2]], B = [0; 1], C = [1, 0], and G(s) = 2/(s² + 2s + 2).
Example 2 — a hidden mode (GATE level)
Given: A = [[0, 1], [−2, −3]], B = [0; 1], C = [1, 1], D = 0. Find the eigenvalues and G(s).
det(sI − A) = s² + 3s + 2 = (s + 1)(s + 2)→ eigenvalues −1 and −2 (check: trace −3 = sum, det 2 = product).sI − A = [[s, −1], [2, s + 3]];(sI − A)⁻¹ = [[s + 3, 1], [−2, s]]/(s² + 3s + 2).(sI − A)⁻¹·B = [1; s]/(s² + 3s + 2).G(s) = C·[1; s]/(…) = (1 + s)/[(s + 1)(s + 2)] = 1/(s + 2).
Result: eigenvalues −1, −2 but G(s) = 1/(s + 2). The mode at −1 is cancelled by a zero: it is invisible at the output (unobservable for this C), yet it still responds to initial conditions inside the system. A transfer function alone would never reveal it.
Common mistakes
- Writing
G(s) = (sI − A)⁻¹Bwithout theC(andD). - Inverting
sI − Awith the off-diagonal signs wrong. - Taking the eigenvalues of
sI − Aor of−Ainstead ofA. - Assuming the state-space model of a system is unique, or that every eigenvalue must appear as a pole of
G(s). - Choosing dependent state variables (e.g. two capacitor voltages in parallel), which gives a singular, non-minimal model.
- Forgetting
Dwhen the transfer function has equal numerator and denominator degree.
For GATE IN
Expect questions on converting a transfer function to phase-variable form, finding G(s) from (A, B, C, D), finding eigenvalues or the characteristic equation, writing state equations for an RLC or mechanical system, and recognising pole-zero cancellation. Practise 2×2 and 3×3 (sI − A)⁻¹ calculations, and use trace and determinant as quick checks.
Quick check
- For
A = [[0, 1], [−5, −6]], what are the eigenvalues? - What is the sum of the poles for
A = [[0, 1], [−2, −3]]? - Write
Ain phase-variable form forG(s) = 4/(s² + 5s + 6). - For
A = [[0, 1], [−2, −3]],B = [0; 1],C = [1, 0],D = 0, what is the DC gainG(0)?
Answers: 1. s² + 6s + 5 = 0 → −1 and −5; 2. trace = −3; 3. [[0, 1], [−6, −5]] (with B = [0; 1], C = [4, 0]); 4. G(s) = 1/(s² + 3s + 2), so G(0) = 0.5.
Interview questions
All Control Systems interview questionsTry answering each one aloud before you open it.
1.What is state-space representation in control systems?Concept
State-space representation is a mathematical model of a physical system expressed as a set of input, output, and state variables related by first-order differential equations. It provides a compact way to model and analyze systems with multiple inputs and outputs.
2.Explain the components of a state-space model.Concept
A state-space model consists of matrices A, B, C, and D. Matrix A represents the system dynamics, B represents the input, C represents the output, and D represents the direct transmission path. The state vector x describes the system's state, and the input vector u and output vector y represent the system's inputs and outputs, respectively.
3.Why is state-space representation preferred over transfer function representation for multi-input multi-output (MIMO) systems?Application
State-space representation is preferred for MIMO systems because it can handle multiple inputs and outputs more naturally than transfer functions. It provides a unified framework for modeling, analysis, and design, and is more suitable for modern control techniques like state feedback and observer design.
4.What is the significance of the state matrix (A) in the state-space representation?Concept
The state matrix (A) defines the system's dynamics by describing how the state of the system evolves over time. It captures the internal interactions between the state variables and is crucial for determining system stability and response characteristics.
5.How does the controllability of a system relate to its state-space representation?Concept
A system is controllable if it is possible to move the system from any initial state to any desired final state within a finite time using appropriate inputs. In state-space representation, controllability is determined by the controllability matrix, which is derived from matrices A and B. If the controllability matrix has full rank, the system is controllable.
6.What happens if the state matrix (A) is not stable in a state-space model?Application
If the state matrix (A) is not stable, the system may exhibit unbounded behavior over time, leading to instability. This means that small disturbances or initial conditions can cause the system's state to grow without bound, which is undesirable in control systems.
7.Explain how state feedback control is implemented using state-space representation.Application
State feedback control involves using the state vector to compute the control input. The control law is typically u = -Kx, where K is the state feedback gain matrix. By appropriately choosing K, the closed-loop system's dynamics can be modified to achieve desired performance, such as stability and response speed.
8.What is the role of the observer in state-space control systems?Concept
An observer estimates the internal state of a system from its outputs and inputs. In state-space control systems, observers are used when not all state variables are measurable. The observer uses the system's output and input to provide an estimate of the state vector, which can then be used for state feedback control.
9.Given a state-space model with matrices A = [[0, 1], [-2, -3]], B = [[0], [1]], C = [1, 0], and D = [0], determine if the system is controllable.Numerical
To determine controllability, compute the controllability matrix: [B, AB]. Here, B = [[0], [1]] and AB = A*B = [[1], [-3]]. The controllability matrix is [[0, 1], [1, -3]]. Since the rank of this matrix is 2 (equal to the number of states), the system is controllable.
Finished this topic? Mark it so your progress, study plan and readiness keep up.
Stuck on something here?