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

Join the discussion
Registration is free. Start your own thread to ask a follow-up.
3 replies · 4K views
ErezAgh
Messages
5
Reaction score
0
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

v[n+1]=v[n]−γv[n]Δt+sqrt(ϵ⋅Δt)Γn.
(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?
 
Physics news on Phys.org
ErezAgh said:
Why are these actual OSCILLATIONS, and not simply random fluctuations?

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.

ErezAgh said:
What is the period of these oscillations?

Er, the step size.
 
ErezAgh said:
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

v[n+1]=v[n]−γv[n]Δt+sqrt(ϵ⋅Δt)Γn.
(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?

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:
[tex] 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).
 
pasmith said:
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:
[tex] 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).

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: