tokamak-plasma-operation-control-based-on-rl

Tokamak plasma operation control through multi-objective reinforcement learning in KSTAR

https://github.com/zinzinbin/tokamak-plasma-operation-control-based-on-rl

Science Score: 49.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 3 DOI reference(s) in README
  • Academic publication links
    Links to: arxiv.org, ieee.org, iop.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.6%) to scientific vocabulary

Keywords

controls deep-reinforcement-learning numerical-computation physics-informed-neural-networks plasma-physics reinforcement-learning
Last synced: 6 months ago · JSON representation

Repository

Tokamak plasma operation control through multi-objective reinforcement learning in KSTAR

Basic Info
Statistics
  • Stars: 14
  • Watchers: 1
  • Forks: 0
  • Open Issues: 1
  • Releases: 0
Topics
controls deep-reinforcement-learning numerical-computation physics-informed-neural-networks plasma-physics reinforcement-learning
Created almost 4 years ago · Last pushed 12 months ago
Metadata Files
Readme Citation

README.md

Plasma Shape Control under the equilibrium of GS equation via Deep Reinforcement Learning

[Poster: Tokamak Plasma Operation Control using Multi-Objective Reinforcement Learning in KSTAR]

Introduction

This is github repository for research on Tokamak plasma operation control based on deep reinforcement learning. We aim to control more than two targets with sustaining stable operation. In this research, we implement OpenAI gym based environment which contains neural networks that predict the state of the tokamak plasma, indicating that we can use GPU based computations for estimating the tokamak plasma profiles.

Based on our approach, we can show some control performance under the virtual KSTAR environment resulted from neural networks. The poloidal flux of the plasma is estimated by Grad-Shafranov solver based on Physics-Informed Neural Network. For multi-target control, we will proceed development of the multi-objectve reinforcement learning algorithm for multi-objective tokamak plasma operation control.

The summary of our proceeding work is listed as below. - Targets - Plasma Beta-N | q95 - Plasma boundary shape - Neural networks for implementing virtual KSTAR tokamak environment - Prediction for plasma state: Non-stationary Transformer, Transformer, SciNet - Determination of the plasma poloidal flux: Physics-Informed Neural Network (Free-boundary Grad-Shafranov Solver) - Reinforcement Learning algorithm for control - DDPG : Deterministic Deep Policy Gradient Method - SAC : Soft Actor Critic Algorithm - CAPS : Conditioning for Action Policy Smoothness (Smooth control)

Scheme

Below is the overall scheme for our research. Our plan is to control both 0D parameters and shape parameters as a multi-objective control. Our final aim is to develop the framework for virtual tokamak plasma operation control under the V-DEMO project. The ML pipeline construction and integrated database for training RL based controller and prediction model will be the main purpose for future research.

How to Run

  • Training 0D parameter predictor : Training code for NN-based predictor for RL environment python3 train_0D_predictor.py --gpu_num {gpu number} --num_epoch {number of epoch} --batch_size {batch size} --lr {learning rate} --verbose {verbose} --gamma {decay constant} --max_norm_grad {maximum norm grad} --root_dir {directory for saving weights} --tag {tag name} --use_scaler {bool} --scaler {'Robust','Standard','MinMax'} --seq_len {input sequence length} --pred_len {output sequence length} --interval {data split interval} --model {algorithms for use : Transformer, NStransformer, SCINet} --use_forgetting {differentiate forgetting mechanism}
  • Training shape predictor : Training code for Physics-informed Neural Network for GS solver python3 train_shape_predictor.py --gpu_num {gpu number} --num_epoch {number of epoch} --batch_size {batch size} --lr {learning rate} --verbose {verbose} --gamma {decay constant} --max_norm_grad {maximum norm grad} --save_dir {directory for saving result} --tag {tag name} --GS_loss {weight for Grad-Shafranov loss} --Constraint_loss {weight for constraint loss for training GS solver}
  • Training policy network : Training code for RL-based controller based on virtual KSTAR environment python3 train_controller.py --gpu_num {gpu number} --num_epoch {number of epoch} --shot_random {bool} --t_init {initial time} --t_terminal {terminal time} --dt {time interval} --tag {tag name} --save_dir {directory for saving result} --batch_size {batch size} --num_episode {number of episode} --lr {learning rate} --gamma {decay constant} --min_value {minimum value for action} --max_value {maximum value for action} --tau {constant for updating policy} --verbose {verbose} --predictor_weight {directory of saved weight file} --seq_len {input sequence length} --pred_len {output sequence length} --algorithm {RL algorithm for use : SAC, DDPG} --objective {objective for RL : params-control, shape-control, multi-objective}
  • Playing policy network : Execute the autonomous control under the virtual KSTAR environment using the policy network python3 play_controller.py --gpu_num {gpu number} --shot_random {bool} --t_init {initial time} --t_terminal {terminal time} --dt {time interval} --tag {tag name} --save_dir {directory for saving result} --predictor_weight {directory of saved weight file} --seq_len {input sequence length} --pred_len {output sequence length} --algorithm {RL algorithm for use : SAC, DDPG} --objective {objective for RL : params-control, shape-control, multi-objective}

