State-space modelling and solution

State variables and the (A, B, C, D) model, phase-variable form from a differential equation, the transfer function C(sI − A)⁻¹B + D, eigenvalues as poles, and solving with the state transition matrix e^(At).

Drafted with Aria, reviewed by the AiCanCode.org team. Spotted an error? Use Give Feedback at the bottom of the page.

Why it matters

A robot arm, a quadcopter or an active suspension has several inputs, several outputs and internal variables (velocities, currents) that matter as much as the measured output. Transfer functions hide these internal variables and assume zero initial conditions; the state-space model keeps them, handles many inputs and outputs in one matrix equation, includes initial conditions naturally, and is the form used by simulation tools, embedded controllers, observers and modern design methods.

Key ideas

State. The state of a system is the smallest set of variables x₁, …, xₙ whose values at time t₀, together with the input for t ≥ t₀, fully determine the future behaviour. Physically they are usually the variables of the energy-storing elements: positions and velocities of masses and springs, inductor currents and capacitor voltages. n equals the order of the system. The state summarises the past; it does not need to be measurable.

State-space model (LTI)

  • State equation: ẋ = A·x + B·u (n first-order differential equations).
  • Output equation: y = C·x + D·u.
  • A (n × n) system matrix: internal dynamics. B (n × m) input matrix: how inputs drive the states. C (p × n) output matrix: how the states appear in the outputs. D (p × m) feed-through matrix: direct input-to-output path, zero for most physical plants.
  • The nonlinear form ẋ = f(x, u), y = g(x, u) also exists; linearising it about an operating point gives A, B, C, D as Jacobians.

Choosing states. Not unique. From an n-th-order ODE y⁽ⁿ⁾ + a₁y⁽ⁿ⁻¹⁾ + … + aₙy = u, choosing x₁ = y, x₂ = ẏ, … gives the phase-variable (controllable canonical) form: A has ones on the super-diagonal and the last row −aₙ, …, −a₁; B = [0 … 0 1]ᵀ. Physical variables, diagonal (modal) form and other choices describe the same system; they are related by a similarity transformation x = P·z, which leaves the eigenvalues and the transfer function unchanged.

Link to transfer function. Taking Laplace transforms with zero initial state, 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 an uncontrollable or unobservable mode — see the next topic). The system is asymptotically stable if all eigenvalues of A have negative real parts.

Solution. The state transition matrix Φ(t) = e^(At) carries the initial state forward: with u = 0, x(t) = Φ(t)·x(0). Properties: Φ(0) = I, Φ⁻¹(t) = Φ(−t), Φ(t₁ + t₂) = Φ(t₁)Φ(t₂), and dΦ/dt = AΦ. The full solution adds the forced response as a convolution.

Computing e^(At). (1) Laplace: Φ(t) = L⁻¹[(sI − A)⁻¹] — the usual hand method. (2) Diagonalisation: if A = PΛP⁻¹ then e^(At) = P·e^(Λt)·P⁻¹. (3) Cayley–Hamilton: write e^(At) = α₀I + α₁A + … using the eigenvalues. (4) Series I + At + A²t²/2! + … — useful for checks and for numerical work.

Formulas

ẋ = A·x + B·u, y = C·x + D·u

  • x: state vector (n × 1); u: inputs (m × 1); y: outputs (p × 1). Units follow the physical states (m, m/s, A, V …).

G(s) = C·(sI − A)⁻¹·B + D — transfer function (matrix).

det(sI − A) = 0 — characteristic equation; roots are the eigenvalues of A (poles).

Φ(t) = e^(At) = L⁻¹[(sI − A)⁻¹] — state transition matrix.

x(t) = Φ(t)·x(0) + ∫₀ᵗ Φ(t − τ)·B·u(τ) dτ — complete solution.

(sI − A)⁻¹ = adj(sI − A)/det(sI − A); for a 2 × 2 matrix [[a, b], [c, d]] the inverse is [[d, −b], [−c, a]]/(ad − bc).

Worked examples

