Helical mode localization and mode locking of ideal MHD instabilities in magnetically perturbed tokamak plasmas

In H-mode tokamak plasmas, the achievable pressure-gradient is limited by type-I Edge Localized Modes (ELMs), which are projected to cause severe damage to future fusion devices. There are several approaches aiming to mitigate/suppress the occurrence of ELMs, such as the application of an external non-axisymmetric magnetic perturbation field, which breaks the axisymmetry of the tokamak plasma. In this work we use the CASTOR3D code to investigate helical localization and mode locking of edge-localized ideal MHD instabilities in rotating and flow-free magnetically perturbed tokamak plasmas with NP=2 periodicity. Helically localized instabilities are separated into two classes: quasi-locked and strictly locked. In a non-rotating plasma, the localization of quasi-locked modes is determined by an envelope while their precise location under the envelope is arbitrary, whereas strictly locked modes can only occur at a single helical position. Strictly locked modes only rotate if the toroidal plasma rotation exceeds a critical threshold; above the threshold the forced rotation of the strictly locked modes is non-uniform. For quasi-locked modes, no such critical threshold exists; they rotate uniformly beneath their envelope in the case of finite plasma rotation. The helical localization of both quasi-locked and strictly locked instabilities is determined by the energetic decomposition of the instabilities close to the most unstable flux-surface; for example, strongly current-density driven instabilities are aligned with regions of augmented parallel equilibrium current-density. Finally, we compare the computationally determined localization of MHD instabilities to experimental observations. The determined MHD instability is located at the same position as the experimentally measured modes with respect to the equilibrium corrugation, verifying that ideal MHD can describe the experimentally observed instabilities.

In H-mode tokamak plasmas, the achievable pressure-gradient is limited by type-I Edge Localized Modes (ELMs), which are projected to cause severe damage to future fusion devices. There are several approaches aiming to mitigate/suppress the occurrence of ELMs, such as the application of an external non-axisymmetric magnetic perturbation field, which breaks the axisymmetry of the tokamak plasma. In this work we use the CASTOR3D code to investigate helical localization and mode locking of edge-localized ideal MHD instabilities in rotating and flow-free magnetically perturbed tokamak plasmas with N P = 2 periodicity. Helically localized instabilities are separated into two classes: quasi-locked and strictly locked. In a non-rotating plasma, the localization of quasi-locked modes is determined by an envelope while their precise location under the envelope is arbitrary, whereas strictly locked modes can only occur at a single helical position. Strictly locked modes only rotate if the toroidal plasma rotation exceeds a critical threshold; above the threshold the forced rotation of the strictly locked modes is non-uniform. For quasi-locked modes, no such critical threshold exists; they rotate uniformly beneath their envelope in the case of finite plasma rotation. The helical localization of both quasi-locked and strictly locked instabilities is determined by the energetic decomposition of the instabilities close to the most unstable flux-surface; for example, strongly current-density driven instabilities are aligned with regions of augmented parallel equilibrium current-density. Finally, we compare the computationally determined localization of MHD instabilities to experimental observations. The determined MHD instability is located at the same position as the experimentally measured modes with respect to the equilibrium corrugation, verifying that ideal MHD can describe the experimentally observed instabilities. Original Content from this work may be used under the terms of the Creative Commons Attribution 4.0 licence. Any further distribution of this work must maintain attribution to the author(s) and the title of the work, journal citation and DOI.

Introduction
The pressure gradient in the pedestal region of H-mode tokamak plasmas is mainly limited by type I Edge Localized Modes (ELMs) [1][2][3]. Type I ELMs lead to significant bursts of energy and particle losses and are projected to cause severe damage in future fusion devices. For this reason, it is important to improve the understanding of the methods which suppress or mitigate ELMs. ELM suppression is achieved if there is no ELM activity in the plasmas, while in the case of ELM mitigation the large type I ELMs are replaced by many small ELMs [4][5][6][7][8][9].
One method to suppress or mitigate ELMs is the application of a non-axisymmetric Magnetic Perturbation (MP) field by MP coils [7][8][9]. While the onset of ELMs in axisymmetric tokamak plasmas is well-described by the stability to ideal MHD instabilities at the plasma edge, the impact of MPs on MHD stability is not well understood.
Experimental observations showed that the application of a MP field causes inter-ELM modes and the ELM onset to appear in certain helical positions (at certain toroidal phase angles) instead of being randomly located along the toroidal direction [10]. The toroidal mode localization for infinite-n ballooning modes, which are located at a single flux surface, was studied analytically by [11]. The helical localization of intermediate to high toroidal mode number peeling-ballooning modes in non-axisymmetric tokamak plasmas in the limit of weak MP fields (perturbative stability analysis) was investigated by [12]. Further research investigated the impact of MPs on the MHD stability limit, but has not analyzed the localization of the instabilities [13,14]. In this work, we focus on the helical localization and mode locking of general ideal MHD instabilities at the edge in magnetically perturbed tokamak plasmas of arbitrary MP field strength using the CASTOR3D code [15,16], which allows to investigate instabilities of any toroidal mode number.
The phenomenon of helical mode localization is analyzed for a simplified MHD equilibrium (section 2). A systematical differentiation between two kinds of helical mode localization, strictly locked and localized (quasi-locked) modes, is introduced. The effect of toroidal plasma rotation on the strictly locked and quasi-locked modes is studied, providing a physical interpretation of strict locking and quasi-locking (section 3). Strictly locked modes are shown to rotate nonuniformly above a critical plasma rotation, while quasi-locked modes are shown to rotate uniformly at any plasma rotation. Finally, the helical mode localization is studied for an experimental case and successfully compared to ECE measurements [10] (section 4). We show that the equilibrium is unstable to low mode number instabilities which are located at the same helical position as observed in the experiment.

