Minimizing Residuals in ODE Integration Using Optimal Control
Robert M. Corless, C. Yalçın Kaya
TL;DR
This work treats the residual (defect) of an ODE solution as a controllable perturbation and seeks interpolants through a given skeleton that minimize this residual. By formulating the interpolation as a multi-stage optimal-control problem, it derives necessary conditions of optimality for both $L^2$ and stage $L^{\infty}$ objectives, and analyzes normality to yield tractable two-point boundary-value problems. The authors provide analytic solutions for the Dahlquist test problem and a leaky-bucket variant, and perform numerical optimization for the Van der Pol equation, comparing the resulting residuals with MATLAB's deval across several solvers. The results show that the proposed residual-minimizing interpolants often yield substantially smaller residuals than standard polynomial interpolants, offering a robust diagnostic tool for validating numerical ODE solutions and understanding solver behavior, including order-reduction phenomena. This framework can enhance reproducibility and reliability in numerical ODE integration by quantifying how closely a skeleton fits a perturbed model via minimal residuals.
Abstract
Given the set of discrete solution points or nodes, called the skeleton, generated by an ODE solver, we study the problem of fitting a curve passing through the nodes in the skeleton minimizing a norm of the residual vector of the ODE. We reformulate this interpolation problem as a multi-stage optimal control problem and, for the minimization of two different norms, we apply the associated maximum principle to obtain the necessary conditions of optimality. We solve the problem analytically for the Dahlquist test problem and a variant of the leaky bucket problem, in terms of the given skeleton. We also consider the Van der Pol equation, for which we obtain interpolating curves with minimal residual norms by numerically solving a direct discretization of the problem through optimization software. With the skeletons obtained by various ODE solvers of MATLAB, we make comparisons between the residuals obtained by our approach and those obtained by the MATLAB function deval.
