1 The Forward Euler Method
We implement the explicit Euler method for ODEs and prove its convergence. Consider the initial value problem \(y'(t) = v(t, y(t))\), \(y(t_0) = y_0\), where \(v \colon \mathbb {R} \times E \to E\) is a vector field on a normed space \(E\).
1.1 Definitions
Given a vector field \(v\), step size \(h\), time \(t\), and current value \(y\), the Euler step is
The sequence of Euler points is defined recursively by
The Euler path is the piecewise linear interpolation of the Euler points. For \(t \in [t_n, t_{n+1})\) where \(n = \lfloor (t - t_0)/h \rfloor \),
The Euler derivative is the piecewise constant right derivative of the Euler path. For \(t \in [t_n, t_{n+1})\),
1.2 Properties of the Euler path
The Euler path coincides with the Euler points at the grid points:
The Euler path is continuous on \([t_0, \infty )\).
For \(t \geq t_0\), the Euler path has right derivative \(\mathrm{eulerDeriv}(t)\) at \(t\).
For \(t \in [t_n, t_{n+1})\),
For \(t \in [t_n, t_{n+1})\),
1.3 Error analysis
Suppose \(\| v(t, y)\| \leq M\) for all \(t, y\). For \(t \in [t_n, t_{n+1})\),
Suppose \(v\) is \(K\)-Lipschitz in space, \(L\)-Lipschitz in time, and \(\| v\| \leq M\). For \(t \in [t_n, t_{n+1})\),
Under the same hypotheses, for all \(t \geq t_0\),
Let \(\mathrm{sol}\) be the true solution of the ODE on \([t_0, T]\). Under the Lipschitz and boundedness hypotheses on \(v\),
for all \(t \in [t_0, T]\).
The Euler method converges to the true solution as the step size \(h \to 0^+\): for all \(t \in [t_0, T]\),