Mode localization and mode locking for a numerical test equilibrium
In order to study helical mode localization and mode locking of ELMs, we begin with the analysis of a simple equilibrium. The simple equilibrium should have smooth plasma profiles, an intrinsically small size of the linear eigenvalue problem, and it should be unstable to edge localized instabilities of any toroidal mode number in the axisymmetric case, i.e. without application of a MP to the equilibrium.
The stability analysis of non-axisymmetric MHD equilibria requires factorizing large matrices whose dimensions scale with the number of poloidal and toroidal Fourier harmonics. The number of poloidal harmonics required to describe global MHD instabilities is proportional to the range of safety factor values ∆q over the plasma radius. To minimize the memory requirements for our test case and allow large toroidal mode numbers to be investigated, we choose a small but relevant value for the edge safety factor: where ψ N is the normalized poloidal flux. Next, we use the IPED2 framework to create a model plasma boundary (major radius R 0 = 1.66 m, minor radius a 0 = 0.6 m, elongation κ = 1.8, triangularity δ = 0.4), pressure profile (normalized plasma beta β N = 1.54, pedestal top pressure p ped = 17.5 kPa), and an electron density profile (pedestal top electron density n e,ped = 5 · 10 19 m −3 ) [17]. The toroidal flux at the plasma boundary is set to Φ bnd = −3.64 Wb.
The obtained set of plasma boundary, safety factor, pressure profile, and toroidal flux at the plasma boundary defines our numerical test equilibrium, which fulfills all properties described in the first paragraph of this section. Figure 1 shows the safety factor and pressure profile of the numerical test case. The profiles are shown in ρ pol = √ ψ N coordinates, usually used for tokamak profiles, as well as in toroidal flux coordinates, which stretch the pedestal region and are numerically beneficial for the equilibrium convergence and stability analysis. The global plasma parameters of the resulting magnetic equilibrium are: plasma current I P = 1.75 mA, toroidal magnetic field at the axis B T = 1.73 T, total normalized plasma beta β N = 1.47 and pedestal beta poloidal β pol,ped = 0.27.
The growth rates of the axisymmetric equilibrium are listed in table 1. As desired, all instabilities have comparably large growth rates, which implies that the numerical test case is far  above the stability boundary, i.e. far above marginal stability. The growth rate of every fourth mode number is damped because the edge safety factor multiplied by 4 is an integer, which causes the outermost resonant surface to be aligned with the boundary for n/4 ∈ N. Finally, the energetic composition of the instabilities is calculated using the intuitive energy functional of ideal MHD derived by Greene and Johnson [18], which separates the current-density drive δW CUR and pressuregradient drive δW DP from stabilizing energy contributions (e.g. δW SHA ) and was recently implemented in the CASTOR3D code [19]: where V is the plasma volume, j is the current-density, B is the magnetic field, ξ is the displacement of the instability, p is the pressure, κ is the curvature vector of the magnetic field, ⊥ denotes vector components perpendicular to B 0 and the indices 0 and 1 denote equilibrium quantities and instability quantities, respectively. Note that the other stabilizing terms are typically very small. As a result, all modes are strongly current-density driven, while the relative pressuregradient drive δW DP /(δW CUR + δW DP ) increases with increasing toroidal mode number from 2.3% for n = 1 to 14.0% for n = 15.