Additional result

In this part, we will share some result for virtual KSTAR tokamak operation control. The below picture describes the result of the training procedure with respect to the reward for each episode. DDPG and SAC are both applied and we found that the SAC shows possibility of smooth and robust control on virtual KSTAR tokamak operation.

And we play SAC algorithm with initial condition for KSTAR shot # 21747. We can observe the improved operation under the virtual KSTAR environment via RL control. The below picture is an example of the result for the purpose of 0D parameters control.

Details

model / algorithm

  • SCINet : https://arxiv.org/abs/2106.09305
  • Transformer : https://arxiv.org/abs/1706.03762
  • Non-stationary transformer : https://arxiv.org/abs/2205.14415
  • DDPG : https://arxiv.org/abs/1509.02971
  • SAC : https://arxiv.org/abs/1812.05905

Dataset

  • iKSTAR
  • over 4000 experiments are used

Reference

  • Deep Neural Network-Based Surrogate Model for Optimal Component Sizing of Power Converters Using Deep Reinforcement Learning(https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=9841555)
  • Feedforward beta control in the KSTAR tokamak by deep reinforcement learning, Jaemin Seo et al : https://iopscience.iop.org/article/10.1088/1741-4326/ac121b/meta
  • Magnetic control of tokamak plasmas through deep reinforcement learning, Jonas Degrave, Federico Felici et al : https://iopscience.iop.org/article/10.1088/1741-4326/ac121b/meta
  • Development of an operation trajectory design algorithm for control of multiple 0D parameters using deep reinforcement learning, Jaemin Seo et al : https://iopscience.iop.org/article/10.1088/1741-4326/ac79be/meta

Citation

If you use this repository in your research, please cite the following:

Research Article

Tokamak Plasma Operation Control using Multi-Objective Reinforcement Learning in KSTAR
Jinsu Kim et al 2023 International Fusion Plasma Conference

Code Repository

Jinsu Kim (2023). Tokamak-Plasma-Operation-Control-based-on-RL. GitHub.
https://github.com/ZINZINBIN/Tokamak-Plasma-Operation-Control-based-on-RL

BibTeX:

bibtex @software{Kim_Data-driven_Tokamak_Plasma_2023, author = {Kim, Jinsu}, license = {MIT}, month = aug, title = {{Data-driven Tokamak Plasma Simulator and RL Controller Code}}, url = {https://github.com/ZINZINBIN/Tokamak-Plasma-Operation-Control-based-on-RL}, version = {1.0.0}, year = {2023} }

Owner

  • Name: KIM JINSU
  • Login: ZINZINBIN
  • Kind: user
  • Location: Seoul, Republic of Korea
  • Company: Seoul National University

BS : Nuclear Engineering / Physics

GitHub Events

Total
  • Issues event: 2
  • Watch event: 8
  • Issue comment event: 2
  • Push event: 3
Last Year
  • Issues event: 2
  • Watch event: 8
  • Issue comment event: 2
  • Push event: 3