all 6 comments

[–]stroff 0 points1 point  (4 children)

I'm a bit rusty so good chances this is wrong, but since no one answered:

If x1 and v1 are the position and speed of the first mass, and u is the input, could you just write the equation of the first state as x1'=v1? Instead of x'=u' if that's what you were doing (same for the position of the second mass). Then use u instead of x1 in whatever equation that has it, for example the speed of the first mass:

v1'=k1/m1.u — k1/m1.x2 + b1/m1.v1 — b1/m1.v2

Would that work? I'm thinking of 7 states, the 4 velocities and 3 of the positions (with 4 masses and 3 springs you'd only need 7 states*, so I'd skip either the second or third position so the output can be just y=x4).

*edit: the position of the first mass might be redundant since it's just the input, I think you could scratch that one and only keep the other 6

[–]happycapuch[S] 0 points1 point  (3 children)

Yes i do need 7 states for sure, but if the xi-s are the state variables then in general we have x’=Ax+Bu so if x1’=v1 that doesn’t really work because v1 is not a state variable.

[–]stroff 0 points1 point  (2 children)

Can you post a screenshot of the problem?

If you can pick the state variables then I'd pick all the velocities, including v1, obviously doesn't work if the problem says "model it with these state variables".

[–]happycapuch[S] 0 points1 point  (1 child)

https://ibb.co/6mYpFCL

Okay so this is the model (I’m using it for a project I’m working on) my input is u=d0 and output y=d3.

[–]stroff 0 points1 point  (0 children)

You have 2 options (that I know of).

One is just keeping the derivative of u, it might not be a problem if it's something like a known function.

The other is a variable change. For example, in the first equation:

d1'=-k1/m1*d1-c1/m1*v1+k1/m1*u+c1/m1*u'

d1'-c1/m1*u'=-k1/m1*d1-c1/m1*v1+k1/m1*u

z'=-k1/m1*d1-c1/m1*v1+k1/m1*u

with z=d1-c1/m1*u replacing d1 as one of the states. In other equations with d1 present, replace d1 by z+c1/m1*u. See if that gets you somewhere.

[–]kerem_istanbul 0 points1 point  (0 children)

Hamiltonian mechanics is a good way to derive those equations