I was helping some of the students on my team understand what exactly the State Space models actually mean. It’s kind of difficult to understand like, why a state can be represented as a vector, what the controller gains do, how it relates to PID, and what happens if you tinker with each of the parts of the model.
I have quite a bit of experience making desmos’s that represent math models and I decided to make a model of State Space using its simulation feature. This really helped make the whole thing click for me, and I wanted to share this with the community.
Some aspects like discretization are missing, but the idea is still there and I’d love to get your feedback. There are no matrixs because desmos does not support those, so I simulated the matrix with functions. This is something that I feel is really important for teams to understand and hopefully this could help.
This model represents velocity on the X axis and position on the Y axis. It is modeling a robot trying to get to a certain position. You can move the target and mess with the P and D values, or just completely change the controller gain function if you wish. If you have any question’s I’d be happy to answer.
I suggest superimposing a vector field onto the Desmos phase portrait, as that’s the most common method for visualizing what you’re getting at. The vector field lets you see all paths at once for any initial condition, not just the one being simulated at the moment. For example:
Here you go, this is a slope field model for State Space Control that uses The Runge–Kutta method to integrate the state. This is probably more useful than the original one, however because of the weird Slope Field math it makes it a little harder to understand, but it’s still very interesting.