---
name: radau-iia-5
description: "Solve a stiff ordinary differential equation with adaptive steps and evaluate it between accepted steps. Three-stage Radau IIA is a fifth-order implicit Runge–Kutta method that damps fast modes. It requires a reliable coupled stage solve, usually with a Jacobian."
---

# Fifth-order Radau IIA

## 1. What this solves

Advance a stiff ODE while resolving the evolution you care about, even when other modes decay much faster. Radau IIA uses three coupled implicit stages. Its endpoint has order five for smooth problems, and a collocation cubic provides values inside the step.

## 2. When to use

Use this for a stiff explicit ODE $y'=f(t,y)$ that needs tighter accuracy, adaptive steps, or output at irregular times. Provide a Jacobian $J_f(t,y)$ or an equivalent way of solving the stage equations. Scale tolerances for the components that matter. The reference is for small dense systems.

## 3. When not to use (and what to use instead)

| Situation | Use instead |
|---|---|
| Smooth nonstiff ODE with an adaptive tolerance | `dormand-prince-rk45`. |
| Fixed-grid stiff decay at modest accuracy | `bdf2`, or `backward-euler` for rougher results and startup damping. |
| Long-time symplectic integration | `gauss-legendre-4` or `implicit-midpoint` for canonical nonseparable systems. |
| Algebraic equations or singular mass matrix | Use a DAE solver appropriate to the index and constraints. The reference solves explicit ODEs. |

## 4. Algorithm

Put $s=\sqrt6$, $c=((4-s)/10,(4+s)/10,1)$ and use the rows of $A$ below. The weights $b$ equal the last row of $A$.

```
[(88-7s)/360,   (296-169s)/1800, (-2+3s)/225]
[(296+169s)/1800, (88+7s)/360,   (-2-3s)/225]
[(16-s)/36,     (16+s)/36,       1/9]
```

Solve the stage-state equations $Y_i=y+h\sum_j a_{ij} f(t+c_jh,Y_j)$. Start all stage states at $y$. For the residual $r_i=Y_i-y-h\sum_j a_{ij} f(t+c_jh,Y_j)$, the Newton block $(i,j)$ is $\delta_{ij}I-h a_{ij}J_f(t+c_jh,Y_j)$. Solve for the stage corrections and subtract them. The standalone `step` bounds each stage correction component by `max(tol * scale, 4 * ulp(scale))`. For each component, `scale` is its largest absolute value in the step input, the old stage, and the updated stage. Here `ulp` is floating-point spacing and the default is `tol=2e-14`. The reference permits 12 updates and reports failure for a singular block matrix, nonfinite arithmetic or an exhausted iteration limit. Return $Y_3$ directly. Its equality with the Runge–Kutta output follows from $c_3=1$ and the last row of $A$ being $b$.

For dense output at fractional time $\theta$, use the cubic Lagrange interpolant through the pairs $(0,y)$ and $(c_i,Y_i)$. Interior interpolation has its own error, which can exceed the endpoint error. For $z=h\lambda$ on the scalar linear equation, the amplification factor is

$$R(z)=\frac{1+2z/5+z^2/20}{1-3z/5+3z^2/20-z^3/60}.$$

It is bounded by one on the closed left half-plane and tends to zero far into that half-plane, giving L-stability.

## 5. Adaptive steps and parameters

For the full step and each half step, require every Newton correction component to fit within 1% of its error weight. Use `atol + rtol * magnitude`, where `magnitude` is the largest absolute value of that component in the substep input, the old stage and the updated stage. The correction limit has a roundoff floor of four floating-point spacings at that magnitude.

The reference tests a full step against two half steps. At the endpoint, use $(Y_f-Y_r)/31$ to estimate the error of the refined result in the smooth asymptotic regime. Scale each component by `atol + rtol * max(abs(y), abs(Y_r))` and let $e_{\mathrm{end}}$ be the largest ratio.

Also compare the full-step cubic with the refined cubics at the midpoint and at one-third and two-thirds of each half step. At each of these five times, divide the absolute difference by `atol + rtol * max(abs(full), abs(refined))` and let $e_{\mathrm{dense}}$ be the largest ratio. Use the full difference for this check because the two dense outputs interpolate different segments. Reject if either ratio exceeds one. For the next trial, use $0.9/\max(e_{\mathrm{end}}^{1/6},e_{\mathrm{dense}}^{1/4})$ clipped to $[0.2,4]$, with 4 when both errors are zero. The exponents reflect the smooth local endpoint and interior error orders. Keep the two half-step cubics on acceptance. Retry a failed Newton solve at half size, leave the accepted state intact on rejection, and clip the last trial to the end time.

Choose the first trial size with the fastest transient you intend to measure in mind. Set absolute tolerance to an error scale near zero and relative tolerance to the useful fractional accuracy. The interior check catches unresolved initial layers that give small differences at the endpoint alone. It samples the two interpolants, so verify the requested output times with tighter tolerances or smaller steps when accuracy matters there. The fifth-order endpoint and the local estimate can degrade in stiff nonautonomous or nonsmooth regimes.

## 6. Applying it to your code

Keep the stage ordering consistent when building the Jacobian blocks. For large systems use an established solver. Production codes such as RADAU5 or SciPy Radau use transformed stage systems, reuse linear algebra and use an embedded error estimate. The reference uses dense Newton with separate stage Jacobians, step doubling and its own sampled dense-output check. Add the code comment `radau-iia-5 v0.1.0, Hairer & Wanner (1996)`.

## 7. Verification

Create `port_adapter.py` with `step(fun, jac, t, y, h) -> (endpoint, dense)`. A signed $h$ is supported, and the callable `dense(theta)` takes a fraction from zero to one. You can also export `solve(fun, jac, t0, y0, t_end, *, h0, rtol, atol) -> (endpoint, evaluate, accepted, rejected)`. That optional checker expects `evaluate(time)` to use physical time and counts trials, with each accepted trial containing two half steps. It checks a stiff initial layer and a nonlinear component in two unit scales. Run `python <skill>/checks/check_port.py` from the adapter directory and show the output. Other languages can use the formulas in `checks/cases.json`. The standalone step checker compares endpoints and dense output for a nonlinear problem in two state scales.

On your model, compare tighter tolerances at identical output times and check the resolved slow component and any transient you need. Inspect rejected steps and compare the endpoint and interior errors separately.

## 8. Failure signatures

| Symptom | Likely cause |
|---|---|
| Accurate endpoints, inaccurate interior values | The interpolation is lower order or the output lies in an unresolved initial layer. Check the interpolation nodes and refine the steps through that layer. |
| Fast mode rings or persists across large steps | Check that the last stage is used as the endpoint and that the couplings are in the displayed order. |
| Repeated rejection or Newton failure | Check Jacobian orientation, scales, stiffness and whether the RHS is smooth through the trial interval. |

## 9. Files and commands

`reference/radau_iia_5.py` provides a step and a forward adaptive solver. `uv run examples/stiff_output.py` shows irregular sampling. `uv run verify/check_cases.py` tests endpoints, dense output, damping, rejection, state scaling and three incorrect ports. `uv run checks/make_cases.py` prints the fixture JSON.

## 10. Sources

- Hairer and Wanner give the tableau (Table IV.5.6), the stability function and its A- and L-stability (Table IV.3.1 and Sect. IV.3), and discuss implementation (Sect. IV.8). [Solving Ordinary Differential Equations II (1996)](https://doi.org/10.1007/978-3-642-05221-7)
