Week 2/3: Transforming Viewpoints
April 6, 2026
Welcome back, everyone. I’m really sorry for the delay. It has been a few busy weeks as I’m currently moving. Last time we left off right after linearizing the equations, today, we are going to see how these equations translate into a State-Space representation.
But first, what even is a State-Space?
Classically, in Physics classes, we often use sets of equations to describe the evolution of a system, such as F = ma or V = IR. They work perfectly fine for a limited number of variables, but as the number of unknowns grows, it can be difficult to keep track of all equations, their inputs, and outputs separately. This is where the state-space representation comes in handy. Instead of having equations scattered around, unrelated to each other, we can embed them into a single matrix that describes them all at once.
In reality, they are just another way to represent the system that we are dealing with.
Typically, 2 equations define a representation.
The State Equation:
![]()
And the Output Equation:
![]()
Where u(t) is the input, y(t) is the output, and A, B, C, and D are matrices describing the system. x(t) is a little special. Notice how it appears as both an input and the result of the first equation as a derivative. This is because the first equation continuously updates the system’s state based on the current state and the input. Hence, x(t) is also given the name State Vector.
For the pendulum, x(t) is a column vector of 4 elements, the horizontal position of the cart and the angle of the pendulum. These are the fewest variables required to track the state of the system.
![]()
u(t) is simply F, as it is the only input of the system, the force on the cart.
Using the equations from Last week,
![]()
we can derive A and B to be the following, respectively.


Where D is
![]()
Please keep in mind that this D is not the same as the D in the output; this is merely a placeholder for the long string of variables above.
We do not currently need to derive the Output Equations, as our primary goal is not to evaluate the output but to constantly update the cart’s position based on the state of the system.
With this done, our system of the cart and pole can now be described solely in terms of matrices and vectors, allowing for much cleaner math, especially when implemented on a computer. Tune in next time as I begin the first important part of the project, the simulation, and use it to find the optimal gain matrix for our controller.

Leave a Reply
You must be logged in to post a comment.