Abstract
We have developed TorbeamNN: a machine learning surrogate model for the TORBEAM ray tracing code to predict electron cyclotron heating and current drive locations in tokamak plasmas. TorbeamNN provides more than a 100 times speed-up compared to the highly optimized and simplified real-time implementation of TORBEAM without any reduction in accuracy compared to the offline, full fidelity TORBEAM code. The model was trained using KSTAR electron cyclotron heating (ECH) mirror geometries and works for both O-mode and X-mode absorption. The TorbeamNN predictions have been validated both offline and real-time in experiment. TorbeamNN has been utilized to track an ECH absorption vertical position target in dynamic KSTAR plasmas as well as under varying toroidal mirror angles and with a minimal average tracking error of 0.5cm.
Introduction
Electron Cyclotron Heating (ECH) is a cornerstone of modern tokamak operation, used for both heating the plasma and driving non-inductive current. By targeting specific regions of the plasma with radio frequency (RF) waves, operators can suppress instabilities and optimize plasma scenarios. However, the path of these waves is not straight; plasma density and magnetic fields refract and deflect the rays. Aiming the ECH mirrors accurately requires complex ray-tracing calculations to determine the precise absorption location.
The standard physics-based tool for this task is TORBEAM. While a real-time version exists, it typically requires 10-20 milliseconds per calculation. This latency is problematic for controlling fast plasma transients, such as Edge Localized Modes (ELMs), which occur on timescales of 20-50ms. Furthermore, future reactors like ITER will demand even faster response times to manage multiple simultaneous control tasks. To bridge this gap, we developed TorbeamNN, a deep learning surrogate model that achieves a 100x speedup over existing real-time physics models.
Methods and Data
TorbeamNN is designed to mimic the full-fidelity offline version of TORBEAM. We trained separate neural networks for each of KSTAR’s three gyrotrons and for both O-mode and X-mode operations. The architecture consists of a multi-layer perceptron with three dense layers (60 neurons each) using ReLU activations.
A key innovation in TorbeamNN is the simplification of input data. Rather than processing a computationally expensive 3D magnetic field grid, the model uses global plasma shape parameters (e.g., magnetic axis, minor radius, elongation) and a 3-point electron density profile. This approach captures the essential physics while enabling inference in under 60 microseconds.
The training dataset was built from 2,712 unique plasma time slices from 336 KSTAR shots. We ran the full-fidelity offline TORBEAM code on these slices with randomized gyrotron angles, generating over 640,000 samples per mode. As shown in the offline validation results, TorbeamNN achieves exceptional accuracy across all predicted parameters, maintaining an $R^2 > 0.992$ and a mean absolute error (MAE) for the vertical absorption location of just 0.2 cm.
Real-Time Experimental Validation
The model was integrated into the KSTAR Plasma Control System (PCS) by converting the Keras models to C code. In experimental trials, TorbeamNN was used to steer ECH mirrors in real-time to track a moving vertical target ($Z_{target}$) in a dynamic plasma.
The real-time tracking demonstrated an average error of only 0.535 cm. This performance confirms that the surrogate model can replace physics-based ray-tracing in a live control loop without sacrificing precision. The model predicts O-mode absorption slightly better than X-mode, which aligns with the underlying physics as O-mode waves experience less deflection compared to their vacuum trajectories.
Discussion and Future Work
TorbeamNN demonstrates that machine learning surrogates can provide the speed necessary for advanced plasma control. By reducing calculation time from milliseconds to microseconds, we enable the control system to respond to fast transients and perform complex multi-tasking.
Future developments will focus on moving from physical $Z$ coordinates to normalized flux coordinates ($\rho_{pol}$) for more robust physics control and training models to predict the entire ECH deposition profile rather than just the peak absorption point. Additionally, because neural networks are differentiable, future control systems could use the model's gradients to directly calculate mirror angle changes, bypassing traditional PID controllers for even faster convergence.
While the model is currently limited by the quality of real-time diagnostic inputs, it represents a significant step toward the high-performance control systems required for future fusion reactors.
Summary updated