Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
ode45 mass spring damper solution

Subject: ode45 mass spring damper solution

From: Mark Rossi

Date: 9 Apr, 2013 00:15:12

Message: 1 of 4

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.

Subject: ode45 mass spring damper solution

From: Nasser M. Abbasi

Date: 9 Apr, 2013 03:19:05

Message: 2 of 4

On 4/8/2013 7:15 PM, Mark Rossi wrote:
> 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.
>

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
  

Subject: ode45 mass spring damper solution

From: Loren Shure

Date: 9 Apr, 2013 08:32:40

Message: 3 of 4


"Mark Rossi" <mr3bn@virginia.edu> wrote in message
news:kjvmig$9m6$1@newscl01ah.mathworks.com...
> 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.
>

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

Subject: ode45 mass spring damper solution

From: tharinduweerakoon@gmail.com

Date: 28 Nov, 2014 04:54:29

Message: 4 of 4

On Tuesday, 9 April 2013 17:32:40 UTC+9, Loren Shure wrote:
> "Mark Rossi" <mr3bn@virginia.edu> wrote in message
> news:kjvmig$9m6$1@newscl01ah.mathworks.com...
> > 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.
> >
>
> 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

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

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us