Construction of the non-axisymmetric equilibrium and toroidal mode coupling
Next, we perturb the plasma boundary with a resonant nonaxisymmetric corrugation of periodicity N P = 2. For this purpose, we start from the prescribed boundary of the axisymmetric equilibrium ('2D' equilibrium) and calculate the Fourier representation of the last closed flux surface in 2D straight-field-line coordinates. Then we add the desired nonaxisymmetric toroidal harmonics (N > 0) to the Fourier spectrum encoding the last closed flux surface and assemble the last closed flux surface in real space. Finally, a non-axisymmetric equilibrium ('3D' equilibrium) is calculated from the generated non-axisymmetric plasma boundary while keeping safety factor, pressure profile and toroidal flux from the axisymmetric equilibrium using the fixed-boundary equilibrium solver GVEC [20]. Figure 2 shows the corrugation of the 3D equilibrium. The simple corrugation of the equilibrium has similar amplitude on the high and low field side and the MP field   In general, if we perturb the plasma boundary with a corrugation or MP field of toroidal periodicity N P , the instabilities of the corresponding N P -periodic equilibrium separate into ⌊(N P + 1)/2⌋ toroidal mode families [21]. In the case of an N P = 2 equilibrium, there are two different toroidal mode families N 1 = 1, 3, 5, 7, . . . and N 2 = 0, 2, 4, 6, . . .. Without loss of generality, we restrict the analysis in this work to equilibria of periodicity N P = 2. The toroidal mode numbers of a mode family form instabilities by coupling together via the harmonics provided by the Fourier spectrum of the equilibrium [21]. For the created test case, the equilibrium Fourier spectrum contains significant non-axisymmetric contributions from the toroidal harmonics N = 2, 4, which enable the coupling between different toroidal perturbation harmonics n 1 and n 2 which differ by ∆n = 2, 4. For this reason, the Fourier spectrum of instabilities no longer contains only a single toroidal harmonic. As in the axisymmetric case, where every toroidal mode number is decoupled and the corresponding instabilities grow independently, the instabilities belonging to different mode families also grow independently.
There are multiple instabilities in each of the mode families. Some of these instabilities might have a clearly dominating toroidal harmonic n * in their Fourier spectrum. The dominating harmonic n * contributes to the distinction between different modes of the same mode family, similar to the toroidal mode number for axisymmetric plasmas. In general, because of the 3D geometry, there are two non-degenerate or degenerate eigenvalues for each dominating toroidal harmonic n * , which we will separate by their growth rate (fast or slow). Since the non-axisymmetric tokamak configurations are in general not stellarator-symmetric, it is not possible to separate the eigenfunctions by their parity as it it usually done for stellarator plasmas (see [16,21]).

Linear 3D stability analysis
The helical localization of the MHD instabilities is analyzed for the n * = 1, 2, 3, 4, 5, 6, 15 instabilities. The Fourier spectrum of the radial velocity perturbation for the n * = 4 fast growing mode as well as for one of the degenerate n * = 5 instabilities is shown in figures 4(a) and (b). While multiple toroidal harmonics (n = 2, 4, 6 or n = 3, 5, 7) are contained in the Fourier spectrum because of the coupling of toroidal harmonics, one can clearly see that there is a single strongly dominating toroidal harmonic, n = 4 or n = 5, for each of the instabilities which determines n * . Table 1 contains the growth rates of the fast and slow growing n * = 1, 2, 3, 4, 5, 6, 15 modes in comparison to their respective axisymmetric instability. One can clearly see that the instabilities become degenerate for n * > 4, because the growth rate or eigenvalue is equal for the fast and slow growing instabilities, i.e. ∆γ 3D,fast-slow = 0. The applied equilibrium corrugation has destabilized all instabilities of the plasma ∆γ 2D→3D > 0. Figure 4(c) reveals the exponential decrease of the energetic non-degeneracy with increasing mode number n * , which is similar to the exponential decrease of the contributions from the equilibrium Fourier harmonics N (figure 3). The distinction into slow and fast growing is arbitrary for the degenerate instabilities, which is not important since they describe the same instability (equal growth rate and spatial mode structure). However, we keep this distinction for the degenerate instabilities in table 1 in order to indicate that there are still two solutions of the eigenvalue problem. Comparing the Fourier spectra of the instabilities which correspond to the non-degenerate and degenerate eigenvalues, one can see that the former have significant contributions from both complex and complex-conjugate Fourier coefficients (figure 4(a)), while the latter have only significant contributions from either the complex or complex-conjugate Fourier coefficients ( figure 4(b)).
The energy density of the current-density drive δW CUR for different mode numbers n * is shown in figure 4(d) (see [19]). We will evaluate the helical localization of the eigenfunctions close to the most unstable flux surface. The most unstable flux surface is determined by the minimum of the potential energy density corresponding to the dominating drive, which is δW CUR for current-density driven instabilities and δW DP for pressure-gradient driven instabilities. If there is no clearly dominating drive, the helical localization has to be evaluated with respect to both energetic drives.

