second order diffrential equations to state space

42 Views Asked by At

i derived this Ordinary Difrential Equations of Motion of a self balancing robot using lagrange mechanics the next step is to convert them to state space representaion where with foure state variables : X1 = x ( position ) X2 = theta (inclination angle) X3 and X3 are derivatives of X1 and X2 and to be calculated from these two ODE's

$ x ̈ (2M+ m+(2*Jw)/R^2 )+ l*m *θ ̈- l*m*θ*(θ^2 ) ̇+2μ0*x ̇=0 $ 1.30

$ θ ̈(Jc+l^2*m)+( l*m)*x ̈+θ ̇(2*μ1-mgl*θ)=Tl+Tr $ 1.31

this is s picture (first timt in the forume )

second orders ODE's

how convert this equations to state space rep because the theta dot squared term might be a problem