Numerical solutions and error
Chapter 10 - Follow the local rule in finite steps
Many useful differential equations have no solution expressible by a finite combination of familiar elementary functions. Numerical methods turn the rate rule into a sequence of approximations.
Euler's method uses the current slope for one short step:
It is the tangent-line approximation repeated.
Lab: shrink the step
For each equation, compare , , , and . Smaller steps usually reduce error, but they require more work. "Numerical" does not mean "unreliable"; it means error must be estimated and controlled.
Worked example: show every step
- Start. . The slope is .
- Step to . .
- Recompute the slope. At , . Do not reuse the old slope.
- Step to . .
- Recompute again. At , . Thus at .
- Behavior check. The state first falls because , pauses near the line , then rises after . The discrete values reproduce that qualitative change.
A table is part of the reasoning
| slope | next | |||
|---|---|---|---|---|
| 0 | 0.0 | 1.000 | -1.000 | 0.500 |
| 1 | 0.5 | 0.500 | 0.000 | 0.500 |
| 2 | 1.0 | 0.500 | 0.500 | 0.750 |
The table prevents a common error: evaluating the new slope at a mixture of old and new coordinates.
Local and global error
Euler replaces a curved segment by a tangent step. If the exact solution has bounded second derivative, one step's local truncation error (the unscaled one-step defect from exact starting data) is . Some texts divide this defect by and call the result local truncation error instead. If is also Lipschitz in the state near the solution, accumulation across a fixed time interval gives global error . These are upper-order bounds; special solutions can have zero error.
Practical consequence: halving should roughly halve Euler's global error once the steps are small enough for this small-step pattern to appear.
Error estimate. Euler with has error about 0.08 at a fixed final time. What error would first-order behavior predict for ?
Better slopes: midpoint and Runge-Kutta
Euler uses the slope at the start of a step. A midpoint method samples a slope near the middle. Classical fourth-order Runge-Kutta blends four slope samples. The central design idea is the same: spend more rate evaluations to approximate the curve across each step more accurately.
You do not need to memorize this fourth-order method, often called RK4, here. You should be able to ask:
- where does the method sample slopes?
- what order of global error does it claim?
- does halving the step produce the expected convergence?
- does the numerical curve respect known equilibria, signs, and bounds?
Numerical stability is not physical stability
For , the true solution decays. Euler gives
If , the multiplier is : the approximation alternates and grows even though the true system decays. The step is too large for Euler's stability region.
A plotting tool can connect inaccurate points smoothly. Test convergence by rerunning with a smaller step, and compare the result with qualitative facts from the differential equation.
Fade the computation
Use Euler with for , .
- .
- Evaluate the next slope at .
- Compute and confirm that the approximation stays between 0 and 1.
Check two steps
. Then the slope is , so . Both points respect the phase-line prediction of growth toward 1.
Practice
- Practice - Euler table
10.1 Use Euler with to approximate for , . Show a slope table.
- Practice - convergence
10.2 For , , derive Euler's approximation . Compare at with .
- Integrated - qualitative check
10.3 Design a test that would catch a numerical solution of , , crossing above 10.
- Challenge - step stability
10.4 For with , find all for which Euler approximations decay in magnitude. Which subset decays without alternating sign?
- Practice - extension
10.5 The explicit midpoint method uses , , and . Apply two steps with to . Compare with two Euler steps and the exact value from .
- Challenge - transfer
10.6 For , , Euler gives . Show that implies whenever . Test to demonstrate overshoot, and explain why a bound-preserving step is not automatically accurate.
Retrieve the whole loop
Choose one equation from any earlier chapter and state:
- its structural fingerprint;
- a qualitative prediction;
- an analytic method, if available;
- a numerical fallback; and
- two independent checks.