Toroidal mode locking
The eigenfunctions of an axisymmetric plasma ζ are proportional to a single toroidal harmonic ζ ∼ e −i nϕ because there is no coupling of the toroidal harmonics. Since in linear MHD the (complex) amplitude of the eigenfunctions is arbitrary, the multiplication of an eigenfunction by an arbitrary complex prefactor results in an equivalent eigenfunction corresponding to the same eigenvalue as the original eigenfunction. Thus, if ζ is an eigenfunction, ζ φ = ζe i φ are equi-valent eigenfunctions for any solution phase φ ∈ [0, 2π). In the case of a single toroidal harmonic, the solution phase is equivalent to a shift of the perturbation in the toroidal direction: This implies that there is no preferred toroidal position of the eigenfunction for an axisymmetric plasma.
Since in a non-axisymmetric equilibrium different complex toroidal harmonics as well as complex-conjugates couple together, the eigenfunctions might be located at preferred toroidal/helical locations. Clearly, the transition between solution phase and a toroidal shift in equation (5) is no longer possible if there is more than one toroidal harmonic in the Fourier spectrum of the eigenfunction. For non-axisymmetric plasmas, eigenfunctions can lock to certain toroidal locations, creating 'standing waves' with respect to φ by containing complexconjugate Fourier harmonics in their spectrum, or they can localize toroidally without strictly locking via the superposition of different toroidal mode numbers, similar to the poloidal localization known from ballooning modes. We will distinguish strictly locked perturbations, which are perturbations for which the helical position is strictly constant for all values of φ, and quasi-locked perturbations, which are perturbations for which the helical position varies with φ but which are bound to an envelope of periodicity N P . While the fine mode structure of the quasi-locked perturbations is not truly locked, their N P envelope which determines the mode amplitude is locked at a fixed position. Thus, especially for instabilities with a high toroidal mode number, the structure of quasi-locked modes seems like a locked n * = N P /2 mode. This will be discussed in more detail in the next subsection.
In order to systematically analyze the helical/toroidal localization of instabilities we define quantities representing the spatial structure/location of the mode while being independent of the arbitrary amplitude and sign of the eigenfunction. Such quantities are for example given by the normalized square of the perturbed magnetic field eigenvectors Re(B 1 e i φ ) 2 or by the normalized physical energy densities of the ideal energy functional, normalized with respect to the square of the arbitrary amplitude of the eigenfunction. As the normalized squares of the eigenfunctions are strictly positive, they purely encode the spatial localization of the mode. These normalized squared quantities are strictly independent of the solution phase φ if the mode is strictly locked or form an envelope for φ ∈ [0, 2π) if the mode is quasi-locked. Note that the periodicity of the squared quantities is twice the periodicity of the corresponding mode, e.g. the energy densities and squared eigenvectors of an n * = 1 mode have a periodicity of 2.
Since the instabilities in this section are current-density driven, we show the localization/structure of the perturbations relative to the normalized non-axisymmetric part σ 1,N of the parallel equilibrium current-density σ = j 0 · B 0 /B 2 0 , which is defined as where σ av (u) = ⟨σ⟩ v is the average of σ(u, v) over the toroidal coordinate v for every poloidal angle u and ∆σ av = ±[ max{σ av (u)} − min{σ av (u)}] is the variation of the axisymmetric parallel equilibrium current-density σ av along the poloidal direction; the sign of ∆σ av is chosen such that σ 1,N > 0 stands for an augmented current-density. The eigenfunctions with low dominating mode numbers n * = 1, 2, 3, 4 are strictly locked. There are two orthogonal eigenfunctions (fast and slow growing) located at distinct toroidal/helical locations for each of these perturbations. Their corresponding eigenvalues are non-degenerate. The location of the perpendicular magnetic perturbation Re(B 1,⊥ ) 2 of the n * = 1 fast and slow growing modes is shown in figures 5(a) and (b). Although the two orthogonal n * = 1 instabilities are located at different helical locations, they are positioned such that they maximize their current-density drive (figures 5(c) and (d)) which is optimized by locating where the nonaxisymmetric part of the parallel equilibrium current-density σ 1,N has its maximum. This alignment is natural since the instabilities are current-density driven. The faster growing n * = 1 mode perfectly aligns with the regions where σ 1,N is positive ( figure 5(c)). The slower growing n * = 1 mode, which is the second of the two orthogonal n * = 1 solutions and shifted by ∆v ≈ π/2, is distorted such that it minimizes the localization in the region of negative σ 1,N as much as possible ( figure 5(d)). Clearly, the n * = 1 mode which is located such that the parallel current-density drive is maximized is the faster growing dominating n * = 1 instability. Since the mode energy is proportional to the square of the perturbation (see equations (3) and (4)), the energy density of the n * = 1 instability is correlated with the non-axisymmetric N = 2 equilibrium harmonic.
As one can see in figure 6(a), the fast growing n * = 2 mode is localized in the regions of augmented as well as in regions of weakened parallel equilibrium current-density. If there are maxima of the n = 2 harmonic of the instability at the regions of augmented parallel equilibrium current-density (magenta region in figure 6(a)), there are also maxima at the regions of weakened parallel equilibrium current-density (cyan region in figure 6(a)), because the energy of the n = 2 harmonic has 4 maxima which can not be aligned with the two maxima of the dominating equilibrium harmonic N = 2. This means the n * = 2 instability is not correlated with the N = 2 equilibrium harmonic and its location is not determined by the N = 2 equilibrium harmonic. However, the non-degeneracy and localization of the n * = 2 perturbation is reasoned by the correlation with the N = 4 equilibrium harmonic. This can be seen in figures 6(c) and (d), where we subtracted the N = 2 harmonic from σ 1,N in order to reveal the N = 4 component of the parallel equilibrium current-density. The fast growing n * = 2 mode is at a favorable position (region of augmented current-density) while the slow growing n * = 2 mode is at a less optimal position (region of weakened current-density) with respect to the N = 4 harmonic (see figures 6(c) and (d)). Moreover, the localization in the regions of minimum parallel current-density is reduced by coupling to the n = 0, 4 harmonics, maximizing the growth rate of the n * = 2 modes (figures 6(a) and (b)).

