State-Space Observability Simulator Back
Control Engineering

State-Space Observability Simulator

For a 2nd-order linear time-invariant system ẋ=Ax+Bu, y=Cx, this tool answers the question "can the full internal state x be known from the measurable output y alone?" Adjust the system matrix A and the sensor row vector C and watch the determinant and rank of the observability matrix O=[C;CA] update in real time to find a design where state estimation works.

Parameters
System matrix A
2nd-order dynamics A = [[a11,a12],[a21,a22]]
a11
a12
a21
a22
Output row vector C
How the sensor measures the state: y = C·x = c1·x1 + c2·x2
c1
c2
Set to 0 to not measure state x2 directly
Results
Observability det
Rank
CA component 1
CA component 2
Observability
|det|
Observability-matrix rows — the plane spanned by C and CA

The two arrows from the origin are the observability-matrix rows C (blue) and CA (orange). If linearly independent they span the whole plane (green shading = observable); if collinear, the unobservable direction is shown in red.

det(𝒪) versus c2
Observability-matrix row-vector components
Theory & Key Formulas

$$\mathcal{O}=\begin{bmatrix}C \\ CA\end{bmatrix},\qquad \text{observable}\iff \operatorname{rank}\mathcal{O}=n$$

The observability matrix 𝒪 and the observability test. C: output row vector, A: system matrix, n: state dimension (here n=2). Full rank means the state x can be fully reconstructed from the output y.

$$CA=\bigl[\,c_1a_{11}+c_2a_{21},\;\; c_1a_{12}+c_2a_{22}\,\bigr]$$

The components of the CA row vector for a 2nd-order system. It is the output row C multiplied on the right by A, and forms the second row of 𝒪.

$$\det\mathcal{O}=c_1\,CA_2-c_2\,CA_1$$

Determinant of the 2×2 observability matrix. If non-zero the rank is 2 (full rank) and the system is observable. For an n-th order system O=[C;CA;CA²;…;CAⁿ⁻¹]; observability is the dual of controllability, so observability of (A,C) equals controllability of (Aᵀ,Cᵀ).

What is Observability?

🙋
The word "observability" came up in my control class, and honestly I don't really get it. What exactly is being "observed"?
🎓
In plain terms it asks: "looking only at the measurable output y from your sensors, can you figure out the whole inside of the system — the internal state x?" Think of a drone's attitude control. You really want both angle and angular rate, but a gyro may only measure rate. If, mathematically, you can still recover the angle from the history of the output, the system is observable. If some direction can never be recovered, it is unobservable.
🙋
I see. So how do you decide whether a system is observable? It comes out of an actual calculation, not just intuition, right?
🎓
Right — you build the observability matrix 𝒪 and look at its rank. Put the output row vector C as the first row, and the row CA (C multiplied by A) as the second. For a 2nd-order system that gives 𝒪=[C;CA], a 2×2 matrix. If its rank equals the state dimension n (2 here), it is full rank and observable. Try sliding c2 on the left: the instant det(𝒪) crosses zero, the rank drops from 2 to 1 and the verdict flips to "unobservable".
🙋
There are two arrows on the canvas on the right. Are those C and CA? They turn red when they line up...
🎓
Exactly. Those two are a picture of the "row vectors" of the observability matrix. As long as C and CA point in different directions, the two of them span the whole plane — you get two independent pieces of information — so the system is observable. But if the two end up on the same line (parallel), you effectively only have information in one direction. That "invisible direction" shows up in red. det(𝒪) is precisely the signed area of the parallelogram those two arrows make: zero area means they have collapsed.
🙋
If a system turns out unobservable, is there nothing you can do?
🎓
No, there are a few moves. The most direct is to add a sensor and change C. Just bumping c2 from 0 to 0.5, for instance, often mixes information about x2 into the output and brings observability back. If you cannot add sensors, at least confirm that the unobservable modes are stable — that is "detectability". If a diverging mode is unobservable, no observer and no Kalman filter can ever track it, so this is a make-or-break check.
🙋
We always learn it alongside "controllability". How are observability and controllability related?
🎓
The two are "duals" — the two sides of the same coin. Controllability is "can the input drive the state anywhere?", observability is "can the output reveal every state?" Mathematically, the observability matrix [C;CA;…] coincides exactly with the controllability matrix of the dual system, where A is transposed. So a test algorithm for one carries straight over to the other. That duality is also why observer design is a mirror image of state-feedback design.

Frequently Asked Questions

