Diagnostic weight functions in constants-of-motion phase-space

The fast-ion phase-space distribution function in axisymmetric tokamak plasmas is completely described by the three constants of motion: energy, magnetic moment and toroidal canonical angular momentum. In this work, the observable regions of constants-of-motion phase-space, given a diagnostic setup, are identified and explained using projected velocities of the fast ions along the diagnostic lines-of-sight as a proxy for several fast-ion diagnostics, such as fast-ion Dα spectroscopy, collective Thomson scattering, neutron emission spectroscopy and gamma-ray spectroscopy. The observable region in constants-of-motion space is given by a position condition and a velocity condition, and the diagnostic sensitivity is given by a gyro-orbit and a drift-orbit weighting. As a practical example, 3D orbit weight functions quantifying the diagnostic sensitivity to each point in phase-space are computed and investigated for the future COMPASS-Upgrade and MAST-Upgrade tokamaks.


Introduction
In experimental and proposed power plant fusion plasmas, the hydrogen isotopes, deuterium and tritium, fuse to create a neutron and an alpha particle.The alpha particle is much more energetic than the bulk plasma and is therefore termed a fast ion.The confinement of alpha particles, or more generally of fast ions, is essential, as they sustain the high temperature in the fusion plasma in future burning plasmas.The fast ions can experience large transport away from the plasma core [1][2][3][4][5][6], but they can also themselves drive plasma instabilities, deteriorating plasma confinement [7][8][9][10][11][12].Therefore, it is vital to understand the distribution of the fast ions in order to understand their behavior.Fast ions not only originate as fusion products, they are also used in diagnostics and heating by neutral beam injection (NBI), or accelerated in the plasma by electromagnetic waves in ion cyclotron range of frequencies.An NBI injects neutral particles into the plasma at high energy, and when these neutral particles ionize in the plasma, they become fast ions.
Averaging over the fast gyration of the fast ions around the magnetic field lines introduces the notion of a guiding center, which follows distinct trajectories called drift orbits or guiding-center orbits.In axisymmetric tokamaks, the guidingcenter orbits are closed in a poloidal projection of the plasma.From here on, orbit will refer to the guiding-center orbit, unless otherwise stated, whereas we will be explicit in mentioning when the full orbit, including the gyro motion, is considered.
Most thermal ions in axisymmetric tokamak plasmas follow co-passing, counter-passing or trapped orbits.For fast ions, co-and counter-stagnation orbits and potato orbits are common, too, since they have much larger curvature or ∇B drifts than thermal ions.For a detailed explanation of the different orbit types, see e.g.[13].These orbits are uniquely determined by three coordinates plus a binary index, where the coordinates are the three constants of motion in a tokamak.These constants of motion are the kinetic energy E, the magnetic moment µ and the toroidal canonical angular momentum P ϕ .The magnetic moment is an adiabatic invariant and only becomes a constant of motion in the guiding center approximation, which is adopted in this work.The binary index is needed to distinguish co-and counter-passing orbits with the same triplet of constants of motion in a subset of phase-space due to an ambiguity in the sign of the velocity of the fast ions along the magnetic field lines.The constants of motion are essential for stability calculations and are explained along with the orbit topology in sections 2 and 3.
In addition to the constants of motion, the orbit topology can be fully determined by a different triplet of variables (E, p m , R m ), called orbit variables.These are the kinetic energy E, the maximum major radius of the orbit R m and the pitch at the maximum radial position p m [43].These orbit variables are convenient for reconstructing the fast-ion phase-space distribution function.Using the orbit variables, the fast-ion phasespace distribution function was reconstructed right before and after a sawtooth crash in ASDEX-Upgrade, and it was clearly seen how the crash expelled fast ions from the plasma core [44].To accomplish this inference, generalized, orbit-based, fast-ion diagnostic weight functions were first described in [45], expressed in terms of the orbit variables (E, p m , R m ) [46,47].Weight functions in constants-of-motion phase-space have also previously been numerically calculated for FIDA diagnostics in the DIII-D tokamak [48].Here, we explain the shape of weight functions for different projected velocities, different angles between the diagnostic line-of-sight (LOS) and the magnetic field, and at different locations of the measurement volume inside the plasma.
An advantage of the constants-of-motion phase-space is that we have direct analytical access to the orbit topology, and the observable regions of phase-space given a diagnostic setup.This allows an understanding of the mapping of the observable regions between position-space, velocityspace and phase-space.In addition to this, it is well established that fast-ion induced instabilities can occur when welldefined surfaces in constants-of-motion phase-space, called Kolmogorov-Arnold-Moser (KAM) surfaces, are destroyed [8], i.e. the orbits turn chaotic.Therefore, an investigation of where in this space and to which degree a diagnostic is sensitive is desirable.
The remainder of this paper is organized as follows.In section 2, we review the orbit topology in the constantsof-motion space, since the understanding of the topological boundaries is crucial when studying the orbit sensitivity and tomography.In section 3, we provide analytical expressions for the observable orbits given a diagnostic setup, and thus we investigate the observable regions of phase-space and the relation to position-and velocity-space.This leads us into the study of weight functions in three-dimensional phasespace, which are calculated and investigated in section 4. The weight functions are calculated for both the future COMPASS-Upgrade tokamak and the MAST-Upgrade tokamak as a proxy for FIDA diagnostics in section 5. We conclude and discuss possible future work in section 6.

