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!

Why do we get oscillations in Euler's method of integration and what i

  1. Jul 8, 2014 #1
    When using Euler's method of integration, applied on a stochastic differential eq. :

    For example - given
    d/dt v=−γvΔt+sqrt(ϵ⋅Δt)Γ(t)
    we loop over

    (where −γv[n] is a force term, can be any force and Γn is some gaussian distributed random variable. ) .

    Then if we choose Δt not small enough, we eventually get (if we run over long times, meaning many repeated iterations) that the solutions become "unstable and oscillations appear around the analytic solution, with amplitude becoming larger and larger with time" (~ collected from many different sources I found on the internet that mention the problem but don't discuss it in depth).

    Why are these actual OSCILLATIONS, and not simply random fluctuations? What is the period of these oscillations?
  2. jcsd
  3. Jul 8, 2014 #2
    For the same reason single-step numerical integration is unstable for non-stochastic problems when the step size is large enough so that each step 'overshoots' the analytic solution.

    Er, the step size.
  4. Jul 8, 2014 #3


    User Avatar
    Homework Helper

    Consider the non-stochastic ODE [tex]
    y' = -ky[/tex] with [itex]k > 0[/itex] and [itex]y(0) = 1[/itex]. This can be solved analytically: [tex]y(t) = e^{-kt}.[/tex] Note that [itex]y \to 0[/itex] as [itex]t \to \infty[/itex]. Applying Euler's method with step size [itex]h > 0[/itex] we obtain [tex]
    y_{n+1} = y_n - hky_n = y_n(1 - hk)[/tex] which again can be solved analytically:
    y_n = (1 - hk)^n.
    [/tex] Thus the error at time [itex]t = nh[/itex] is given by [tex]
    \epsilon_n = y(nh) - y_n = e^{-nhk} - (1 - hk)^n.
    [/tex] If [itex]hk > 2[/itex] then [itex]1 - hk < -1[/itex], so that [tex]
    \epsilon_n = e^{-nhk} - (-1)^n|1 - hk|^n.[/tex] Thus, since [itex]|1 - hk| > 1[/itex] and [itex]e^{-nhk} < 1[/itex], we see that [itex]|\epsilon_n| \to \infty[/itex] and that [itex]\epsilon_n[/itex] is alternatively positive and negative (which is what "oscillates" means in this context).
  5. Jul 8, 2014 #4
    Thanks a lot both!

    1) I see why it oscillates with a frequency of 1 step, (-1)^n, so this means you normalized the step size to be Er=1?
    2) Silly question perhaps, but can this be written in the form of a sine() than?
    Last edited: Jul 8, 2014
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook