Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ode45 mass spring damper solution

1,140 views
Skip to first unread message

Mark Rossi

unread,
Apr 8, 2013, 8:15:12 PM4/8/13
to
Having a lot of trouble understanding how matlab solves second-order ODE's. I have a relatively simple mass spring damper problem, but for the life of me I can't wrap my head around what .m files to write. Any help would be appreciated.

Nasser M. Abbasi

unread,
Apr 8, 2013, 11:19:05 PM4/8/13
to
need to write the 2nd ode as 2, first order ode's. Then use ode45.
many examples on the net.

see

http://12000.org/my_notes/matlab_ODE/index.htm
http://12000.org/my_notes/vanderpol/using_ODE45_to_solve_vanderpol/index.htm

--Nasser


Loren Shure

unread,
Apr 9, 2013, 4:32:40 AM4/9/13
to

"Mark Rossi" <mr...@virginia.edu> wrote in message
news:kjvmig$9m6$1...@newscl01ah.mathworks.com...
Here's the mass-spring system worked out in detail. You should be able to
go from there.

http://blogs.mathworks.com/loren/2010/03/25/solving-ordinary-differential-equations/

--
--Loren

http://blogs.mathworks.com/loren

tharindu...@gmail.com

unread,
Nov 27, 2014, 11:54:35 PM11/27/14
to
Dear all,

I have a mass-spring damper system with variable external force. The system is discrete and the force applied to the system by en external force can be estimated for each and every time step.

M*Xdd(t) + B*Xd(t) + K*X(t) = F(t)

I could solve the system for periodically known F(t). But I have a doubt of solving the above system for different values of F(t) when the function of F(t) cannot be properly defined.

Another problem I have is that what happen to the system when the reference point is changing while to system is running (before the system comes to the stable we change the reference point for X)? That means whole to system is moving from one point to another and this whole system motion will stop when it has reached to the destination.

I want this to solve in a while loop or for loop.

Can someone give me sample code or guide.

Thanking you
0 new messages