© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2022
M. Paluszek et al.Practical MATLAB Deep Learninghttps://doi.org/10.1007/978-1-4842-7912-0_6

6. Tokamak Disruption Detection

Michael Paluszek1  , Stephanie Thomas2   and Eric Ham2  
(1)
Plainsboro, NJ, USA
(2)
Princeton, NJ, USA
 

Abstract

Tokamaks are fusion machines that are under development to produce baseload power. Baseload power is the power that is produced 24/7 and provides the base for powering the electric grid. The International Thermonuclear Experimental Reactor (ITER) is an international project that will produce net power from a Tokamak. Net power means the Tokamak produces more energy than it consumes. Consumption includes heating the plasma, controlling it, and powering all the auxiliary systems needed to maintain the plasma. It will allow researchers to study the physics of the Tokamak which will hopefully lead the way toward operational machines.

6.1 Introduction

Tokamaks are fusion machines that are under development to produce baseload power. Baseload power is the power that is produced 24/7 and provides the base for powering the electric grid. The International Thermonuclear Experimental Reactor (ITER) is an international project that will produce net power from a Tokamak. Net power means the Tokamak produces more energy than it consumes. Consumption includes heating the plasma, controlling it, and powering all the auxiliary systems needed to maintain the plasma. It will allow researchers to study the physics of the Tokamak which will hopefully lead the way toward operational machines. A Tokamak is shown in Figure 6.1. The central solenoid field coils act like a transformer to initiate a plasma current. The outer poloidal and toroidal coils maintain the plasma. The plasma current itself produces its own magnetic field and induces currents in the other coils.

The image in Figure 6.1 was produced by the function DrawTokamak which calls DCoil and SquareHoop. We aren’t going to discuss those three functions here. You should feel free to look through the functions as they show how easy it is to do 3D models using MATLAB.

One problem with Tokamaks is disruptions. A disruption is a massive loss of plasma control that extinguishes the plasma and results in large thermal and structural loads on the Tokamak wall. This can lead to catastrophic wall damage. This would be bad in an experimental machine and unacceptable in a power plant as it could lead to months of repairs.

The factors that can be used to predict a disruption [31] are
  1. 1.

    The poloidal beta (beta is the ratio of plasma pressure to magnetic pressure).

     
  2. 2.

    The line-integrated plasma density.

     
  3. 3.

    The plasma elongation.

     
  4. 4.

    The plasma volume divided by the device minor radius.

     
  5. 5.

    The plasma current.

     
  6. 6.

    The plasma internal inductance.

     
  7. 7.

    The locked mode amplitude.

     
  8. 8.

    The plasma vertical centroid position.

     
  9. 9.

    The total input power.

     
  10. 10.

    The safety factor reaching 95%. The safety factor is the ratio of the times a magnetic field line travels toroidally (the long way around the doughnut) vs. poloidally (the short way). We want the safety factor to be greater than one.

     
  11. 11.

    The total radiated power.

     
  12. 12.

    The time derivative of the stored diamagnetic energy, which is energy stored by the magnetic fields of the plasma.

     
Figure 6.1

A Tokamak. There are three sets of coils. The central solenoid field coil initializes the plasma, and the poloidal and toroidal coils maintain the plasma. Some of the toroidal coils are left out to make it easier to see the Tokamak center.

Locked modes are magnetohydrodynamic (MHD) instabilities that are locked in phase and the laboratory frame. They can be precursors to disruptions. The plasma internal inductance is the inductance measured by integrating the inductance over the entire plasma. In a Tokamak, the poloidal direction is along the minor radius circumference. The toroidal direction is along the major radius circumference. In a plasma, the dipole moment due to the circulating current is in the opposite direction of the magnetic field which makes it diamagnetic. Diamagnetic energy is the energy stored in a magnetized plasma. Diamagnetic measurements measured this energy.

Our system is shown in Figure 6.2. We will just be looking at the plasma vertical position and the coil currents.
Figure 6.2

Tokamak and control system. ELM means “Edge Localized Mode” and is a disturbance. The plasma is shown in a poloidal cut through the torus.

We’ll find it to be more than complex enough! We will start with the dynamics of the vertical motion of a plasma. We’ll then learn about plasma disturbances. After that, we will design a vertical position controller. Finally, we’ll get to deep learning.

6.2 Numerical Model

6.2.1 Dynamics

