This cheat sheet covers one-step numerical methods for initial value problems of the form with . Euler and Runge-Kutta methods approximate solutions when an exact formula is difficult or impossible to find. Students need these methods to compute solution values, compare accuracy, and understand how step size affects numerical error.
The reference emphasizes formulas, update rules, and practical checks for college calculus and differential equations work.
The main idea is to move from a known point to a new point using slopes from the differential equation. Euler's method uses one slope, improved Euler uses an average of two slopes, and classical fourth-order Runge-Kutta uses a weighted average of four slopes. The step size is , so smaller values of usually improve accuracy but require more computations.
Error behavior is summarized by local truncation error and global error orders.
Key Facts
- An initial value problem has the form with , and a numerical method estimates values .
- The time grid is defined by , where is the step size and is a nonnegative integer.
- Euler's method updates by , using the slope at the beginning of the interval.
- Improved Euler's method uses , , and .
- The midpoint RK2 method uses , , and .
- Classical RK4 uses , , , , and .
- Euler's method has global error , RK2 methods have global error , and classical RK4 has global error under standard smoothness assumptions.
- Halving approximately halves Euler global error, divides RK2 global error by , and divides RK4 global error by when the asymptotic error model applies.
Vocabulary
- Initial value problem
- A differential equation with a starting condition, usually written as and .
- Step size
- The fixed or variable spacing between consecutive numerical time values.
- Euler's method
- A first-order one-step method that estimates the next value using .
- Runge-Kutta method
- A one-step method that combines several slope estimates from to produce a more accurate update.
- Local truncation error
- The error made in one step when the method starts from the exact value, often described as a power of .
- Global error
- The accumulated difference between the numerical value and the exact value after many steps.
Common Mistakes to Avoid
- Using instead of is wrong because the slope must be multiplied by the step size .
- Substituting into Euler's slope is wrong for standard Euler's method because the formula uses the beginning slope .
- Forgetting that , , and are slopes is wrong because the RK4 update multiplies their weighted average by .
- Mixing midpoint RK2 with improved Euler is wrong because midpoint uses , while improved Euler uses .
- Assuming a smaller always fixes every problem is wrong because stiffness, roundoff error, and discontinuities in can still cause inaccurate or unstable results.
Practice Questions
- 1 Use Euler's method with to estimate for , .
- 2 For , , compute one improved Euler step with .
- 3 For , , compute one classical RK4 step with and give the estimate for .
- 4 Explain why RK4 is usually more accurate than Euler's method for the same step size, even though both are one-step methods.
Understanding ODE Methods Euler & Runge-Kutta Reference
A numerical step is really a short prediction about the curve. Near a known point, the derivative tells how fast the quantity is changing at that instant. Euler treats that instant rate as if it stays unchanged for the whole step.
This works reasonably when the graph bends very little over that interval. It can fail visibly when the slope changes fast. Improved methods first make a rough prediction, then sample the slope later in the interval.
Their correction accounts for some of the curve's bending. RK4 repeats this idea at carefully chosen locations. Its weighted result gives most importance to information from the middle of the interval, where a single beginning slope is often least representative.
Local error and global error describe different parts of the same problem. Local truncation error measures the mistake made in one step if that step begins from the exact solution value. Global error measures the difference between the computed value and the true value after many steps.
Each new calculation starts from a value that may already contain error. The method can therefore carry old errors forward while adding new ones.
A high order method reduces the error created by the approximation rule, but it cannot guarantee a good answer in every situation. Roundoff error from decimal arithmetic, incorrect input, and unstable growth can still damage a result.
Stability matters especially for equations where small disturbances grow rapidly. A computed value may drift away from the real solution even when each individual step seems reasonable. This happens often in models of cooling with extreme parameters, chemical reactions, electrical circuits, and motion with strong damping.
A smaller step can improve stability, though it costs more calculations. Students should not judge a table only by whether its numbers look smooth. Compare results from two different step sizes.
If reducing the step substantially changes the final value, the first calculation was not yet reliable. A graph can reveal warning signs such as impossible oscillations, sudden jumps, or values with the wrong sign.
Step size control is a practical compromise between speed and accuracy. In a hand calculation, a fixed step keeps the table organized. In software, adaptive methods use an error estimate to decide where smaller steps are needed.
Rapid change requires short steps. Slow, nearly straight behavior permits longer steps. Many adaptive Runge-Kutta routines estimate error by making two predictions of different orders during nearly the same work.
They reject a step when the estimated error is too large, then try again with a smaller interval. When learning these methods, track the time value separately from the solution value, keep enough digits in intermediate slopes, and label every slope evaluation with its input point. Most classroom mistakes come from evaluating a slope at the wrong predicted point or forgetting that every slope must be multiplied by the step size only in the appropriate update.