Search

Search papers and lessons

Observability

Level 3 · 13 min read

A system is observable when its outputs, watched over enough steps, pin down its whole hidden state, which a rank test on a stacked matrix decides.

On this page

  • Colour = topic mix
  • Linear algebra
  • Probability
  • Discrete math
  • Calculus
  • Control systems
  • ReadReady to readNot yet

TL;DR

A system has a hidden state that moves by a linear rule, and you see only its outputs. The system is observable when those outputs, watched for enough steps, determine the whole hidden state, so nothing about the state stays secret. The test is a rank check on one stacked matrix, and the check says in advance whether any estimator, such as a Kalman filter or an observer, can recover every part of the state.

Builds on: Linear Dynamical System, Matrix Rank · Leads to: Controllability (its dual), Kalman Filter

Where it's used

Battery packs. A battery's state of charge cannot be read off a meter, so a model with a hidden charge state is run alongside the measured voltage and current. Before trusting such an estimate, the designer checks that the chosen sensors actually reveal every hidden part of that model. A part that no measurement reveals cannot be corrected by feedback.

Spacecraft attitude. An attitude estimator tracks orientation and spin rate, which are hidden inside the state. A star tracker measures orientation directly, and a gyro measures spin rate. Engineers confirm that the combined sensors observe every component of the state. A component that no sensor reveals drifts unchecked, however good the filter is.

Power-grid state estimation. Operators estimate the voltage angle at every bus of a grid from a sparse set of meter readings. Whether the readings make the whole state observable decides where meters must be placed.

How it works

Take the simplest setting: no input, a state xt\mathbf{x}_t with nn numbers, and an output yt=Cxty_t = C\mathbf{x}_t with mm numbers, where the state moves by xt+1=Axt\mathbf{x}_{t+1} = A\mathbf{x}_t. The question is whether the outputs y0,y1,…y_0, y_1, \dots determine x0\mathbf{x}_0.

Here is one tiny instance. The state is a cart: x=(position,velocity)\mathbf{x} = (\text{position}, \text{velocity}), one second per step, so A=(1101)A = \begin{pmatrix} 1 & 1 \\ 0 & 1 \end{pmatrix}. The sensor reads position only, C=(1    0)C = (1 \;\; 0). The true starting state is x0=(2,1)\mathbf{x}_0 = (2, 1).

  1. The cart starts at position 2 with velocity 1. Nobody sees the velocity. Check: the hidden state is (2,1)(2, 1).
  2. The sensor reads y0=2y_0 = 2, the position. Check: the first entry of x0\mathbf{x}_0 is 2.
  3. One step later the state is x1=Ax0=(2+1,1)=(3,1)\mathbf{x}_1 = A\mathbf{x}_0 = (2 + 1, 1) = (3, 1), and the sensor reads y1=3y_1 = 3. Check: 3=2+13 = 2 + 1.
  4. Now the two readings differ by y1−y0=1y_1 - y_0 = 1. A change in position over one step is the velocity, so the velocity is revealed even though no sensor measures it. The starting position is y0=2y_0 = 2. Both starting numbers are recovered from the outputs. Check: running the model from (2,1)(2, 1) reproduces y0=2y_0 = 2 and y1=3y_1 = 3.
  5. Conclusion: the outputs over two steps determine the state, so this pair is observable. The rank test in the next section does the same reasoning for any size of system.
flowchart LR
  S[hidden state x0] --> M[step the model: A]
  M --> O[sensor reads C x]
  O --> R[stack the readings over n steps]
  R --> T{rank of the stacked matrix equals n?}
  T -->|yes| Y[state is recoverable: observable]
  T -->|no| N[some direction is invisible]

Now the contrast. Keep the same AA but let the second state component be a slower-moving quantity, A=diag(0.5,0.9)A = \mathrm{diag}(0.5, 0.9), with the same kind of sensor C=(1    0)C = (1 \;\; 0). Two different starting states, (2,1)(2, 1) and (2,5)(2, 5), give the same readings. Both read y0=2y_0 = 2, then y1=0.5⋅2=1y_1 = 0.5 \cdot 2 = 1, then y2=0.52⋅2=0.5y_2 = 0.5^2 \cdot 2 = 0.5, and so on forever. The second component is multiplied by zero in every reading, so it never appears. This system is not observable.

024681000.20.40.60.81step kerror size
  • error factor 0.5 per step
  • error factor 0.9 per step
The error of an observer shrinks by the eigenvalue of its error matrix at each step. Observability is what lets you choose those eigenvalues freely.

The math

Definition: Observability