Orbit topology
In this section, we briefly review the topology of fastion orbits in axisymmetric tokamaks in constants-of-motion phase-space.This topology is central to the content of this paper, as the observable regions and the weight functions are related to this topology.The following discussion follows [49,50] and the section on orbit classification in [51], but is included here for completeness.Throughout the paper, the assumed ion species is deuterium.
As explained in the introduction, the guiding-center motion of the fast ions can be completely described by the three constants of motion assuming ideal axisymmetry of the tokamak, i.e. the energy E, the magnetic moment µ and the toroidal canonical angular momentum P ϕ .The latter, expressed in cylindrical coordinates (R, ϕ, z), with ϕ going counter-clockwise seen from the top, is given by where, using v ϕ /v ∥ = B ϕ /B the three constants of motion in guiding-center coordinates are given by [8,13,52] where m is the mass of the fast ion, q is the electric charge, B is the magnitude of the magnetic field, R is the major radius coordinate of the fast ion, v is the speed of the fast ion, v ∥ is the velocity component parallel to the magnetic field and v ⊥ is the velocity component perpendicular to the magnetic field, and Ψ p is the poloidal magnetic flux per radian, given by We take a positive parallel velocity to be in the direction of the plasma current.Throughout the paper, we adopt the small gyroradius approximation, such that if the guiding-center goes through a measurement volume, we assume that the gyro orbit is observable as well.Therefore, v ∥ and v ⊥ , calculated along the full-orbit trajectory, are given by equations ( 3) and ( 4).Thus, the radial position of the ion is the guiding-center position.
The orbits are classified by whether they are trapped or passing, whether they are confined or lost, and whether they encircle the magnetic axis or not.We will need to know where in phase-space an orbit touches the inner and outer wall in the midplane, where an orbit intersects the magnetic axis in the plasma, and where the boundary between passing and trapped orbits is located.Writing the kinetic energy in terms of the magnetic moment and the toroidal canonical angular momentum, we have We choose the normal vector to calculate the poloidal flux such that the poloidal magnetic flux is taken to be zero at the magnetic axis and then decreases towards its minimum value Ψ p,w at the wall, such that Ψ p,w < Ψ p < 0. With this convention, the plus sign in front of the poloidal magnetic flux term in equation ( 4) is retained, consistent with the fact that trapped orbits travel in the co-current direction on the outer leg of its trajectory.This defines an alternative coordinate instead of the minor radius.The poloidal angle θ is defined such that the maximum magnetic field B hf , which is at the inner wall on the high-field side in the midplane, occurs at the coordinate pair Ψ p = Ψ p,w and θ = π, whereas the minimum magnetic field B lf , at the outer wall on the low-field side in the midplane, occurs at Ψ p = Ψ p,w and θ = 0.The poloidal angle increases in the counter-clockwise direction in the poloidal plane when looking along the positive ϕ-direction.The magnetic field and the poloidal magnetic flux are functions of space (time is not considered in this work).
As is evident from (6), the three constants of motion are not all mutually independent for a particle at a given position.Knowing two of them enables the calculation of the third, if we know the magnetic equilibrium and the particle (R, z) position.Not all points in phase-space are thus realizable by fast ions.For an ion with a fixed energy, it cannot have any combination of magnetic moment and toroidal canonical angular momentum in the given equilibrium.It must obey (6) for the given equilibrium and possible positions.Therefore, we start by identifying the valid region of phase-space.We will discuss how these valid regions restrict the observable phase-space of diagnostics in section 3.For a fixed energy E, we find the maximum possible µ for each P ϕ that an ion can have somewhere in the poloidal plane (R, z) of the tokamak plasma, i.e. an envelope function.This defines the top blue line in figure 1.
In figure 1(b) there is an extra blue line, since for very high ion energies, there is also a minimum possible µ for each P ϕ that an ion can have somewhere in the plasma.All components of figure 1 will be explained in the current section.Only the region below the blue line corresponds to realizable fastion orbits, which will now be classified.Thus, only ions with values of µ and P ϕ in the region below the blue line can be observed with any diagnostic, as we will see in the following sections.
For a given point A located at (R A , z A ) in the poloidal plane in cylindrical coordinates, the magnetic field and the poloidal magnetic flux are known.If they are B A , B ϕ,A and Ψ p,A , we get from (6), Thus, in a plane with constant energy in the 3D constantsof-motion phase-space, the curve µ = µ(P ϕ ) defines a parabola opening downward, which is the locus of all orbits going through point A, as also remarked previously in [53].This is an important point, which we will rely on several times in later sections, as this defines the maximum possible observable part of phase-space of a diagnostic observing a single (R, z)point.Later, these will be referred to as position-space parabolas.There is a subtle point regarding the right and left legs of each parabola.By plotting the curve P ϕ (µ) instead of µ(P ϕ ), i.e. effectively tilting figure 1 90 degrees, we get upward and downward going square-root curves depending on the sign of v ∥ , which can be found by combining equations ( 4) and (7), as can also be seen from equation (10) below.Thus countergoing orbits lie on the left leg of each parabola in figure 1 and co-going orbits lie on the right leg of each parabola.This is important information in order to distinguish whether a diagnostic is sensitive to co-or counter-passing orbits.Because, as is also reviewed below, some specific (P ϕ , µ, E)-triplets correspond to both co-and counter-passing orbits.
The three spatial locations that turn out to encapsulate the possible orbits in phase-space are in the midplane: at the inner wall of the tokamak, the outer wall and the magnetic axis, respectively.The corresponding parabolas are found by inserting the local major radius coordinate, magnetic field and flux in (7).These are shown in figure 1 at energies E = 95 keV and The equilibrium used is a test equilibrium from the COMPASS-Upgrade tokamak.Note how the stagnation and potato regions grow with increasing energy, and how the degenerate passing region disappears for appropriately large energies, as in the E = 1 MeV case.'C' ('L') denotes confined (lost) orbits, 'P' ('T') denotes passing (trapped) orbits, and ± denotes whether the orbit is co-or counter-going with respect to the plasma current.E = 1 MeV for a magnetic equilibrium in COMPASS-Upgrade calculated by the FIESTA code [54].The 1 MeV case is shown for visualization purposes to highlight the fact that the potato and stagnation regions grow with higher energies, and that the degenerate passing region can disappear altogether.This is explained further below.The small dashed line parabola on the left is the locus of all orbits with their trajectory striking the inner wall in the midplane.The large full line parabola on the left, whose left leg coincides with the blue line, is the locus of all orbits with their trajectory striking the outer wall in the midplane.The orbits with trajectories that hit the wall are lost.The parabola on the right, whose right leg lies just inside the blue envelope line, is the locus of all orbits with their trajectory going through the magnetic axis.Now, all points in the midplane from the inner to the outer wall have an associated parabola.The maxima of all these parabolas lie on the sloping lines (i.e.not the vertical line) in figure 1 between the three parabolas.The bottom sloping line originates from the spatial locations between the inner wall and the magnetic axis, and the top line, which lies just below the blue line, originates from the spatial locations between the magnetic axis and the outer wall.We will return to this, when we study the three-dimensional weight functions at different measurement locations.The significance of these lines is that they define the trapped region of phase-space, i.e. the region of phase-space in which each point corresponds to a trapped orbit.
These lines defining the trapped region are found as follows.To leading order in the small gyroradius approximation, the parallel velocity vanishes v ∥ = 0, at the same point where the poloidal direction of the guiding-center motion changes sign [51], the so-called banana-tip.Thus, at this tipping point, v ∥ = 0, which means that P ϕ = qΨ p and E = µB.The two banana-tips meet and become two passing orbits on the highfield side in the midplane at the poloidal angle θ = π.When v ∥ goes to zero on the low-field side at θ = 0 the trapped orbit transitions into a stagnation orbit, as can be seen from the topological map in the following discussion.Thus, orbits with a vanishing parallel velocity in the midplane define the two curves where we have written the magnetic field with the poloidal magnetic flux and poloidal angle as arguments.The innermost possible location of the banana-tip is right at the inner wall, which is located in phase-space at the vertical line P ϕ = qΨ p,w , which also defines a boundary of the trapped region in phasespace.The final pieces of the classification are the envelope functions enclosing all possible orbits.In the top right corner the blue envelope curve encapsulates an extra tiny region of phase-space in which so-called co-stagnation orbits can be found.However tiny as this region is, it grows with increasing energy of the fast ions.Similarly, the minimum absolute value of P ϕ for given E and µ that a counter-going orbit can have is found by solving equation ( 6) for P ϕ : Note that ( 10) is only real for µ ⩽ E/B.Due to the ± in equation (10), we now have two solutions corresponding to coand counter-going orbits, respectively.The very smallest and the very largest values that P ϕ can take are the same solutions as we found by maximizing µ for given E and P ϕ and are located on the blue line.The maximum of the '−' (counter-going) solution is close to the left leg of the magnetic axis parabola.This curve encapsulates an extra tiny region of phase-space in which so-called counter-stagnation orbits can be found, shown in red in figure 1.The stagnation orbits are usually found as small orbits close to the magnetic axis without encircling it, as the passing orbits do.Examples of co-stagnation and counterstagnation orbits can be seen in [47].
All regions are denoted by the orbit type and whether they are confined or lost.'T' denotes trapped orbits and 'P' denotes passing orbits.'C' denotes confined orbits and 'L' denotes lost orbits.+ denotes co-going passing and stagnation orbits and-denotes counter-going passing and stagnation orbits with respect to the plasma current.In the center, the degenerate region is found where a single (E, µ, P ϕ )-triplet corresponds to both a confined co-and a confined counterpassing orbit, denoted by 'CP+−'.The stagnation and potato orbits are also confined.
This completes our introduction to the orbit topology which forms the basis needed to understand how the observable regions of constants-of-motion phase-space are identified.In the next section, we study the observable regions of phasespace by considering projected velocities as a proxy for fastion diagnostics.

