Skip to content

Commit

Permalink
Update README.md (to include CNN description)
Browse files Browse the repository at this point in the history
  • Loading branch information
mgyoo86 committed Oct 22, 2024
1 parent 0eab5a4 commit fa237ab
Showing 1 changed file with 55 additions and 17 deletions.
72 changes: 55 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,45 @@
[![Build Status](https://github.com/mgyoo86/TroyonBetaNN.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/mgyoo86/TroyonBetaNN.jl/actions/workflows/CI.yml?query=branch%3Amain)




<!-- ABOUT THE PROJECT -->
## About The Package
This package uses a pre-trained neural network (NN) to predict Troyon (no-wall) $\beta_N$ limits for a given equilibrium specified by sampling a few points on 2D plasma boundary and 1D profiles of the equilibrium safety factor and plasma pressure.
Note that the NN model was developed and trained by Yueqiang Liu, *et al.*, where the MHD stability was analyzed by MARS-F code (see [[Y.Q. Liu, *et al.*, *PPCF* (2020)]](https://doi.org/10.1088/1361-6587/ab6f56) for details).
This package employs the pre-trained NN model and provides some useful interfaces to make it compatible with the IMAS data structure and FUSE ecosystem.


### Quick Examples
This package uses pre-trained neural network (NN) models to predict Troyon (no-wall) $\beta_\mathrm{N}$ limits for a given equilibrium specified by sampling a few points on 2D plasma boundary and 1D profiles of the equilibrium safety factor and plasma pressure.
There are two different NN models with either MLP or CNN architectures, whose training dataset were generated with the [CHEASE](https://doi.org/10.1016/0010-4655(92)90167-W) and [MARS-F](https://doi.org/10.1063/1.1287744) codes for the equilibrium and MHD stability, respectively.
This package employs the pre-trained NN models and provides some useful interfaces to make it compatible with the IMAS data structure and [**FUSE**](https://github.com/ProjectTorreyPines/FUSE.jl) ![GitHub](https://i.sstatic.net/tskMh.png) ecosystem.

## About NN models
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 ($A\in[1.3, 4.0]$), while the CNN model only targets a specific aspect ratio ($A \sim 2.74$) since it is designed for the HL-2M tokamak.
On the other hand, the MLP model can only hanlde the positive triangularity ($\sigma>0$), but the CNN model can deal with a range of triangularity ($\sigma \in [-0.6, 0.8]$), including the negative triangularity.

### 1. MLP (Multi-Layer Perceptron) model
Developed and trained by Yueqiang Liu, *et al.*. (see [[Y.Q. Liu, *et al.*, *PPCF* (2020)]](https://doi.org/10.1088/1361-6587/ab6f56) 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

### 2. CNN (Convolutional neural network) model
Developed and trained by Yifei Zhao, *et al.*. (see [[Y.F. Zhao, *et al.*, *PPCF* (2022)]](https://doi.org/10.1088/1361-6587/ac4524) 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 modes



## Quick Examples
```julia
# Assuming that "FUSE" and "dd" are already in your scope

using TroyonBetaNN

TBNN = TroyonBetaNN
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
Expand Down Expand Up @@ -62,19 +85,34 @@ Sample points for a FPP equilibrium:






<!-- CONTACT -->
## Contact
Min-Gu Yoo [![Linkedin](https://i.sstatic.net/gVE0j.png)](https://www.linkedin.com/in/min-gu-yoo-704773230) (General Atomics) [email protected] \
Yueqiang Liu (General Atomics) [email protected]



<!-- ACKNOWLEDGMENTS -->
## ACKNOWLEDGMENTS
We acknowledge Yeifei Zhao (<[email protected]>) for graciously providing the trained CNN models for this project.

## References

* Yueqiang Liu, Lang Lao, Li Li, and A D Turnbull, *Plasma Phys. Control. Fusion* **62** (2020) 045001 \
* **[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"](https://doi.org/10.1088/1361-6587/ab6f56)
<!-- <p align="right">(<a href="#readme-top">back to top</a>)</p> -->

* **[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"](https://doi.org/10.1088/1361-6587/ac4524)

* **[CHEASE code]**\
H. Lütjens, A. Bondeson, A. Roy, *Comput. Phys. Commun.* **69** (1992) 287 \
["Axisymmetric MHD equilibrium solver with bicubic Hermite elements"](https://doi.org/10.1016/0010-4655(92)90167-W)

* **[MARS-F code]**\
Y. Q. Liu, A. Bondeson, C. M. Fransson, B. Lennartson, C. Breitholtz,
*Phys. Plasmas* **7** (2000) 3681
["Feedback stabilization of nonaxisymmetric resistive wall modes in tokamaks. I. Electromagnetic model"](https://doi.org/10.1063/1.1287744)


<!-- <p align="right">(<a href="#readme-top">back to top</a>)</p> --j>

0 comments on commit fa237ab

Please sign in to comment.