The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: simple harmonic oscillator using ode45 function
Replies: 9   Last Post: May 28, 2013 9:04 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Steven Lord

Posts: 18,038
Registered: 12/7/04
Re: simple harmonic oscillator using ode45 function
Posted: Dec 14, 2012 9:31 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Shane " <> wrote in message
> Hi,
> new to matlab and struggling to grasp the language. My problem is I have
> been given the equation:
> x" +ax' + bx = f(t)
> solved using the ode45 function
> first for f(t) = 0 and then when f(t)= 1
> the point is to study the influence of the variables a and b, I'm sure i
> will be comfortable enough to evaluate these myself once I have the code.

You should be able to fairly easily adapt one of the examples from the
documentation to solve your specific ODE.

In particular, the van der Pol example is already quite close to what you've

Steve Lord
To contact Technical Support use the Contact Us link on

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.