Example 1 (standard — transfer function from a state model). Find G(s) for A = [[−1, 1], [0, −2]], B = [0; 1], C = [1 0], D = 0.

  1. sI − A = [[s + 1, −1], [0, s + 2]].
  2. det(sI − A) = (s + 1)(s + 2).
  3. (sI − A)⁻¹ = [[s + 2, 1], [0, s + 1]] / ((s + 1)(s + 2)).
  4. (sI − A)⁻¹B = [1; s + 1] / ((s + 1)(s + 2)).
  5. Multiply by C = [1 0]: G(s) = 1/((s + 1)(s + 2)) = 1/(s² + 3s + 2).
  6. Poles −1 and −2 equal the eigenvalues of A (the diagonal of this triangular matrix). Stable.

Example 2 (GATE level — state transition matrix and free response). The system ÿ + 3ẏ + 2y = u is put in phase-variable form with x₁ = y, x₂ = ẏ. Find A, Φ(t), and x(1 s) for x(0) = [1; 0] and u = 0.

  1. ẋ₁ = x₂, ẋ₂ = −2x₁ − 3x₂ + u → A = [[0, 1], [−2, −3]], B = [0; 1], C = [1 0]. (Same transfer function as Example 1 — a different realisation.)
  2. sI − A = [[s, −1], [2, s + 3]], det = s² + 3s + 2 = (s + 1)(s + 2).
  3. (sI − A)⁻¹ = [[s + 3, 1], [−2, s]] / ((s + 1)(s + 2)).
  4. Partial fractions entry by entry: (s + 3)/((s + 1)(s + 2)) → 2e^(−t) − e^(−2t); 1/((s + 1)(s + 2)) → e^(−t) − e^(−2t); −2/((s + 1)(s + 2)) → −2e^(−t) + 2e^(−2t); s/((s + 1)(s + 2)) → −e^(−t) + 2e^(−2t).
  5. Φ(t) = [[2e^(−t) − e^(−2t), e^(−t) − e^(−2t)], [−2e^(−t) + 2e^(−2t), −e^(−t) + 2e^(−2t)]]. Check: Φ(0) = I.
  6. x(t) = Φ(t)·[1; 0] = first column of Φ.
  7. At t = 1 s: e^(−1) = 0.3679, e^(−2) = 0.1353. x₁ = 0.7358 − 0.1353 = 0.600; x₂ = −0.7358 + 0.2707 = −0.465 (units of y and y per second).

Common mistakes

  • Writing (As − I) or (sI + A) instead of (sI − A).
  • Multiplying matrices in the wrong order: C(sI − A)⁻¹B, not B(sI − A)⁻¹C.
  • Computing e^(At) element by element as e^(aᵢⱼt) — it is a matrix exponential, not a scalar one.
  • Forgetting D when the output depends directly on the input.
  • Assuming every eigenvalue appears as a pole of G(s): cancelled modes are invisible in G(s) but still present in A.
  • Thinking the state choice is unique — many realisations give the same G(s).

For GATE ME

Expect: writing A and B from a differential equation or a mass–spring–damper; eigenvalues of A and the stability conclusion; G(s) from (A, B, C, D); the state transition matrix for a 2 × 2 A; free response at a given time; and identifying which matrix plays which role. Practise the 2 × 2 inverse and partial fractions until they are automatic.

Quick check

  1. Which matrix defines how the state appears in the output?
  2. For A = [[0, 1], [−2, −3]], B = [0; 1], x(0) = [1; 0] and u = 5, what is ẋ(0)?
  3. What is Φ(0)?
  4. What are the eigenvalues of A = [[0, 1], [−2, −3]]?
  5. If x(0) = [1; 1] and C = [1 0], D = 0, what is y(0)?

Answers: 1. C. 2. [0; 3]. 3. The identity matrix I. 4. −1 and −2. 5. 1.

