Skip to main content

8.4 ODE algorithms

Source: Ideas from Computational Physics (Landau, Páez, Bordeianu), §8.4. Original wording — not a paste of rk4.py / rk45.py / ABM.py. Continues 8.2–8.3. Labs: 8.4b ODE algorithm labs.

Fixed steps​

We march with a uniform step hh (Fig. 8.5). Adaptive and multistep methods appear only as structure sketches in 8.7.

Figure 8.5 — uniform time steps.

Euler and midpoint RK2​

Euler follows the left-endpoint tangent; midpoint RK2 samples a half-step slope. Walk both updates among lookalike formulas (RK4 stages are separate below).

Figure 8.3 — Euler uses the left-endpoint slope.

Figure 8.4 — RK2 midpoint rule.

Classic RK4 (structure)​

Four slopes with weights 1/61/6, 1/31/3, 1/31/3, 1/61/6. Pick the stage definitions and the weighted update among lookalikes.

Labs implement RK2 carefully and may use this RK4 structure; do not paste VPython textbook listings.

What we leave for sketches​

  • RK45 (adaptive): two embedded formulas estimate the local error and adjust hh.
  • Adams–Bashforth–Moulton (ABM): multistep predictor–corrector using a history of f\mathbf f values.

Both are outlined in 8.7 without dumping publisher code.

Quiz

ODE algorithms

1 / 4

Euler’s update is…

Pick an answer to see if you are right.

Next: 8.4b ODE algorithm labs.