MATLAB: State-Space for Inerter based suspension system

quarter carstate-spacesuspension system

Hello, I'm doing my project on the comparison of Conventional suspension system with an inerter based suspension system. I'm struck at deriving the state-space equations for the parallel based inerter. Here the acceleration of other mass acts as a loop. I tried but i wasn't able to solve. I'll be grateful if someone could give me a hint to crack this. The Equations are given below.
Where Z0 is an input, Z1 is the Unsprung Mass & Z2 is the Sprung Mass.
These are the Matrices i got.
Amat = [0,1,0,0 % A_mat of the Unsprung and Sprung Mass
-((Ks/Mu)+(Kt/Mu)), -Cs/Mu, Ks/Mu, Cs/Mu
0,0,0,1
Ks/Ms, Cs/Ms, -Ks/Ms, -Cs/Ms];
Bmat = [0;Kt/Mu;0;0]; % B_Matrix of the Unsprung mass and Sprung Mass
Cmat = [1,0,0,0 % C_Matrix of the Unsprung Mass and Sprung Mass
0,1,0,0
0,0,1,0
0,0,0,1];
Dmat = [0]; % D_Matrix of the Unsprung Mass and Sprung Mass

Best Answer

See odetovectorfield :https://www.mathworks.com/help/symbolic/odetovectorfield.html. It also have example to convert the symbolic ODE to the system of first order ODE which can be used to write a ss-model.
If you want to do it by hand, then you first need to write the two ODEs in this form
and then convert it into the state-space form
where .
Following shows the code using ode2vectorfield:
syms ms mu ks cs binrt kt z0(t) z1(t) z2(t)
Dz1 = diff(z1);
DDz1 = diff(Dz1);
Dz2 = diff(z2);
DDz2 = diff(Dz2);
eq1 = ms*DDz2 == ks*(z1-z2) + cs*(Dz1-Dz2) + binrt*(DDz1-DDz2);
eq2 = mu*DDz1 == ks*(z1-z2) + cs*(Dz1-Dz2) + binrt*(DDz1-DDz2) + kt*(z0-z1);
[V,S] = odeToVectorField(eq1, eq2)
Result
>> V
V =
Y[2]
(binrt*kt*z0(t) + kt*ms*z0(t) - binrt*kt*Y[1] + cs*ms*Y[2] - cs*ms*Y[4] + ks*ms*Y[1] - ks*ms*Y[3] - kt*ms*Y[1])/(binrt*mu - binrt*ms + ms*mu)
Y[4]
(binrt*kt*z0(t) - binrt*kt*Y[1] + cs*mu*Y[2] - cs*mu*Y[4] + ks*mu*Y[1] - ks*mu*Y[3])/(binrt*mu - binrt*ms + ms*mu)
>> S
S =
z1
Dz1
z2
Dz2
You can also use this outout to write a state-space model.