This package uses pre-trained neural network (NN) models to predict Troyon (no-wall)
Note that the following two models are each valid for a specific range of plasma parameters (e.g., aspect ratio and shape).
For example, the MLP model can cover a wider range of aspect ratio (
Developed and trained by Yueqiang Liu, et al.. (see [Y.Q. Liu, et al., PPCF (2020)] for details). This model can cover a wider range of plasma parameters
- Input
- 2D boundary shape
- 1D safety factor
- 1D plasma pressure
- Output
- Troyon
$\beta_\mathrm{N}$ limits for$n=(1,2,3)$ toroidal modes
- Troyon
Developed and trained by Yifei Zhao, et al.. (see [Y.F. Zhao, et al., PPCF (2022)] for details)
- Input
- 2D boundary shape
- 1D safety factor
- 1D plasma pressure
- Internal inductance (
$l_i$ ) - Pressure Peaking Factor (PPF)
- Output
- Troyon
$\beta_\mathrm{N}$ limit for$n=1$ toroidal mode
- Troyon
# Assuming that "FUSE" and "dd" are already in your scope
import TroyonBetaNN as TBNN
# The following function cacluates Troyon limits for all equilibrium time_slices in dd,
# and returns Vector{Troyon_Data}, which has all information about the result
TD_vec = TBNN.calculate_Troyon_beta_limits_for_IMAS_dd(dd); # To iterate
# Or one can specify a time_slice of equilibrium and calculate Troyon limits for it,
# which returns a single "Troyon_Data" struct
eqt = dd.equilibrium.time_slice[2];
TD = TBNN.calculate_Troyon_beta_limits_for_a_given_time_slice(eqt);
The above functions show a simple terminal output about Troyon
One can get more verbose information by adding a keyword argument "verbose=true".
# For all time_slices
TD_vec = TBNN.calculate_Troyon_beta_limits_for_IMAS_dd(dd; verbose=true);
# Or, for a specific time_slice
eqt = dd.equilibrium.time_slice[2];
TD = TBNN.calculate_Troyon_beta_limits_for_a_given_time_slice(eqt; verbose=true);
This will give the following verbose terminal output and write figure file of sampling points used for NN.
Sample points for a DIII-D equilibrium:
We can load the NN models once, and reuse it for any equilibrium time slices as desired. Note that the following TD (TroyonData) instance has every input/output information inside.
# Loads NN Models and stores them inside TD (TroyonData)
TD = TBNN.load_predefined_Troyon_NN_Models();
# Pass TD as an argument to TBNN functions
# This is a more performant way than the previous basic usage
for eqt in dd.equilibrium.time_slice
TBNN.calculate_Troyon_beta_limits_for_a_given_time_slice(TD, eqt; silence=true);
# You can get any information from TD (TroyonData),
# and post-process it as desired like the following
println("For n=1 mode:")
println(" MLP's βₙ_limit = $(TD.MLPs[1].βₙ_limit)")
println(" CNN's βₙ_limit = $(TD.CNN.βₙ_limit)")
# or like the following
MLPs_toroidal_modes = getfield.(TD.MLPs, :n); # return 3-element Vector{Int64}
MLPs_betaN_limits = getfield.(TD.MLPs, :βₙ_limit); # return 3-element Vector{Float64}
println("For toroidal modes: $(MLPs_toroidal_modes)")
println("MLP's betaN limits: $(MLPs_betaN_limits)")
end
Min-Gu Yoo (General Atomics) [email protected]
Yueqiang Liu (General Atomics) [email protected]
We acknowledge Yeifei Zhao (Dalian University of Technology; [email protected]) for graciously providing the trained CNN models for this project.
Please refer to NOTICE.md for citations, if this package contributes to an academic publication.
-
[MLP model]
Yueqiang Liu, Lang Lao, Li Li, and A D Turnbull, Plasma Phys. Control. Fusion 62 (2020) 045001
"Neural network based prediction of no-wall βN limits due to ideal external kink instabilities" -
[CNN model]
Y F Zhao, Y Q Liu, S Wang, G Z Hao, Z X Wang, Z Y Yang, B Li, J X Li, H T Chen, M Xu, and X R Duan, Plasma Phys. Control. Fusion 64 (2022) 045010
"Neural network based fast prediction of βN limits in HL-2M" -
[CHEASE code]
H. Lütjens, A. Bondeson, and A. Roy, Comput. Phys. Commun. 69 (1992) 287
"Axisymmetric MHD equilibrium solver with bicubic Hermite elements" -
[MARS-F code]
Y. Q. Liu, A. Bondeson, C. M. Fransson, B. Lennartson, and C. Breitholtz, Phys. Plasmas 7 (2000) 3681
"Feedback stabilization of nonaxisymmetric resistive wall modes in tokamaks. I. Electromagnetic model"