8.10 $DES models and solver selection
General nonlinear ADVANs require $MODEL compartments and a $DES block that assigns DADT(n). During each right-hand-side evaluation, nlmx exposes integration time as T, current amounts as A(n), runs $DES, then adds active infusion rates.
Solver mapping
| ADVAN | Initial solver policy |
|---|---|
| 6 | Dormand–Prince 5(4), nonstiff |
| 8, 9, 14, 15 | Rosenbrock 2(3), stiff |
| 13 | Dormand–Prince, automatically switch permanently for the subject when stiffness/excess work is detected |
ADVAN10 uses the nonlinear integration path for one-compartment Michaelis–Menten elimination with VM and KM, but it does not require a user $DES block.
Interval semantics
The solver integrates only between engine events. Pending lagged doses, infusion ends, model times and data records create boundaries. At each boundary, the relevant event is applied and parameters can be rebuilt. This avoids stepping across a discontinuity without notifying the solver.
For an ODE interval, $PK values used to build the system are those associated with the interval that ends at the current record under the engine's NONMEM-style convention. $DES itself can depend continuously on T, A(n), fixed parameter variables and data values available in the environment.
Dual event times
If a lag, modelled duration or rate depends on ETA, the event time carries derivatives. Integration occurs on the value grid, with endpoint sensitivity corrections using the right-hand side. This preserves first-order derivative information that would otherwise be lost by converting event times to plain numbers.
Failure modes
The engine reports maximum-step exhaustion, step-size underflow, non-finite solutions and singular/stiff-solver problems as numerical failures. These are not evidence that the model syntax is unsupported; they indicate a parameter-, state- or tolerance-dependent integration problem.
Common mistakes
- Letting the solver cross a dose or infusion end as though the RHS were continuous.
- Treating ADVAN13's automatic switch as repeated per interval; it remains stiff for the subject.
- Ignoring event-time derivatives.
Checklist
- Match ADVAN to the intended stiffness policy.
- Verify every
DADT(n)and compartment unit. - Exercise discontinuities and solver failures explicitly.
Further reading
See ODE tolerances, event timelines and automatic differentiation.