MTH3007B Lecture 5
Today’s session follows a familiar structure, starting with a recap and feedback on the stability of the explicit and implicit Euler methods we covered in the previous lecture. We then move into the main content, exploring how to compute integrals by reframing them as initial value problems, before finally learning how to solve higher-order ordinary differential equations by reducing them to systems of first-order equations.
Recap: Euler Method Stability
We can evaluate the stability of our numerical schemes by applying them to a standard test equation, such as a simple exponential decay model.
Explicit (Forward) Euler
The explicit Euler Method is only conditionally stable. When applied to the test equation, the numerical scheme becomes:
Instability Condition
For , the explicit scheme becomes unstable if . In this scenario, , causing the errors to amplify and the numerical solution to run away from the true analytical solution as the number of steps approaches infinity.
Implicit (Backward) Euler
By contrast, the implicit (backward) Euler method is unconditionally stable for this stable ODE. The scheme is defined as:
Since and , the denominator is always strictly greater than . Thus, the multiplier is less than , ensuring the solution always converges to zero irrespective of the step size .
Numerical Evaluation of Integrals
We can compute a definite integral numerically by differentiating it and solving the associated Ordinary Differential Equation (ODE).
If we want to evaluate an integral of the form , we can differentiate both sides with respect to to obtain a first-order ODE:
Initial Value Problem
To solve this ODE, we need an initial condition. Since the integral from to represents an area of zero, our initial condition is naturally .
Once formulated this way, we can use any of our standard numerical methods - such as the explicit Euler method, Implicit Trapezoid Method, or RK4 - to find the value of the integral by marching forward in .
Solving Higher-Order ODEs
So far, our numerical methods only apply to first-order ODEs. To numerically integrate an ODE that involves second or higher-order derivatives, we must reduce its order.
Order Reduction Method
An -th order ODE can be rewritten as a system of coupled first-order ODEs. For a general -th order equation , we introduce new variables such that corresponds to the -th derivative of :
Differentiating this system gives us our solvable first-order scheme:
Suppose we have the specific second-order equation:
First, isolate the highest derivative:
Introduce and . The reduced first-order system is:
We can now apply standard methods like Forward Euler to this coupled system simultaneously.
Python Implementation
Here is how we might implement the Forward Euler method to solve a second-order ODE using the reduction technique we just defined.
Pre-Lecture Notes from University Notes
- Stability Analysis: Review of how limits explicit Euler choices compared to the stable implicit approach.
- Integral as an ODE: Converting into the initial value problem with .
- Higher-Order ODEs: Demonstrated that numerical solvers require rewriting -th order ODEs into first-order differential equations using substitution .
- Looking Ahead: Next session, we’ll likely expand upon solving these newly formed systems of first-order ODEs in vector formats and assessing their broader stability.