Take a linear system xt+1=Axt\mathbf{x}_{t+1} = A\mathbf{x}_t with xt∈Rn\mathbf{x}_t \in \mathbb{R}^n, and an output yt=Cxty_t = C\mathbf{x}_t with CC an m×nm \times n matrix. The pair (A,C)(A, C) is observable when two different starting states always produce different output sequences. Equivalently, the only starting state that gives all-zero outputs is the zero state.

Here xt\mathbf{x}_t is the state at step tt, AA is the n×nn \times n dynamics matrix, and CC is the readout matrix. "Different output sequences" means that for some step kk the readings differ.

Step 2 in symbols: the outputs are a stacked product

Iterating the dynamics gives xk=Akx0\mathbf{x}_k = A^k\mathbf{x}_0, so the output at step kk is yk=CAkx0y_k = CA^k\mathbf{x}_0. Stack the first nn outputs:

(y0y1⋮yn−1)=(CCA⋮CAn−1)⏟O x0.\begin{pmatrix} y_0 \\ y_1 \\ \vdots \\ y_{n-1} \end{pmatrix} = \underbrace{\begin{pmatrix} C \\ CA \\ \vdots \\ CA^{n-1} \end{pmatrix}}_{\mathcal{O}}\,\mathbf{x}_0.

The matrix O\mathcal{O} is the observability matrix. It has nmnm rows and nn columns. Each block row is the readout after some number of steps, so it is the readout matrix seen through the dynamics.

Step 3 in symbols: the rank decides

Call the stacked outputs Y\mathbf{Y}. The equation Ox0=Y\mathcal{O}\mathbf{x}_0 = \mathbf{Y} has a unique solution for x0\mathbf{x}_0 exactly when the columns of O\mathcal{O} are independent, which is when rank⁡(O)=n\operatorname{rank}(\mathcal{O}) = n. If so, O⊤O\mathcal{O}^\top\mathcal{O} is an invertible n×nn \times n matrix and

x0=(O⊤O)−1O⊤Y.\mathbf{x}_0 = (\mathcal{O}^\top\mathcal{O})^{-1}\mathcal{O}^\top\mathbf{Y}.

If the rank is less than nn, some nonzero vector v\mathbf{v} satisfies Ov=0\mathcal{O}\mathbf{v} = \mathbf{0}. Then x0\mathbf{x}_0 and x0+v\mathbf{x}_0 + \mathbf{v} give identical outputs for the first nn steps. By the Cayley-Hamilton theorem, AnA^n is a combination of lower powers of AA. Then every later power AkA^k is also a combination of I,A,…,An−1I, A, \dots, A^{n-1}, so every later block row is a combination of the first nn block rows. If Ov=0\mathcal{O}\mathbf{v} = \mathbf{0}, the outputs of x0\mathbf{x}_0 and x0+v\mathbf{x}_0 + \mathbf{v} agree at every step, not just the first nn. Only the first nn powers ever need checking.

Step 4 in symbols: the observer

Observability is what makes an observer possible. An observer is a copy of the model that is corrected by the readings:

x^t+1=Ax^t+L (yt−Cx^t).\hat{\mathbf{x}}_{t+1} = A\hat{\mathbf{x}}_t + L\,(y_t - C\hat{\mathbf{x}}_t).

The gain LL is a matrix you choose. Let the error be et=xt−x^t\mathbf{e}_t = \mathbf{x}_t - \hat{\mathbf{x}}_t. Subtracting the two updates gives et+1=(A−LC)et\mathbf{e}_{t+1} = (A - LC)\mathbf{e}_t. The error shrinks at each step by the eigenvalues of A−LCA - LC (see Eigenvalues and Eigenvectors). A standard result says that the eigenvalues of A−LCA - LC can be placed anywhere, by a suitable LL, exactly when (A,C)(A, C) is observable.

Worked examples

Example
A scalar with and without a sensor

Let n=1n = 1 with A=0.5A = 0.5. The observability matrix is just O=C\mathcal{O} = C.

  1. Take C=2C = 2. Then O=(2)\mathcal{O} = (2) has rank 1, which equals nn. The system is observable.
  2. Check: the reading is y0=2x0y_0 = 2x_0, so x0=y0/2x_0 = y_0 / 2 is recovered exactly.
  3. Take C=0C = 0. Then O=(0)\mathcal{O} = (0) has rank 0, which is less than 1. The system is not observable.
  4. Check: the reading is yk=0y_k = 0 for every kk, whatever x0x_0 is. Any two starting states look the same.

Interpretation: observability is not about how big the measurement is. It is about whether the measurement carries the state at all. A sensor with gain 2 sees the state fully, and one with gain 0 sees nothing.

