Active ramp-down control and trajectory design for tokamaks with neural differential equations and reinforcement learning

Allen Wang, Cristina Rea, Oswin So, Charles Dawson, D. Garnier, Chuchu FanCommunications 2025

Abstract

The tokamak offers a promising path to fusion energy, but disruptions pose a major economic risk, motivating solutions to manage their consequence. This work develops a reinforcement learning approach to this problem by training a policy to ramp-down the plasma current while avoiding limits on a number of quantities correlated with disruptions. The policy training environment is a hybrid physics and machine learning model trained on simulations of the SPARC primary reference discharge (PRD) ramp-down, an upcoming burning plasma scenario which we use as a testbed. To address physics uncertainty and model inaccuracies, the simulation is massively parallelized on GPU with randomized physics parameters during policy training. The trained policy is then run in feedback on a transport simulator as a demonstration. We also directly address the crucial issue of control validation by demonstrating that a constraint-conditioned policy can be a trajectory design assistant that designs a library of feed-forward trajectories to handle different physics conditions and user constraint settings, a promising approach for the sensitive context of burning plasma tokamaks. Finally, we demonstrate that the training environment can be a useful platform for feed-forward optimization approaches by optimizing feed-forward trajectories that are robust to physics uncertainty. The robust termination of tokamak fusion plasmas poses massive simulation and control challenges. In this work, the authors provide simulation demonstrations of how techniques like neural differential equations and reinforcement learning can help with both real-time feedback control and offline trajectory design.

Introduction

Tokamaks—donut-shaped devices that confine plasma using magnetic fields—are a leading candidate for commercial fusion energy. However, they face a significant operational hurdle: disruptions. These sudden losses of plasma control can cause severe thermal and mechanical damage to the reactor. Preventing disruptions requires a safe "ramp-down" procedure, where plasma current and stored energy are reduced without violating critical operational limits.

Designing controllers for this phase is difficult due to the high computational cost of high-fidelity simulations and the lack of large-scale datasets for upcoming burning plasma devices like SPARC and ITER. This paper introduces a sample-efficient reinforcement learning (RL) approach that leverages neural differential equations (NDEs) and physics-based modeling to bridge the gap between simulation and real-world control.

Methodology: Hybrid Physics and Machine Learning

To overcome the data requirements of standard deep learning, the authors developed a hybrid dynamics model. This model hardcodes fundamental plasma physics (such as power and particle balance) while using neural networks to approximate complex, unknown dynamics. Implemented in JAX, the simulation is fully differentiable and parallelizable on GPUs.

Overview of the methodology, including dynamics model calibration (a), policy training (b), and the three primary applications: trajectory design (c), feedback control (d), and robust optimization (e).

This hybrid model was wrapped into PopDownGym, an OpenAI Gym environment. The training dataset consisted of only 481 ramp-down simulations generated by RAPTOR, a control-oriented transport simulator. By embedding physical equations directly into the architecture, the model achieved high accuracy with orders of magnitude less data than traditional black-box models.

Constraint-Conditioned Reinforcement Learning

The authors used Proximal Policy Optimization (PPO) to train a control policy. A key innovation is the use of constraint-conditioning: user-specified safety limits are fed directly into the policy as inputs. This allows the policy to adapt to changing operational constraints in real-time without retraining. During training, physical parameters were randomized to ensure the policy remained robust against physics uncertainty, a strategy known as domain randomization.

Key Applications and Results

The methodology was validated through three primary applications:

  1. Trajectory Design Assistant: The policy can generate compliant, safe trajectories in approximately 15.4 milliseconds. This allows operators to explore different constraint settings and physics conditions rapidly.
  2. Feedback Controller: When deployed in feedback with the RAPTOR simulator, the policy successfully navigated late-stage constraint violations that often cause static trajectories to fail. It managed to ramp down plasma current from 8.7 MA to below 2 MA while respecting eight complex state constraints.
  3. Robust Optimization: The environment also supports evolutionary strategies to optimize feed-forward trajectories that remain safe across a wide range of physical parameter variations.
The policy acting as a feedback controller, processing observations and outputting actions to the RAPTOR simulator in real-time.

Conclusion

This work demonstrates that combining neural differential equations with reinforcement learning provides a powerful framework for tokamak control. The approach is highly sample-efficient, training in under two hours on a single consumer GPU. While the current study uses a lower-fidelity simulator (RAPTOR) as a testbed, the successful "sim-to-sim" transfer suggests that this methodology is a viable path toward real-hardware deployment on future devices like SPARC and ITER. Future work will focus on incorporating historical experimental data and addressing real-world sensor noise.

Summary updated

BibTeX
@inproceedings{wang2025active,
  author = {Allen Wang and Cristina Rea and Oswin So and Charles Dawson and D. Garnier and Chuchu Fan},
  title = {{Active ramp-down control and trajectory design for tokamaks with neural differential equations and reinforcement learning}},
  booktitle = {Communications},
  year = {2025},
  doi = {10.1038/s42005-025-02146-6},
}
Figure