Multi-mass, damper, spring system in matlab
2 views (last 30 days)
Show older comments
I am looking to solve a multi-mass, damper, and spring system in matlab.
Eq1 = mx1'' + 2cx1' + -cx2' + 3kx1 - kx2 = 0 Eq2 = mx2'' - cx1' + 3x2' - kx1 + 2kx2 = 0
x1(0)=0; x2(0)=0.3; x1'(0)=-0.1,x2'(0)=0
How do I solve for the equations of motion (x1 and x2) in matlab? I believe I should be using ode45, but am not sure how.
0 Comments
Answers (1)
Sam McDonald
on 19 Apr 2017
A solver like "ode45" would be the correct choice for a problem like this. It takes a function handle as its first argument of the form y' = f(t,y). You will need to convert your equations to this form, where x1 and x2 are two of the four states in y. Your function will return y', which are the derivatives of the states, expressed in terms of the other states.
Looking at the ode45 examples is a good place to start:
0 Comments
See Also
Categories
Find more on Numerical Integration and Differential Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!