Numerical Solutions of First-Order Differential Equations – Explicit Euler's Method
1. Problem setting
Consider the initial value problem (IVP) for a first-order ordinary differential equation (ODE): \[ y'(t) = f(t, y(t)), \quad t \in [t_0, T], \qquad y(t_0) = y_0. \] The goal is to compute an approximate solution \( y(t) \) at discrete nodes \( t_n = t_0 + n h \) where \( h > 0 \) is the step size and \( n = 0,1,\dots,N \) with \( Nh = T - t_0 \).
2. Derivation of explicit Euler
Using the forward difference to approximate the derivative at \( t_n \), \[ y'(t_n) \approx \frac{y(t_{n+1}) - y(t_n)}{h}. \] Substituting \( y'(t_n) = f(t_n, y(t_n)) \) and solving for \( y(t_{n+1}) \) yields the Explicit Euler update: \[ y_{n+1} = y_n + h\, f(t_n, y_n), \qquad y_0 \text{ given}. \] This is a one-step, first-order method that advances the solution using the slope at the left endpoint of each interval.
3. Algorithm
- Initialize: Choose step size \( h \), set \( t_0 \), \( y_0 \), and \( N = \frac{T - t_0}{h} \).
- Loop for n = 0 to N-1:
Compute \[ y_{n+1} = y_n + h\, f(t_n, y_n), \qquad t_{n+1} = t_n + h. \] - Output: The sequence \( \{(t_n, y_n)\}_{n=0}^N \) approximates \( y(t) \) on \([t_0,T]\).
4. Local truncation error and global error
4.1 Taylor expansion and local error
The exact solution satisfies \[ y(t_{n+1}) = y(t_n) + h\, y'(t_n) + \frac{h^2}{2} y''(\xi_n) = y(t_n) + h\, f(t_n, y(t_n)) + \mathcal{O}(h^2), \] where \( \xi_n \in (t_n, t_{n+1}) \). The local truncation error per step (inserting the exact solution into the scheme) is \[ \tau_{n+1} = \frac{y(t_{n+1}) - y(t_n)}{h} - f(t_n, y(t_n)) = \mathcal{O}(h). \] Multiplying by \( h \) to compare with increments, the one-step defect in \( y \) is \( \mathcal{O}(h^2) \).
4.2 Global error order
Under standard Lipschitz conditions on \( f \) in \( y \) and continuity in \( t \), error propagation over \( N = \mathcal{O}(1/h) \) steps yields a global error: \[ \max_{0 \le n \le N} \lvert y(t_n) - y_n \rvert = \mathcal{O}(h). \] Thus, Explicit Euler is first-order convergent.
5. Stability analysis
5.1 Linear test equation
Consider the linear test ODE \( y' = \lambda y \), \( \lambda \in \mathbb{C} \). Applying Explicit Euler, \[ y_{n+1} = y_n + h \lambda y_n = (1 + h \lambda)\, y_n \quad \Rightarrow \quad y_n = (1 + h \lambda)^n y_0. \] The method is absolutely stable if perturbations decay, i.e., \[ \lvert 1 + h \lambda \rvert < 1. \] The stability region is the open disk in the complex plane centered at \(-1\) with radius \(1\).
5.2 Real negative eigenvalues
For stiff-like problems with \( \lambda \in \mathbb{R}_{-} \), stability requires \[ -2 < h \lambda < 0 \quad \Longleftrightarrow \quad 0 < h < \frac{2}{\lvert \lambda \rvert}. \] Large negative \( \lambda \) forces very small \( h \), making Explicit Euler inefficient for stiff ODEs.
6. Consistency, stability, convergence
- Consistency: Local defect \( \mathcal{O}(h^2) \Rightarrow \) method is consistent.
- Stability: Requires step-size constraints depending on problem stiffness.
- Convergence: By Lax–Richtmyer type arguments for ODE one-step methods, consistency + stability imply convergence of order 1.
7. Step-size selection and practical tips
- Error–cost balance: Global error scales like \( C h \). Halving \( h \) roughly halves error and doubles cost.
- Event locations: Choose \( h \) so important features (peaks, discontinuities in \( f \), switch times) align with nodes or are sufficiently resolved.
- Diagnostics: Monitor step-to-step change \( \lvert y_{n+1} - y_n \rvert \) and, if available, problem-specific invariants for sanity checks.
- Stiffness warning: If solutions decay rapidly and Euler demands tiny \( h \) for stability, prefer implicit methods (e.g., backward Euler) or higher-order A-stable schemes.
8. Worked examples
8.1 Exponential decay: \( y' = -3y, \ y(0)=1 \)
Exact solution: \( y(t) = e^{-3t} \). Take \( h = 0.2 \), nodes \( t_n = 0.2 n \). Euler update: \[ y_{n+1} = y_n + h(-3 y_n) = (1 - 0.6) y_n = 0.4 y_n. \] Steps: \[ y_0 = 1,\quad y_1 = 0.4,\quad y_2 = 0.16,\quad y_3 = 0.064,\quad y_4 = 0.0256,\quad y_5 = 0.01024. \] Compare with exact at \( t=1.0 \): \( y(1) = e^{-3} \approx 0.049787 \). Euler gives \( y_5 \approx 0.01024 \) (strongly damped due to stability constraint proximity: \( h < 2/3 \approx 0.666\ldots \) is satisfied but error is large because the method is only first order and the step is coarse).
8.2 Nonautonomous linear ODE: \( y' = t + y, \ y(0)=1 \)
Update:
\[
y_{n+1} = y_n + h\,(t_n + y_n) = (1 + h) y_n + h\, t_n, \qquad t_{n+1} = t_n + h.
\]
Take \( h=0.1 \).
Step 0: \( t_0=0,\ y_0=1 \Rightarrow y_1 = 1.1\cdot 1 + 0.1\cdot 0 = 1.1 \).
Step 1: \( t_1=0.1,\ y_1=1.1 \Rightarrow y_2 = 1.1\cdot 1.1 + 0.1\cdot 0.1 = 1.21 + 0.01 = 1.22 \).
Step 2: \( t_2=0.2,\ y_2=1.22 \Rightarrow y_3 = 1.1\cdot 1.22 + 0.1\cdot 0.2 = 1.342 + 0.02 = 1.362 \).
8.3 Logistic growth: \( y' = r y (1 - y/K),\ y(0)=y_0 \)
Euler step: \[ y_{n+1} = y_n + h\, r y_n \left(1 - \frac{y_n}{K}\right). \] For large \( h r \), the iterates can overshoot or even become negative (unphysical). Stability and positivity may require smaller \( h \) or positivity-preserving variants.
9. Error propagation and a priori bound
Let \( e_n = y(t_n) - y_n \). For Lipschitz \( f \) in \( y \) with constant \( L \), \[ e_{n+1} = e_n + h\big[f(t_n, y(t_n)) - f(t_n, y_n)\big] + \mathcal{O}(h^2) \quad \Rightarrow \quad \lvert e_{n+1} \rvert \le (1 + hL)\lvert e_n \rvert + C h^2. \] Discrete Grönwall inequality yields \[ \lvert e_n \rvert \le \frac{C h}{L}\big[(1+hL)^n - 1\big] = \mathcal{O}(h)\, e^{L(t_n - t_0)}. \]
10. Implementation notes
- Vector ODEs: For \( y \in \mathbb{R}^m \), the same update applies componentwise: \( y_{n+1} = y_n + h f(t_n, y_n) \).
- Stopping criteria: For unknown \( T \), advance until a terminal condition on \( t \) or \( y \) is met.
- Adaptive ideas: Although Euler is fixed-step here, a simple embedded estimate can be formed by comparing one step of size \( h \) with two steps of size \( h/2 \) to guide \( h \).
11. Advantages and limitations
- Advantages: Simple, cheap per step, easy to implement and analyze; useful as a building block or for pedagogical purposes.
- Limitations: Low accuracy (order 1); stringent stability limits for stiff problems; may require very small \( h \) for acceptable accuracy.
12. Summary
Explicit Euler advances the IVP via \( y_{n+1} = y_n + h f(t_n, y_n) \). It is consistent and first-order convergent with global error \( \mathcal{O}(h) \). Stability is governed by the condition \( \lvert 1 + h\lambda \rvert < 1 \) on eigenvalues of the linearized system, making it unsuitable for stiff problems unless very small steps are used. Despite its simplicity, it is foundational for understanding more advanced and stable higher-order methods.