1B = [0, 0.5]2AB = [0.5, -1]3det [B AB] = -0.25 → rank 21B = [1, 1]2AB = [-1, -1]3det [B AB] = 0 → rank 11C = [1, 0]2CA = [0, 1]3det [C; CA] = 1 → rank 21C = [1, 1]2CA = [-1, -1]3det [C; CA] = 0 → rank 10.000 m0.00 N0.000 m0.000 m/s0.51−2511111u
00.511.505101520time (s)cm · cm/sCART: TWO PUSHESx₁ pos (cm)x₂ vel (cm/s)u 2.17 Nu 4.20 Nu 5 N0123400.511.5time (min)level (m)TANKS: PUMP AT u = 1 mx₁ tank 1x₂ tank 2gap x₁ − x₂the gap decays as e^(−t)whatever the pump does0123400.51time (min)y (m)TANKS: OUTPUT y, PUMP OFFstart A [1, 0]start B [0, 1]same y from both starts:y alone cannot tell them apart
Lit wire with moving dashes: a non-zero entry of B, A or C that the step is aboutBlocks: input u, the two states (integrators) and the output y; the card holds the rank testPlots: the demos, computed from the state equationsThe pill rides the wire a step is about, in the direction the signal flowsA two-state model as blocks: input u, states x₁ and x₂, output y. Each wire is a non-zero entry of B, A or C; a missing wire is a zero. The cart is controllable and observable; two identical tanks fed by one pump and read by one total-level sensor are neither. The plots are computed from the state equations as the steps play. For n states the tests use n blocks: controllable if and only if [B AB … Aⁿ⁻¹B] has rank n, observable if and only if [C; CA; …; CAⁿ⁻¹] has rank n. With two states that is one 2×2 determinant each.

Controllability

  1. A state-space model ẋ = Ax + Bu, y = Cx raises two questions. Can the input u steer every state wherever we like? That is controllability. Can the output y reveal every state? That is observability. Start with the cart.

When it fails

Observability

What is happening

# step 1/11 · question
# about: State x₁, State x₂, Input u, Output y

the cart from "State-space models"
  2 kg, spring 50 N/m, damper 4 N·s/m

x = [x₁, x₂] = [position, velocity]
u = force (N)      y = position (m)

A = [[  0,  1],    B = [0, 0.5]ᵀ
     [-25, -2]]    C = [1, 0]

controllable  u can drive x anywhere
observable    y lets us work out x

The cart is the 2 kg, 50 N/m, 4 N·s/m cart of the earlier lessons; the tanks are an illustrative pair with a 1-minute time constant. Every curve and number in the figure is computed from these state equations. The Python on each step is plain Python 3. It steps the equations forward with small time steps, so its last digits differ slightly from the exact values the figure plots.