Mass spring system equation help
10 views (last 30 days)
Show older comments
Hi all fellow Matlab users.
I'm fairly good a Matlab but I have encountered some difficulty in getting my function to work with ode45. I have a system with two springs and two masses which are attached to a wall. I am given two second order odes (x1'' = -((k1)*(x1 - L1))/m1 + ((k2)*(x2 - x1 - w1 - L2))/m1 & x2'' = -((k2)*(x2 - x1 - w1 - L2))/m2). There after I made the 2nd order odes into 4 1st order odes which would go into my function. The time span is from 0 - 20 and initial values of x1 = L1 and x2 = L1 + w1 + L2 + 6. Assume all the other variables to be = 1. L1 & L2 = free length of spring. m1 & m2 = masses. x1 & x2 = position of the masses. w1 & w2 = width of masses and k1 & k2 = stiffness of spring.
Any ideas on how i should approach this problem will be greatly appreciated.
Thank you
0 Comments
See Also
Categories
Find more on Ordinary 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!