9.2 Euler’s method
Taylor’s Theorem about \(t_i\) gives \(y(t_{i+1}) = y(t_i)+hy'(t_i)+\frac {h^2}2y''(\xi _i) = y(t_i)+hf(t_i,y(t_i))+\frac {h^2}{2}y''(\xi _i)\). Dropping the remainder gives Euler’s method: \begin {equation} \label {eq:euler} w_0 = \alpha ,\qquad w_{i+1} = w_i+hf(t_i,w_i),\quad i = 0,1,\dots ,N-1 . \end {equation} Geometrically, each step follows the tangent line of the solution curve through \((t_i,w_i)\) for a time \(h\).
Example 9.2.1. Apply Euler’s method to the test problem of Example 9.1.4 with \(h = 0.2\).
Solution. \(w_1 = 0.5+0.2(0.5-0+1) = 0.8\), \(w_2 = 0.8+0.2(0.8-0.04+1) = 1.152\), and so on:
| \(t_i\) | \(w_i\) | \(y(t_i)\) | \(|y(t_i)-w_i|\) | bound (9.3) |
| \(0.2\) | \(0.8000000\) | \(0.8292986\) | \(0.029\) | \(0.038\) |
| \(0.4\) | \(1.1520000\) | \(1.2140877\) | \(0.062\) | \(0.083\) |
| \(0.6\) | \(1.5504000\) | \(1.6489406\) | \(0.099\) | \(0.140\) |
| \(1.0\) | \(2.4581760\) | \(2.6408591\) | \(0.183\) | \(0.291\) |
| \(1.4\) | \(3.4517734\) | \(3.7324000\) | \(0.281\) | \(0.517\) |
| \(2.0\) | \(4.8657845\) | \(5.3054720\) | \(0.440\) | \(1.08\) |
The error grows steadily as \(t\) increases; Euler’s method is simple but not very accurate.
Theorem 9.2.2 (Error bound for Euler’s method). Suppose \(f\) is continuous and Lipschitz in \(y\) with constant \(L\) on \(D\), and \(|y''(t)|\leq M\) on \([a,b]\). Then the Euler approximations satisfy \begin {equation} \label {eq:eulerbound} |y(t_i)-w_i|\leq \frac {hM}{2L}\left [e^{L(t_i-a)}-1\right ],\qquad i = 0,1,\dots ,N . \end {equation}
Proof. Subtracting (9.2) from the Taylor expansion, the errors \(e_i = y(t_i)-w_i\) satisfy \[e_{i+1} = e_i+h\bigl [f(t_i,y(t_i))-f(t_i,w_i)\bigr ]+\frac {h^2}{2}y''(\xi _i),\] so \(|e_{i+1}|\leq (1+hL)|e_i|+\frac {h^2M}{2}\). Unrolling this inequality, with \(e_0 = 0\), \[|e_{i+1}|\leq \frac {h^2M}{2}\sum _{j=0}^{i}(1+hL)^j = \frac {h^2M}{2}\cdot \frac {(1+hL)^{i+1}-1}{hL} .\] Since \(1+x\leq e^x\), \((1+hL)^{i+1}\leq e^{(i+1)hL} = e^{L(t_{i+1}-a)}\), which gives the bound. □
For the test problem, \(L = 1\) and \(y'' = 2-0.5e^t\), so \(|y''|\leq 0.5e^2-2 = 1.6945 = M\) on \([0,2]\), and the bound is \(0.1(1.6945)(e^{t_i}-1)\), as in the last column above. The bound is linear in \(h\): Euler’s method has global error \(O(h)\). At \(t = 2\) the errors for \(h = 0.2, 0.1, 0.05, 0.025\) are \(0.440\), \(0.242\), \(0.127\) and \(0.065\), roughly halving with \(h\).
Definition 9.2.3. The local truncation error of a one-step method \(w_{i+1} = w_i+h\phi (t_i,w_i)\) is \[\tau _{i+1}(h) = \frac {y(t_{i+1})-y(t_i)}{h}-\phi (t_i,y(t_i)),\] the amount by which the exact solution fails to satisfy the method, per unit step. A method is of order \(p\) if \(\tau _{i+1}(h) = O(h^p)\).
For Euler’s method \(\tau _{i+1}(h) = \frac h2y''(\xi _i) = O(h)\), so it is of order \(1\); the global error is of the same order as the local truncation error, which is the typical situation for a stable one-step method.
Questions on this section
Stuck on something here? Ask below and it stays attached to this topic.