Try answering each one aloud before you open it.

  1. 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. The state-space model consists of two equations: the state equation and the output equation.

  2. 2.Explain the difference between state variables and output variables in state-space modeling.Concept

    State variables are the smallest set of variables whose present values, together with future inputs, completely determine the system's future behaviour — they summarise everything relevant from the past, typically the energy-storage variables such as positions, velocities, currents and capacitor voltages. Output variables are the quantities we measure or care about, given by y = Cx + Du. Some states may also be outputs, but many are not measured, which is why observers are used to estimate them.

  3. 3.Why is state-space representation preferred over transfer function models for multi-input multi-output (MIMO) systems?Application

    State-space representation is preferred for MIMO systems because it can easily handle multiple inputs and outputs, whereas transfer function models become complex and cumbersome. State-space models provide a unified framework for both time-domain and frequency-domain analysis, making them more versatile for complex systems. Additionally, state-space models can represent systems with non-linearities and time-varying parameters more effectively.

  4. 4.What happens if a state-space system (A, B) is not controllable?Application

    Controllability is a property of the pair (A, B), not of A alone. If the controllability matrix [B AB … Aⁿ⁻¹B] has rank less than n, some modes cannot be influenced by the input at all. Their eigenvalues cannot be moved by state feedback, so if an uncontrollable mode is unstable no controller can stabilise the system (it is not stabilisable). In the transfer function such a mode usually disappears through a pole–zero cancellation, which hides it.

  5. 5.How can you determine if a state-space system is observable?Concept

    A state-space system is observable if the initial state can be determined from the output over a finite time interval. To determine observability, you can construct the observability matrix and check its rank. If the observability matrix has full rank (equal to the number of states), the system is observable. This means that all internal states can be inferred from the outputs.

  6. 6.Explain the role of the state transition matrix in solving state-space equations.Concept

    The state transition matrix, often denoted as Φ(t), is used to solve the homogeneous part of the state-space equations. It describes how the state of the system evolves over time in response to initial conditions. The state transition matrix is crucial for determining the system's response to initial states and is used in the solution of the state equation to predict future states.

  7. 7.What is the significance of eigenvalues in the context of state-space models?Application

    Eigenvalues of the state matrix in a state-space model are significant because they determine the stability and dynamic behavior of the system. The real parts of the eigenvalues indicate whether the system is stable, unstable, or marginally stable. If all eigenvalues have negative real parts, the system is stable. Eigenvalues also influence the speed of response and oscillatory behavior of the system.

  8. 8.For A = [[0, 1], [−2, −3]], find the state transition matrix Φ(t).Numerical

    Φ(t) = L⁻¹[(sI − A)⁻¹]. Here sI − A = [[s, −1], [2, s + 3]] with determinant (s + 1)(s + 2), so (sI − A)⁻¹ = [[s + 3, 1], [−2, s]]/((s + 1)(s + 2)). Partial fractions give Φ(t) = [[2e^(−t) − e^(−2t), e^(−t) − e^(−2t)], [−2e^(−t) + 2e^(−2t), −e^(−t) + 2e^(−2t)]]. Check: Φ(0) = I, and the exponents match the eigenvalues −1 and −2 of A.

  9. 9.Given a state-space system with A = [[1, 2], [3, 4]], B = [[1], [0]], C = [0, 1] and D = [0], determine whether the system is controllable.Numerical

    The controllability matrix is Qc = [B AB]. AB = [[1 × 1 + 2 × 0], [3 × 1 + 4 × 0]] = [[1], [3]], so Qc = [[1, 1], [0, 3]]. Its determinant is 1 × 3 − 1 × 0 = 3 ≠ 0, so Qc has rank 2, equal to the number of states, and the system is controllable.

  10. 10.Why might a control engineer choose to use a state observer in a control system?Application

    A control engineer might use a state observer to estimate the internal state variables of a system when they cannot be measured directly. This is particularly useful in systems where sensors are expensive, impractical, or introduce noise. State observers help in reconstructing the state vector from the output measurements, allowing for better control and performance of the system.

Finished this topic? Mark it so your progress, study plan and readiness keep up.

Stuck on something here?