1. What this solves
When a smooth ODE needs many steps but calling its rate function dominates cost, ABM43 reuses past slopes. It predicts with fourth-order Adams–Bashforth and applies one fourth-order Adams–Moulton correction. It gives fourth-order global accuracy on smooth problems and provides a local error indicator after startup.
2. When to use
Use a uniform grid for a smooth nonstiff IVP and measure enough steps to amortize startup. Supply and either start from or provide four accurate slopes on the same grid. Compare cost per achieved accuracy with rk4. ABM43 uses two new evaluations per step after startup, whereas classical RK4 uses four.
3. When not to use (and what to use instead)
| Situation | Use instead |
|---|---|
| Short run, inexpensive slope, or frequent restarts | rk4 on a fixed grid. |
| Variable steps or changing order | CVODE Adams or LSODA in its nonstiff Adams mode. dormand-prince-rk45 also fits a general nonstiff adaptive IVP. These solvers have their own error controllers. |
| Stiff decay | bdf2 for fixed steps or radau-iia-5 for adaptive steps. |
| Long-term geometry is the target | stormer-verlet for separable mechanics or gauss-legendre-4 for a canonical nonseparable Hamiltonian. |
4. Algorithm
Store at accepted states. With initial value alone, take three rk4 steps at the same . Use the usual RK4 stages at fractions with weights . Evaluate at the accepted endpoint of each RK4 step so it is available as the first stage of the next step and for the Adams history.
Adams–Bashforth 4 (AB4) predictor
With and history newest first, predict
For standalone AB4, accept and cache its slope. This costs one new evaluation per step after startup. ABM43 uses the same prediction to feed the corrector.
Adams–Moulton correction and Milne estimate
Evaluate . Apply one correction,
Evaluate and cache , move the history forward, and accept . Use exactly one correction for this predictor–evaluate–correct–evaluate form. An implicit Adams–Moulton solve iterates the endpoint equation and is a different algorithm.
With exact input history, the leading exact-minus-predicted and exact-minus-corrected local error coefficients are respectively and , multiplying . Thus estimates exact minus corrected local error. It is asymptotic and does not estimate accumulated global error. Omit the estimate for startup steps.
5. Parameters
The fixed nonzero must lie in the stability and accuracy range for your model. Refine at a common endpoint. When changing the fixed grid or crossing a discontinuity, rebuild the history on the new smooth segment. Repeated failure to resolve the error can indicate stiff dynamics even if the right-hand side is smooth.
7. Verification
Export step(fun, t, y, h, history) -> (C, F_C, estimate) from port_adapter.py. The caller updates history with the returned corrected slope. You can also export integrate(fun, t0, y0, h, n_steps) yielding (time, state, estimate) on the fixed grid, including the initial state and up to three startup rows with estimate=None. For zero steps yield only the initial state without evaluating the RHS. The optional integration test expects the documented startup and slope reuse. Run python <skill>/checks/check_port.py from the adapter directory and show its output. Other languages can use checks/cases.json.
On your ODE, compare fixed-time error under refinement and count actual evaluations. For the local indicator, compare with a finer or exact one-step solution from the same accurate history. Check signed error conventions before using the indicator.
8. Failure signatures
| Symptom | Likely cause |
|---|---|
| First steady-state step jumps or order collapses | History is reversed, unevenly spaced, or seeded with an insufficiently accurate startup. |
| RHS count is higher than two per steady step | History slopes were recomputed or multiple corrections were applied. |
| High-frequency ringing or growth appears after refinement of the spatial model | The explicit stability limit of the time method is being exceeded. |
| Error indicator disagrees on a smooth test | Check its sign, the corrector coefficients, and which state supplied the cached slope. |
9. Files and commands
reference/adams_bashforth_moulton_4.py contains the predictor, corrected step and startup iterator. uv run examples/forced.py reports fixed-time error and evaluation count. uv run verify/check_cases.py checks order, Milne scaling, cost and broken ports. uv run checks/make_cases.py prints the fixture JSON.
10. Sources
- Hairer, Nørsett and Wanner cover Adams formulas and predictor–corrector methods. Solving Ordinary Differential Equations I (1993)
- The exact OrdinaryDiffEq source and API are listed in
meta.yaml.