For our example, we need a numerical model of disruptions [8], [7], [37]. Ideally, our model would include all of the effects in the list given earlier. We use the model in Scibile [38]. We will only consider vertical movement.

The equilibrium force on the plasma is induced by the magnetic field and current density in the plasma:
$$displaystyle egin{aligned} J 	imes B = 
abla p end{aligned} $$
(6.1)
where J is the current density, B is the magnetic field, and p is the pressure. J, B, and p are all three-element vectors, and that ∇ is a cross-product operation. Pressure is the force per unit area on the plasma. The momentum balance is [1]
$$displaystyle egin{aligned} 
ho frac{dv}{dt} = J 	imes B - 
abla p end{aligned} $$
(6.2)
where v is the plasma velocity, and ρ is the plasma density. The imbalance causes plasma motion, that is, when J × B≠∇p. If we neglect the plasma mass, we get
$$displaystyle egin{aligned} L_P^T I + A_{PP}zI_p = F_p end{aligned} $$
(6.3)
where Lp is the mutual change inductance matrix of the coils. I is the vector of currents in the Tokamak coils and the conducting shell around the plasma. Fp is the external force normalized to the plasma current Ip, and APP is the normalized destabilizing force. If we lump currents into active currents, driven by an external voltage, and passive currents, we get a simplified model of the plasma. We need to add Kirchhoff’s voltage law to get a dynamical model.
$$displaystyle egin{aligned} Ldot{I} + RI + L_Pdot{z}I_p = varGamma V end{aligned} $$
(6.4)
Γ couples voltages to the currents, L is the coil inductance matrix, and R is the coil resistance. If we combine these, we get the state space matrices shown in the following. The lumped model is shown in Figure 6.3. Table 6.1 gives the model parameters.
Figure 6.3

Lumped parameter model.

Table 6.1

Model parameters from the Joint European Torus (JET). N/A is Newton (unit of force) per amp, in this case. Ω is Ohm, the unit of resistance; H is Henry, a unit of inductance; A is amps.

Parameter

Description

JET

Units

LAA

Active coil self-inductance

42.5 × 10−3

H

LAV = LV A

Passive coil self-inductance

0.432 × 10−3

H

LV V

Active-passive coil mutual inductance

0.012 × 10−3

H

RAA

Active coil resistance

35.0 × 10−3

Ω

RV V

Passive coil resistance

2.56 × 10−3

Ω

$$L^{prime }_{AP}$$

Mutual change inductance between the active coils and plasma displacement

115.2 × 10−6

H/m

$$L^{prime }_{VP }$$

Mutual change inductance between the passive coils and plasma displacement

3.2 × 10−6

H/m

APP

Normalized destabilizing force

0.5 × 10−6

H/m2

FP

Disturbance force normalized to the plasma current Ip

See ELM

N/A

τt

Controller lag

310 × 10−6

s

Ip

Plasma current

1.5× 106

A

dynamical equations are
$$displaystyle egin{aligned} egin{array}{rcl} left[ egin{array}{l} dot{I}_a\ dot{I}_v\ dot{V}_a end{array} 
ight] &=& A^sleft[ egin{array}{l} I_a\ I_v\ mathfrak{}V_a end{array} 
ight] + B^s left[ egin{array}{l} V_c\ dot{F}_p\ F_p end{array} 
ight] end{array} end{aligned} $$
(6.5)
$$displaystyle egin{aligned} egin{array}{rcl} z &=& C^sleft[ egin{array}{l} I_a\ I_v\ V_a end{array} 
ight]+ D^s left[ egin{array}{l} V_c\ dot{F}_p\ F_p end{array} 
ight] end{array} end{aligned} $$
(6.6)
$$displaystyle egin{aligned} egin{array}{rcl} {} A^s &=& frac{1}{1-k_{av}}left[ egin{array}{rrr} -frac{R_{aa}}{L_{aa}}&k_{av}frac{R_{vv}}{L_{av}}&L_{aa}\ k_{av}frac{R_{aa}}{L_{av}}&-frac{R_{vv}}{L_{vv}}frac{k_{av}-M_{vp}}{1-M_{vp}}&-L_{av}\ 0&0&-frac{1-k_{av}}{	au_t} end{array} 
ight] end{array} end{aligned} $$
(6.7)
(6.8)
$$displaystyle egin{aligned} egin{array}{rcl} C^s&=& frac{1}{A^{primeprime}_{pp}I_p}left[ egin{array}{rrr} -L^{prime}_{ap}&L^{prime}_{vp}&0 end{array} 
ight] end{array} end{aligned} $$
(6.9)
$$displaystyle egin{aligned} egin{array}{rcl} D^s&=& left[ egin{array}{rrr} 0&0&frac{1}{A^{primeprime}_{pp}I_p} end{array} 
ight] end{array} end{aligned} $$
(6.10)
$$displaystyle egin{aligned} egin{array}{rcl} k_{av} &=& frac{L^2_{av}}{L_{aa}L_{vv}} end{array} end{aligned} $$
(6.11)
$$displaystyle egin{aligned} egin{array}{rcl} M_{vp}&=&frac{A^{primeprime}_{pp}L_{vv}}{L^{prime}{}^2_{vp}} end{array} end{aligned} $$
(6.12)
$$displaystyle egin{aligned} egin{array}{rcl} M_{ap}&=&frac{A^{primeprime}_{pp}L_{aa}}{-L^{prime}{}^2_{ap}} end{array} end{aligned} $$
(6.13)
This includes a first-order lag to replace the pure delay in Scibile. The preceding plasma dynamical equations may look very mysterious, but they are just a variation on a circuit with an inductor and a resistor, shown in Figure 6.4.
The major addition is that the currents produce forces that move the plasma in z.
Figure 6.4