Observability is the property that the entire internal state x(t) of a system can be uniquely reconstructed from a finite-time record of the measurable output y(t) alone. For a state-space model ẋ=Ax+Bu, y=Cx, the system is observable when the observability matrix O=[C;CA;…;CAⁿ⁻¹] has rank equal to the state dimension n. A system that is not observable contains an unobservable state direction that never affects the output, regardless of the sensor layout.
For a 2nd-order system you stack the output row vector C=[c1,c2] and the row vector CA, obtained by multiplying C on the right by A, to form the 2×2 matrix O=[C;CA]. Here CA=[c1·a11+c2·a21, c1·a12+c2·a22]. Its determinant is det(O)=c1·CA[1]−c2·CA[0]. If det(O) is non-zero the rank is 2 (full rank) and the system is observable; if it is zero the two rows C and CA are linearly dependent, the rank drops, and the system is unobservable.
Controllability asks whether the input can drive the state to any value; observability asks whether the output reveals every state. They are dual concepts. The observability matrix O=[C;CA;…] coincides exactly with the controllability matrix of the dual system (A→Aᵀ, B→Cᵀ). In other words, observability of (A,C) is equivalent to controllability of (Aᵀ,Cᵀ), so a test for one can be reused for the other.
An unobservable system has an unobservable subspace in state space that never appears in the output y. States within it — for example an internally diverging mode — cannot be estimated by any observer or Kalman filter, no matter how long you measure. On real hardware you must add a sensor in that direction, redesign C, or at least confirm that the unobservable modes are stable (detectable).

Real-World Applications

Observer (state estimator) design: A motor's shaft angle can be measured by an encoder, but the angular rate or the load torque often cannot be measured directly. Designing a Luenberger observer to estimate the unmeasured states requires, as a precondition, that the system be observable. If it is not, the observer poles cannot be placed anywhere and the estimation error never converges. The rank verdict in this tool is the very first sanity check before you build an observer.

Kalman filters and sensor fusion: Self-localization of an autonomous car or the inertial navigation of an aircraft estimates the state from several noisy sensors. For a Kalman filter to converge stably the system must be observable (or at least detectable). A situation where GPS drops out temporarily can be analyzed as "part of the state becoming temporarily unobservable", letting you estimate how much the filter degrades during that gap.

Deciding the sensor layout: Monitoring a large structure or estimating temperatures and concentrations in a chemical plant raises the design question: "where and how many sensors do I need to read the full internal state?" You compute the rank of the observability matrix for each candidate C matrix and choose the minimal sensor set that yields full rank. Moving c1 and c2 in this tool is exactly a miniature of that sensor-selection problem.

Model reduction and control education: Observability is also used when reducing a model down to only its observable and controllable part (the minimal realization). In a university control course, the observability matrix, the controllability matrix and duality are core topics. After working out det(𝒪) by hand, this tool is handy for checking your answer, or for sweeping a parameter continuously to feel where the rank drops at a "singular configuration".

Common Misconceptions and Pitfalls

The most common mistake is assuming "observability depends only on the system matrix A". Observability is a property of the pair (A,C) and depends strongly on how the output matrix C is chosen — that is, which states are measured and how. For the same plant A, you can confirm in this tool that the moment c2 becomes 0 the system turns unobservable. Conversely, "unobservable" does not mean "bad design". Adding one sensor and changing C often restores observability, so observability should be seen as a sensor-design problem, not a plant defect.

Next, the false comfort that "if det(𝒪) is merely close to zero it is almost observable, so no problem". In theory det(𝒪)≠0 means observable, but a system with an extremely small det(𝒪) is "nearly unobservable" and that is serious in practice. When the smallest singular value of the observability Gramian is small, tiny measurement noise is amplified into huge state-estimation errors. This tool shows |det|, but on real hardware you should look not just at the binary observable/unobservable but also at the "strength" of observability — its condition number and singular values.

Finally, the belief that "an unobservable system cannot be controlled". Observability and controllability are different things. Even an unobservable system can be stabilized by output feedback as long as every unobservable mode is stable (detectable). Conversely, if a controllable but unobservable mode is diverging, that state diverges while it can be neither estimated nor observed. In practice the weaker conditions — detectability (weaker than observability) and stabilizability (weaker than controllability) — are often sufficient, so it is important to judge what you truly need.

How to Use

  1. Enter the A matrix coefficients (a11, a12, a21, a22) defining your 2nd-order LTI system dynamics ẋ=Ax+Bu
  2. Specify the C output matrix row vector (1×2), which determines which state combinations are measured
  3. Click Simulate to compute the observability matrix O=[C; CA] and its determinant, rank, and observability classification
  4. Review the output: if rank=2 and |det|≠0, the system is completely observable and full state reconstruction via observer design is feasible

Worked Example

A DC motor speed control system with state vector [angular velocity ω, motor current i]. Given A=[[0, 1], [-5, -2]] (rad/s, A), C=[1, 0] (measuring speed only via tachometer), the observability matrix becomes O=[[1, 0], [-5, -2]]. Determinant=−2, rank=2, confirming complete observability. An observer can reconstruct unmeasured current from speed measurements alone. If instead C=[1, 1] (measuring both outputs), CA=[−5, −2] remains linearly independent of C, maintaining full rank and observability.

Practical Notes

  1. A rank-deficient observability matrix (rank<2) indicates unobservable modes; those state components cannot be inferred from output measurements regardless of observer gain tuning
  2. For mechanical systems (spring-mass-damper), if only displacement is sensed but mass or damping must be estimated, verify C selection ensures rank([C; CA])=2
  3. Zero determinant signals structural observability loss; add additional sensors (enlarge C to 2×2 or cascade measurements) to restore observability before deploying state feedback control