# How to model the state space matrix of a pendulum?

Here's an image of the problem:

I'm trying to put the following problem in matrix form (state space) but I don't know how would I put -(g/L)sin(x1) in the A matrix since the x1 value is inside the sin() wave.

Thanks!

• What you may be referring is the state space representation of a linear system where the coefficients can be separated from the state variables. $\dot x = A x$. Your system is a non linear system. It cannot be represented in this format. It can be linearised. The linear approximation of the system can be brought into the form you need.
– AJN
Feb 7, 2022 at 12:05
• hint: sin(x) ≈ x , for small x Feb 7, 2022 at 14:01
• here is an answer I wrote which shows linearisation steps, in case you want to go that way.
– AJN
Feb 7, 2022 at 15:34
• if it's a small angle you can put -g/l in there. Feb 7, 2022 at 16:42

$$\sin \left(x_1\right) = x_1-\frac{x_1^3}{6}+O\left(x_1^4\right)$$
As $$x_1$$ gets further away from 0, the correctness of the approximation and that of the linear model with $$\sin \left(x_1\right) \approx x_1$$ decreases.