Quasi-locked modes
The location of the perpendicular magnetic perturbation Re(B 1,⊥ e i φ ) 2 at φ = 0 of the n * = 15 mode as well as the corresponding envelope are shown in figures 7(a) and (b). One can see that the precise location of the eigenfunction is not fixed but bound to an envelope E = max φ {Re(B 1,⊥ e i φ ) 2 } of periodicity N P . In order to determine the envelope, it is necessary to evaluate the eigenfunction at a range of solution phase angles φ. As expected, close to the most unstable flux surface, the envelope of the n * = 15 eigenfunction is aligned with the maximum equilibrium current-density perturbation (see figure 7(c)). Note that the eigenfunction is eventually not aligned with the maximum equilibrium current-density perturbation at flux surfaces which are far from the most unstable flux surface.
From the considerations in this section it follows that, in general, for every harmonic of the equilibrium spectrum N the location of the perturbation with mode number can be optimized with respect to this equilibrium harmonic N, resulting in non-degenerate perturbations. Since the contributions of the equilibrium harmonics decrease exponentially, the non-degeneracy, which encodes the strict locking of the instability, also decreases exponentially. Note that only instabilities which are a multiple of N P /2 can be nondegenerate / strictly locked, belonging either to the N P /2 or N P mode family (see [21]). The energy of the degenerate instabilities is independent from the precise toroidal location of the eigenfunction but instead is determined by its envelope (with respect to the solution phase φ), which is aligned with the equilibrium perturbation of periodicity N P . This can be seen for the n * > 4 modes, which are quasi-locked. This interpretation is also in agreement with the results from linear MHD calculations for stellarators [16].

