Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 11

Observability Matrix & System Observability

Recommended resources

Hello! Welcome back.

In our last lesson, we built the intuition behind observability, understanding it as the answer to the question, "Can we know the state of the system by only looking at its outputs?" We saw that observability is the fundamental property that makes state estimation possible, allowing us to reconstruct the full state vector from limited sensor measurements.

Today, we move from the "what" to the "how." Just as we used the controllability matrix to get a definitive mathematical answer about controllability, we will now learn the parallel test for observability. The goal for this lesson is to learn how to compute the observability matrix and use its rank to determine if a system is observable. This is the crucial analytical tool you'll need before designing a state estimator for your rotary inverted pendulum.

The Observability Matrix and the Rank Test

Recall the standard LTI state-space model:

Observability is entirely determined by the relationship between the system dynamics (matrix ) and the sensor configuration (matrix ). The mathematical tool that captures this relationship is the observability matrix, denoted by .

For a system with states and outputs, the observability matrix is constructed as follows:

This is an matrix. Notice the structural similarity to the controllability matrix—this is an example of the principle of duality in control theory.

The condition for observability is straightforward and is known as the Kalman test for observability:

A system is observable if and only if its observability matrix has full column rank, meaning .

The following resource provides a concise definition of this test, directly in the context of a rotary pendulum project.

State feedback control of a rotary inverted pendulum

This paper, 'State feedback control of a rotary inverted pendulum', formally defines the observability matrix and the associated rank condition. It's a great, compact reference.

Please read Section 2.1, 'State-space representation'. Focus on Equation (3), which defines the observability matrix, and the rank condition required for the system to be observable.


A Worked Example: Calculation and Rank Analysis

Let's see how this test is applied in practice with a simple 2-state system. The following video walks through the entire process step-by-step: building the matrix and then calculating its determinant to check the rank.

1. Controllability and Observability by Kalman's Test in State Space Analysis

This video from Engineering Funda provides a clear, procedural demonstration of computing the observability matrix for a 2x2 system and determining its rank.

Please watch from 08:54 to 13:14. The first part (08:54 - 11:02) shows the construction of the observability matrix, \mathcal{O} = [C^T, (CA)^T]^T. (Note: The video constructs it column-wise, which is equivalent to transposing the row-wise formula we use). The second part (11:02 - 13:14) shows how to calculate the determinant. Because the determinant is zero, the rank is not 2. The video then explains that because sub-matrices are non-zero, the rank is 1, meaning only one state is observable.

The key takeaways from this example are:

  • For a system with states and one output (), the observability matrix will be square ().
  • For a square matrix, checking for full rank is equivalent to checking if its determinant is non-zero. If , the system is observable.
  • If the rank of is less than , the rank's value indicates the number of observable states. The remaining states are unobservable.
Test your understanding!

Consider the system:

Is this system observable? Follow the steps to determine the answer.

Show answer
  1. Identify parameters: , , .
  2. Construct the observability matrix: .
  3. Calculate the terms:
  4. Assemble the matrix:
  5. Check the rank: The matrix is the identity matrix. Its determinant is .
  6. Conclusion: The rank is 2, which equals the number of states. The system is observable.

Practical Application: The Inverted Pendulum

Now let's apply this test to the system you're interested in: the inverted pendulum. As we discussed last time, the choice of sensors is critical. We'll now see mathematically how different sensor choices (i.e., different matrices) affect observability.

The following video is an excellent demonstration in MATLAB. It shows how different matrices for the same pendulum system lead to different conclusions about observability.

Control Bootcamp: Observability Example in Matlab

In this 'Control Bootcamp' video, Steve Brunton uses MATLAB to test the observability of the inverted pendulum with two different sensor configurations.

Please watch from 02:10 to 07:51. First (02:10 - 05:22), observe what happens when we only measure the cart's position, x. The obsv(A,C) function is used, and the resulting matrix has a non-zero determinant, proving observability. Second (05:22 - 07:51), see the result of measuring only the pendulum's angle, theta. The determinant is zero, meaning the system is not observable with this sensor. Pay close attention to the physical explanation provided—it perfectly links the math back to the intuition of 'blind spots'.

This is a powerful result. The math confirms our physical intuition:

  1. If you measure the cart's position x, you can infer its velocity and, through the dynamic coupling, the pendulum's angle and angular velocity . The system is observable.
  2. If you only measure the pendulum's angle , you can never know the absolute position of the cart x. If the entire system translates left or right, the angle doesn't change, so this motion is invisible to your sensor. The x state is unobservable.

The CTMS page on the inverted pendulum reinforces this point and introduces the rank() command in MATLAB, which is more general than det() because it works for non-square observability matrices (which occur when you have multiple outputs).

Inverted Pendulum: State-Space Methods for Controller ...

This page from the University of Michigan's Control Tutorials for MATLAB and Simulink (CTMS) applies the observability test to the inverted pendulum.

Please read the section 'Observer-based control'. Notice the use of obsv(sys_ss) and rank(ob) to confirm observability for the case where both position and angle are measured. The text also explicitly confirms the point from the video: obsv(A,C(2,:)) (measuring only the angle) results in a matrix that is not full rank.

Finally, let's look at the model for the specific rotary inverted pendulum system you are studying. The paper State feedback control of a rotary inverted pendulum provides the linearized model and confirms its properties.

Kinematics of the rotary inverted pendulum. The states are the arm angle , pendulum angle , and their velocities.

The paper provides the full state-space model for this system and directly states the result of the observability test:

"The controllability and observability matrices are both full rank, and hence, the state-space model (24) is the minimal realization of the inverted pendulum system." - (Räsänen & Pyrhönen, 2019)

This confirms that with sensors for both the rotary arm angle () and the pendulum link angle (), the system is fully observable. You can find this statement in the resource LINK within Section 4, under Equation (24). This is great news, as it means you can proceed with designing an observer to estimate the angular velocities.


Conclusion

Today we've translated the abstract concept of observability into a concrete mathematical procedure. You now have a definitive test to determine if a system's internal state can be reconstructed from its outputs.

Key Takeaways:

  • The observability matrix, , encapsulates the relationship between system dynamics () and sensors ().
  • A system is observable if and only if the rank of its observability matrix equals the number of states, .
  • For practical analysis, software like MATLAB is used with commands like obsv to construct the matrix and rank or det to check for full rank.
  • The choice of sensors (the matrix) is what determines observability. As seen with the pendulum, one sensor configuration may be observable while another is not.

Preview of the Next Lesson:

We've now seen that a system can have "unobservable states" when the observability matrix loses rank. But what does this mean in other representations? In our next lesson, we will explore the deep connection between observability and transfer functions. You will learn to relate uncontrollable or unobservable modes to pole-zero cancellations, discovering how these "hidden" internal dynamics manifest in the input-output behavior of the system. This will connect our state-space analysis back to the concepts you may have seen in classical, single-variable control.