Optimal Control of Probabilistic Dynamics Models via Mean Hamiltonian Minimization

David Leeftink, Çağatay Yıldız, Steffen Ridderbusch, Max Hinne, Marcel van Gerven

Abstract

Without exact knowledge of the true system dynamics, optimal control of non-linear continuous-time systems requires careful treatment under epistemic uncertainty. In this work, we translate a probabilistic interpretation of the Pontryagin maximum principle to the challenge of optimal control with learned probabilistic dynamics models. Our framework provides a principled treatment of epistemic uncertainty by minimizing the mean Hamiltonian with respect to a posterior distribution over the system dynamics. We propose a multiple shooting numerical method that leverages mean Hamiltonian minimization and is scalable to large-scale probabilistic dynamics models, including ensemble neural ordinary differential equations. Comparisons against other baselines in online and offline model-based reinforcement learning tasks show that our probabilistic Hamiltonian approach leads to reduced trial costs in offline settings and achieves competitive performance in online scenarios. By bridging optimal control and reinforcement learning, our approach offers a principled and practical framework for controlling uncertain systems with learned dynamics.

Introduction

In real-world control scenarios, such as robotics or autonomous driving, a perfect mathematical model of the system's physics is rarely available. Instead, dynamics must be learned from limited and often noisy data, leading to significant epistemic uncertainty. If a controller ignores this uncertainty, it may confidently execute actions that result in catastrophic failures.

While Model-Based Reinforcement Learning (MBRL) typically addresses this by minimizing expected costs over a distribution of models, standard black-box optimization methods often struggle when the distribution is complex. Conversely, classical optimal control utilizes Pontryagin's Maximum Principle (PMP) for structured solutions but is traditionally limited to known deterministic systems. This work bridges these fields by extending PMP to handle learned, uncertain dynamics in continuous time.

Methodology: Mean Hamiltonian Minimization

The core contribution of this work is the formulation of a necessary optimality condition for uncertain systems: Mean Hamiltonian Minimization. Rather than optimizing a single Hamiltonian, the authors define a Hamiltonian averaged over the posterior distribution of the dynamics.

Extracted figure from page 2 of Optimal Control of Probabilistic Dynamics Models via Mean Hamiltonian Minimization

To implement this framework, the authors utilize:

  1. Ensemble Neural ODEs: These models learn continuous-time dynamics from discrete data while capturing epistemic uncertainty through an ensemble (typically 5 models).
  2. Trajectory Sampling: This approximates the expectation over the model ensemble.
  3. Forward Multiple Shooting & MPC: The optimization is framed as a Two-Point Boundary Value Problem (TPBVP). To ensure stability over long horizons, the trajectory is divided into shorter segments (multiple shooting) and applied within a Model Predictive Control (MPC) framework.

Experimental Evaluation

The framework was evaluated on several non-linear control benchmarks:

  • Van der Pol Oscillator (Offline RL): Using a dataset of 25 random trajectories, the PMP-Mean Hamiltonian approach achieved a cost of 11.57, significantly outperforming direct optimization methods like iCEM (14.06) and Adam (14.27).
  • Cart Pole Swing-up (Offline RL): In a sparse data regime (50 random trajectories), the performance gap widened. The proposed method scored 36.78, while standard methods like SQP (77.98) and Adam (311.77) struggled.
  • Duffing Oscillator (Online RL): Starting from a single random trial, the agent iteratively learns dynamics. The approach showed competitive data efficiency compared to state-of-the-art MBRL algorithms like PETS.

Key Insights

A major finding is that structure beats black-box optimization. By exploiting the inherent mathematical structure of the control problem via co-states and the Hamiltonian, the framework is more effective than gradient-based or evolutionary search on expected costs.

Phase portrait showing state-costate trajectories in the $x-\lambda$ space under the mean Hamiltonian minimization framework.

Furthermore, the authors demonstrated that minimizing the mean Hamiltonian is theoretically and practically superior to optimizing controls for individual models and averaging them (Mean $u^*$). The use of Neural ODEs also allows for natural continuous-time optimization, aligning with physical reality even when trained on discrete sensor data.

Conclusion and Future Work

While the framework offers a principled approach to control under uncertainty, it faces a computational bottleneck. Solving co-state equations currently requires root-finding algorithms with $O(N^3)$ scaling, which is challenging for high-dimensional systems. Future work will focus on GPU acceleration and exploring forward-backward iterative approaches to reduce complexity. Additionally, extending these optimality conditions to handle explicit state constraints remains a priority for safety-critical applications.

Summary updated

BibTeX
@misc{leeftink2025optimal,
  author = {David Leeftink and Çağatay Yıldız and Steffen Ridderbusch and Max Hinne and Marcel van Gerven},
  title = {{Optimal Control of Probabilistic Dynamics Models via Mean Hamiltonian Minimization}},
  year = {2025},
  eprint = {2504.02543},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2504.02543},
}
Figure