Strictly locked and quasi-locked instabilities in rotating plasmas
While both strictly locked and quasi-locked instabilities are helically localized, quasi-locked modes can still appear at slightly varying locations under the envelope. In order to further improve the understanding of the difference between strictly locked and quasi-locked modes, we investigate the behaviour of the instabilities for finite equilibrium rotation of the plasma Ω 0 . Note that the equilibrium plasma rotation is only included for the stability analysis (i.e. in the linearized equation system) but not for the equilibrium calculation, which is justified for low Mach numbers Ma ⪅ 0.2 [22]. The values of the plasma rotation applied in this section are lower than Ω 0 = 150 00 rad s −1 , which corresponds to a Mach number of Ma = 0.036 and is consistent with the limit in [22], with exception of the high rotation scenario Ω 0 = 100 000 rad s −1 , which corresponds to a Mach number of Ma = 0.24. While the non-degenerate instabilities remain strictly locked in their position even for finite plasma rotation, the degenerate eigenfunctions immediately start rotating under their envelope. Figure 8(a) shows the growth rates and oscillation frequencies for the fast and slow n * = 3 modes. If one exceeds a critical rotation Ω 0 > Ω crit (n * ), also the formerly non-degenerate instabilities become degenerate and start to rotate. This behavior was also previously investigated for stellarators [16]. The critical rotation for the n * = 3 mode is Ω crit (3) = 28.8 rad s −1 , which is a very small edge rotation threshold. Note that although the sign of the oscillation frequency is opposite for the two different eigenfunctions, they rotate in the same direction in real space. The critical rotation for the much stronger non-degenerate n * = 1 mode is Ω crit (1) = 9765 rad s −1 , which is in the order of typical edge rotation values of present machines. From the above consideration, it follows that quasi-locked instabilities have a critical rotation threshold of zero.
Clearly, the strictly locked modes are forced to rotate by the background velocity of the plasma. Since these instabilities naturally want to stay at a fixed location, they rotate irregularly/non-uniform, like being pushed through a bottleneck, which can be seen in figures 8(b)-(d). From the timeevolution of the irregular rotation, one can see that the instability seems to jump form one preferred location/position of rest to the next ( figure 8(b)). The instability is bound to an envelope. The mode slows down and nearly stops (region of high line density in figure 8(c)) before traversing the minimum of its envelope. While traversing the minimum, the mode is strongly deformed. The irregularity of the rotation decreases with both increasing plasma rotation and decreasing non-degeneracy of the instabilities in a flow-free plasma (figure 8(d)).
This system shows similar behaviour to a ball in a sinusoidal potential which is exposed to an external drag force. A sketch of such a system is shown in figure 9(a). Here we assume a ball which lies on a chain of hills made of a mesh and is forced to roll over the structure by a strong horizontal stream of air. The same behaviour would also be achieved for an electrically charged particle in an electrostatic sine potential which is forced to move through the potential by a background flow of neutrals. The equation of motion for such a system is given by: where m is the mass, v 0 the background velocity, α the drag force strength, k the potential force strength and h(x) = sin(x) 2 the profile of the potential. The potential force strength is related to the degeneracy k ∼ ∆γ 3D,fast-slow , the background flow is related to the equilibrium velocity of the plasma v 0 ∼ Ω 0 and the potential is related to the envelope of the instability h(x) ∼ E. Note that a similar equation of motion describes mode locking of tearing modes caused by external error fields [23][24][25]. Numerical integration of equation (8), shown in figure 9(b), provides the motion of the ball within the defined system and is in good agreement with the rotation behaviour of the quasi-locked and locked modes (see figure 8(d)). The ball only passes the hilltop above a critical threshold for the background flow, which is v crit ≈ 0.2354 for the chosen set of parameters m = 1, α = −0.85 and k = −0.2. Below this threshold the drag has not enough strength to push the ball over the hilltop and a force equilibrium between the drag and potential force is reached. This mechanical systems provides a physical understanding of the irregular rotation of strictly locked and quasi-locked MHD modes. The mode is dragged by the equilibrium plasma flow while a restoring force from a potential (represented by the envelope) tries to pull the instability back to its preferred localization. While there is an envelope also for the quasi-locked modes, their restoring force is small, since they are (numerically) degenerate (k ≈ 0). Finally, figure 10 shows the Fourier spectrum of the n * = 1 instability for Ω 0 = 15 000 rads −1 and Ω 0 = 100 000 rads −1 . If the plasma rotation is large enough such that the forced rotation of the strictly locked n * = 1 instability becomes nearly uniform, there are only significant contributions of either the complex or complex-conjugate Fourier coefficients to the spectrum of the eigenfunction. Thus, for Ω 0 ≫ Ω crit , the Fourier spectrum of the forced rotating modes becomes similar to the spectrum of the quasi-locked modes (see figure 4(b)). A similar suppression of complex or complex-conjugate Fourier coefficients was also recently found for instabilities in stellarator plasmas which were strongly affected by diamagnetic drift [26].

