Why does the Euler method go bad when the time step $T$ is decreased?

1k Views Asked by At

Consider below differential eqn $$\dfrac{dy}{dt} = y$$

In discrete form, with a time step $T$, using forward euler, it becomes $$\dfrac{y[n+1]-y[n]}{T} = y[n]$$ Solving the difference eqn we get $$y[n] = (1+T)^ny[0]$$

Intuitively if we decrease the time step $T$, the discrete form should approach more closely to the continuous form. But this doesn't seem to be the case as changing T moves the base of the $(1+T)^n$ away from $e$. Please look at the plot . Why did the euler method give this kind of solution which doesn't get better even if we decrease time step T ?

1

There are 1 best solutions below

5
On

The relation between discrete numerical approximations $y[n]$ and the solution $y(t)$ is given by $y(t=n \cdot T) \approx y[n]$. In your plot you used the relation $y(t=n) \approx y[n]$.

If you plot $g\left(n\right)\ =\ \left(1+T\right)^{\frac{n}{T}}$ instead of $g\left(n\right)\ =\ \left(1+T\right)^{n}$, you will see convergence for small time steps $T$.