Example
The cart: position sensor versus velocity sensor

Use A=(1101)A = \begin{pmatrix} 1 & 1 \\ 0 & 1 \end{pmatrix} from the walkthrough, and compare two sensors.

  1. Position sensor, C1=(1    0)C_1 = (1 \;\; 0). Compute C1A=(1⋅1+0⋅0,  1⋅1+0⋅1)=(1,1)C_1 A = (1 \cdot 1 + 0 \cdot 0,\; 1 \cdot 1 + 0 \cdot 1) = (1, 1).
  2. Stack: O1=(1011)\mathcal{O}_1 = \begin{pmatrix} 1 & 0 \\ 1 & 1 \end{pmatrix}. Its Determinant is 1⋅1−0⋅1=11 \cdot 1 - 0 \cdot 1 = 1, which is not zero, so the rank is 2.
  3. Velocity sensor, C2=(0    1)C_2 = (0 \;\; 1). Compute C2A=(0⋅1+1⋅0,  0⋅1+1⋅1)=(0,1)C_2 A = (0 \cdot 1 + 1 \cdot 0,\; 0 \cdot 1 + 1 \cdot 1) = (0, 1).
  4. Stack: O2=(0101)\mathcal{O}_2 = \begin{pmatrix} 0 & 1 \\ 0 & 1 \end{pmatrix}. Both rows are equal, so the rank is 1.
  5. Interpretation: the velocity sensor reads the same number at every step, because velocity does not change. The starting position never appears in any reading, so it cannot be recovered. The position sensor is observable and the velocity sensor is not, for the same dynamics.
Example
Designing an observer for the cart

The cart has A=(1101)A = \begin{pmatrix} 1 & 1 \\ 0 & 1 \end{pmatrix} and only a position sensor, C=(1    0)C = (1 \;\; 0). Pick a gain L=(l1,l2)⊤L = (l_1, l_2)^\top so that both eigenvalues of A−LCA - LC equal 0.20.2, which makes the estimate converge quickly.

  1. Compute LC=(l10l20)LC = \begin{pmatrix} l_1 & 0 \\ l_2 & 0 \end{pmatrix}, so A−LC=(1−l11−l21)A - LC = \begin{pmatrix} 1 - l_1 & 1 \\ -l_2 & 1 \end{pmatrix}.
  2. The trace is (1−l1)+1=2−l1(1 - l_1) + 1 = 2 - l_1, and the determinant is (1−l1)⋅1−1⋅(−l2)=1−l1+l2(1 - l_1) \cdot 1 - 1 \cdot (-l_2) = 1 - l_1 + l_2.
  3. Two eigenvalues both equal to 0.20.2 means the characteristic polynomial is λ2−0.4λ+0.04\lambda^2 - 0.4\lambda + 0.04. So the trace is 0.40.4 and the determinant is 0.040.04.
  4. From the trace, 2−l1=0.42 - l_1 = 0.4, so l1=1.6l_1 = 1.6. From the determinant, 1−1.6+l2=0.041 - 1.6 + l_2 = 0.04, so l2=0.64l_2 = 0.64.
  5. Check: A−LC=(−0.61−0.641)A - LC = \begin{pmatrix} -0.6 & 1 \\ -0.64 & 1 \end{pmatrix} has trace 0.40.4 and determinant (−0.6)(1)−(1)(−0.64)=0.04(-0.6)(1) - (1)(-0.64) = 0.04. Both match.
  6. Try it: what happens to the error if you use no correction at all, L=(0,0)L = (0, 0)? Answer: then A−LC=AA - LC = A has both eigenvalues equal to 1, so the error never shrinks. With no correction term, nothing reduces the velocity error either, so the velocity estimate never converges.

Interpretation: the position reading corrects both the position estimate, with gain 1.61.6, and the velocity estimate, with gain 0.640.64. The velocity is never measured, yet the observer recovers it, because observability guarantees that the correction reaches the hidden component.

Common mistakes and tradeoffs

It is tempting to think that observable means every state variable is measured. In fact observability only requires that the state can be inferred from the outputs over time. The cart's velocity is never measured directly, yet it is observable, because a change in position reveals it.

It is tempting to think that observability is a property of the sensor alone. In fact it depends jointly on AA and CC. The same velocity sensor is useless on the cart and useful on a system where velocity changes the readings in a different way.

It is tempting to think that a full-rank observability matrix guarantees a good estimate. In fact a matrix can have full rank and still be nearly singular, with a tiny smallest singular value. The hidden direction is then seen only very weakly, so the estimate needs very large gains and amplifies sensor noise. Check the singular values of O\mathcal{O} (see Singular Value Decomposition (SVD)), not only whether the rank is nn.

It is tempting to think that the rank test can be run in floating-point arithmetic with exact zeros. In fact rounding makes exact zeros rare (see Floating-Point Numbers), so software counts singular values above a tolerance instead.

Use the rank test when you have a linear model and want to know in advance whether an estimator can work. Do not rely on it alone for nonlinear systems: the nonlinear version is a local property, checked at an operating point, and a linear test there is only an approximation. An alternative for hand work is the Popov-Belevitch-Hautus test: the system is unobservable exactly when some eigenvector v\mathbf{v} of AA satisfies Cv=0C\mathbf{v} = \mathbf{0}. Each eigen-direction is checked in turn, which is often quicker than stacking a large matrix.

SituationWhat goes wrongBetter choice
Sensor noise is largeA nearly unobservable direction is buried in noiseCheck singular values, add a sensor that sees that direction
The model is nonlinearA linear rank test may not describe the true behaviourTest the linearisation at the operating point, or use a nonlinear observability test
The system is largeStacking and inverting O\mathcal{O} is slow and rounding-proneUse a numerically stable factorisation, or reduce the model
The dynamics change over timeOne fixed test can pass or fail at different timesTest observability over a sliding window of recent steps

History

Rudolf Kalman's work on linear systems in the early 1960s, the same work that produced his filter, introduced controllability and observability as a dual pair of properties. Controllability asks whether the input can steer the state anywhere. Observability asks whether the output reveals the state. The two are linked by a duality that lets a result about one be read as a result about the other.

David Luenberger published the observer in 1964. It is a deterministic version of the same idea: a copy of the model corrected by the output, with its error dynamics placed by the gain. The Kalman filter is the stochastic counterpart, which chooses the gain from the noise statistics. Both need observability to be sure the error can be made small in every direction. The concept caught on because a single rank test answers, before any data is collected, whether a sensor layout can support an estimator at all.

Recap

  • The state is hidden, the outputs are the only evidence, and observability asks whether the evidence pins the state down.
  • Stacking the readings CC, CACA, up to CAn−1CA^{n-1} gives the observability matrix O\mathcal{O}. The state is recoverable exactly when rank⁡(O)=n\operatorname{rank}(\mathcal{O}) = n.
  • Only the first nn powers are needed, by the Cayley-Hamilton theorem. A nonzero vector in the null space of O\mathcal{O} is a difference between two states that stays invisible forever.
  • An observer's error follows A−LCA - LC, and observability is what lets you place its eigenvalues.
  • Next: Controllability is the dual question about the input, and Kalman Filter shows how the same structure is used with noise. The State Space Model lesson gives the wider setting.

Check yourself

QuestionRecall: what does it mean for a pair (A, C) to be observable?Show answer

It means that two different starting states always produce different output sequences. Equivalently, the only starting state whose outputs are all zero is the zero state. The hidden state can then be determined from the outputs.

QuestionComputation: for A = (1 1; 0 1) and C = (0 1), find the observability matrix and its rank.Show answer

First compute CA=(0⋅1+1⋅0,  0⋅1+1⋅1)=(0,1)CA = (0 \cdot 1 + 1 \cdot 0,\; 0 \cdot 1 + 1 \cdot 1) = (0, 1). The observability matrix is O=(CCA)=(0101)\mathcal{O} = \begin{pmatrix} C \\ CA \end{pmatrix} = \begin{pmatrix} 0 & 1 \\ 0 & 1 \end{pmatrix}. Both rows are equal, so the rank is 1, which is less than n=2n = 2. The system is not observable: the position never appears in any output.

QuestionWhy: why does the rank of the stacked matrix decide whether the starting state can be recovered?Show answer

The stacked outputs equal Ox0\mathcal{O}\mathbf{x}_0. If the columns of O\mathcal{O} are independent, this linear equation has exactly one solution for x0\mathbf{x}_0, so the outputs determine the state. If the rank is less than nn, there is a nonzero vector v\mathbf{v} with Ov=0\mathcal{O}\mathbf{v} = \mathbf{0}, and x0\mathbf{x}_0 and x0+v\mathbf{x}_0 + \mathbf{v} produce the same outputs. Rank is therefore exactly the condition for unique recovery.

QuestionApplied: a sensor reads only the first of two independent processes that do not interact. Can the second process be estimated from the readings?Show answer

No. Since the processes do not interact, the second state never affects the readout, in the same way that the second component of the diagonal example never appeared. The readings carry no information about it, so the observability matrix has rank 1 and the second process is invisible. A second sensor on that process, or a coupling that lets the first process reveal it, would be needed.

Sources