Application to an AUG experimental case
In the following, we compare the numerically predicted mode localization to experimental measurements. The experiment which we will use for comparison was performed at the ASDEX Upgrade tokamak and an experimental analysis was done in [10]. Here, the initially axisymmetric magnetic field of the tokamak was perturbed by MP coils, which create a non-axisymmetric vacuum field acting on the plasma equilibrium. The plasma reacts to this vacuum perturbation with a saturated kink-response forming a weakly non-axisymmetric  equilibrium. In this experiment, an N P = 2 vacuum perturbation field was rotated around the plasma toroidally at a frequency of 3 Hz while the MHD activity was measured by the ECE (electron cyclotron emission) diagnostic at a toroidally fixed location on the outboard midplane as shown in figure 11. This method allows ECE data to be obtained at different toroidal phase angles Φ MP of the vacuum field, which is equivalent to a scan in the toroidal direction. Figure 11 shows the spectrogram of the ECE intensity for a ECE frequency f ECE emitted from the plasma edge measured during the experiment as well as the equilibrium corrugation at the ECE position. One can see that there is MHD activity, caused by inter-ELM modes [10], in the ECE spectrogram (darker regions) only on every other zero of the corrugation. However, since the ECE measures at the same flux surface for every zero of the corrugation this means that the MHD activity or MHD instabilities must be toroidally/helically localized, i.e. they occur at preferred toroidal locations. This is further confirmed by magnetic measurements [10]. Moreover, ELM activity is also found to be at the same location as the inter-ELM modes [10].
For the numerical MHD stability analysis, the nonaxisymmetric MHD equilibrium was calculated with the NEMEC [27,28] and GVEC [20] codes for the applied MP coil currents and for the experimental equilibrium profiles and axisymmetric coil currents obtained by equilibrium reconstruction using the CLISTE code [29]. We use the freebounadry equilibrium code NEMEC to obtain the perturbed plasma boundary from the coil currents, which is in good agreement with experimental lithium beam measurements (see [10]), and refine the NEMEC equilibrium using the GVEC code. Figure 12(a) shows the resulting corrugation of the magnetically perturbed equilibrium. The Fourier spectrum of the equilibrium contains significant non-axisymmetric contributions of the toroidal harmonics n = 2, 4. Figure 12(b) shows a Poincaré plot of the equilibrium, revealing that there is ergodization of the magnetic field near the edge. For the stability analysis, we will crop the ergodized region of the equilibrium at the dashed line in figure 12(b) (s = 0.98) since this region is not well-described by closed flux surfaces or straightfield-line coordinates. The cropped region contains 0.92% of the toroidal plasma current and 0.02% of the thermodynamic energy W pV =´pdV. The thickness of the cropped region at the outboard midplane is 1.8 mm averaged over the toroidal direction.
While the axisymmetric equilibrium, i.e. without application of the MP coils, is stable with respect to ideal MHD, the non-axisymmetric equilibrium is unstable to a strictly locked, ideal, purely current-density driven (δW DP > 0), n * = 1 instability located at the plasma edge. Since the ECE measurement corresponds to a point of constant magnetic field strength along the ECE line-of-sight whereas perturbed quantities in ideal MHD are defined at a constant point in space, we must couple the perturbed quantities to the perturbation of the magnetic field for comparability to the ECE data. To first order, the linear (electron) temperature perturbation at the ECE point of view becomes where e R is the vector pointing in the direction of the ECE lineof-sight and all quantities on the right side of the equation are evaluated at x 0 corresponding to the equilibrium ECE point of view. In equation (9), the thermodynamic temperature T may be replaced by any quantity. Replacing T by the magnetic field strength B, we get B ECE,1 ≡ 0 by construction. Note that the ECE diagnostic measures the ECE intensity or radiation temperature T rad , which is not the same as the thermodynamic (electron) temperature at the ECE point of view T ECE (see [30]). However, in order to compare the helical mode localization between the experiment and linear MHD, we assume that the localization of the MHD activity measured by the ECE diagnostic is strongly related to the linear MHD temperature perturbation at the ECE point of view T ECE . Figure 13(a) and (b) shows the linear ECE temperature perturbation T ECE,1 of the calculated n * = 1 instability relative to the equilibrium corrugation at s = 0.9018. The poloidal and toroidal angles are the geometric angles determined with respect to R 0 = (R geo , Z ECE ), where R geo = 1.66 m is the geometric radius of the device and Z ECE = 3.5cm is the ECE height. The toroidal angle increases in the clock-wise direction in order to be comparable to the time-trace of the ECE spectrogram shown in figure 11. One can see that, similar to the measured ECE intensity, T ECE,1 is large close to the zerocrossing of the corrugation which is right from the maximum corrugation and T ECE,1 is small close to the zero-crossing of the corrugation which is left from the maximum corrugation. Figures 13(c) and (d) shows the perpendicular displacement and normalized current-density drive of the perturbation relative to σ 1,N . The perpendicular displacement is located at the regions of augmented equilibrium current-density, maximizing the potential energy of the instability. Note that the small misalignment between δW cur and σ 1,N (figure 13(d)) could be the consequence of the increasing influence of the stabilizing energy contributions close to the stability boundary.

Modified equilibrium
Finally, we varied the experimental equilibrium profiles in order to test if the localization of the instability with respect to the equilibrium corrugation is robust. We increased the current-density and pressure gradient in the edge by a factor of 2, while keeping the total toroidal current, plasma energy and shaping constant. However, because of the increased currentdensity and pressure gradient, we had to reduce the MP field strength by a factor of 3 in order to get a converged nonaxisymmetric MHD equilibrium. The corrugation of the resulting non-axisymmetric equilibrium as well as a comparison of the pressure and safety factor profiles of the modified and unmodified case are shown in figure 14.
The modified equilibrium is unstable to edge localized instabilities of any toroidal mode number even without application of the MP coils, where we have calculated growth rates for n = 1 to n = 23. The growth rates and the relative pressuregradient drive increase with increasing toroidal mode number. All investigated toroidal mode numbers have significant contributions from the current-density drive (δW CUR /(δW CUR + δW DP ) = 92% for n * = 1 to 50% for n * = 23). The n * = 1 − 4 modes are strictly locked while the n * > 5 instabilities are quasi-locked.
The ECE temperature for the n * = 23 (most unstable) instability is shown in figure 15(a). One can see that the linear ECE temperature of the n * = 23 mode is not located at the same location relative to the equilibrium corrugation as the experimentally measured instabilities, which is reasoned by the modified pressure and current-density profiles. However, since the instability is still significantly currentdensity driven, it is still aligned with the regions of augmented equilibrium current-density ( figure 15(b)). This is in agreement to the alignment of the current-density driven instabilities  analyzed in the previous sections. Moreover, the instability is also aligned with the regions of increased 'bad curvature' κ · ∇p 0 at the most unstable flux surface with respect to δW DP . In conclusion, the localization of the instability relative to the equilibrium corrugation varies with moderate variations of the equilibrium. Instead, the localization of the mode is determined by the energetic drives close to the most unstable flux surface.

