Professional Documents
Culture Documents
net/publication/241208534
CITATIONS READS
0 121
4 authors, including:
O. Sauter T. P. Goodman
École Polytechnique Fédérale de Lausanne École Polytechnique Fédérale de Lausanne
677 PUBLICATIONS 9,692 CITATIONS 380 PUBLICATIONS 3,628 CITATIONS
Some of the authors of this publication are also working on these related projects:
All content following this page was uploaded by O. Sauter on 19 February 2015.
This article has been downloaded from IOPscience. Please scroll down to see the full text article.
(http://iopscience.iop.org/0029-5515/51/8/083052)
View the table of contents for this issue, or go to the journal homepage for more
Download details:
IP Address: 128.178.125.176
The article was downloaded on 09/08/2011 at 10:14
the safety factor (q) or poloidal flux (ψ) profile). We section of this paper in which each is discussed in more detail.
choose this profile for several reasons. First of all, the q • A first-principles-based plasma physics model that
profile is of prime importance for the plasma performance correctly describes the poloidal flux profile dynamics. In
and macro-stability, since its shape determines the proximity order to be applicable to advanced scenarios, this model
to operational MHD limits, the presence of improved must include at least plasma resistivity, bootstrap current
confinement (e.g. hybrid) regimes or transport barriers, and and auxiliary current drive sources. The model we have
the appearance and location of tearing modes. Secondly, implemented is based on the partial differential equation
the physics of poloidal flux diffusion, which governs the (PDE) describing the diffusion of poloidal flux as detailed
current density profile evolution, is relatively well understood in [10] and implemented in the ASTRA code [2], with
and reliable physics models exist on which to base first- the restriction that the shape of the flux surfaces and the
principle simulations. Simulation results, therefore, can be toroidal flux they enclose maintained fixed in time. This
trusted. This is in contrast to the more complex phenomena implies that, at this stage, we do not solve the Grad–
governing anomalous plasma energy transport, for example, Shafranov equation in real-time, though we allow the
for which first-principle models are much less developed value of the poloidal flux at each surface to vary in time.
and understood. Thirdly, the q profile happens to be We use equations based on neoclassical calculations for
a quantity which is particularly difficult to measure with the bootstrap current and neoclassical conductivity. Non-
sufficient spatial and temporal accuracy in real-time, even inductive current drive sources are modelled using a priori
after years of development of diagnostics dedicated to do knowledge of the spatial distribution of the driven current,
so, such as motional Stark effect (MSE) spectroscopy or multiplied by the current drive efficiency and actuator
polarimetry. power level. In section 3 we describe the model and the
We propose to perform an interpretative transport equations in some detail.
simulation in real-time during the plasma discharge, of the • A numerical code solving the poloidal flux diffusion
same nature as is performed today post-shot by specialized PDE that is compatible with real-time implementation.
transport codes (e.g. ASTRA [2], CRONOS [3], TRANSP For this purpose we have developed a new 1D transport
[4, 5], JETTO [6], CORSICA [7]). A considerable amount code RAPTOR (RApid Plasma Transport SimulatOR).
of additional information obtained from these simulations, RAPTOR uses finite elements to spatially discretize
including the profiles of poloidal flux, current density, the PDE, yielding a high-order ODE for the finite-
magnetic energy, rotational transform, magnetic shear, internal element coefficients. To achieve numerical stability,
inductance, poloidal magnetic field, toroidal electric field, we use a mixed implicit-explicit temporal discretization
bootstrap current, ohmic current density, etc, becomes scheme. With this choice, solving one time step involves
available in real-time and can be used for feedback control, constructing and solving a band-structured linear matrix
disruption avoidance, scenario monitoring, and a wealth of equation as is briefly discussed in section 3.2. The
other applications which will be discussed in some detail in numerical implementation and the necessary measures
section 2. to make the solution as fast as possible are discussed in
The basic idea underlying this paper was suggested some detail in appendix A. Although material described
earlier in work by Witrant et al [8], which presents a in this section is essential for the successful real-time
control-oriented current density profile model which would implementation of the algorithm, this rather technical
be suitable for real-time implementation. However, to our section will appeal mostly to those interested in the details
knowledge, such a model had until now never actually been of the involved numerics.
implemented in a tokamak real-time system. Here, we present • Real-time measurements of the plasma quantities that are
not only the methodology but also the implementation of this required as inputs to the poloidal flux transport solver.
paradigm in the control system of the TCV tokamak [9] and These are (a) the total plasma current Ip or loop voltage
its successful demonstration during plasma discharges. We Vloop and (b) the plasma kinetic profiles, at least Te (ρ)
show the successful resolution of the plasma poloidal flux but preferably also ne (ρ) and Ti (ρ) for bootstrap current
transport equation with time steps of the order of 1 ms which is calculations. The plasma current is available in real-time
comfortably shorter than the global TCV current redistribution in practically all present-day tokamaks from a discrete
time (∼150 ms for heated plasmas). The fact that this set of magnetic measurements or from a Rogowski coil.
could be achieved for the relatively short characteristic time The kinetic profiles are inherently more complicated to
scales of the moderately sized TCV implies that this method obtain and the availability of real-time diagnostics for each
can easily be applied to larger tokamaks with longer time profile is different for each individual tokamak. In some
scales. cases, ECE, Thomson scattering, and/or charge exchange
The proof of principle and the main results obtained in recombination spectroscopy diagnostics may be used in
TCV experiments are postponed until section 5. The first part real-time. Since this is not the case for TCV, an alternative
of this paper presents the ingredients necessary to perform solution had to be found which uses other diagnostics that
real-time current density profile simulations. Some are of a are available in real-time. In section 4.1 we present the
general nature and are valid independently of the particular particular solution that has been implemented: a set of line-
tokamak on which the simulation is implemented. Others are integrated soft x-ray measurements and interferometer
more specific to the available diagnostics and implementation signals is combined and processed to yield real-time
environment and will be different for each machine. The estimates of the profiles of ne and Te . This has proven
required ingredients are listed below with reference to the to be one of the more difficult steps in the implementation
2
Nucl. Fusion 51 (2011) 083052 F. Felici et al
3
Nucl. Fusion 51 (2011) 083052 F. Felici et al
whether the plasma is still behaving in a well understood current drive (ECCD) and have not modelled other forms of
and expected way. Since the design of any control system auxiliary current.
is based on expectations of the plasma response to actuator
inputs, an indication that the system is not behaving as 3.1. Poloidal flux diffusion equation
expected from models would be cause for concern and
possibly a reason to terminate the plasma in a safe manner. The derivations and definitions below, as well as the notation,
Apart from the safety aspect, supervision can have the follow the ASTRA documentation [2]. We start, as is
goal of rescheduling the evolution of the single tokamak customary, by defining a set of coordinates {ρ, θ, ζ } where
experiment during the shot as needed. ρ is an arbitrary flux surface label, θ is the poloidal angle
Prediction. As a final application, we mention the use of and ζ is the toroidal angle in the direction required for a
real-time predictive simulations, i.e. faster-than-real-time right-handed system. The following standard relations can
simulations. This provides estimates of the future plasma be derived, relating the main magnetic quantities to the two
state based on knowledge of future actuator inputs. This scalar functions ψ(ρ) and F (ρ):
has important applications in predicting whether actuator 1
B = F ∇ζ + (∇ζ × ∇ψ) Magnetic field (1)
saturations or safety limits are about to be exceeded. The 2π
plasma state can also be monitored to provide advance ∇ζ 2 ∇ψ 1
warning when entering a regime with increased risk of j= R ∇· + (∇F × ∇ζ )
2π µ0 R2 µ0
disruptions: as recent focus has shifted from disruption
Current density (2)
mitigation to disruption prevention and avoidance, a real-
1
time simulation, in particular of the q profile, may enable = B · ∇ζ dV Toroidal flux (3)
a much more precise prediction of the proximity to the 2π V
stability limit and would allow the system to effect an µ0
F = R 0 B0 − j · dSθ
appropriate mitigation or soft-stop response depending on 2π Sθ
the plasma state. This will be particularly crucial for large Poloidal current function. (4)
experiments like ITER where disruptions can have serious
Here R0 is the major radius of the torus, B0 is the vacuum
consequences. Taking this approach one step further,
toroidal magnetic field at R0 and R is the distance from the
one can also optimize future actuator inputs by iteratively
vertical machine axis. Sθ is a toroidal ribbon orthogonal to
predicting the plasma state in a model-predictive control
∇θ, extending from the plasma magnetic axis to a flux surface.
scheme as proposed by [16, 17].
Choosing the flux surface label as the square root of the
With these applications in mind, we now move to describe (unnormalized) toroidal flux:
the physics model for poloidal flux diffusion which has been
implemented in this first version of a real-time physics-based (ρ)
simulation. ρ = ρtor = . (5)
π B0
3. Simplified physics model for poloidal flux we can derive the poloidal flux diffusion equation, describing
diffusion the temporal diffusion of the poloidal flux ψ(ρ, t) due to
the plasma resistivity. Let
us define flux surface averaged
In this section, we describe the simplified physics model that quantities as Q = ∂V ∂
QdV and assume the flux surface
is to be solved in real-time. This is the principal ingredient of averaged longitudinal Ohm’s law
the real-time simulation framework and the choice of which
physics to include or exclude certain physics strongly impacts σ E = j − jBS − jCD , (6)
the final current density profile estimate. We begin this section
where E , j , jBS and jCD are defined following j = j ·
by recalling the 1D poloidal flux transport equation which is
B /B0 , and jBS and jCD are the bootstrap and auxiliary current
to be solved in real-time, and by showing the main simplifying
density profiles, respectively. Assuming that ∂B0 /∂t = 0, the
assumptions which were made to lighten the computational
poloidal flux diffusion equation can be written as [2]
complexity of the problem. Although some of the material
presented here is based on [2, 10] we have included this
∂ψ R0 J 2 ∂ G2 ∂ψ V
material for completeness. σ|| = − (jBS + jCD ), (7)
∂t µ0 ρ ∂ρ J ∂ρ 2πρ
At the end of this section, we will also summarize the
choices made in the numerical implementation of the physics where
model, while referring to the appendix for most details. We F
J = , (8)
also mention the role of the initial conditions of the simulation R 0 B0
and the time scales on which it will affect the solution. ∂V
While this section has some similarities with the work V = , (9)
∂ρ
presented in [8], the model formulation and solution method
is somewhat different. The key difference lies in the spatial 1
G2 = V (∇ρ)2 /R 2 . (10)
discretization scheme, as we do not use finite differences but 4π 2
a finite-element approach, which allows us to formulate a Since ρ is the independent variable in this equation, it describes
variational form of the poloidal flux diffusion equation. Also, the diffusion of poloidal flux through a given background of
we have specifically focused on modeling electron cyclotron toroidal flux. The spatial distribution of toroidal flux in the 2D
4
Nucl. Fusion 51 (2011) 083052 F. Felici et al
8 2
10 2
q reference j//=<J.B>/B0 [MA/m ] V’ = dV/dρ [m ]
0.4 Z [m] 6 4
+ off–axis j
4 β× 2 5
0.2 2
2
ρtor,N ρ
tor,N
ρ
tor,N
0 0 0 0
0 0.5 1 0 0.5 1 0 0.5 1
–0.2 19 –3 ftrapped G /J
50 p [10 m keV] 0.8 0.4 2
40 0.6
–0.4 30
Surfaces of constant
1/2 0.4 0.2
ρ ~ ((Φ/π/ B) 20
tor 0 0.2
R [m] 10 ρtor,N ρ
tor,N
ρ
tor,N
0 0 0
0.6 0.8 1 1.2 0 0.5 1 0 0.5 1 0 0.5 1
Figure 2. Set of TCV equilibria illustrating the effect of assuming fixed toroidal flux surfaces on the geometric terms V , G2 /J appearing in
(7). A reference equilibrium (blue, −) is perturbed by redistributing current density to give a reversed-shear q profile (red, −−), and by
doubling the pressure, i.e. β (green, ·−). The variation in V and G2 /J can be seen to be within 10% of their reference value. Also the
trapped particle fraction, which governs the neoclassical contribution to jBS , σ and current drive efficiency, is hardly changed. The largest
difference appears when changing the pressure through a change in Shafranov shift. The calculations were performed using the
fixed-boundary equilibrium code CHEASE [18].
poloidal plane satisfies the Grad–Shafranov equilibrium, the 3.1.2. Fixed equilibrium assumption. As mentioned, in most
source term of which is the toroidal current density profile jtor existing codes the flux surface shapes are evolved by a Grad–
(the first term on the rhs of (2)) which changes in time according Shafranov solver. The link to the Grad–Shafranov solution
to the radial poloidal flux redistribution governed by (7). Since, has not yet been included in the real-time model at this stage,
on the other hand, changes in the equilibrium cause variations although it could be an important extension. Instead, the shape
in ∼ ρ 2 , J , V and G2 , the full magnetic configuration of of the poloidal flux surfaces as well as the toroidal flux they
the tokamak plasma is governed by (7), nonlinearly coupled to enclose, are chosen once for one reference equilibrium and
the Grad–Shafranov equation. remain fixed in space and time. This restriction means that we
are in practice (i) neglecting variations in diamagnetic effects
3.1.1. Solution method in existing transport codes. While an which cause variations of J (ρ), (ii) neglecting effects due to
in-depth discussion of the working of modern transport codes changes in the shapes flux surface shapes, primarily as a result
is well beyond the scope of this article, it is useful to sketch of varying Shafranov shift as β evolves and (iii) assuming a
a simple outline. The procedure for solving the flux diffusion fixed plasma boundary in time.
equation in interpretative simulations (i.e. with prescribed Note that this is a weaker statement than assuming the
temporal evolution of Te , Ti and ne ) generally involves one Grad–Shafranov equilibrium to be fixed, indeed we do allow
or more iterations of the following steps: the poloidal flux profile ψ(ρ), and hence q, jtor , etc to
(i) The Grad–Shafranov equation, or an approximation change in time. We merely fix the flux surface geometry and
thereof, is solved using the toroidal current density jtor (ρ) enclosed toroidal flux. By choosing a reference equilibrium
giving the spatial functions ψ(R, Z), (R, Z), hence we can treat arbitrary plasma shapes as long as they are
ρ(R, Z) on the poloidal plane. From this, one computes not time-varying. Analysis of several plasma equilibria,
functions that are constant on a flux surface, such as ρ, shown in figure 2, indicates that unless the plasma β varies
J (ρ) and geometric quantities G2 (ρ), V (ρ). This step significantly with respect to the reference, the change in
may be performed by a free or fixed-boundary calculation poloidal current density and Shafranov shift will be limited.
depending on whether the plasma boundary is specified or Even a doubling of β results in a variation of G2 /J and V
is to be determined based on the currents in the poloidal of less than 10%. The consequence of this assumption is that
field (PF) coil set. in equation (7) G2 (ρ, t) = G2 (ρ), V (ρ, t) = V (ρ) and
(ii) The source terms jCD (ρ) and jBS (ρ), as well as the J (ρ, t) = J (ρ) (equations (8)–(10)) are now fixed functions
conductivity σ (ρ), are computed based on the prescribed of ρ in time, evaluated once only based on a chosen Grad–
density and temperature profiles and models of auxiliary Shafranov equilibrium. The only time-varying quantities apart
current drive injection systems. These calculations can be from the dependent variable ψ(ρ, t) are σ (ρ, t), jCD (ρ, t)
of varying complexity and may include geometric, kinetic and jBS (ρ, t).
and neoclassical effects.
(iii) The poloidal flux diffusion equation (7) is solved for the 3.1.3. Current sources, conductivity and flux boundary
next time step, yielding the flux profile ψ(ρ, t) and a new conditions. The bootstrap current term jBS as well as the
jtor (ρ) to be used as input for the Grad–Shafranov step parallel conductivity σ are calculated using the expressions
(i). The edge boundary condition for ψ at ρ = ρedge from [19, 20] which represent numerical fits of accurate
is provided by imposing the total plasma current or loop neoclassical calculations for arbitrary shape, aspect ratio and
voltage. collisionality.
5
Nucl. Fusion 51 (2011) 083052 F. Felici et al
The conductivity term is split into the Spitzer component or using the ohmic transformer flux OH = t VOH dt:
multiplied by a neoclassical correction describing trapped
particle effects: G2 ∂ψ
OH (t) = Lext + ψ(t)|ρ=ρe , (16)
σ = cneo σSpitz . (11) µ0 ∂ρ ρ=ρe
This correction term cneo depends on the trapped particle frac- where Lext represents the mutual inductance between the
tion and collisionality, which in turn depend on the equilib- ohmic primary and the plasma and VOH is the inductive voltage
rium and ne , Te profiles, respectively. The Spitzer conductiv- from the ohmic transformer. Since Ip is available in real-time
= 1.9012 × 104 Te [eV]3/2 /(ZN(Z) ln
e )
ity is given by σSpitz from magnetic measurements, the first option will generally
where Z = Zeff = p∈ions Zp2 np /ne is the effective charge and be used for interpretative simulations.
N(Z) = 0.58+0.74/(0.76+Z) depends weakly on Z [19, 20].
For the bootstrap current we have, again from [19, 20]
(note the factor of 2π due to a different definition of ψ) 3.1.4. Output quantities. From knowledge of the flux
profile ψ(ρ, t) and its spatial and temporal derivatives, profile
∂ ln ne ∂ ln Te quantities related to the magnetic configuration of the plasma
jBS = −2πJ (ψ)R0 p(ψ) L31 + Rpe (L31 + L32 )
∂ψ ∂ψ within the last closed flux surface (LCFS) can be calculated.
∂ ln Ti
+ (1 − Rpe )(L31 + α L34 ) . (12) Plasma current inside ρ surface (A)
∂ψ
G2 ∂ψ
Here Rpe = pe /p is the ratio between electron and total Ipl = . (17)
µ0 ∂ρ
pressure. Assuming ni = ne and ∂ ∂ψ ln Ti
= ∂ ∂ψ
ln Te
we rewrite
Toroidal current density (A m−2 )
this in the more convenient form involving derivatives of ρ:
2π R0 ∂ ∂ψ
jBS = −
2πJ (ψ)R0 ∂ρ
L31
∂ne jtor = G2 . (18)
Rpe ∂ψ ∂ρ
Te µ0 V ∂ρ ∂ρ
Rotational transform, 1/safety factor
∂Te
+ (L31 + Rpe L32 + (1 − Rpe )α L34 ) ne . (13) 1 ∂ψ 1 ∂ψ
∂ρ ι= = = . (19)
q ∂ 2π B0 ρ ∂ρ
The profiles J , L31 , L32 , L34 , α also depend on equilibrium
and collisionality. Note also that since the Te and ne profiles Magnetic shear
derivatives with respect to ρ are used, the above expression 2V ∂q 2V ∂ 2 ψ ∂ψ −1
involves the reciprocal of the flux profile gradient (∂ψ/∂ρ)−1 . s= = 1−ρ 2 . (20)
q ∂V ρV ∂ρ ∂ρ
In general, the auxiliary current drive can be written
as a sum of contributing sources i ji (ρ, t) where i ∈ Poloidal field energy density (J m−3 )
{ECCD, ICCD, LHCD, NBCD}. The only auxiliary current
G2 ∂ψ 2
drive system on TCV is the electron cyclotron (ECCD) system. wi = . (21)
2µ0 V ∂ρ
Its driven current density is modelled by an empirical formula
Magnetic energy inside ρ surface (J)
jaux (ρ, t) = ccd e −ρ 2 /0.52 Te −(ρ−ρdep )2 /w2 ρ
e cd P
EC (t). (14) 1 ∂ψ 2
ne Wi = G2 dρ. (22)
2µ0 0 ∂ρ
Here we have modelled the deposition as a Gaussian with a
Unnormalized internal inductance (H)
given width, including effects of Te /ne on the current drive
efficiency. An ad hoc term accounting for the inefficiency Li = 2Wi /Ipl2 . (23)
due to trapped particles towards the edge has been included.
Toroidal plasma loop voltage (V)
The efficiency is multiplied by the varying gyrotron power
(PEC ). In all, this relation mimicks the more rigorous approach ∂ψ
Upl = . (24)
presented in [21]. A machine-dependent final scaling factor ∂t
ccd is determined from experimental experience to normalize to Parallel electric field (V m−1 )
the experimentally measured values of total current drive. This
factor is typically of order 1015 A/(eV m5 W) for the TCV case. 2πρ
E = Upl . (25)
Multiple ECCD contributions from multiple launchers can be V
included by summing various terms of this form. This way Ohmic power density (W m−3 )
of modeling removes the need for real-time ray-tracing and
1
wave–particle interaction calculations: these are summarized POH = Upl jtor .
by analytic expression. Accurate, pre-calculated current drive 2π R0
profiles for a given set of equilibria and injection geometries (26)
could be pre-calculated using ray-tracing codes, combined in Based on this list of profiles, a number of related quantities
a look-up table and interpolated in real-time. may be computed such as the bootstrap current fraction
The boundary terms can be specified either via the plasma IBS /Ip and externally driven current fraction ICD /Ip . Using
current the ohmic power density POH (26), and since both electron
∂ψ µ0 and ion temperature, density and injected auxiliary power
= Ip (t) (15)
∂ρ ρ=ρe G2 (ρe ) density profiles are assumed to be given, a real-time power
6
Nucl. Fusion 51 (2011) 083052 F. Felici et al
balance can be established using the electron energy transport essentially represent a weighted least-squares distance from
equation [2, 10]: the stationary state (ss) solution. For example
∂ ∂ ∂Te 2 2 1/2
V [ne Te ] = V (∇ρ)2 ne χe + V Pe , (27) ∂ι(ρ) ρe
1 ∂U
fss,ι = pl
∂t ∂ρ ∂ρ ∂t = 2π B0 ρ ∂ρ
dρ
2 0
where χe is the electron heat diffusion profile and Pe =
(34)
POH + Paux − Pei − Prad . The electron–ion equipartition power
Pei is given by [10]
2 1/2
∂wi (ρ) ρe Ipl2 ∂Upl
fss,wi =
∂t =
dρ . (35)
Pei = ne νeq (Te − Ti ), (28) 2 0 V ∂ρ
−3/2 These scalar values provide a practical measure of the degree to
where νeq = 0.041Te(keV) p∈ions np[19] Zp2 /Ap [10] is the
neoclassical equipartition rate and Zp and Ap are the charge and which the profiles have relaxed to their stationary conditions.
atomic mass number of each ion species, respectively. Using In section 5 we provide an example of the evolution of fss,Ipl .
ni = (ZC − Zeff )/(ZC − 1)ne and the definition of Zeff , in the
case of deuterium plasmas with mainly carbon impurity we 3.2. Numerical implementation using finite elements
can rewrite νeq as
The numerical solution of equation (7) is implemented using
a finite-element method for the spatial discretization and
−3/2 ni ZC (ne − ni )
νeq = 0.041Te (keV) + . (29) a semi-implicit backwards Euler method for the temporal
Ai AC
discretization. The code has been recently developed and
The bremsstrahlung radiation losses are calculated using the named RAPTOR (RApid Plasma Transport SimulatOR). The
simple formula Prad = 5.35×10−5 Zeff n2e Te [22]. We neglect
1/2
methodology describing the use of finite elements is discussed
losses due to cyclotron radiation, as they are usually negligible in detail in appendix A but a brief outline is given here. The
in the plasmas we have considered. Furthermore, as we do not flux at a discrete time step k: t = tk is approximated as
model the ion temperature (which plays a minor role for the
TCV plasmas studied), loss channels for the ion energy need
nsp
ψ(ρ, tk ) ≈ ψ̂α (tk )
α (ρ). (36)
not be considered.
α=1
Calculating the electron thermal energy We =
ρ k B n e T e V dρ and its time derivative, the instantaneous Where
α (ρ) are the finite-element basis functions, chosen as
electron thermal diffusivity profile is given by cubic B-splines. To evolve equation (7) in time one needs, at
each time step, to construct and solve a linear matrix-vector
∂We
− Pe V dρ equation of the form
ρ ∂t
χe (ρ, t) = , (30) Ak ψ̂ k+1 = Bk ψ̂ k + sk , (37)
∂Te
(V (∇ρ) kB ne
2
∂ρ
where the matrices Ak and Bk and vector sk must be
which can be calculated at each time step. The global energy assembled at each time step and depend on the time-varying
confinement time is given by terms σ (ρ, tk ), jBS (ρ, tk ), jaux (ρ, tk ) and Ip (tk ). ψ̂ k =
Rpe We [ψ̂1 (tk ), . . . , ψ̂nsp (tk )]T is the vector collecting the finite-
τE =
, (31) element coefficients.
ρ (P oh + P aux − P rad )V dρ − Rpe dWe /dt
Considerable care has been taken to minimize the amount
from which confinement enhancement factors can be of computation time necessary for each time step (i.e. the part
calculated for different scaling laws. that has to be executed in real-time). The approach using finite
We can also compute time derivatives of profile quantities. elements differs from most other 1D plasma transport codes
For example which use finite differences. The use of finite elements and
∂Ipl (ρ) G2 ∂Upl
= (32) the resulting weak form allows one to reduce the order of the
∂t µ0 ∂ρ derivatives involved. Indeed, only first derivatives of the finite
from which we can define a degree of ‘variability’ or, elements are involved in the construction of Ak and Bk , while
conversely ‘stationarity’ of this profile: the original PDE (7) involves second-order spatial derivatives.
2 1/2
∂Ipl (ρ) ρe
G 2
∂U
fss,Ipl = 2 pl
∂t = µ0 ∂ρ
dρ . 3.3. Role of the initial condition
2 0
7
Nucl. Fusion 51 (2011) 083052 F. Felici et al
in which the current redistribution time is short, the profiles As TCV plasmas have only direct electron heating, the ion
will rapidly converge to a stationary state and errors in the temperature Ti plays a relatively modest role in the sustainment
initial condition will at the same time disappear. If, on the of the bootstrap current and ions store a relatively small and
other hand, early heating is applied lengthening the current constant fraction of the total plasma thermal energy. Lacking
redistribution time, it will take a longer time for the effect of a real-time diagnostic to measure the Ti evolution, we fix this
the initial condition to become negligible. profile and take the value during the initial, ohmic phase of
On TCV, this does not pose a problem since (i) the current the discharge (before any auxiliary heating is applied), which
redistribution time is relatively short (∼150 ms for heated yields, on average Tiohmic ≈ 0.7Teohmic at the densities obtained
plasmas, much shorter for ohmic plasmas, compared with a in the discharges considered here.
typical shot duration of ∼2 s), and (ii) in the majority of TCV The remaining problem is to estimate the Te and ne
shots, there is always an ohmic phase early in the shot just after profiles. The central electron temperature Te0 is directly
the plasma current ramp-up, which allows the profiles to go provided by the XTe diagnostic by taking the ratio between
to a stationary state even before heating is applied. For larger x-ray intensities measured with different thicknesses of
tokamaks, however, the problem may be more significant since beryllium filters. This diagnostic has been calibrated against
the current redistribution time may be a significant fraction, Thomson scattering measurements in the past and is known
or may even be even longer than the total shot time. Also, to give a reasonable quality estimate. To estimate the Te
many hybrid and advanced scenarios rely explicitly on early profile shape T̃e (ρ) ≡ Te (ρ)/Te,0 , and the density profile
heating. A further complication may arise in the case where ne (ρ), we rely on a combination DMPX and FIR chords. As
the plasma shape is also evolved during the ramp-up, as is the SXR intensity has the dependence Isxr ∼ n2e Teα where
envisaged in ITER. α ∼ 0.5, the ne and Te profiles can in theory be derived from
To alleviate this, one can either rely on internal current a nonlinear mapping from these two measurements. We have
density profile measurements as discussed in section 6.1 or chosen to construct this mapping using machine-learning based
use more advanced models of the initial phases of plasma techniques which are discussed in more detail in appendix B.
formation and ramp-up to estimate the initial current density In this approach, a set of shots with similar plasma shape is
profile for initial (low-current) plasma and/or include some collected for which the ne , Te profiles are known from off-line
effects of the free-boundary equilibrium to account for varying post-shot Thomson scattering data. Using this shot database,
shaping. a neural network is constructed which maps the data of the
DMPX and FIR chord to profiles of ne (ρ) and Te (ρ). After
training the network, it can be used in real-time to estimate
4. Implementation of the real-time simulation these profiles from fresh diagnostic data.
on TCV Profiles estimated by TENEX in real-time for one example
shot are shown in figure 3 and compared with Thomson
In the previous section, we have described the physics model scattering measurements for the same shot. We see that the
which is solved in real-time to obtain the poloidal flux profile Te profile is relatively well reproduced by the neural network
and have introduced the RT-RAPTOR transport code used to and the main difficulty resides in the estimation of Te (0) from
simulate the model. In this section, we will show how this the XTe diagnostic. On the other hand, both ne (0) and the ne
simulator has been implemented in practice in the TCV digital profile are well reproduced. We note here that this approach
control system for real-time operation. has been taken mainly because a direct Te profile measurement
We have seen that, in order to calculate the conductivity, is not available in real-time on TCV at this time. If such a
bootstrap current and auxiliary current one needs to have measurement were available, the data could be used directly,
estimates of the profiles of Te , ne and Ti in real-time. The avoiding the need for this scheme.
details of how they are obtained will be different for each
tokamak, depending on the available real-time diagnostics.
We will begin this section by describing the particular method 4.2. Implementation on the TCV digital control system
that was implemented on TCV for the available real-time Having described the physics model RT-RAPTOR (Real-Time
diagnostic set. RAPTOR) code in section 3, and the TENEX real-time kinetic
profile reconstruction in section 4.1, we turn in this section to
4.1. Real-time estimates of the kinetic profiles their implementation in the TCV digital control system.
The new TCV digital control system [11] consists of
Ideally, a tokamak equipped with real-time Te , ne and Ti profile multiple nodes, all of which have a Linux PC with a X86 CPU.
diagnostics could feed this information directly to the real- Some nodes have analogue acquisition and output modules
time flux diffusion simulator. However, the ECE, Thomson hosted in a compact-PCI crate. The present system contains
scattering and charge exchange recombination spectroscopy four nodes, two of which are connected to a complementary
systems available on TCV cannot provide real-time data at set of diagnostics and which command a set of actuators.
this time. We must therefore infer the profiles from diagnostics The other two nodes are for computation only and have no
available in real-time, in the TCV case a set of 14 far-infrared autonomous data acquisition or command capabilities. The
interferometer (FIR) chords [23], 64 soft-x ray chords from nodes can pass data to each other in real-time utilizing a
the DMPX diagnostic [24] and 4 channels from a single-chord reflective (shared) memory. Data written into this memory by
multi-filter x-ray diagnostic (XTe). The method to do this has one node are automatically copied to the same memory space
been named ‘TENEX’ (TE and NE from X-rays). in all of the other nodes. Each node can run at a different
8
Nucl. Fusion 51 (2011) 083052 F. Felici et al
9
Nucl. Fusion 51 (2011) 083052 F. Felici et al
Figure 4. Diagram of the implementation of RT-RAPTOR in the distributed TCV digital control system. The main algorithm is run on node
RT01 which is connected to the profile diagnostics needed to reconstruct the Te and ne profiles. Measurement of Ip is provided by a second
node (RT02) which runs a functionally identical copy of the TCV analogue control system. Each node is connected to a different set of
diagnostics via analogue to digital converters (ADCs) and commands a different (sometimes overlapping) set of actuators via DACs (Digital
to Analog Converters). Information is exchanged via a real-time reflective (shared) memory (RFM). The third and fourth nodes (RT03,
RT04) are now passively observing data generated from the other two nodes, but could be used for other applications in the future. Details of
the architecture of the control system hardware and software can be found in [11].
related by analytical expressions in [19, 20], but were skipped 5.1. Plasma current ramps
in this first implementation for simplicity.
As a first and basic test of the current diffusion simulation, we
For these experiments, RT-RAPTOR adapts in real-time
present an example plasma in which the current is forced to
the value of Zeff . As the measurement of Vloop , as measured
diffuse by repeatedly varying the plasma current Ip between
by a flux loop outside the vessel, is redundant (since the
240 and 160 kA with different linear ramp rates. We use this
boundary condition has already been specified via (15)),
example to focus on some of the magnetic quantities calculated
it can be compared with the simulation output Upl (ρ =
by RT-RAPTOR. A selection of the real-time data coming from
ρe , t). The value of the Zeff parameter is then increased
the RAPTOR flux profile reconstruction is shown in figure 5.
or decreased, depending on whether the plasma voltage is
overestimated/underestimated (corresponding to too high/too We mention four important events occurring during the
low Zeff , respectively). This is implemented into the real-time evolution of this plasma:
loop in the form of a parameter adaptation law for Zeff , using • t = 0.3 s: the control loop for elongation feedback is
the simple expression closed, bringing the plasma to the required elongation.
This leads to transients in the coil currents which induce
Zeff,k+1 = Zeff,k + γ [Vloop,meas − Upl (ρe )]. (38) some sharp variations in loop voltage.
• t = 0.4 s: the first current ramp is initiated, bringing
Here, γ is the adaptation gain which is tuned empirically. A
the plasma current from 160 to 240 kA in 50 ms,
more general discussion of this idea is given in section 6.
and simultaneous switch-on of ECH power, leading to
To illustrate the capabilities and typical results of the code, increased temperature and decreasing loop voltage due to
we present two different types of shots. Time traces obtained the lower plasma resistivity.
in real-time are compared, where possible, to off-line data
• t = 1.0 s: a slower ramp-down is imposed, to bring Ip
obtained from (a) the off-line Grad–Shafranov equilibrium
back to 160 kA in 100 ms. The lower current gives lower
code LIUQE [26], which reconstructs the plasma magnetic
particle confinement such that a lower density is obtained
equilibrium using magnetic measurements and a constraint
thus higher temperature at constant auxiliary input power.
on the plasma stored energy via a DML (Diagmagnetic
• t = 1.6 s: an even slower ramp-up back to 240 kA is
loop) diagnostic, and (b) an off-line interpretative transport
performed in 200 ms.
simulation performed using ASTRA [2]. The boundary and
plasma current used in the ASTRA simulations were taken The profile of Ipl (ρ, t) is plotted in figure 5(a) for distinct
from the LIUQE equilibrium data, while kinetic profiles were values of ρ, showing how the change in Ip (controlled by
taken from Thomson scattering measurements. feedback) penetrates the plasma on the current redistribution
10
Nucl. Fusion 51 (2011) 083052 F. Felici et al
11
Nucl. Fusion 51 (2011) 083052 F. Felici et al
1 Pin [MW] naturally filters out any high-frequency content in the Te signal,
0.8
and no further filtering is necessary.
PECH The extra auxiliary power causes a net decrease in
0.6
P confinement time as expected from known scaling laws
0.4 OH
(figure 6(c)). Comparing the confinement time with the TCV
0.2 L-mode scaling, which follows the Rebut–Lallia–Watkins
(a)
0 scaling [27, 28], reveals an HTCV-Lmode = τE /τRLW factor of
W [kJ] W just under 2 (figure 6(d)) as is typically the case when the EC
thermal tot
8
power is deposited inside of the q = 1 radius. We stress again
6 that the quantities shown here are now available in real-time
4 We during the shot, rather than post-shot from transport analysis,
2 and may now be used for monitoring and control purposes.
Wi (b)
0
5.3. Discussions and possibilities for improvement
25
20 All of the simulations shown above gave satisfactory results
15 within error margins expected from diagnostics. Whenever
10 the real-time simulation results have been compared with
5 τ [ms] post-shot (off-line) simulations, good agreement was obtained
E (c)
0 taking into account the different information available in the
Vloop [V] Flux loop measurement various cases. The experience gained operating this real-time
RAPTOR: Zeff adaptation interpretative transport code during TCV tokamak experiments
has, however, allowed us to highlight a number of possible
1.5 ASTRA: Zeff = 2.5
improvements for the system as it is implemented today.
1
As illustrated in section 4.1, TCV currently lacks a
0.5
0 (d) real-time Te profile diagnostic and the reconstruction is
done using indirect means, heavily relying on a single
Zeff and H factor
chord Te0 estimate and multi-chord x-ray wire chamber.
3 This has often led to errors in the Te profile estimate
Z
eff
2 which is a crucial quantity strongly influencing conductivity,
bootstrap current and confinement estimates. Particularly if
1
H
TCV–Lmode
these real-time simulations are to be applied to advanced
0 (e) scenarios with significant bootstrap current fractions, the
1 correct determination of the Te profile with steep gradients
ρtor
3 will be crucial in simulating the correct current density profile,
0.8
(although to some extent this requirement may be alleviated by
2
0.6 using an ad hoc method to estimate the Te gradients specifically
location of rational q surfaces in these plasmas). Secondly, the simulation currently requires
0.4 1 a number of similar shots to be performed beforehand, with an
time [s] (f)
adequate range of heating and density conditions to establish
0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
the neural-network mapping from real-time diagnostics to
Figure 6. Illustration of several real-time signals available from the kinetic profiles. A new shot database must be constructed
interpretative transport simulation done using RAPTOR during a if the plasma shape or position is significantly altered. It
TCV shot. During this particular shot, the ECH power is increased would be a major advantage to have a real-time Te and ne
in steps and ohmic power drops due to the decreased loop voltage
(a). At the same time the plasma energy content is seen to increase
profile measurement of high spatial accuracy to be able to
(b). The confinement decreases as expected for heated plasmas (c) improve on the results, avoiding the neural-network based fits
while the HTCV-Lmode scaling factor stays approximately constant. described in section 4.1 entirely. Furthermore, any additional
The loop voltage (d) is shown as measured by a flux loop, as tracked measurements of internal profile quantities would provide
by RAPTOR by adapting Zeff (e) and from off-line ASTRA extra constraints and redundancy in the system and yield
simulations with fixed Zeff . The movement of the rational q surfaces
improved current density profile estimates. Finally, instead
due to the internal redistribution of current density is also shown for
RAPTOR, ASTRA and from the LIUQE off-line equilibrium of using one static equilibrium, one could treat time-varying
reconstruction code. Other parameters for this discharge plasma equilibria by pre-calculating a set of equilibria based
(TCV#41752) are Ip = 240 kA, κ = 1.5, δ = 0.4. on the planned discharge parameters.
An outlook on how the present system could be extended
during the shot. This example illustrates that an accurate and implemented on ITER and other tokamaks is given in
reconstruction of Te is crucial for accurate estimation of Zeff section 7.
using this method. The noise in the confinement data can be
explained as coming directly from the DMPX diagnostic which 6. Handling model-reality mismatch
is used in the determination of Te , where the high-frequency
oscillations are largely result from sawteeth. Since the flux In the description of the physics model in section 3 and in the
profile evolution evolves at a slower time scale, the simulation TCV implementation discussed so far, we assumed that the
12
Nucl. Fusion 51 (2011) 083052 F. Felici et al
model was perfect in the sense that it perfectly reproduces is that in the first case one directly corrects the estimate of the
the physical evolution of the flux profile. In this section state, while in the second case one corrects the parameters of
we will discuss, in a rather general way, how the inevitable the model generating the state estimate. We already mentioned
model-reality mismatch can be treated. We will point out the in section 5 the particular case of adapting the effective charge
possible uses of redundant diagnostic signals to pinpoint and Zeff by comparing the Vloop measurement with the simulated
correct errors of different origin, and will lay out three possible value. Of course the above methodology assumes that all of
approaches. A discrepancy between measured and simulated the other model parameters and measurements are correct.
quantities (residual) may roughly be categorized as due to an In practice, errors in, for example, the reconstruction of Te
erroneous initial condition, to an incorrect choice of physics would perturb our estimate of Zeff . A more complete approach
parameters, or due to unmodelled processes or disturbances. would attempt to make consistent estimations of all quantities,
In the design of a more advanced real-time simulation, the including measurement and parametric uncertainties. Also,
choice must be made as to how to link each type of residual adding further redundant measurements clearly increases
to a source of error. This is a design choice which varies the number of parameters which can be constrained and
depending on the available measurements and the degree of improves the quality of the reconstructions. Full analysis and
confidence placed on each part of the physics model. One development of this approach is beyond the scope of this paper
possibility which has already been implemented as described in and is left as future work.
section 5 is to use redundant measurements to adapt uncertain
physics parameters: in this case Vloop was used to adapt Zeff . 6.3. Disturbance estimation and fault detection
This section will generalize this idea as well as discussing
alternatives. Finally, we discuss a third option for classifying a mismatch
between measurements and simulations, that of a disturbance
6.1. Closed loop observer or fault. In the case of a disturbance, some unexpected or
unmodelled effect causes the simulations and measurements to
As was mentioned in the introduction, the real-time diverge. By assuming a particular structure for the disturbance,
simulations in this paper are known in control systems theory as its magnitude and distribution can be computed from the
dynamic state observers. Just as our simulations, they evolve residual error. Similarly, one can construct a typical signature
the dynamic equations of the system. The standard way to of the residual which would arise from faults in a particular
handle measurements in the framework of state observers is to actuator or diagnostic. Correlating the occurring errors with
add a term to the equations which feeds back the error between the signature of each possible fault can aid in model-based
measured system outputs and predicted system outputs with diagnosis of problems in real-time. This field of model-based
an observer gain. This observer gain is chosen such that the fault detection and identification (FDI) has been little explored
observer error (the difference between true and observer state) for tokamaks so far but may be of great interest for the future.
converges to zero following a specified dynamics dictated by We conclude this section by mentioning that the three
the characteristics of the system and the observer gain. Our approaches mentioned above can be treated in a unified
case, where no internal measurements for the flux profile are manner by e.g. the extended Kalman filter method, where
available, is equivalent to using an open-loop observer, i.e. both the system states and parameters are estimated [31].
choosing zero observer gain. Since the system is stable (from This has recently been proposed [32] for estimating transport
the diffusive nature of the equations), the observer error will parameters. The full development of an adaptive, closed-
decay to zero asymptotically by the same stable dynamics that loop state observer including disturbance rejection and fault
governs the overall profile evolution. This property is known detection would be a very interesting avenue for research.
in the literature as asymptotic observability [29, chapter 6,7].
If internal measurements of some function of ψ were
available, we could construct a closed-loop observer by adding 7. Real-time simulation on ITER and other
an observer error feedback term to the flux diffusion equation tokamaks
chosen such that the observer error decays on some fast time
scale, faster than the diffusion time of the system. Using a Before concluding this paper, we provide an outlook on the
closed-loop observer allows us, in theory, to reduce the effects possible future application of real-time simulations on ITER
of measurement noise and imperfect initial condition. This and other (existing and future) tokamaks. ITER will certainly
approach is natural when modeling errors are assumed to be have a real-time Grad–Shafranov equilibrium solver, allowing
small: the observer can then effectively filter out measurement a real-time update of the flux surface geometry based on
noise. State observers for PDEs are extensively treated in [30] magnetic measurements, without having to choose a fixed
which may be used as a starting point for further work in this equilibrium. The reconstructed current density profile can also
direction. be fed back into the real-time equilibrium code, providing a
better profile than can be obtained from a purely diagnostics-
based approach, not being limited by diagnostic spatial or
6.2. Adaptation of model parameters
temporal resolution. Additionally, any available real-time
If high-quality, trustworthy measurements are available, but internal current density profile measurements such as MSE
the parameters in the physics model are less well known, it or polarimetry should be included in a closed-loop observer as
may be appropriate to adapt the model parameters in order outlined in section 6.1, rather than fed directly to a q profile
to reduce the residual error. The key difference between the feedback controller. When the density profile is available, real-
closed-loop observer and the parameter adaptation approach time ray tracing would give the ECCD distribution providing
13
Nucl. Fusion 51 (2011) 083052 F. Felici et al
better current drive modeling. Self-consistent modeling of internal current density distribution, parallel electric field and
other heating sources such as NBI could also be included. many more, and yields reconstructions with higher accuracy,
While the combination of the above features would require temporal and spatial resolution than can be obtained from
significant computational effort, one should note that they diagnostic measurements alone. We have discussed multiple
can each be performed separately on different, dedicated applications of such an implementation, ranging from feedback
computers, and require only exchange of the final results. control, estimation and monitoring of physics parameters
As such, we foresee no technical obstacles to deploying this of an ongoing tokamak discharge, disruption avoidance and
technique to ITER. predictive control.
The feasibility of the proof-of-principle implementation The simulation is based on the numerical solution of a PDE
on TCV, with its relatively short time scales, shows that describing the radial diffusion of poloidal flux, employing real-
today’s large tokamaks could certainly use this approach. Real- time kinetic profile measurements to calculate the conductivity
time equilibrium reconstructions codes (e.g. RT-EFIT [33] or and bootstrap current and using the plasma current as a
EQUINOX [34]) exist and most tokamaks have multiple real- boundary condition. In this initial implementation, the
time diagnostics available [35, 36]. The extra computational underlying 2D Grad–Shafranov equilibrium does not evolve
effort required to include time-varying flux surface shapes is during the simulation. This assumption only has a small effect
non-negligible, but will be offset by the longer time scales as long as the actual equilibrium does not deviate too far from
of larger devices, making the implementation viable. For any the chosen reference equilibrium.
tokamak, the accuracy of the real-time simulations will largely The real-time simulations use a new finite-element code
depend on the quality and resolution of the available kinetic called RAPTOR (RApid Plasma Transport simulatOR) which
profile measurements and their availability in real-time, which is embedded in the real-time control system of the TCV
is a crucial condition for the method to be applicable. tokamak and uses real-time estimates of the kinetic profiles
In the introduction, we mentioned that the real-time Te and ne provided indirectly by a nonlinear mapping of data
simulation paradigm is applicable, in principle, to any profile from several diagnostics. The first experiments have shown
including kinetic (Te , ne , . . .) profiles, and would hold similar very good agreement of the quantities reconstructed in real-
advantages as for the current density profile. However, kinetic time by RT-RAPTOR with those from post-shot calculations,
profiles are more difficult to simulate in real-time, partly the latter computed with the Grad–Shafranov equilibrium code
because they evolve more rapidly but especially because first- LIUQE and interpretative transport simulations using ASTRA.
principle models are not yet sufficiently developed to allow For a shot with varying plasma current, the inward diffusion of
accurate and rapid simulation. Ad hoc models could be used the current density distribution, and evolution of the q profile
in these cases, similar to those used in [37], for example. are well reproduced. It has also been shown that during a shot
These models would have to be tuned depending on the plasma with increasing auxiliary power, the confinement properties
such as confinement time and H factor can be calculated. This
scenario, but given the experience operating today’s tokamaks,
shows that the real-time simulation is capable of producing,
reasonable results can be expected. Fortunately, high-quality
even assuming a fixed equilibrium, the evolution of the internal
diagnostic measurements of kinetic profile quantities are often
current density profile with similar quality as is obtained from
available, so a real-time simulation would be able to rely more
off-line analysis. It is found that a correct estimate of the
heavily on the diagnostics and less on the model than would
electron temperature profile is essential due to the sensitivity
be the case for the current density profile. Although the TCV
of the poloidal flux transport to this quantity, and a high-quality
energy confinement times (∼1 ms) probably preclude kinetic
diagnostic measuring this profile is beneficial.
profile simulation on TCV with the present architecture, the
In this new paradigm, physics-based real-time simulation
time scales involved on today’s large tokamaks, and even more
and real-time diagnostics work in synergy, with the diagnostics
so on ITER, would probably be sufficiently long for kinetic
providing crucial data and constraints to the simulation
profile simulations. Further research and better understanding
and the simulation providing the basis for real-time
of kinetic profile transport could also yield more tractable,
validation of the diagnostic’s measurements. More real-time
accurate and general models. diagnostic measurements would improve the accuracy of the
Finally, real-time prediction and model-predictive control, reconstructed profiles, as well as further constrain some of
as mentioned in section 2, requires faster-than-real-time the unknown or uncertain physics parameters governing the
predictive simulation capabilities, which may be beyond poloidal flux transport. Synergy with real-time equilibrium
today’s computing power for small tokamaks and may be at reconstruction codes is also fruitful: the toroidal current density
the limit of the capabilities for existing tokamaks. However estimate can be fed back to the Grad–Shafranov code. This
for the ITER time scales this will most likely be possible, current density will have a higher spatial accuracy than can
especially when relying on ad hoc models as mentioned above be obtained from a discrete set of internal measurements and
and when simplifying the dynamical model, for example by the internal profile description will not be limited to the space
local linearization. spanned by a small number of basis functions. Linking the 2D
flux map with the 1D profiles in this way yields a complete and
8. Conclusions self-consistent picture of the plasma state. In this sense, the
approach we put forward ideally complements existing tools
In this paper we have presented a first implementation of a real- and methods, unifying available measurements with known
time simulation of the diffusion of poloidal flux in a tokamak physics.
plasma. This allows full reconstruction of the plasma state In summary, this paper offers a new framework for real-
including quantities otherwise difficult to measure, such as the time estimation of tokamak current density profiles for control
14
Nucl. Fusion 51 (2011) 083052 F. Felici et al
applications. Full knowledge of the plasma state obtained this Substituting this into (A.1)
way could now be exploited on existing experiments to improve
nsp
nsp
dŷα (t) ∂ ∂
α (ρ)
the reliability, repeatability, performance, and safety of present m
α (ρ) = ŷα (t) g + kj,
and future devices. The presented approach is fully general and α=1
dt α=1
∂ρ ∂ρ
could readily be deployed on other tokamaks provided a given (A.6)
set of real-time capabilities are available. where we have dropped the (ρ, t) dependences for notational
simplicity, we can construct the weak form by projecting the
Appendix A. Numerical implementation equation for each α onto a trial function
β and integrating
over the domain
This appendix will treat some details of the numerical imple- nsp
dŷα (t) ρe
mentation, including the spatial and temporal discretization of m
β
α dρ
dt 0
the poloidal flux diffusion equation as well as some measures α=1
which have been taken to render the problem computationally nsp ρe
∂ ∂
α
efficient for real-time applications. Appendix A.1 will treat = ŷα (t) dρ
β g
α=1 0 ∂ρ ∂ρ
the spatial discretization of the PDE using finite elements, ap- ρe
pendix A.2 will briefly show the time discretization employed. + dρ
β k(ρ)j, (A.7)
Appendix A.3 will show some details of how the numerical 0
integration necessary for the real-time computations is treated
nsp ρe
dŷα (t)
using Gaussian quadrature. Finally appendix A.4 will show an m
β
α dρ
dt
example of how output quantities such as the rotational trans- α=1 0
form can be calculated efficiently based on knowledge of the Mβα (t)
(for which a vast literature exists, e.g. [38]). An important Mβα = −Dβα yˆα + lβ + sβ , (A.10)
α=1
dt α=1
advantage of using finite element methods is that the basis
functions can easily be modified, and also that the order of which can be written in the matrix form as
spatial derivatives of the elements involved are, as we shall
dŷ
see, one order lower than the order of the PDE. M = −D ŷ + l + s, (A.11)
First, approximate the solution by dt
where M ∈ Rnsp ×nsp , D ∈ Rnsp ×nsp , l ∈ Rnsp , s ∈ Rnsp and
nsp
ŷ ∈ Rnsp As a consequence of the finite support of the basis
y(ρ, t) ≈ ŷα (t)
α (ρ). (A.2)
functions, the matrices have limited bandwidth. Furthermore,
α=1
the finite-element basis functions
α and
β are usually
We choose polynomial B-splines [39] on a finite support as chosen such that
α =
β ∀ α = β, in which case the
finite elements
α . Choosing a set of (possibly irregularly matrices become symmetric.
spaced) knots 0 = x1 < · · · < xN = ρe the basis functions are We now write the weak form of the poloidal flux transport
defined recursively as equation (7). By inspection, we see that we can cast (7) into
the form (A.1) by choosing
pα = wα−1
α−1 + (1 − wαp )
p−1
α , (A.4)
ρ − xα g(ρ) = G2 /J, (A.13)
wαp = . (A.5)
xα+p − xα k(ρ) = −V µ0 /2π J R0 , 2
(A.14)
We obtain non-periodic splines by defining additional knots j (ρ, t) = jBS + jaux . (A.15)
on the domain boundary: x−p+1 = · · · = x1 and xN +p =
xN +p−1 = · · · = xN . For a given spline order and set of knots The flux profile is written as a sum of finite elements:
we can construct nsp = p + N − 1 unique splines. Note that
nsp
p
as a result of the finite support of the elements,
α (ρ) = 0 if ψ(ρ, t) ≈ ψ̂α (t)
α (ρ) (A.16)
and only if xα−p < ρ < xα+1 . α=1
15
Nucl. Fusion 51 (2011) 083052 F. Felici et al
Then the weak form is written in the matrix form as This linear system is to be solved for each time step yielding
an update ψ̂ k+1 . Note that the elements Mψ,k and sψ,k of
dψ̂ this linear system are all calculated based on the current
Mψ = −Dψ ψ̂ + lψ + rψ , (A.17)
dt time step, k, avoiding the need to iterate: a step forward
where the elements of the matrices are in time to step k + 1 is made based only on information
available at time step k. Experience suggests that when
σ µ0 the time step is taken sufficiently small with respect to the
[Mψ ]βα = 2R
ρ
β
α dρ, (A.18)
ρ J 0 characteristic time scales of the equations, errors introduced
by the approximations (A.24)–(A.27) are acceptable. In our
G2 ∂
β ∂
α case, a time step of 1 ms was found adequate. Each time step
[Dψ ]βα = dρ, (A.19)
ρ J ∂ρ ∂ρ requires the solution of the linear system (A.28), the left-hand
side of which contains a banded, positive definite, symmetric
−V µ0
[rψ ]β = 2
j (ρ, t)
β dρ (A.20) matrix such that the problem can be efficiently solved by LDLT
ρ 2πJ R0 (Cholesky) decomposition [40]. In the next subsection we turn
and for the boundary term to the problem of how to efficiently calculate the terms Mψ,k ,
Dψ and sψ,k .
G2 ∂ψ G2 ∂ψ
[lψ ]β =
β −
β (A.21)
J ∂ρ ρe J ∂ρ 0 A.3. Numerical integration using Legendre–Gauss
The second term on the right-hand side is zero since G2 (0) = 0. quadrature
The first term of the right-hand side of this expression depends The integrals (A.18), (A.19) and (A.20) are evaluated
on the chosen boundary condition at the edge. If we choose numerically using Gaussian quadrature [41]. Note that due
to fix the boundary flux derivative via the total current to the finite support of the basis functions the terms are
∂ψ/∂ρ|ρe = µ0 Ip /G2 , we obtain (recalling J = 1 at the edge) identically zero except pairs of indices α, β satisfying α − p
[lψ ]β = µ0 Ip
β |ρe which is nonzero only for the last basis β α + 1 where p is the order of the spline. For this
β = nsp . Note that the boundary condition at ρ = 0 is not set of combinations of α, β, the integrals can be computed
explicitly imposed, but will appear as a natural solution of the efficiently using Gaussian quadrature. On the ith interval
physical problem. We can collect the vectors on the right-hand [xi , xi+1 ] between two knots, define the set of ng Gauss points
side of (A.17) writing sψ = ζ Ip + rψ where ζ is a vector of g
xi,j for j = [1, 2, . . . , ng ], then define the function z(x) =
zeros except for the last element which is µ0 . Then (A.17) (2x−xi+1 −xi )/(xi+1 −xi ) which linearly maps the interval x ∈
becomes [xi , xi+1 ] to z ∈ [−1, 1], now the j th Gauss point is the point
dψ̂ g
Mψ = −Dψ ψ̂ + sψ , (A.22) for which z(xi,j ) is the j th zero of the normalized Legendre
dt polynomial of order ng . The corresponding set of weights wi,j
g
where the source term in the flux diffusion equation can are given by wi,j = 2(1 − z(xi,j ) ) [Lng (z(xi,j ))]−2 where
g g 2 −1 g
therefore be considered as a sum of the effect of injected
Lng is the derivative of that same Legendre polynomial. Then
(auxiliary and bootstrap) current density and a boundary source
we can approximate the integral
depending on Ip .
xi+1
ng
g g
A.2. Time discretization f (x) dx ≈ wi,j f (xi,j ). (A.29)
xi j =1
To discretize the continuous-time equation (A.22), we start
by choosing a time grid t = [t0 , . . . , tk , . . . , tM ]. We write a Now one can approximate, for example, integral (A.18) as
general Crank–Nicholson-type discretization scheme follows:
ψ̂ k+1 − ψ̂ k m(ρ, t)
α (ρ)
β (ρ)dρ
Mψ (tk+ 1 ) = −Dψ (tk+ 1 )(θ ψ̂ k+1 + (1 − θ )ψ̂ k ) ρ
2 t 2
+ sψ (tk+ 1 ), (A.23)
imax
ng
g g g g
2 ≈ wi,j
α (xi,j )
β (xi,j )m(xi,j , t). (A.30)
which is second-order accurate. For practical reasons, we i=imin j =1
approximate the terms above such as to obtain a stable Here imin and imax are the indices of the intervals delimiting the
numerical scheme requiring no iterations, at the expense of domain where
α > 0. Using ng points exactly integrates up
being less accurate. This is achieved by choosing to polynomial order 2ng − 1, thus choosing ng = 4 provides
Mψ (tk+ 1 ) ≈ Mψ (tk ) = Mψ,k , (A.24) exact integration of the products of up to order 7 (Note that
2
sψ (tk+ 1 ) ≈ sψ (tk ) = sψ,k , (A.25) the integrands include a product of two cubic spines which
2
gives order 6). Thus one needs to evaluate radial quantities
Dψ (tk+ 1 ) = Dψ (tk ) = Dψ (time-independent), (A.26)
2 on Nng radial points. Separating the time-varying part of
θ = 1. (A.27) m(ρ, t) = m̃(ρ)σ (ρ, t) where m̃(ρ) = (µ0 ρ/(J (ρ)2 R0 ))
This gives the following difference equation, implicit in time: we can write each element of Mψ,k as an inner product
(Mψ,k + t Dψ )ψ̂ k+1 = (Mψ,k )ψ̂ k + t sψ,k (A.28) [Mψ (tk )]βα ≈ ξTα,β σ̄ α (t), (A.31)
16
Nucl. Fusion 51 (2011) 083052 F. Felici et al
17
Nucl. Fusion 51 (2011) 083052 F. Felici et al
Figure B.1. Schematic representation of the training phase of the ‘TENEX’ algorithm for determining estimates of Te and ne profiles from
DMPX soft-x ray and FIR interferometer diagnostics. The basis function coefficients for the Te /Te0 and ne profile are the output of a neural
network, trained on data from previous shots.
We first build a database of several shots spanning a ∀j ∈ [1, . . . , np ] (time points in the database). We now
range of different heating conditions but similar shape. In attempt
to find the nonlinear mapping N : R2nbas → R2nbas such
practice, about 15 shots, corresponding to approximately 300 that j dout (tj )− N (din (tj ))2 is minimized. For N we use a
2
time points, were found sufficient as long as the heating neural network which is trained on the available data set using
conditions were sufficiently diverse. We collect both the post- standard techniques [42] such as the Levenberg–Marquardt
shot processed and fitted Thomson profiles for Te (ρ) and ne (ρ) optimization algorithm, separating the data set into training,
every 20 ms, and the (lowpass filtered) raw data from all DMPX validation and test samples with suitable stopping criteria
and FIR channels corresponding to the same time points. The based on the validation set to avoid over-fitting. Once the
data are collected into matrices, the columns of which contain neural-network parameters have been optimized the network
data for each time point, for example can be used to map a fresh input set of real-time DMPX
and FIR measurements to estimated profiles of ne (ρ) and
MFIR = [mFIR (t1 ), . . . , mFIR (tP )] ∈ Rnd ×nP , (B.1)
T̃e (ρ) = Te (ρ)/Te0 profile. The overall method is illustrated
where nP represents the total number of time points available schematically in figure B.1.
in the database, nd is the number of diagnostic channels and
mFIR (t1 ) is the vector of acquired FIR values (one data point
for each chord) at the time t1 . Similarly we construct matrices Acknowledgments
MDMPX , Mne and MT̃e .
To reduce the dimensionality of the problem, the data are We gratefully acknowledge discussions with Drs S. Brunner,
parametrized by writing each data vector as a sum of basis T.-M. Tran and J.B. Lister, and thank the referees for providing
functions useful suggestions for improving the original manuscript. This
nbas work is supported in part by the Swiss National Science
m(tj ) = bi di (tj ). (B.2) Foundation.
i=1
The basis functions are determined as the minimum least- © Euratom 2011.
squares error fit to the data by computing the singular value
decomposition of each matrix and retaining the dominant nbas
References
vectors spanning the matrix column space. Typical values
for nbas are 3 or 4 and this number may be different for [1] Svensson J. et al 2008 Plasma Phys. Control. Fusion
each diagnostic. Thus, each matrix can be approximated as 50 085002
M ≈ BD , where B ∈ Rnd ×nbas is a matrix containing the [2] Pereverzev G.V. et al 2002 ASTRA automated system for
first nbas orthogonal singular vectors and D ∈ Rnbas ×nP is the transport analysis in a tokamak Technical Report 5/98 IPP
Report
matrix of basis function coefficients. Now for each data vector
[3] Artaud J. et al 2010 Nucl. Fusion 50 043001
m(tj ) the corresponding basis function coefficients are given [4] Hawryluk R.J. 1980 Physics of Plasmas Close to
by d(tj ) = B + m(tj ) where B + = (B T B )−1 B T denotes the Thermonuclear Conditions vol 1, ed B. Coppi p 19
pseudo-inverse of B . This procedure gives us a set of input [5] Budny R. et al 1992 Nucl. Fusion 32 429
and output vectors [6] Genacchi G. et al 1988 JETTO: a free boundary plasma
transport code RT/TIB 5 ENEA
dFIR (tj ) [7] Crotinger J. et al 1997 Technical Report UCRL-ID-126284
din (tj ) = ∈ R2nbas ,
dDMPX (tj ) LLNL
[8] Witrant E. et al 2007 Plasma Phys. Control. Fusion 49 1075
dne (tj )
dout (tj ) = ∈ R2nbas . (B.3) [9] Hofmann F. et al 1994 Plasma Phys. Control. Fusion 36 B277
dTe (tj ) [10] Hinton F.L. et al 1976 Rev. Mod. Phys. 48 239
18
Nucl. Fusion 51 (2011) 083052 F. Felici et al
[11] Paley J. et al 2010 17th IEEE-NPSS Real Time Conf. (RT) [27] Rebut P. et al 1989 Proc. 12th Int. Conf. on Plasma Physics
(Lisbon, Portugal) pp 1–6 and Controlled Nuclear Fusion Research 1988 (Nice, 1988)
(doi:10.1109/RTC.2010.5750487) vol 2 (Vienna: IAEA) p 191
[12] Moreau D. et al 2008 Nucl. Fusion 48 106001 [28] Coda S. et al 2000 Plasma Phys. Control. Fusion 42 B311
[13] Porcelli F. et al 1996 Plasma Phys. Control. Fusion 38 2163 [29] Sontag E.D. 1998 Mathematical Control Theory (Texts in
[14] Sauter O. et al 1999 Proc. Joint Varenna–Lausanne Int. Applied Mathematics vol 6) 2nd edn (New York: Springer)
Workshop on Theory of Fusion Plasmas Varenna (Italy, [30] Smyshlyaev A. et al 2010 Adaptive Control of Parabolic PDEs
31 August–4 September 1998) vol ISPP-18 pp 403–8 (Princeton, NJ: Princeton Univeristy Press)
http://infoscience.epfl.ch/record/123899 [31] Anderson B. et al 1979 Optimal Filtering (Mineola, NY:
[15] Sauter O. et al 2002 Plasma Phys. Control. Fusion 44 1999 Dover)
[16] Ou Y. et al 2007 Fusion Eng. Des. 82 1153 [32] Xu C. et al 2010 IEEE Trans. Plasma Sci. 38 359
[17] Ou Y. et al 2008 Plasma Phys. Control. Fusion 50 115001 [33] Ferron J. et al 1998 Nucl. Fusion 38 1055
[18] Lutjens H. et al 1996 Comput. Phys. Commun. 97 219 [34] Blum J. et al 2008 J. Phys.: Conf. Ser. 135 012019
[19] Sauter O. et al 1999 Phys. Plasmas 6 2834 [35] Felton R. et al 2005 Fusion Eng. Des. 74 561
[20] Sauter O. et al 2002 Phys. Plasmas 9 5140 [36] Barana O. et al 2007 Fusion Eng. Des. 82 1023
[21] Prater R. 2004 Phys. Plasmas 11 2349 [37] Albajar F. et al 2005 Nucl. Fusion 45 642
[22] Wesson J. 2004 Tokamaks (International Series of [38] Hughes T.J.R. 1987 The Finite Element Method (Englewood
Monographs on Physics vol 118) 3rd edn (New York: Cliffs, NJ: Prentice-Hall)
Oxford Science) ISBN 0-19-8509227 [39] de Boor C. 2001 A Practical Guide to Splines (Applied
[23] Barry S. 1999 The extension of the FIR interferometer of TCV Mathematical Science vol 27) (New York: Springer)
to a polarimeter and measurements of the Faraday rotation [40] Golub G.H. et al 1996 Matrix Computations (London: The
caused by the poloidal magnetic field PhD Thesis National Johns Hopkins University Press) ISBN: 0-8018-5413-X
University of Ireland, Cork [41] Press W.H. et al 1996 Numerical Recipes 2nd edn (New York:
[24] Sushkov A. et al 2008 Rev. Sci. Instrum. 79 023506 Cambridge University Press)
[25] Lister J. et al 1997 Fusion Technol. 32 321 [42] Haykin S. 1999 Neural Networks: A Comprehensive
[26] Hofmann F. et al 1988 Nucl. Fusion 28 1871 Foundation 2nd edn (Upper Saddle River, NJ: Prentice-Hall)
19