1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: 2nd Order Differential Equation with Improved Euler Method (Heun's)

  1. May 1, 2014 #1
    1. The problem statement, all variables and given/known data
    I would like to solve a 2nd Order Differential Equation using the Improved Euler Method. The 2nd ODE is a Mass-Spring-Damper equation. I tried coming up with an solution for the Improved Euler Method, but not entirely sure. Can you help me and have a look if this is correct?
    This solution assumes that inital conditions for x and u are known.

    2. Relevant equations
    Forced Mass-Spring-Damper equation:

    [itex]m\ddot{x} + b\dot{x}+kx = F[/itex]

    3. The attempt at a solution

    Converting the equation to a pair of first order differential equations:

    And thus we have:

    The forward Euler solution would result in:

    And the Improved Euler solution would be:
    [itex]u_{n+1}=u_{n}+dt*\dot{u_{n}}=u_{n}+\frac{dt}{2} \left[ \frac{1}{m} \left[F_{n}-bu_{n}-kx_{n}\right]+\frac{1}{m}\left[F_{n+1}-bu_{n+1}-kx_{n+1}\right] \right][/itex]

    In the last equation, does the last [itex]F[/itex] needs to be [itex]F_{n+1}[/itex] like I have it?

    Thanks a bunch, if you have time to have a look at it!
  2. jcsd
  3. May 1, 2014 #2


    User Avatar
    Homework Helper

    Your improved Euler solution looks fine to me. You indeed want the 'n+1'.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted