简体   繁体   中英

Finding the roots of a polynomial with symbolic coefficients

As part of an assignment, I had to derive the equations of motion for a car's suspension system. Essentially it is a spring mass damper problem. The values for the car mass, M1, wheel mass, M2, the spring constant, k1 & k2 and the damping constant, c have not been given. I have derived the equations of motion and derived a transfer function relating the road surface (input) to the resulting car body displacement (output). I must determine the poles of this transfer function, hence I need to find the roots of the characteristic equation (denominator). The problem is that I do not have any values for the aforementioned variables and I am trying to either factorise my 4th order polynomial in MATLAB symbolically or calculate the roots straight away. I cannot assume any values, and it must be solved symbolically, however I do not know if this is possible in MATLAB.

I do not have a lot of experience with MATLAB so I am not aware of all its capabilities.

The characteristic equation I am trying to solve is :

(M1*M2)*s^4 + c*(M1+M2)*s^3 + ((M1*k1)+(M1*k2)+c^2+(M2*k2)-c)*s^2 + k1*c*s + ((k1*k2)-(k2^2))

Thank You in advance.

You have some errors in your equation;

 c(M1+M2)*s^3 -> c*(M1+M2)*s^3
 + +k1*c*s -> + k1*c*s

But if you want to solve multivariate equations you can do it like this;

syms M1 M2 c k1 k2 s
eqn = (your equation) == 0;
roots = solve(eqn, s);

More information here: solve

Now you only need to follow this steps in case you only want to calculate the roots of the equation , which are similar to the previous comment:

1. syms c s
2. roots=solve((M1*M2)*s^4 + c*(M1+M2)*s^3 + ((M1*k1)+(M1*k2)+c^2+(M2*k2)-c)*s^2 + k1*c*s + ((k1*k2)-(k2^2)),s)
or
roots=solve((M1*M2)*s^4 + c*(M1+M2)*s^3 + ((M1*k1)+(M1*k2)+c^2+(M2*k2)-c)*s^2 + k1*c*s +((k1*k2)-(k2^2)),c)
or 
roots=solve((M1*M2)*s^4 + c*(M1+M2)*s^3 + ((M1*k1)+(M1*k2)+c^2+(M2*k2)-c)*s^2 + k1*c*s + ((k1*k2)-(k2^2)),s,c)

depending on the solution you want

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM