4.8.27 · D5Numerical Methods
Question bank — Systems of ODEs — RK4 for systems
Before we start, one reminder of the notation used throughout, so nothing here is unexplained:
- is the stacked column of all unknowns at a moment in time.
- returns the stacked column of slopes .
- are four slope-vectors (each length ) sampled across one step of width .
- is the step size (how far in we jump each step).
True or false — justify
Every item: decide true/false, then give the reason. The reason is the answer.
RK4 for a system is a genuinely new algorithm, unrelated to scalar RK4.
False — it is the identical recipe with every scalar symbol replaced by its vector version; the weights over and the stage structure are unchanged.
You can solve each equation of a coupled system with its own independent scalar RK4 run.
False — because depends on all components, so any stage after needs the advanced state of the other unknowns, which an independent run has not computed yet.
If the two equations happen to be uncoupled (each depends only on its own ), then running scalar RK4 separately gives exactly the same answer as the vector method.
True — with no coupling the advanced state of one component never enters another's slope, so the stages decouple and independent scalar runs coincide with the system method.
RK4 for systems changes the weights to over because there are two equations.
False — the weights are a property of the time-quadrature (Simpson-like sampling over one step), not of how many unknowns there are; they stay over for any .
Each is a single number that gets reused for all components.
False — each is a length- vector; component of is the estimated slope of at that stage.
The global truncation error of RK4 for a system is , the same order as for a scalar.
True — the Taylor-matching that gave order 4 used only algebra of , and addition, which behaves identically on vectors, so the order is preserved component-by-component.
If you halve , you should expect the global error to drop by roughly a factor of .
True — global error is and , so halving the step cuts error about sixteenfold (until round-off dominates).
A 2nd-order ODE cannot be handled by RK4-for-systems; you need a special second-order solver.
False — you rename derivatives () to convert it into a first-order system, which RK4-for-systems then solves directly.
The intermediate state passed into is evaluated at time .
True — probes the slope at the predicted midpoint, so both the time argument and the state argument advance by half a step using .
uses a full step in the state, not a half step.
True — samples the slope at the end of the interval, so it advances by the whole .
Spot the error
Each item shows a plausible-sounding statement or step. Say what is wrong and why.
"I computed all of for first, then repeated for ."
The error is losing stage synchronization: of needs 's advanced state, which doesn't exist yet if hasn't been stepped alongside; compute the whole vector first, then the whole , and so on.
"For I used the state ."
Wrong slope fed in — must use the refined midpoint state ; reusing there collapses into and destroys the fourth-order accuracy.
"To reduce I set and ."
The labels are backwards for readability but the real trap is consistency: whatever you name them, you need (or the matching pair) — if you write while , you have paired with the wrong second equation and the system no longer encodes the original ODE.
"My final update was ."
The middle two slopes are missing their weight of ; the correct combination is , which mimics Simpson's pattern (the two midpoint samples together give the ).
"I dropped the factor because was small anyway."
The is not optional smallness — it is the step's length scaling; without it you add a raw slope with no units of time, giving a wildly wrong (and -independent) jump.
"In I advanced the time to but kept the state at ."
You must advance both the time and the state; using the old state with a new time makes an inconsistent slope and breaks the midpoint prediction the method relies on.
"Since already gives a good slope, I skipped to save time."
Using alone is just Euler's method (see Euler's method for systems), which is only order-1 accurate globally; the whole point of the extra three samples is to reach order 4.
Why questions
Answer with the underlying reason, not just a restatement.
Why does replacing scalars by vectors leave the RK4 weights unchanged?
Because the order-4 derivation only matched Taylor terms using addition, scalar multiplication by , and function evaluation — all of which act identically on each vector component, so no weight ever needed re-tuning.
Why does RK4 sample the slope twice at the midpoint (giving and )?
It mimics Simpson's rule, whose accuracy comes from weighting the midpoint heavily; two successive midpoint estimates ( using the improved ) let the method cancel more Taylor error than a single midpoint could.
Why must every component advance together at each stage?
Because the components are coupled — reads the other unknowns — so a stage's slope is only meaningful if it sees a consistent snapshot where all components have moved to the same intermediate time. (See Simpson's Rule for the quadrature this imitates.)
Why is reducing a high-order ODE to a first-order system worthwhile at all?
It lets a single algorithm (RK4-for-systems) solve ODEs of any order, so you never need a separate integrator per order; naming the derivatives as new unknowns is the universal adapter (see Reducing higher-order ODEs to first-order systems).
Why is the local error but the global error only ?
You accumulate roughly steps to cross a fixed interval, so the per-step errors add up to about (detailed in Local vs Global Truncation Error).
Why can explicit RK4 still fail badly on some systems despite its high order?
On stiff systems the stability region of explicit RK4 forces impractically tiny , so accuracy is fine but you'd need enormous computation to stay stable (see Stiff systems and stability).
Why does the same numerical answer appear for the system and for the reduced ?
Because they are the same equations — the reduction of produces exactly , so RK4 sees identical right-hand sides and produces identical steps.
Edge cases
Boundary and degenerate scenarios you must not be surprised by.
What happens if the system is (a single equation) run through RK4-for-systems?
It reduces exactly to scalar RK4 for a single ODE — the vector of length one is just a number, so the two methods coincide with no special-casing.
If does not depend on (an autonomous system), do we still pass the shifted times ?
The time arguments still exist in the formula but ignores them, so effectively only the state shifts matter; the recipe is unchanged and correct.
For a linear system , are the still needed, or is there a shortcut?
RK4 still applies verbatim (each )); a closed-form via the matrix exponential exists too, but RK4 needs no such special structure and works identically whether or not is constant.
What if one component's initial value is exactly — does that break any stage?
No — a zero entry is a perfectly valid state value; the slopes and averages are computed the same way, so zeros propagate through the arithmetic without any special handling.
If a component reaches a fixed point (its slope is there), does RK4 leave it unchanged?
If all four vanish for that component it stays put; but if coupling makes any midpoint slope nonzero, it can still drift, so a true equilibrium requires the slope to be zero throughout the whole predicted step, not just at the start.
What does taking do to both the accuracy and the cost?
Accuracy improves like but the number of steps (and -evaluations, four per step) grows like , so there is a practical trade-off — shrinking forever eventually just accumulates round-off error, not precision.
If two stages accidentally receive the same state (e.g. happens to be zero), are and still valid?
Yes — a zero simply means the midpoint state equals , so evaluates there legitimately; nothing degenerates, the method just samples fewer distinct states this step.
Connections
- Parent topic — RK4 for systems
- RK4 for a single ODE — the scalar case these traps generalise.
- Euler's method for systems — what "use only " collapses to.
- Reducing higher-order ODEs to first-order systems — the adapter behind the edge cases.
- Local vs Global Truncation Error — the reasoning.
- Stiff systems and stability — why order 4 alone is not enough.
- Simpson's Rule — the source of the weights.