Series resistor and inductor circuit, an RL circuit.

The equation for this circuit is
$$displaystyle egin{aligned} Lfrac{dI}{dt} + RI = V end{aligned} $$
(6.14)
which looks the same as our first-order lag. The first term is the voltage drop across the inductor and the second the voltage drop across the resistor. If we suddenly apply a constant V , we get the analytical solution:
$$displaystyle egin{aligned} I = frac{V}{R}left(1-e^{-frac{R}{L}t}
ight) end{aligned} $$
(6.15)
LR is the circuit’s time constant τ. As t →, we get the equation for a resistor V = IR. You will notice a lot of RL’s in Equation 6.7.

6.2.2 Sensors

We are going to assume that we can measure the vertical position and the two currents directly. This is not entirely the case in a real machine. The vertical position is measured indirectly in a real machine. We also assume we have available the control voltage.

6.2.3 Disturbances

The disturbances are due to Edge Localized Modes (ELM). An Edge Localized Mode is a disruptive magnetohydrodynamic instability that occurs along the edges of a Tokamak plasma due to steep plasma pressure gradients [23]. The strong pressure gradient is called the edge pedestal. The edge pedestal improves plasma confinement time by a factor of two over the low-confinement mode. This is now the preferred mode of operation for Tokamaks. A simple model for an ELM is
$$displaystyle egin{aligned} d = kleft(e^{-frac{t}{	au_1}} - e^{-frac{t}{	au_2}}
ight) end{aligned} $$
(6.16)
d is the output of the ELM. It can be scaled by k based on the usage. For example, in [38] it is scaled to show the output of a sensor. In our simulation, it is scaled to produce a driving force on the plasma.
τ1 > τ2 with the ELMs appearing randomly. The function ELM produces one ELM. The simulation must call it with a new sequence of times to get a new ELM. Figure 6.5 shows the results of the built-in demo in ELM. The function also computes the derivative since the derivative of the disturbance is also an input.
Figure 6.5

Edge Localized Mode.

6.2.4 Controller

We will use a controller to control the vertical position of the plasma, which otherwise is unstable as shown earlier. The controller will be a state space system using full state feedback. The states are the two currents. Position, z, is controlled indirectly. We will use a quadratic regulator. We will use a continuous version. This just means that we need to sample much faster than the range of frequencies for the control.
If you get repeated roots, you must manually adjust q or r, the state and control weights, respectively. The Matrix Riccati equation is solved in the subfunction Riccati. Notice the use of unique to find repeated roots.
The demo is for a double integrator. This is just
$$displaystyle egin{aligned} ddot{z} = u end{aligned} $$
(6.17)
In state space form, this becomes
$$displaystyle egin{aligned} left[ egin{array}{l} dot{z}\ dot{v} end{array} 
ight] = left[ egin{array}{ll} 0 & 1\ 0 & 0 end{array} 
ight] left[ egin{array}{l} z\ v end{array} 
ight] + left[ egin{array}{l} 0\ 1 end{array} 
ight]u end{aligned} $$
(6.18)
The states are z, position, and v, velocity. u is the input. The following is the built-in demo code. The demo shows that the function creates a controller.
We chose the cost on the states and the control to all be 1.
We compute the eigenvalues to show that the result is well behaved. The result is critically damped, that is, damping ratio of 0.7071 in the second-order damped oscillator equation.
$$displaystyle egin{aligned} x^2 + 2zetaomega x + omega^2 = 0 end{aligned} $$
(6.19)