Conclusion
In this work, we discussed that in general every MHD instability, which is a solution of the linear MHD equations, has multiple possible mode structures or can be located at different toroidal angles. We systematically analyzed helical mode localization of instabilities by investigating their possible mode structures, which are represented by the arbitrary complex amplitude or phase angle of the linear solution.
Two different types of mode localization, strict locking and quasi-locking, were introduced. If the non-axisymmetric equilibrium contains a significant contribution of the toroidal harmonic N, instabilities which have a dominating toroidal mode number n * = N/2 are strictly locked, which means they can only appear in a single toroidal location. This is because energy density of these instabilities is correlated to the equilibrium harmonic N, creating preferable toroidal locations. Strict locking is directly related to non-degenerate eigenvalues of the two orthogonal eigenvectors (slow and fast growing solutions) corresponding to the same dominating toroidal harmonic. In a rotating plasma, strictly locked instabilities start rotating/oscillating only above a critical rotation threshold. When these strictly locked modes are forced to rotate with the plasma, their rotation is non-uniform. With increasing plasma rotation, the rotation of the instability becomes increasingly more uniform. The instabilities of the non-axisymmetric equilibrium which are not strictly locked are quasi-locked, which means that their location is determined by a helically localized envelope but their position beneath the envelope is arbitrary. Quasi-locked modes are represented by a pair of degenerate eigenvalues. In a rotating plasma, the quasi-locked modes start to rotate immediately without the need to overcome a critical rotation threshold and their rotation is uniform. The major differences between strictly locked and quasi-locked modes in rotating and non-rotating non-axisymmetric plasmas are summarized in table 2. Table 2. Summary of the major differences between quasi-locked and strictly locked linear MHD instabilities in rotating (Ω 0 > 0) and non-rotating/flow-free (Ω 0 = 0) non-axisymmetric plasmas. ( * ) We define two (complex) eigenvalues λ 1 = γ 1 + iω 1 and λ 2 = γ 2 + iω 2 as degenerate if γ 1 = γ 2 and |ω 1 | = |ω 2 |.

Quasi-locked
Strictly locked Ω 0 = 0 Mode amplitude determined by an envelope, but position of fine mode structure not fixed Only one possible mode location; the mode structure is fixed Ω 0 > 0 Mode rotates for any Ω 0 under its envelope Rotation only above critical threshold Ω 0 > Ω crit Ω 0 > 0 Nearly uniform rotation for any Ω 0 > 0 Locked/non-rotating (Ω 0 < Ω crit ) Forced non-uniform rotation (Ω 0 > Ω crit ) Ω 0 ⩾ 0 Two degenerate ( * ) eigenvalues for each n * Two non-degenerate eigenvalues for each n * (Ω 0 < Ω crit ) Both, strictly locked and quasi-locked instabilities, are helically localized with respect to the non-axisymmetric equilibrium component. The instability (strictly locked modes) or their envelope (quasi-locked modes) is located such that the potential energy of the instability is minimized. For this reason, the localization of the instabilities is determined by the energetic drives close to the most unstable flux surface. We demonstrated that, for the strongly current-density driven instabilities, the (fast growing and degenerate) instabilities were localized such that they were aligned with the region of augmented parallel equilibrium current-density close to the most unstable flux surface in order to maximize their currentdensity drive. The localization of the quasi-locked and strictly locked instabilities is achieved by coupling of the different toroidal harmonics.
Finally, a comparison to experimental observations was performed. Therefore, the helical localization investigated by the ECE diagnostic was compared to the electron temperature perturbation at constant magnetic field strength. The instability, which was determined by the linear stability analysis, is current-density driven and located at the same helical location as observed in the experiment, which verifies that ideal MHD can describe the observed instabilities. It is aligned with the region of augmented current-density. The pressure and current-density profiles of the equilibrium were modified in order to investigate the parameter space around the operational point. The current-density driven modes of the modified equilibrium were also aligned with the regions of augmented equilibrium current-density, while no consistent alignment of the instabilities is found with respect to the corrugation for the experiment and modified case.
Note that in general finite-n (non-local) MHD instabilities are the solution of a global energy minimization. Ideal MHD instabilities can be driven/stabilized by current-density, pressure-gradient or both (see [18,19]). Depending on their energetic decomposition, they might preferably align with regions of augmented equilibrium current-density (currentdensity driven modes) or bad field-line curvature (pressuregradient driven modes) or the position will be a complex compromise between these alignments such that the global energy is minimized. While this is a very general statement, a detailed global MHD stability analysis is required in order to predict the precise localization of general finite-n instabilities for a specific MHD equilibrium.
Future work might focus on the analysis of the influence of MP field strength or configurations on helical mode localization and investigate the effect of MP fields on the linear MHD stability limit. Moreover, the impact of additional (non-)ideal MHD effects as resistivity and gyroviscosity on the stability of magnetically perturbed tokamak plasmas might be investigated.