Observable regions in constants-of-motion phase-space
In this section, we investigate which parts of constants-ofmotion phase-space are observable given different diagnostic setups.That is, we study the relation between position-space, velocity-space and constants-of-motion space.To understand the observable regions, i.e. how they depend on the diagnostic setup, is vital in e.g. the study of diagnostic signals and fast-ion distribution functions.The intended goal of this section is to find the exact fast-ion orbits that can be observed in a specific measurement volume given a specific projected velocity u and angle φ between the LOS and the magnetic field in the measurement volume.That is we seek an explicit expression for the (P ϕ , µ, E)-coordinate triplet from where a signal originates.
The diagnostic signal can be related to the fast-ion distribution function via a so-called weight function [55].Assuming that the diagnostic signal is linearly related to the phase-space distribution function, we have the 6D linear integral equation where the integration is over three position coordinates x and three velocity coordinates v.The weight function w has units of signal per ion and is thus non-zero only in the observable regions.In this work, a diagnostic is assumed to measure projected velocities u, as this is a fundamental quantity in several fast-ion diagnostics, such as FIDA spectroscopy [18,[55][56][57][58], CTS [14], GRS [19,20] and NES [21].The appearance of two projected velocities reflects the finite spectral resolution of diagnostics by denoting the lower and upper limits of the interval within which a signal is measured.We denote by φ the angle between the diagnostic line of sight and the magnetic field vector at the spatial location of the measurement, so that cos(φ) = û • B. This is essential information, as it may lead to asymmetric signals with preference for blue shift or red shift, depending on the directions of the fast ion and the diagnostic geometry.The fundamental ingredient in the shift of the signal is the projected velocity u of the fast-ion, along the diagnostic LOS.Relativistic effects are not taken into account, as ions in fusion plasmas very rarely reach such high energies.Fusion born alpha particles with an energy of 3.5 MeV reach ∼4% of the speed of light, so their dynamics are well described without taking relativistic effects into account.For the treatment of runaway electrons e.g.relativistic effects cannot be ignored [59], but these are not considered in this work.
We will return to the calculation and study of weight functions in section 4.
The projected velocity of the fast ion at any point along its full orbit, i.e. including the gyro motion, is found by trigonometric considerations and is given by where û denotes the unit vector along the line of sight and γ is the gyro angle of the fast-ion motion around the magnetic field line.This is illustrated in figure 2 [14].The uaxis denotes the line of sight, and the larger black dot in the center of the vertical line denotes the velocity of the ion.As the ion gyrates around the magnetic field line, the ion position moves up and down the vertical black line.At any time, the projection onto the u-axis is the projected velocity u p = v p ∥ cos(φ) + v p ⊥ sin(φ) cos(γ p ), given by the red line.We are searching for the observable region of phasespace.For a proxy FIDA diagnostic, the observable regions in position-space, e.g. in the (R, z)-coordinates are defined by the overlap between the line of sight and the NBI.This measurement volume size is much smaller than the minor radius of the tokamak.This can be easily extended to line-integrated signals, such as NES, by summing up the contributions from each point along the LOS.Note that for very energetic ions, the gyroradius can be of comparable size to the measurement volume.However, this complication is not taken into account in this work.The observable regions in velocity-space for a single (R, z)-point, i.e. in the (v ∥ , v ⊥ )-coordinates form triangles [14].Weight functions in velocity-space have been studied extensively for various fast-ion diagnostics [14][15][16][17][18][19][20][21].The boundaries of the observable regions in velocity-space are found at the edges of the gyro motion by setting cos(γ) = ±1 in (12).
Observable regions in phase-space satisfy two conditions: (i) Position-space condition: The orbit must go through the measurement volume.(ii) Velocity-space condition: The projected velocity of the orbit (12) must match the projected velocity that the diagnostic is sensitive to.
As in (6), we start by expressing the kinetic energy in terms of P ϕ and µ, while restricting ourselves to consider a single measurement volume M located at (R M , z M ), Condition (i) was discussed in section 2 for any point in the plasma.The locus of all points going through the measurement volume M is a downward opening parabola.This parabola will be referred to as the position-space parabola, as we will see that the velocity-space condition also gives rise to a parabola.
In figure 3(a), nine different measurement volumes are chosen, and the corresponding parabolas are shown in figure 3(b).An idealized point measurement volume can only observe ions on orbits with constants-of-motion triplets on the corresponding parabola in this energy plane.Recall that this gives a parabolic surface in 3D constants-of-motion space, of which we show one plane at constant energy.To simplify the notation, the subscript M will be omitted from now on, but for the remainder of this section all equations are evaluated in a single measurement volume (R M , z M ).
A weight function quantifies the sensitivity of the diagnostic at a specific projected velocity in a given measurement volume.Thus, condition (ii) must be satisfied.Ions with a given projected velocity u = |u| obey equation (12).Eliminating v ∥ and v ⊥ gives Scanning different values of µ for different values of the gyro angle γ, we get a set of P ϕ -values and another curve µ = µ(P ϕ ).Notice that the energy E is not fixed in (14).However, the projection of the curve µ = µ(P ϕ ) onto a plane of constant energy is, again, a parabola, opening upward this time, and we will refer to this parabola as the velocity-space parabola.Note that the legs of each parabola are defined as mirrored square root curves P ϕ = P ϕ (µ) from ( 14) with opposite signs of cos(γ).The velocity-space parabola intersects the positionspace parabola in two points, and this is where the diagnostic is sensitive to orbits moving through that particular measurement volume with this specific projected velocity and gyro angle.These velocity-space parabolas are shown for a single measurement volume in figure 4(a) for several gyro angles.For γ = 0 • and γ = 180 • , i.e. cos(γ) = ±1, we find the boundaries of the observable region and thus of the weight function.
The boundaries of three weight functions, i.e. three different projected velocities u, are shown in figure 4(b) for the same single measurement volume.These intersections are found by solving the two equations ( 13) and ( 14) for the two unknowns P ϕ and µ.First, solving for µ in (14), and plugging it in ( 13), To find the (P ϕ , µ)-coordinates where the velocity-space parabolas ( 14) cross a specific energy plane, E is fixed in (16) and we solve for P ϕ , where we have defined the number g(φ, γ) = 1 − sin 2 (φ) sin 2 (γ).To find real solutions of P ϕ for a given projected velocity u, angle φ and gyro angle γ, the energy of the fast ion must satisfy Thus, on the boundaries of the observable region, corresponding to γ = 0 • and γ = 180 • , the energy must satisfy E ⩾ E u .
For any energy plane below E u , the diagnostic is not sensitive.This reflects that the particle speed must always be at least as large as the projected velocity.Notice how all terms simplify on the gyro angle boundaries γ = 0 • , 180 • , due to sin 2 (γ) = 0 ⇒ g(φ, γ) = 1.Plugging ( 17) into (15) we find the corresponding µ coordinates, where the velocity-space parabolas cross the energy E-plane, The '+' solution in (17) leads to the '+' solution in (19), and the '−' solution in (17) leads to the '−' solution in (19).Equations ( 17) and ( 19) are complicated, but the important thing is not the exact expressions, but the fact that we are able to get explicit expressions for the (P ϕ , µ)-coordinate pair where the velocity-space parabolas cross the position-space parabolas for each energy plane.The goal of this section was exactly to obtain these expressions.The crossings correspond to the exact fast-ion orbits that can be observed in a specific measurement volume given a specific projected velocity u, gyro angle γ, and angle φ between the LOS and the magnetic field in the measurement volume.This is a central result in the paper, as it provides a link between position-, velocity-and phase-space and demonstrates complete understanding of the observable orbits given a diagnostic setup.The crossing points of the position-space parabola and the velocity-space parabola calculated in equations ( 17) and ( 19) are indicated by circles in figure 4. In the remainder of this section, we consider special cases of equations ( 17) and (19) for specific values of gyro angle γ and angle φ, to showcase that the expressions are consistent with the definitions of P ϕ , µ and E.
At the limiting gyro angles γ = 0 • , 180 • , the (P ϕ , µ)coordinate pair simplifies to and where the extra factor of (±1) is for γ = 0 • and γ = 180 • respectively.There is up to two solutions for each gyro angle, as can be seen in figure 4. It is interesting to consider limiting cases for the observable boundaries for the ideal experimental observation angles parallel and perpendicular to the magnetic field.Consider a completely perpendicular sightline φ = 90 • , which can be rearranged to read such that which makes sense.Since the sightline is completely perpendicular to the magnetic field, the projected velocity of the fast ion along the LOS is also perpendicular to the magnetic field.Thus, the observed projected velocity is simply the perpendicular velocity of the fast ion, hence equation ( 23) and the observed magnetic moment is given by (24).For gyro angle γ the magnetic moment is As the second special case, consider parallel and anti-parallel sightlines, such that To find µ for this φ, we first rewrite (21) as we get which is consistent with ( 27) and ( 3).This concludes the section on the observable regions in constants-of-motion phase-space.In the next section, we continue by calculating the weight functions.

Weight function calculation
To calculate the weight functions, equation (11) will be simplified by reducing the dimensionality of the problem, by taking advantage of ignorable coordinates.The six-dimensional integral (11) is reduced to a three-dimensional one by integrating out the ignorable coordinates using the constraints imposed by the symmetries of the system.Equivalently, the distribution function can be described in terms of the three conserved quantities, E, µ and P ϕ .However, recall that there is an ambiguity in the direction of the particles relative to the magnetic field.A passing particle moving in the same direction as the magnetic field can have the same (E, µ, P ϕ )-triplet as a particle moving in the opposite direction as the magnetic field.Therefore we need a binary index σ to tell the two different orbits apart.A three-dimensional fast-ion orbit can thus be uniquely determined by the triplet of constants of motion with the addition of a single binary index, (E, µ, P ϕ ; σ).Expressing the weight function and the fast-ion distribution function in terms of these, the relation between the diagnostic signal and the fast-ion distribution function takes the form, where the Jacobian of the transformation from the Cartesian coordinates to the constants-of-motion coordinates in (31) is absorbed in f (3D) COM .The constants-of-motion coordinates span the discretised three-dimensional phase-space, such that the number of points in phase-space is M = N E N µ N P ϕ , where N E is the number of grid points in energy, N µ is the number of grid points in magnetic moment and N P ϕ is the number of grid points in the toroidal canonical angular momentum.Numerically, the fast-ion distribution function is thus implemented in a threedimensional array, such that the weights are implemented in a four-dimensional array, where N is the number of measurements.
The fundamental physical quantity that enters in several diagnostic signals is the projected velocity u of the fast ion along the line of sight of the diagnostic.This can be calculated analytically using the constants of motion and the known angle between the line of sight and the magnetic field vector at the location of the measurement, as we have seen before.
As previously noted, the triplet of constants of motion, and the binary index σ, determine uniquely a fast-ion orbit.Therefore, for each fixed value of E j and P ϕ,j , an orbit corresponds to the contour lines in µ, In equation ( 33), the magnetic field as well as the poloidal magnetic flux are functions of space, Thus, the valid orbits in this specific magnetic equilibrium for the specific values of energy and angular momentum, E j and P ϕ,j , satisfy Assuming fast gyration, cos (γ) is not a single number, but a distribution.The gyro angle γ ∈ [0, 2π] is taken to be uniformly distributed, and so cos (γ) provides an entire spectrum of projected velocities for every single point along the guidingcenter orbit for each triplet of constants of motion (E, µ, P ϕ ).
Real diagnostics have finite resolution in the measurements, and thus we are interested in the probability of observing a projected velocity within a given interval [u 1 , u 2 ].Given that the ion is on a part of the gyro orbit observable by the diagnostic, this probability is given by [18], The probability density function of u can be written in terms of the probability density function of γ, where the factor of two comes from the fact that two gyro angles result in the same projected velocity, and pdf (γ) = 1/2π.The gyro angle is given by so using (37) and observing that arccos is monotonically decreasing, we get [18] prob Letting u 1 and u 2 run from the minimum possible projected velocity to the maximum possible projected velocity, thus defining a projected velocity array, γ 1 and γ 2 are Ndimensional vectors with the ath element of (γ 1 − γ 2 ) /π being the probability of observing the ath element of the projected velocity array.This is calculated at all (R, z)-coordinates along the fast-ion orbit.For fixed magnetic moment µ i , toroidal angular momentum P ϕ,j and energy E k , the weight matrix elements are calculated as where is the set of (R, z)-coordinates defining the contour lines in µ, and hence the orbits.L O is a weighting describing the measurement volume.E.g. for FIDA diagnostics, this is the amount of overlap between the NBI and the line of sight.The weighting factor N t ∥ is an approximation of the time spent by the fast ion at the small but finite piece of the orbit around the specific (R, z)-point relative to the total poloidal transit time, i.e. the time needed to complete one entire guiding-center orbit trajectory.Parametrising the orbit using the coordinate s and splitting the orbit into small elements ∆s i , an ad-hoc model for the time spent in one cell is the poloidal increment divided by the speed, where the perpendicular drift velocity is approximated by the vacuum approximation of the ∇B and curvature drifts, such that the weighting is given by The orbit is numerically resolved on the (R, z) grid, on which the equilibrium is defined, as contour lines of µ via equations ( 33) and ( 35) using interpolation.This is possible as the equilibrium is known, and thus all possible orbits are realized by scanning all triplets of (E, µ, P ϕ ).The more time spent in the interval ∆s i around the (R, z)-point, the larger is the N t ∥ factor.Specifically, this factor gets large around the tips of the trapped orbits, since there the parallel velocity goes to zero.This is shown in figure 5, where three orbits are drawn with each point along the orbit colored according to the value of N t ∥ at that point.A co-passing, a trapped and a marginally trapped orbit are shown from left to right.It is evident that the value of N t ∥ does not change very much along the passing orbit, whereas it changes by one-two orders of magnitude along the trapped orbits.In addition to this, to further understand the behavior of N t ∥ in the constants-of-motion phase-space, we consider small finite measurement volumes on the high-and low-field side from figures 7(a) and (c).In figure 6, the values of N t ∥ for each single orbit in these single small measurement volumes are shown.All values below 10 −3 are not shown for visualization purposes.Two-three orders of magnitude are still retained.As expected, the value of N t ∥ peaks at those orbits with parallel velocities approaching zero near the measurement volumes.These can be found at the lower and upper trapped boundaries for the measurement volume at the high-field side and low-field side, respectively.The (γ 1 − γ 2 )/π factor is a probability density related to the gyro-orbit.The N t ∥ factor is related to the drift-orbit, but is not a probability density, since the parallel velocity is included in the definition.This, and the introduction of the L O factor means that the sum of all rows in W does not sum up to one.The precise value of each element in W is not important in this work, where we study the shape of the weight functions in phase-space.Only the values of the elements relative to each other are important, since we are interested in finding the regions of phase-space a given diagnostic is sensitive to.
In the next section we study the weight functions, specifically how spatial locations of measurement volumes map to regions of phase-space and how properties of weight functions in 2D velocity-space are reflected in the 3D weight functions in phase-space.

Weight function studies
To study the shape of the weight functions, we first consider only the probabilistic quantity related to the gyro-motion (39) and set N t ∥ = L O = 1 in (40).In order to relate this to velocity-space, we restrict the diagnostic lines of sight to observe a small region in position space, where the magnetic field components as well as the poloidal flux are approximately constant.The fast ion species is assumed to be deuterium, and thus the mass m is set accordingly.
In figure 7, we consider the weight functions in a plane of constant energy for three different angles φ in three different measurement volumes located at the midplane on the high-field side, close to the magnetic axis, and on the low-field side respectively.The figures in the left column of figure 7 show weight functions corresponding to the high-field side observation.The central column corresponds to the magnetic axis observation, and the right column corresponds to the lowfield side observation.The second row depicts the weight functions for the respective measurement volume given the LOS with angle φ = 26.4• .The third and fourth row are similar to the second row, this time for φ = 45.0 • and φ = 79.5 • respectively.The weight functions show high sensitivity at each end, which is related to the high density of lines of constant gyro angle near the gyro-angle boundaries, as shown in figure 4(a) equivalent to the 2D velocity-space weight functions, see e.g.[14].
The width of the sensitivity area is explained by the finite size of the measurement volume, so that it contains about 500 pixels, each of which is associated with its own positionspace parabola.Weight functions of an extended volume is thus simply understood as the sum of all weight functions originating from each pixel in the measurement volume.This is shown in figure 8.The position-space parabolas corresponding to each pixel in the measurement volume are plotted below the weight functions for the φ = 45.0 • angle.These parabolas were discussed in sections 2 and 3 regarding the topological boundaries and the observable regions, respectively.Note that these parabolas do not depend on the LOS, so they also draw out the sensitivity area for the LOS with other angles φ.
Just as for the topological boundaries, each pixel in the measurement volume gives rise, in general, to a parabola of non-zero sensitivity in the energy slice of the weight function.However, as is evident in figure 8, the non-zero sensitivity area does not extend across the entire parabolas, but is bounded by the velocity-space condition (ii) from section 3, which is explained by figure 4(a).Note that the weight function is bounded by the parabolas of all pixels.To not overpopulate figure 8, velocity-space parabolas corresponding to two pixels only at the minimum and maximum radial coordinate of the measurement volumes are shown.The position-space parabolas cross each other at the top, such that a parabola bounding the right leg of the sensitivity area from below may go on and bound the left leg from above.Rather, the collective area spanned by all the position-space parabolas draw out the sensitivity area, and vice-versa for the velocity-space parabolas.
In figure 9, we vary the z-coordinate of the measurement volume instead.Thus, the center column is identical to the center column in figure 7. The position of the parabolas is completely clear from the position and velocity conditions discussed in the previous section.The first thing we notice is that the non-zero weights now do not terminate at either the top or bottom leg of the topological boundary around the trapped region, as was the case when the measurement volume was on the midplane in the low-field and high-field side, respectively.This is because the measurement volume is not in the midplane, as figure 3(b) also showed.The next thing we notice is that the weight function for the measurement volume below the midplane looks similar to the weight function for the measurement volume above the midplane, as can also be understood from figure 3(b).The non-zero sensitivity has moved the same distance away from the dotted dashed parabola, which corresponds to orbits moving through the magnetic axis.This is expected, as the same passing and trapped orbits traversing the measurement volume below the midplane will also traverse the measurement volume above the midplane.However, the weight functions for the two locations are not exactly similar in figure 9. See e.g. the third row of the first and third column, i.e. φ = 45.0 • .The high-sensitivity areas are slightly closer to P ϕ = 0 in the third column.This is because the measurement volume in this case is slightly closer to the magnetic axis.The magnetic axis is located at approximately z ≈ 0.02 m.This can be seen in the first row of figure 9.
As a final inspection we vary the observed projected velocity for two different angles between the LOS and the magnetic field, but keep the measurement volume fixed.This is shown in figure 10.We choose the measurement volume close to the magnetic axis.When increasing the projected velocity, the weight function for a LOS with φ = 26.4• is sensitive to orbits moving more parallel to the magnetic field, since the LOS is close to parallel to the magnetic field.Stated differently, for an ion with a fixed energy to increase its projected velocity along the LOS with φ = 26.4• , it needs to have more of its energy in the parallel direction, thus decreasing its magnetic moment, since the LOS is almost parallel to the magnetic field in the measurement volume.The opposite behavior is seen in the second row for φ = 79.5 • .The weight function is sensitive to orbits moving more perpendicular to the magnetic field, since the LOS is almost perpendicular to the magnetic field line in the measurement volume.Thus, to increase its projected velocity along this LOS, the ion needs to have more of its energy in the perpendicular direction, thus increasing its magnetic moment.
In the next section, we study weight functions for a specific tentative diagnostic setup for COMPASS-Upgrade and MAST-Upgrade.

COMPASS-Upgrade
In this section, we study weight functions in the future COMPASS-Upgrade tokamak for a projected velocity diagnostic as a proxy for FIDA spectroscopy.Thus the L O weighting from equation (40) describes the amount of overlap between the diagnostic LOS and the NBI and is included in the calculation of the weight functions from now on, as is the N t ∥ weighting.We study the gross weight functions of fans of sightlines (10 LOS) with different angles with respect to the magnetic field.The gross weight function is the sum of all weight functions, i.e. a sum over projected velocities, for an entire fan of sightlines.Thus, there is both a sum over projected velocities and over sightlines within a single fan of sightlines.The magnetic equilibrium used is the same as used in the previous sections, calculated by the FIESTA code [54] with a plasma current of 1.6 MA parallel to the toroidal magnetic field, and all profiles used for the simulation are referenced in [60].To account for the fact that not all projected velocities are observable in a real experiment, projected velocities between ±0.7 • 10 6 m s −1 are removed from all spectra, since fast ions with small projected velocities cannot be distinguished from thermal ions.We thus consider the sensitivity to active FIDA signal.
Due to the degenerate region in the constants-of-motion phase-space, where a single point corresponds to both a coand counter-passing orbit, we need to be careful with the bookkeeping.This is especially important if the weight functions are to be used in tomographic reconstructions in future work.Therefore, the sensitivity to all counter-passing orbits and counter-stagnation orbits for some energy E j are placed in the negative energy plane −E j , such that a single point in phase-space only corresponds to a single orbit [61].The negative energies in the phase-space are not physical, they are only used for bookkeeping purposes.Therefore, the plots of weight functions will from now on refer to energies with a sign using the binary index σ = ±1.Trapped orbits contribute to both blue-and red-shifted signals, but they are collected in σ = 1.This is to ensure that each point in phase-space corresponds to a unique orbit.Also, when calculating synthetic spectra, this storing does not prevent trapped orbits from contributing to both blue-and red-shifted signals.
Following the systematic study of the weight functions in the previous section, we now turn to more realistic cases adopting proposed LOS for the COMPASS-Upgrade tokamak, which are visualized in figure 11.The major radius is R 0 = 0.90 m, and the minor radius is 0.28 m.The magnetic field on axis is B 0 = 4.3 T. The intensity of the diagnostic lines of sight and the neutral beam are modeled as Gaussian beams.The overlap factor L O included in the weight function calculations is the product of the Gaussian LOS and the Gaussian beam in each voxel in the 3D position space.The standard deviation parameters of the Gaussian LOS and beam are chosen to be 6 cm and 10 cm respectively.Even though the LOS and beam have finite extension, the value of the viewing angle, between a single LOS and the magnetic field, corresponding to the center of the measurement volume is used.Each port used has a whole fan of LOS, and a distinct angle φ is calculated for each LOS.The FIDA setup considered in this work consists of five ports in segments 3, 7, 8 and 9 (segment 8 contains an upper and a lower port, as can be seen in figure 11(a)) with 10 LOS in each.The port in segment 3 is included in order to obtain more parallel viewing angles compared to the rest, which can provide additional information.We will see this in the gross weight functions.Since the ports in segments 7, 8 and 9 are placed symmetrically around the NBI, redundant information will be obtained due to the similar viewing angles of the sightlines.
In figure 12 we consider the gross weight function for the upper port in segment 8 where the average angle between the LOS and the magnetic field is φ = 90.5 • .The gross weight function of port is the sum of all weight functions for all LOS in that port.This shows which parts of phase-space the entire fan of sightlines is sensitive to.The contribution to the weight function from the counter-passing particles is collected in the negative energy slices, which are shown in figure 12(b).It is evident that almost the entire phase-space is covered but with the highest sensitivity on the right leg of the parabola, corresponding to orbits going through the magnetic axis, and on the upper trapped boundary.The overlap weighting L O contributes to this pattern since the overlap factor drops to zero on the high-field side, since the neutral beam does not penetrate all the way through the plasma.In general, we observe that the diagnostics are less sensitive to orbits along the lower trapped boundary than the upper one.This is due to the fact that the total measurement volume does not extend all the way across the high-field side.
The corresponding gross weight functions for the remaining four ports are shown in figures 13-16.The pattern of a high sensitivity is evident in all the gross weight functions with the highest sensitivities in the oblique LOS.This shows the advantage of including the oblique LOS more parallel to the magnetic field.The high-sensitivity area is more pronounced in figure 16.However, in figure 16, we also see that this port is less sensitive to orbits along the upper trapped boundary.This is due to the fact that these LOS are close to parallel to the magnetic field lines in the measurement volumes, and v ∥ of the orbits along the upper trapped boundary goes to zero on the high-field side.The projected velocities of these orbits along the LOS are therefore small, thus rendering the sensitivity low.
In the next section, we consider the gross weight function for MAST-Upgrade.

MAST-Upgrade
In this section, we study the gross weight function for MAST-Upgrade using all available 11 FIDA LOS on the SS Beam, using the knowledge we gained in the previous section.See [38,62] for details on the FIDA setup.The major radius is R 0 = 0.85 m, the minor radius is 0.65 m and the magnetic field on axis is B 0 = 0.62 T. The equilibrium used is calculated from MAST-Upgrade shot number 45 424 with the plasma current opposite the toroidal magnetic field.More details on this shot can be found in e.g.[63].The NBI is directed at an oblique angle into the plasma with the 11 LOS looking at an oblique angle in the co-current direction into the plasma.The angles with respect to the magnetic field are distributed in the interval φ ∈ [161.0,177.4] • , with some angles covered twice, i.e. all 11 LOS are close to parallel to the magnetic field in the measurement volumes.All angles are listed in table 1.A simplified view of the MAST-Upgrade tokamak, with the NBI and the FIDA diagnostic LOS, is shown in figure 17.In figures 18(a) and (b), we see the gross weight functions for σ = ±1.First of all, we notice that the topological boundaries between the orbit regions are different for MAST-Upgrade than for COMPASS-Upgrade due to the different magnetic equilibrium.In particular, the degenerate region, where a single (E, µ, P ϕ )-triplet corresponds to both a co-and a counterpassing orbit, is much smaller for the same energy, than in COMPASS-Upgrade.
Regarding the sensitivity, we notice that the diagnostics are very sensitive to co-and counter-going orbits close to the magnetic axis.This is due to the fact that most measurement volumes are located close to the magnetic axis and on the low-field side, all at the midplane.Thus, the diagnostics are very sensitive to orbits that spend a lot of time at the midplane close to the magnetic axis.These orbits are exactly located along the magnetic axis parabola in phase-space.Also, along this parabola we find co-stagnation orbits, close to the right leg, and counter-stagnation orbits, close to the left leg.Since the stagnation orbits are very localized in the (R, z)-projection, many of these orbits will be entirely within the measurement volumes all the time, and thus the diagnostics are very sensitive to these orbits.
The low sensitivity along the upper trapped boundary, despite the fact that orbits along this line spend a lot of time inside the measurement volumes, is due to the fact that the sightlines are close to parallel to the magnetic field.Thus, the projected velocity of those orbits along the LOS is close to zero and therefore not large enough to be observed.
A general feature of the gross weight function is that as the energy of the fast ions is increased, the diagnostic    becomes sensitive to larger values of µ.This is due to the fact that the LOS are all close to parallel to the magnetic field in the measurement volumes.Therefore, fast ions with higher energies can have a larger fraction of their energy in the perpendicular direction and still be observed by the diagnostics [64].

Conclusion
In this paper, we calculated the observable regions of constants-of-motion phase-space, using projected velocities as a proxy for different fast-ion diagnostics, by setting up two conditions for an observation; a position-space condition stating whether an orbit travels through the measurement volume or not, and a velocity-space condition, stating where in phasespace the projected velocity of the fast ion can be observed.This allows us to find analytic expressions for the observable regions, given a diagnostic setup: the region on the parabola given by equation ( 13) bound by the points given by equations ( 17) and (19) for each small point within the sightline.The study of the observable regions was used to calculate 3D weight functions in phase-space and relate them to position-space and velocity-space.The behavior of the weight functions was studied and understood by considering different measurement volumes, different angles between the lines of sight and the magnetic field, and different projected velocities.
In the final part of the paper, we quantified the orbit sensitivity in the COMPASS-Upgrade and the MAST-Upgrade tokamaks, by calculating the weight functions in phase-space, using projected velocities as a proxy signal for diagnostics such as FIDA spectroscopy and CTS.In this work, a tentative FIDA setup of the future COMPASS-Upgrade and the FIDA setup of MAST-Upgrade was used.
A natural next step is to use the three-dimensional weight function to reconstruct the fast-ion distribution function in both COMPASS-and MAST-Upgrade given diagnostic signals, likely using strong prior information such as collision physics [65].The weight functions can also be used to assess the amount and variety of information obtainable by a given diagnostic setup.This can be utilized to optimize a diagnostic setup according to specific requirements.In addition to this, the weight functions are able to identify the region of phase-space from which each point in a measured spectrum originates.

Figure 1 .
Figure 1.Topological map dividing phase-space into regions of different fast-ion orbits at constant energies E = 95 keV and E = 1 MeV.The equilibrium used is a test equilibrium from the COMPASS-Upgrade tokamak.Note how the stagnation and potato regions grow with increasing energy, and how the degenerate passing region disappears for appropriately large energies, as in the E = 1 MeV case.'C' ('L') denotes confined (lost) orbits, 'P' ('T') denotes passing (trapped) orbits, and ± denotes whether the orbit is co-or counter-going with respect to the plasma current.

Figure 2 .
Figure 2. The projected velocity u along the LOS visualized in the Cartesian coordinate system (v ∥ , v ⊥1 , v ⊥2 ), where the velocity-vector of the particle is v p .Reproduced courtesy of IAEA. Figure from [14].Copyright 2011 IAEA.

Figure 3 .
Figure 3. (a) Nine different measurement volumes, which are to be understood as single pixels in the (R, z)-plane.The squares with the green and orange colors correspond to the dashed parabolas in (b) with the same colors.The blueish diamonds correspond to the dashed-dotted parabolas with the same colors in (b), and the circles at the midplane correspond to the full lines in (b) with the same colors.The trapped and stagnation orbit boundaries are shown in dim gray to help the readers' orientation in phase-space.

Figure 4 .
Figure 4.In all subfigures, the energy plane shown is E = 95 keV, and the measurement volume considered is the bottom right measurement volume (R = 1.04 m, z = −0.20 m) from figure 3(a).The full black lines correspond to the midplane volumes in figure 3(a).(a) Projection of equation (14) (the dashed lines) for different gyro angles γ onto the E = 95 keV energy plane, with projected velocity u = 0.5 • 10 6 m s −1 in the measurement volume.The blue dotted full line is the corresponding position-space parabola.The angle between the LOS and the magnetic field at the measurement volume is φ = 60 • .The circles denote where the projections cross the E = 95 keV plane, i.e. equations (17) and (19).(b) The same angle φ as in (a).This time the boundaries γ = 0 • , 180 • for three velocity-space parabolas are shown, corresponding to three different projected velocities u = [−2.0,0.5, 2.0] • 10 6 m s −1 .The left leg of each parabola corresponds to γ = 0 • and the right leg corresponds to γ = 180 • .(c) Same projected velocity as in (a), but this time three velocity-space parabolas in dark red at the boundaries γ = 0 • , 180 • , corresponding to three different angles between the LOS and the magnetic field φ = [20 • , 50 • , 80 • ] are shown.The innermost narrow parabola corresponds to φ = 20 • and the widest parabola corresponds to φ = 80 • .

Figure 5 .
Figure 5.The value of Nt ∥ plotted along three different types of orbits, (a) co-passing, (b) trapped and (c) marginally trapped.

Figure 6 .
Figure 6.The value of Nt ∥ for each single orbit at the single small measurement volumes from (a) figure 7(a), and (b) figure 7(c).

Figure 8 .
Figure 8.The sensitivity areas given as the sum of each individual pixel in the measurement volumes, i.e. it is the collection of all position-space parabolas, plotted in dashed lines, from the finite sized measurement volume.Velocity-space parabolas corresponding to two pixels at the minimum and maximum radial coordinate of the measurement volumes are added to showcase how the length of the sensitivity area is bounded.The measurement volumes in these figures are (a) in the high-field side (b) by the magnetic axis and (c) in the low-field side, as in figure 7. The energy plane is E = 95 keV and the angle φ is φ = 45.0 • in all three plots.

Figure 9 .
Figure 9. Weight functions for Eu = 25.44 keV for φ = 26.4• , 45.0 • and 79.5 • .The energy planes shown are all E = 95 keV.The measurement volume in (a) is centered around (R = 0.90 m, z = −0.20 m).The measurement volume in (b) is centered around (R = 0.90 m, z = −0.01m) The measurement volume in (c) is centered around (R = 0.90 m, z = 0.20 m).The values on the colorbars are in arbitrary units.

Figure 10 .
Figure 10.Weight functions for a variation of the observed projected velocity corresponding to Eu = 27.5 keV, 47.1 keV and 68.4 keV respectively, and for all six cases the measurement volume is the one close to the magnetic axis.The energy plane is E = 95 keV.In the first row φ = 26.4• and in the second row φ = 79.5 • .

Figure 11 .
Figure 11.Diagnostic setup of COMPASS-Upgrade.(a) Side view of COMPASS-Upgrade.The magenta lines are the diagnostic sightlines used in this work.Three oblique horizontal fans and two vertical fans, viewing the plasma from above and below, are used.(b) Top view of COMPASS-Upgrade.Segment 3, 7, 8 and 9 are used, with two ports in segment 8, with all LOS directed at the same diagnostic NBI (DNBI) beamline, which is the orange line originating from segment 8.

Figure 12 .
Figure 12.Positive and negative energy slices of the gross weight function of the fan of LOS from the upper port in segment 8 of COMPASS-Upgrade.The mean angle between the LOS and the magnetic field is φ = 90.5 • .σ = 1 is the binary label denoting the sensitivity to co-passing and -stagnation and trapped orbits, while σ = −1 denotes the sensitivity to counter-passing and -stagnation orbits.

Figure 13 .
Figure 13.Positive and negative energy slices of the gross weight function of the fan of LOS from segment 7 in COMPASS-Upgrade.The mean angle between the LOS and the magnetic field is φ = 145.0• .

Figure 14 .
Figure 14.Positive and negative energy slices of the gross weight function of the LOS from the lower port in segment 8 of COMPASS-Upgrade.The mean angle between the LOS and the magnetic field is φ = 89.5 • .

Figure 15 .
Figure 15.Positive and negative energy slices of the gross weight function of the fan of LOS from segment 9 in COMPASS-Upgrade.The mean angle between the LOS and the magnetic field is φ = 35.3• .

Figure 16 .
Figure 16.Positive and negative energy slices of the gross weight function of the fan of LOS in segment 3 of COMPASS-Upgrade.The mean angle between the LOS and the magnetic field is φ = 171.7 • .

Figure 17 .
Figure 17.Simplified view of the MAST-Upgrade tokamak with NBI and FIDA diagnostic LOS.

Table 1 .
Angle between the magnetic field and all 11 FIDA LOS in MAST-Upgrade.