C945 of 55
0 XP
  1. Hook
  2. Play
  3. Predict
  4. Name it
  5. Check
  6. Explain

C9 · Lesson 45 · State-space models

Systems as first-order matrix equations

Transfer functions describe a system from the outside: input in, output out. A state-space model describes it from the inside, with a short list of numbers, the state, that captures everything about the system's past that matters for its future: a capacitor's voltage, an inductor's current, a motor's position and speed. The state changes by a first-order matrix equation, which is how simulators step systems forward in time, how controllers estimate what they can't measure, and the natural way to handle several inputs and outputs at once. The poles turn out to be the eigenvalues of a matrix.

  • A damped oscillator, x1′=x2 and x2′=−ωn2x1−2ζωnx2, drawn as a phase portrait: the state (x1,x2) moves along the arrows, and the curves are paths from two starting states.
  • With small ζ the path spirals in slowly: an underdamped ringing. Raise ζ past 1 and the spiral straightens: no oscillation.
  • Set ζ to 0: the paths are closed loops, oscillating forever. The readouts are the eigenvalues of the matrix, the system's poles.

Predict

A system has A=[01−4−4]. What are its poles?

Name it

The model

𝐱′=A𝐱+B𝐮,𝐲=C𝐱+D𝐮

The state 𝐱 has one entry per energy store (capacitor voltages, inductor currents, positions and velocities), so its length is the system's order.

From a differential equation. y′′+a1y′+a0y=b0u with x1=y, x2=y′:

A=[01−a0−a1],B=[0b0],C=[10],D=0

From a circuit. A series RLC driven by vs, with states vC and iL: vC′=iL/C and iL′=(vs−vC−RiL)/L.

Poles and transfer function

The poles are the eigenvalues of A, the roots of det⁡(sI−A)=0. For a 2 × 2 matrix that's

s2−(tr⁡A)s+det⁡A=0

so the eigenvalues add to the trace and multiply to the determinant. The transfer function is H(s)=C(sI−A)−1B+D, and its DC gain is D−CA−1B.

Discrete time and simulation

𝐱[n+1]=A𝐱[n]+B𝐮[n] is stable when every eigenvalue of A has magnitude below 1. Simulating the continuous model with Euler's method, 𝐱←𝐱+h(A𝐱+B𝐮), is a discrete system with matrix I+hA; for x′=−ax that's 1−ah, stable only if h<2/a, which is why stiff systems need small steps or implicit methods (A8).

Worked example

Write y′′+3y′+2y=u in state space and find its poles and DC gain.

Show the solution
  1. State matrices. A=[01−2−3] with B=[0,1]T and C=[1,0].
  2. Poles. Trace −3, determinant 2: s2+3s+2=0 gives −1 and −2.
  3. DC gain. Set y' = y'' = 0, so y = u/2: a DC gain of 0.5.

Answer poles at −1 and −2, and a DC gain of 0.5.

Worked example

A series RLC has R = 2 Ω, L = 1 H, C = 0.5 F. Find A and its eigenvalues.

Show the solution
  1. State equations. vC′=2iLiL′=−vC−2iL+vs
  2. The A matrix. A=[02−1−2]
  3. Eigenvalues. Trace −2, determinant 2: s2+2s+2=0 so s = −1 ± j.
  4. Natural frequency and damping. So ωn=2 and ζ=1/2.

Answer A has rows [0, 2] and [−1, −2], and its eigenvalues are −1 ± j.

Worked example

x˙1=−x1+x2, x˙2=−2x2, with x(0)=(1,1). Find the eigenvalues and x1(1).

Show the solution
  1. Eigenvalues. A is upper triangular, so the eigenvalues are its diagonal: −1 and −2.
  2. The second state. x2=e−2t
  3. The first state. With x1(0)=1, the solution of x˙1+x1=e−2t is x1=2e−t−e−2t
  4. At t = 1. x1(1)=2e−1−e−2=0.600 The slower mode, e−t, dominates after a second.

Answer the eigenvalues are −1 and −2, and x1(1) = 0.600.

Check

y′′+1y′+9y=u is written in state space with x1=y, x2=y′.

(a)

What is the bottom-left entry of A?

(b)

What is the damping ratio of its poles?

Check

A=[134−1].

(a)

What do its eigenvalues add up to?

(b)

What do they multiply to?

Check

What is the DC gain of y′′+3y′+4y=2u?

Check

A series RLC (R = 1 Ω, L = 0.5 H, C = 0.01 F) has states vC and iL.

(a)

What is the entry of A giving iL's dependence on itself?

(b)

What is ωn?

Write units the way you normally would: 1.5 rad/s and 1500 mrad/s are the same answer.

Check

A discrete system has A=[0.50.10.10.4] (real eigenvalues). What is its larger eigenvalue?

Check

Euler's method simulates x′=−100x with step h. Above what h does the simulation blow up?

Write units the way you normally would: 1.5 s and 1500 ms are the same answer.

Check

How many state variables does a circuit with two capacitors and one inductor (no loops of only capacitors, no cutsets of only inductors) need?

Check

A 2 × 2 matrix A has trace −7 and determinant 2.

(a)

What is its eigenvalue nearer zero?

(b)

And the other?

Check

x˙=−2x+1u, y=3x.

(a)

What is its DC gain?

(b)

What is its time constant?

Write units the way you normally would: 1.5 s and 1500 ms are the same answer.

Explain why

Why are a state-space model's poles the eigenvalues of A?

Practice

Keep practicing

11 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.