6.3 Dynamical Model

6.3.1 Problem

Create a dynamical model of the Tokamak.

6.3.2 Solution

Implement the plasma dynamics model in a MATLAB function.

6.3.3 How It Works

We first code the right-hand-side function. We create the four matrices in the DefaultData Structure function. This makes the right-hand side simple.
If we type RHSTokamak at the command line, we get the default data structure.
This is the four matrices plus all the constants. The two inputs, control voltage d.vC, and ELM disturbances, d.eLM, are zero. If you have your own values of lAA, and so on, you can do

and it will create the matrices. There are two warnings to prevent you from entering invalid parameters.

To see that the system really is unstable, type
These agree with the reference for JET. The third is the first-order lag. Note that

This value was chosen so that the roots match the JET numbers.

6.4 Simulate the Plasma

6.4.1 Problem

We want to simulate the vertical position dynamics of the plasma with ELM disturbances.

6.4.2 Solution

Write a simulation script called DisruptionSim.m.

6.4.3 How It Works

The simulation script is an open-loop simulation of the plasma.
It prints out the eigenvalues for reference to make sure the dynamics work correctly.
The value for the magnitude of the ELMs was found by running the simulation and looking at the magnitude of $$dot {z}$$ and matching them to the results in the reference.
The value of the time derivative of the plasma vertical position z is just the first difference.
The ELMs are triggered randomly inside of the simulation loop. tRep is the time of the last ELM. It adds a random amount of time to this number.

The results are shown in Figure 6.6. The currents grow with time due to the positive eigenvalue. The only disturbance is the ELMs, but they are enough to cause the vertical position to grow.

Figure 6.6

Plasma simulation. The position is unstable.

6.5 Control the Plasma

6.5.1 Problem

We want to control the plasma vertical position.

6.5.2 Solution

Write a simulation script called ControlSim.m to demonstrate closed loop control of the vertical position of the plasma.

6.5.3 How It Works

ControlSim is a closed-loop simulation of the plasma. We added the controller with the gains computed by the QCR function.
The controller is implemented in the loop. It applies the limiter.
Results are shown in Figure 6.7.
Figure 6.7

Plasma simulation. The position is now bounded. Compare this to Figure 6.6.

6.6 Training and Testing

6.6.1 Problem

We want to detect measurements leading up to disruptions.

6.6.2 Solution

We use a biLSTM (Bidirectional Long Short-Term Memory) layer to detect disruptions by classifying a time sequence as leading up to a disruption or not. LSTMs are designed to avoid dependency on old information. A standard RNN has a repeating structure. An LSTM also has a repeating structure, but each element has four layers. The LSTM layers decide what old information to pass on to the next layer. It may be all, or it may be none. There are many variants of LSTM, but they all include the fundamental ability to forget things. biLSTM is generally better than an LSTM when we have the full-time sequence.

6.6.3 How It Works

The following script, TokamakNeuralNet.m, generates the training and the test data, trains the neural network, and tests it. The constants are initialized first.
We design the controller as we did in ControlSim. The script runs 100 simulations. The linear quadratic controller demonstrated in ControlSim controls the position.
A disruption is any time response with z peaks over the threshold. Figure 6.8 shows the responses and the distribution of standard deviations. The blue line is a simulation that failed to keep vertical displacement of the plasma field under the prescribed threshold, and the red line is a simulation that succeeded in keeping the displacements below that threshold. The classification criteria are set in the following code.
Figure 6.8

Time responses and distribution of one-sigma values.

The training is done next.

The training is shown in Figure 6.9. It takes over 42 minutes and converges after 10 epochs. Given this, if we rerun training with fewer MaxEpochs – perhaps 20 – training will be faster; this is left to the reader.

The testing is done next.
Figure 6.9

Training.

The results are encouraging. The International Thermonuclear Experimental Reactor (ITER) will require 95% of disruption predictions to be correct and to present an alarm 30 ms before a disruption [34]. Good results have been obtained using data from DIII-D [19].

This chapter did not deal with recursive or online training. A disruption prediction would need to constantly incorporate new data into its neural network. In addition, the other criteria for disruption detection would also need to be incorporated.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset