Tokamak to stellarator conversion using permanent magnets

With the advances in the optimization of magnetic field equilibria, stellarators have become a serious alternative to the tokamak, bringing this concept to the forefront of the pursuit of fusion energy. In order to be successful in experimentally demonstrating the viability of optimized stellarators, we must overcome any potential hurdles in the construction of its electromagnetic coils. Finding cost-effective ways of increasing the number of operating optimized stellarators could be key in cementing this magnetic confinement concept as a contender for a reactor. In this work, an alternative to modular coils, permanent magnets, are studied and are shown to enable the possibility of converting a tokamak into a stellarator. This is then applied to the case of ISTTOK tokamak, where an engineering design study is conducted.


Introduction
Successive breakthroughs in stellarator research have greatly reduced what was considered to be their primary drawback, neoclassical transport [1].This has been experimentally realized with the W7-X device [2].Furthermore, due to having no plasma current, stellarators offer inherent steady-state operation and far fewer magnetohydrodynamic (MHD) instabilities, leading to no disruptions.On the other hand, they are technically more complex, usually relying on non-planar coils to generate their magnetic field.
The optimization, construction, and assembly of complex coil systems have proven to be one of the biggest bottlenecks and cost drivers in the development of modern stellarators [3,4,5].For instance, in the case of W7-X, coil manufacturing tolerances were approximately 0.1% relative to the coil radius, while the magnetic system placement tolerances were kept below 1.5 cm [3].The maximum coil assembly error remained under 4.4 mm [3].Meeting these stringent requirements was only possible with precision metrology and continual adjustments of the built components, including a reoptimization procedure based on the up-to-date coil and module shapes and positions [3].This has sparked a search for simpler methods of achieving the desired magnetic field configurations without compromising field quality and plasma confinement.
Although magnetic confinement devices have traditionally relied on electromagnets to create a toroidal magnetic field equilibrium, Ref. [6] has introduced the idea of coupling coils with permanent magnets (PMs).By providing additional threedimensional shaping of the magnetic field, PMs can alleviate the role of non-planar coils, thus allowing a reduction in the complexity of the coil systems Refs.[6,7,8,9,10,11].For less stringent magnetic equilibria, PMs are even able to eliminate the need for non-planar coils allowing for a stellarator design that requires only toroidal field coils similar to those of a tokamak [7,8,9,10,11,12,13].
Besides simplifying the coil systems, permanent magnets offer other advantages.PMs have a steady magnetic field that requires no external source of power, they only require passive mechanical support and there is no need for cryogenic electrical connections, in contrast with superconducting coils [14,15,16].Furthermore, the materials used in permanent magnets are inexpensive, especially when compared to the superconductors used in the modular coils of fusion devices.The cost of assembly and the supporting structure likely exceeds the material cost of the magnets [7].This makes PMs a cost-effective choice, reducing both manufacturing and energy consumption expenses.Finally, PMs would be able to produce less field ripple than modular coils due to having a more continuous distribution [17].However, permanent magnets have some disadvantages: their inability to be turned off, their inherently discrete and limited magnetic field strength, and the prospect of demagnetization [14].
Fortunately, magnetic materials have considerably improved, with the magnetic field energy density doubling every 12 years throughout the 20th century [14].Commercial magnets can now have remnant magnetic fields B r larger than 1.4 T while also having a coercive field µ 0 H c larger than 2.2 T at room temperature [18].Coercivity may be increased to as high as 3.5 T albeit with a reduction in the remnant field [18].Coercivity may be further increased by reducing the magnet's temperature.A sintered neodymium magnet with a coercive field of µ 0 H c = 1.25 T at room temperature has a much higher µ 0 H c > 5 T at 77 K [19].In a similar manner to how high-temperature superconductor coils are cooled down to liquid nitrogen temperature (77 K) to enable the generation of very large magnetic fields, magnets could be cooled down to prevent their demagnetization.These properties make PMs relevant for most of the present-day magnetic confinement facilities, especially for university-scale projects.
Permanent magnets are present in a large number of high-field applications, namely particle accelerators [20], electric motors [21], and magnetic resonance imaging [22].Nonetheless, for a fusion reactor, where the average toroidal field is likely to exceed 5 T [5], magnetic materials need to either be improved or restricted to the low field side.Alternatives that still produce dipole-like fields without relying on magnetic materials, such as superconducting tiles [23] or small superconducting saddle coils could represent a way of extending the core principles of PM stellarators to higher field machines.
After the demonstration of the possibility of designing stellarators with permanent magnets by Ref. [6] and the realization that present-day materials are relevant for fusion research, large efforts began in adapting existing codes [7] and developing new codes for PM design, namely FAMUS [8], MAGPIE [24] and SIMSOPT [17,25,26].Additionally, the PM4Stell project [9] attempted to prove the technical viability of permanent magnets through the construction of a half-period device that uses the NCSX equilibrium, replacing the modular coils with a permanent magnet structure.Finally, a small quasi-axisymmetric stellarator, MUSE, has been built using only normally oriented PMs and circular toroidal field coils [10].The present work leverages the outlined projects and makes use of their developed tools, especially the greedy optimization algorithms from SIMSOPT [17] and MAGPIE [24] (see Section 3).
Historically, tokamaks have yielded larger energy confinement times than stellarators, while being technically simpler.This has led to tokamaks outnumbering stellarators roughly by a factor of 5 [27].Increasing the experimental efforts, even with smaller machines, could greatly increase the understanding of different stellarator equilibria and plasma regimes.Nonetheless, this requires a large investment or cheaper alternatives for designing and building stellarators.Conversely to how the model C stellarator was repurposed to be the Symmetric Tokamak [28], in this work, we propose the conversion of a tokamak into a stellarator.This idea arises from the realization that by swapping the transformer/solenoid of a tokamak with permanent magnets, we have all the necessary components to build a stellarator without a large investment.Although a large portion of the obtained results should be general and applicable to other tokamaks, for concreteness, we applied the tools developed in this work to the conversion of the ISTTOK tokamak [29] to a stellarator.This paper is organized as follows.Section 2 provides an overview of the ISTTOK tokamak, its current setup, and the aspects to take into account for adding permanent magnets.In Section 3, the used permanent magnet optimization and array design methods are described.Core design choices, namely the omnigeneous type of magnetic equilibrium (quasi-axisymmetric, QA; quasi-helically symmetric, QH; or quasiisodynamic, QI), the vacuum vessel shape, the magnet array design, and the magnet's orientations are addressed in Section 4. In Section 5, we optimize a suitable equilibrium and evaluate three different scenarios to identify a viable design for converting the ISTTOK tokamak into a stellarator.The conclusions follow.

Description of the ISTTOK tokamak
ISTTOK is the only toroidal magnetic confinement device in Portugal.Its construction began in 1990 with many of its components being repurposed from the TORTUR tokamak [29].Its toroidal magnetic field results from a set of 24 circular coils which produce an on-axis magnetic field of 0.5 T. These coils could generate up to 3 T if coupled to a cooling system and a larger power source.The poloidal magnetic field is provided by four vertical and two horizontal field coils beyond the self-created field by the plasma current.Today, its main objectives are the study of plasma turbulence, operation and control on alternating plasma current regimes, testing liquid metal limiter concepts, developing and upgrading plasma-relevant diagnostics for nuclear fusion, and supporting nuclear fusion and plasma physics education.
The experimental parameters of ISTTOK relevant for this work are summarised in Table 1 and Fig. 1 showcases its main components.With a magnetic field of 0.5 T at a major radius of 0.46 m and a coil radius of 0.2025 m, the maximum field inside the nominal toroidal field coils is ≤ 0.9 T which is comfortably below the coercive field of grade N52 NbFeB magnets.Furthermore, the PM4Stell project tested demagnetization effects also using a 0.5 T toroidal field for NCSX, whose coil radius is considerably larger, and calculated that less than 1% of the magnets were at risk of demagnetization [9].[30].
A cross-section of ISTTOK's current setup is illustrated in Fig. 2. The concept of transforming ISTTOK into a stellarator using permanent magnets stems from the The vacuum vessel has a minor radius of 8.5 cm in its narrowest section (grey).The vessel is enveloped by a copper shell that maintains a minor radius of 10 cm for the majority of its extent.However, its widest section, corresponding to the region where the two halves of the vessel are fixed together, has a radius of 12.75 cm (orange).
recognition that there is a substantial volume available between the coils and the copper shell enveloping the vacuum vessel.The copper shell, for the majority of its extent, maintains a minor radius of 10 cm, while the coils have a circular shape with a radius of 20.25 cm.This configuration allows for the placement of magnets close to the plasma, thereby maximizing their impact.If the coils were directly positioned on the vessel, it would only be feasible to place magnets at a relevant distance to the plasma between the coils.Nonetheless, this configuration still poses challenges, particularly since the available volume on the high field side is significantly smaller than on the low field side.It is anticipated that a larger volume of magnets will be required where the toroidal field is the largest.This challenge is further explored in Section 5.2.
Another aspect to take into account in ISTTOK's current design is the plasma accessing ports, see Fig. 3.The plasma accessing ports pose a challenge to the integration of permanent magnets in magnetic confinement devices, directly influencing the available volume for magnet placement.In the design of a machine from scratch, the port placement can be strategically chosen after determining ideal magnet locations, and the number of ports can be minimized.Furthermore, the locations of these ports can be selected to adhere to stellarator and field period symmetry, see Ref. [31] and Section 5.4.For ISTTOK however, if the vacuum vessel is to be kept, the large number of ports, 33 in total, the lack of either of the mentioned symmetries, and the need for the magnet placement to accommodate the existing port locations present an added layer of complexity.One positive characteristic of ISTTOK's ports is their geometrical simplicity.All ports are cylindrical and their dimensions fall on one of three flange standards, DN40, DN60, or DN100.The modeling and impact of including the ports in the design are evaluated in Section 5.3.

Optimization Methods
In this work, we use the SIMSOPT code [25] for magnetic equilibrium optimization and permanent magnet optimization.The goal of permanent magnet optimization is to find a magnetization distribution that produces an intended magnetic field.This field is usually computed in one of two ways, effective currents or discretized magnetic dipoles.We use the latter approach.The available volume for the magnetic material is split into elements of a mesh, with the center of each element depicting a dipole.By optimizing a predefined set of possible available positions, the complexity of the problem is considerably reduced, while ensuring the solution obtained can be reasonably built.
Two types of magnet arrays were used, a uniform toroidal grid, following the scheme in Ref. [17] and the trapezoidally-enclosed rectangular prisms (trec) [32] design from MAGPIE [32].For the first, the array is defined between two toroidally closed surfaces.The radial grid spacing, dr, is an input, while both the toroidal and poloidal grid units are defined by the quadrature points of the plasma surface.In general, a 64 × 64 quadrature grid was considered per half-field period.For the second, each magnet is a rectangular prism that conforms to a rectangular grid in cylindrical coordinates.The magnet array consists of drawer-like bundles that are grouped into a number of toroidal wedges.Within a drawer, the magnets are glued to one another.Each wedge is divided into two subsets, one for the high field side and one for the low field side, which is further determined separately at the top and bottom to best adjust the inner limiting surface.In this concept, all magnets have the same shape and size, there are no unique magnets, which reduces magnet and assembly cost, while facilitating the array construction (see Fig. 9 and Refs.[9,32]).
Having defined the magnet mesh, similarly to coil optimization, our objective is to minimize the squared error field on the plasma surface.The optimization problem can then be formulated as where with n the normal vector to the magnetic surface, m a vector with the magnetic moment of all the D dipoles, and B coils is the field produced by the coil system.The objective function f B can be reformulated as [26] where A is a matrix that depends only on the geometry of the problem and b encapsulates the magnetic field from sources other than the permanent magnets.These two factors can be computed before the optimization begins, and then re-used, thus making this form of f B more computationally efficient.The magnetic material used in the design will be evaluated by the effective volume, One engineering restriction that is essential in permanent magnet optimization is a limit on the value of the magnetization, This guarantees that the calculated magnet solution can be constructed from real magnets.In the present work, we consider commercial N52 neodymium-iron-boron magnets [33] for their high remnant fields, B r = 1.43 − 1.48T (m max i = B r V i /µ 0 , where V i is the volume of magnet i), and their high coercive fields, H c ≤ 2 T.
Having defined Eq. ( 2) with the restriction in Eq. (4), the most common approach is to perform continuous optimizations that take advantage of gradient-based algorithms [6,8,26,10,32].Choosing this approach has the consequence of producing solutions where each cell has a different magnetic moment with possibly varying orientations.Different magnetic moments can be attainable by either using distinct materials, effectively changing the magnetization or by using magnets with different volumes.This would make manufacturing and assembly of magnet grids highly non-efficient, defeating the purpose of introducing PMs in stellarators.Therefore, the solutions need to be further tuned to produce binary dipole distributions with a fixed magnetization and the magnet orientations need to be mapped to a set of possibilities to ensure they are feasible.Those two steps reduce the field accuracy of the found solution.
In Ref. [17], the Greedy Permanent Magnet Optimization (GPMO) algorithm that directly produces binary dipole arrays from a set of possible orientations was introduced.Using this algorithm we can define the material to be used, the set of possible magnet orientations, and the magnet grid, before the optimization.This is the ideal case, as it keeps the number of unique magnets to a minimum, facilitating the fabrication and assembly of the magnet system.Furthermore, GPMO outperforms other state-of-the-art algorithms while being substantially faster [17].Due to these factors, GPMO was chosen as the method to use in this work.Since the solutions are binary, the dipole moment is normalized by its respective maximum in the previous formulation (see Ref. [17]).
The GPMO algorithm can be outlined in the following way.The maximumstrength magnetic moment that minimizes f B out of a predefined mesh of possible dipole positions and orientations is added individually at each iteration.Once a magnet is placed, its corresponding position is removed from the grid of available positions.The procedure repeats until K magnets have been positioned.We note that the GPMO baseline algorithm has been expanded to include other variants, such as the baseline GPMO, GPMO backtracking (GPMOb) and its Arbitrary Vector (ArbVec) versions [17,34].GPMOb works by backtracking every K b iteration, checking the N adjacent adjacent magnets for each magnet placed and removing the oppositely orientated pairs it finds.GPMOb is more accurate than the baseline version and requires fewer magnets, thus GPMOb solutions are more cost-effective.The ArbVec version of the baseline and backtracking algorithms introduces user-specified magnet orientations.Before this addition, the magnet orientations were defined by the coordinate system.Therefore, when using a uniform toroidal grid, the magnets followed the toroidal, poloidal, or radial directions.For further descriptions of GPMO see [17] and [34].

Design Choices: Equilibrium, Vessel, and Magnet Grid
Before establishing a definite solution, it is enlightening to start with a simpler approach, namely to use uniform grids to assess the viability of the project and to evaluate multiple early design choices.

Magnetic Configuration
First, two aspects were considered -the type of magnetic field omnigenity (QA, QH, or QI) and the impact of the toroidal magnetic field intensity on the resulting field quality.When optimizing electromagnetic coils only, the latter is typically not a concern, due to the fact that to reach higher fields, one simply needs to scale the current up.In contrast, for permanent magnets, the field intensity may only be altered by either changing the magnets' volume and/or its material.Ideally, when designing a magnet grid, all magnets have a predetermined volume, are restricted to one material only, and their orientations are chosen from a finite set.This makes construction and assembly considerably easier by keeping the number of unique magnets to a minimum.As the average toroidal magnetic field increases, to keep a given magnetic equilibrium the poloidal component must increase accordingly.However, given the fact that the maximum volume of the magnet mesh is fixed, the field produced by the magnets will, at some point, be too low to keep up with the toroidal field intensity produced by the coils.
To confirm this idea, three different configurations were used: a precise QA configuration [35] with ι QA = 0.185 and a number of field periods of nfp QA = 2, the precise QH from Ref. [36] with ι QH = 1.24 and nfp QH = 4, and W7-X's standard configuration [37] with ι W 7−X = 1 and nfp W 7−X = 5 [3].The major radius was chosen to match ISTTOK's, R 0 = 0.46 m.Permanent magnet optimizations using the baseline GPMO algorithm were performed scanning over different values of toroidal magnetic flux, ϕ edge , for the last closed flux surface, where S is the surface delimited by the plasma boundary.The magnet grids were defined in toroidal coordinates with 64 by 64 quadrature points and a magnet radial dimension of dr = 2 cm following the SIMSOPT scheme explained in Section 3. The grid's inner and outer limiting surfaces were separated by a radial extent of r ext = 13 cm.The toroidal component of the magnetic field is provided by 24 circular coils whose currents are optimized before the PM optimization.The obtained objective function, f B , for a given ϕ edge value is represented in Fig. 4. In order to properly assess if the field quality is relatively increasing as ϕ edge decreases, the objective function is normalized by the square of the field intensity at the axis, (B 0 ) 2 multiplied by the surface area of the equilibrium, A S = 4πR 2 0 /A, where A = R 0 /a is the aspect ratio, R 0 is the major radius and a is the minor radius.
As shown in Fig. 4, the equilibria are more easily reproduced in the order: QA, QI, QH.This aligns with the increasing order of ι.Notably, low ι QA configurations prove to be the most achievable with permanent magnets, with the QA configuration being the only one with an error field below 0.01%.This is expected as higher ι requires a higher poloidal field strength, which is provided by the PMs.Additionally, QA configurations are more convenient for fitting into a circular vessel, making it the selected magnetic equilibrium used in this work.
Although the behavior of the curves for the three configurations is vastly different, a noticeable trend emerges at high ϕ edge .Namely, the relative error field increases with increasing magnetic field flux.However, for the QA case, between ϕ edge ≈ 0.002 T m −2 and ϕ edge ≈ 0.008 T m −2 , there is a plateau.This suggests that the magnetization of the considered material (N52 NdFeB) is enough to obtain the poloidal component of the 0.000 0.003 0.006 0.009 0.012 0.015 0 , and the surface area of the equilibrium, A S = 4πR 2 0 /(2Anfp), as a function of ϕ edge for three magnetic field surfaces.The equilibria are more easily reproduced in the order QA, QI, and QH, with the QA configuration being the only one with an error field below 0.1%.field and no relative advantage is gained from reducing the toroidal magnetic field.For very low magnetic field flux, there is an increase that may suggest the magnetization is too high, and using weaker magnets could be beneficial.

Vacuum Vessel Shape
We now assess the influence of the shape of the vacuum vessel (VV) on the optimization of the permanent magnets.In tokamaks, a circular or D-shaped VV is commonly employed, while for stellarators, the VV usually follows the cross-section of the nested magnetic surfaces.We then considered two grids, one with a circular cross-section and one following the cross-section of the plasma boundary.
The grids followed a setup similar to the one used above, namely toroidal coordinates, 64x64 quadrature points, dr = 2 cm, d plasma = 2 cm and 24 circular coils.The toroidal magnetic field was kept at 1 T.For the circular grid, a radial extent of r ext = 13 cm was defined, while for the magnetic surface cross-section, two cases were investigated, one with the same radial extent as the circular case and one where r ext was chosen to match the effective permanent magnet volume, V ef f , of the circular case.This bifurcation arose from the recognition that for the same radial extent, there was a larger effective volume available to the circular case.
The three described cases were optimized for the same QA configuration using the baseline GPMO algorithm.The resulting optimization curves are shown in Fig. 5 and the magnet configurations for the optimized solutions are shown in Fig. 6.From the optimization curves in Fig. 5 left, it is clear that using a circular VV is advantageous when compared to using a VV with the equilibrium's magnetic surface cross-section, 0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 as f B is roughly one order of magnitude lower.Although for the latter, the cost function initially decreases faster with the used magnet volume, it also reaches a plateau first, around V ef f ∼ 0.15 m 3 compared to V ef f ∼ 0.25 m 3 .This is a positive result for converting tokamaks into stellarators, as it means that, at least for low ι QA configurations, the VV may be kept the same without a loss in field quality, as long as multiple magnet orientations are considered.
The closest layers of magnets to the VV are filled first for both grid layouts, meaning they lead to the biggest reduction of the cost function.Furthermore, the chosen grid spots and corresponding magnet orientations are very similar for the two cases in Fig. 7, with radially oriented magnets being the most prevalent.This means that, for a thin layer, using a magnet grid that follows the magnetic surfaces is advantageous.However, as the distance to the plasma increases, the magnets placed on the circular grid have a larger effect leading to a later saturation of the objective function and a lower minimum.
In the present case, we obtained an objective function of f B = 6 × 10 −6 T 2 m 2 , yielding field errors close to 0.1%.To assess if such an objective is low enough to obtain the target set of nested flux surfaces, the field lines were traced using the SIMSOPT framework with a tolerance of 10 −14 .The Poincaré plot, i.e., the tracing of the magnetic field lines along a cross-section plane, on the resulting field of the toroidal field coils and permanent magnets is shown in Fig. 8.We find that the field lines approximately follow the intended surfaces and that there are no signs of magnetic islands.We note that the uniform meshes considered here do not allow for spacing between magnets for a support structure, nor leave space for ports to access the plasma.These approximations will negatively impact the generated field, thus it is important to find ways of including these aspects while keeping f B low.
As an aside, we note that for designs where the main goal is the use of a thin layer of magnets, where most of the poloidal field is provided by another source, e.g., to do error field corrections to a set of modular coils, the results above point to the use of a magnet grid with the same shape as the boundary of the nested flux surfaces as a more viable option as it offers a faster decrease of the objective function and follows the shape of the coils more closely than a circular shape, which is favorable for maximum use of the available volume.The grid may even be further restricted to only allow normally oriented magnets for ease of assembly as it is the dominant magnet orientation, similarly to Ref. [7].

Cubic Magnets and Polarization Study
Up to now, we have only considered uniform magnet grids which are useful for determining a project's viability and allow qualitative comparisons between distinct situations.However, in order to design a magnet array that can be built, one has to consider spacing for a mounting structure and practical magnet orientations.The ideal Note that the radial direction is by far the most populated one and that the positions close to the VV are preferred over farther away spots.This indicates that the equilibrium cross section is more effective for radially oriented magnets close to the VV, but is less efficient when the magnets have to be placed farther away.
magnet mesh should minimize the number of unique magnet types both in shape and in polarization while maximizing the use of the available volume and the number of possible magnetization directions.For this purpose, the MAGPIE code [32], which was developed with the objective of aiding the design of practical PM arrays, was used.MAGPIE currently supports three geometries: quadrilaterally-faced hexahedra (qhex ), curved bricks (cbrick ), and trapezoidally-enclosed rectangular prisms (trec).The qhex concept is intended for perpendicularly oriented magnets.The cbrick concept can fit the volume between two toroidal surfaces better than the trec concept.However, the magnets increase in volume with the radial coordinate, thus increasing the number of unique magnets.Furthermore, as a consequence of having a curvature, they do not have any rotational symmetries that can be exploited to increase the number of magnetization directions without increasing the number of unique magnets.Since minimizing the number of unique magnet types and maximizing the number of possible magnetization directions are key aspects in an ideal magnet mesh, the trec concept was chosen.The advantages of this design can be built upon by considering cubic magnets.In the prism family, cubes have the most degrees of rotational symmetry, thus maximizing the possible magnet orientations without increasing the number of unique magnets.Additionally, picking cubes reduces the degrees of freedom by choosing only 1 spatial dimension instead of up to 3 (length, width, and height).Furthermore, the cubic magnet has the least average dipole approximation error for rectangular-cross-section bars and when compared to other shapes, namely diametric and axial magnets [38].This means the estimation of the magnetic field is as accurate as it could be with the chosen optimization tools.Finally, cubic magnets are easily obtained from any magnet manufacturer.
The MAGPIE code enables the specification of spaces between magnets, magnet bundles, and toroidal wedges, accounting for the placement of the mounting structure.Calculating how large these spaces must be requires rigorous structural analysis, determining if the electromagnetic loads are within an allowable stress range.This is beyond the scope of this work.Instead, the required space is overestimated by using  [32].Top right: considered polarization types in this work [32].
the work done for NCSX as reference [9,32].NCSX has a major radius of R 0 = 1.44 m and a minor radius of a = 0.32 m.It is considerably larger than the machine we are considering, hence leading to a conservative approach.In Refs.[9,32], magnets within the same bundle are separated by 0.04 cm to allow for a coating layer on each magnet and gluing magnets to one another, the 6 cm bundles/drawers are separated by 0.97 cm and there is a minimum distance of 1.59 cm between toroidal wedges.
In this work, we consider a 0.05 cm gap between magnets, a 1 cm gap between magnet bundles for each 6 cm of magnetic material (for example, 2 cm drawers are separated by approximately 0.33 cm) and the same minimum distance of 1.59 cm between toroidal wedges.The number of toroidal wedges, N tor , is picked to match the number of toroidal field coils.This allows the larger portions of the mounting structure to be in between coils, having more freedom in the volume use and easier access to the mounting structure.By default we will consider 1 cm magnets and 2 cm bundles (2 rows of magnets per bundle).The magnet array is limited by an inner toroidal surface with a major radius of R 0 = 0.46 m and a minor radius of a = 0.12 m and an outer toroidal surface with a major radius of R 0 = 0.46 m and a minor radius of a = 0.25 m.The MAGPIE inputs and outputs for the arrays used in this work are available in [35].
The final PM structure is shown in Fig. 9.This design has a simple and practical mounting structure that facilitates the assembly and disassembly of the magnet mesh (see Refs. [9,32]), as the magnet array consists of magnet bundles (drawers) that are grouped into a number of toroidal wedges.Within a bundle, the magnets are glued to 0.00 0.06 0.12 0.18 0.24 0.30 0.36 0.42

Optimized Solutions
Figure 10: Left: Optimization curves for a QA configuration using the ArbVec algorithm with different magnet polarization types.The magnet grid follows the cubic magnet design described in Ref. [32] using a circular cross-section.The results are in good agreement with Ref. [32], with the face, face-edge, face-corner combination being the most cost-effective solution.Right: Bar chart of the optimal solution (minimum cost function) for each case.
one another, with the number of magnet layers being chosen as an input.
Having selected the magnet array design and the spacing for the mounting structure, the possible optimization polarization types are the only aspects left to be defined.The following polarization types are considered: face (f ), corner (c), edge (e), face-edge (f e), and face-corner (f c) (see Fig. 9).They have 6, 8, 12, 24, and 24 rotational symmetries, respectively.The magnet price is dependent on the polarization.Polarizations that align with a larger number of faces are harder to manufacture and hence more expensive.
In Refs.[9,32] the f , f e, f c combination is appointed as the best subset of polarization types.Nonetheless, this result was obtained for an NCSX-like configuration, which is a larger machine with more available magnet volume and a different plasma shape.In order to verify these results, the ArbVec GPMO algorithm was used for 5 subsets of magnets.Subsets with edge or corner magnets without f e and/or f c are excluded as the subset with all polarizations is enough to confirm whether these polarizations are advantageous or not.The resulting optimization curves are presented in Fig. 10 and the resulting magnet configurations in Fig. 11, with the relevant statistics being summarized in Table 2.
The first remark to make is the large difference in field error between the uniform toroidal grid case and a more realistic design (see Fig. 10).It is indeed important to consider the spacing between magnets.Secondly, we note that the results are consistent with Ref. [32], as there is close to no difference (< 0.5%) when adding the edge and corner polarizations to the f + f c + f e combination.However, adding these two polarizations would increase the cost of our magnet grid considerably due to the increase in the number of unique magnets and the fact that edge and corner polarizations are more expensive to manufacture.The magnet face (red), face-edge (magenta), face-corner (yellow), corner (green), and edge (blue) polarizations are identified for the optimal solution of the curves in Fig. 10.The case with only face-polarized magnets is omitted as all magnets would be red.Note how some patterns remain the same in different solutions, namely the face-polarized magnets always occupy the same spots.In Ref. [32], the f e and f c polarizations were not considered individually.However, from Fig. 10 it is possible to see that the f + f c combination is more effective for PM optimization than the f + f e combination.In contrast, when PM4Stell-like or all polarizations are considered, face-edge magnets are the most prevalent and in the f + f e and f + f c cases, the face-edge magnets are more dominant over the facecentered magnets than the face-corner magnets (see Table 2 and Fig. 11).If there is some leeway in a design with PM4Stell-like polarizations, it may be worth considering dropping the face-edge magnets to reduce the number of unique magnets.
From Fig. 11, it is possible to notice that the face-polarized magnets always occupy the same spots, forming a similar red pattern independently of the other polarizations involved, even though they are the least prevalent magnets in all cases where multiple polarizations are involved.The number of face magnets drops only 0.2% from the f +f e to the f +f e+f c cases and then 0.1% to the situation with all considered polarizations.This suggests they are more effective in specific cells, but less adaptable, possibly due to their lower number of rotation symmetries.On the other hand, f e and f c lose a large portion of their spots when edge and corner magnets are introduced, yet this barely impacts the objective function.In the optimization with all possible polarizations, the fraction of occupied spots follows the same order as the number of rotation symmetries (f < c < e < f c = f e) evidencing the importance of choosing magnet geometries that allow for multiple rotation symmetries.
Given the findings in this study, we will adopt the face, face-corner, and face-edge polarizations for the remainder of this work, due to their cost-effectiveness.

From ISTTOK to ISTELL
While the results obtained in the previous sections already took ISTTOK's geometry into account, some aspects of the machine still need to be considered to obtain a comprehensive design, namely the VV minor radius, the shift between the VV and the TF coils, and the volume occupied by the plasma accessing ports.In the following sections, these aspects will be addressed.The coil currents are fixed to match ISTTOK's operating toroidal magnetic field of 0.5 T. Due to its small size and long lifetime, ISTTOK is a prime candidate for transforming a tokamak into a stellarator.Retaining its naming scheme, we refer to its stellarator counterpart as ISTELL for short.First, a new magnetic equilibrium that aligns with the device's characteristics is optimized.Subsequently, an initial permanent magnet optimization study is conducted, excluding consideration of any diagnostic ports.The diagnostic ports are then modeled and taken into account in the following optimization.Lastly, a scenario in which the vacuum vessel is replaced is considered.

Equilibrium Optimization
The first step in converting ISTTOK to a stellarator is finding a suitable magnetic equilibrium.Having a predetermined VV greatly increases the difficulty of adapting existing equilibria to our needs.Instead, we optimize a magnetic equilibrium.The main optimization objectives for ISTELL's equilibrium are, in order of significance, fitting ISTTOK's VV, having a high degree of quasisymmetry, and being well described by the near-axis expansion [39,40].The second target serves to have better particle confinement and the third to allow experimentally validating near-axis codes that have been recently developed, as well as to simplify future analytical studies.The equilibrium was chosen to have nfp = 2 and to be stellarator symmetric.
With these objectives in mind, the optimization of ISTELL's equilibrium [35] was performed using the following cost function, J, with and N = 0.The parameter s is the toroidal magnetic flux enclosed by a flux surface, normalized to the flux at the boundary.The first term in Section 5.1 is a threshold on the distance (∥r i − s∥ 2 ) between N C curves, C i , and the last closed surface, S.
The curves are evenly distributed circumferences with radius r C i = 8.5 cm that model ISTTOK's VV.The second term [36] optimizes for quasi-axisymmetry.The third term defines a target for the rotational transform, ι, so the solution does not converge to the axisymmetric case and reduces the plasma shaping when compared to the previously used QA equilibrium.The fourth term defines a target aspect ratio to attempt to find a solution with as high a plasma volume as possible.Nonetheless, the ι and A values are greatly influenced by the need for the equilibrium to fit ISTTOK's VV.The number of Fourier modes that define the boundary was progressively increased up to a maximum of 3, while d min was progressively decreased down to a minimum of 0.6 mm.This strategy had the most success in guaranteeing the equilibrium fit the VV.The optimization is formulated using the SIMSOPT framework [25], with each magnetic equilibrium being calculated through the VMEC code [41].A local minima of the cost function is found using the Levenberg-Marquardt algorithm, which is SciPy's default algorithm, with an absolute step of 10 −7 and a relative step of 10 −5 .The resulting equilibrium fits ISTTOK's vessel, Fig. 12, has an aspect ratio of A = 10.8, an almost constant rotational transform of ι = 0.122 and a quasisymmetry Figure 13: Left: the quasisymmetry of the found QA magnetic equilibrium is demonstrated by the straight contours of the field strength B on the s = 0.5 flux surface in the θ-ϕ plane in Boozer coordinates.The contours were calculated using the Booz XFORM code [42].Right: Superimposition of the target magnetic surfaces and the magnetic surfaces calculated with the near-axis expansion after the fitting of the parameters to the VMEC magnetic field.
residual of 3.49 × 10 −7 .The high degree of quasisymmetry is evident in Fig. 13 (left), with the contours of B being straight in Boozer coordinates.This guarantees that collisional transport would almost certainly be weaker than turbulent transport.The equilibrium's axis shape can be described as R 0 (ϕ)[m] = 0.4572 − 0.0368 cos(2ϕ) + 0.0018 cos(4ϕ), (8) z 0 (ϕ)[m] = −0.03667sin(2ϕ) + 0.0018 sin(4ϕ), (9) corresponding to two field periods.For the first and second-order near-axis parameters, we find that η = −1.91 m −1 and B 2c = 2.70 T m −2 .The parameters were obtained by fitting a near-axis solution to the VMEC magnetic field.The parameters σ(0) and B 2s were set to zero so the configuration is stellarator symmetric.We also choose I 2 = 0 and p 2 = 0 so the configuration is a vacuum field.The resulting configuration has ι 0 = 0.125, and the boundary shape for A = 10.8 is shown in Fig. 12. From Fig. 13 we can also verify that the near-axis expansion can, as intended, fit the equilibrium, although it was optimized with VMEC.

ISTELL Shifted and Aligned Scenarios
To have a higher average magnetic field, ISTTOK's coil and VV axes have a 6 cm shift between the two axes (see Table 1 and Fig. 2).In this shifted configuration, there is little available space for permanent magnet placement on the high field side.On the other hand, the total available volume is larger than in an aligned case, as the volume increases with the radius.It is possible to align the coil and VV axis, increasing the available volume on the high field side, by pushing the coils to the inside of the machine.However, due to ISTTOK's large number of coils, N = 24, and limited space on the inner side of the torus, this requires reducing the number of coils to N ≤ 17.
In order to evaluate which setup is better, PM optimizations were performed with the existing shifted arrangement and a new proposed layout, Fig. 14, with the two axes aligned and N = 16 coils (corresponding to 4 coils per half field period).A reduction in the number of coils increases the coil ripple.Nonetheless, this plays directly into the advantages of employing a permanent magnet grid and can likely be therefore compensated.
For both cases, the inner limiting surface for the magnets is axisymmetric with the same axis as the VV and a 12.75 cm radius.This corresponds to the VV external radius at its thickest section of 11.25 cm plus the 1.5 cm copper shell.The outer radius of the VV is 9.4 cm for the majority of the machine, so this is a rather risk-conservative approach.The considered dimensions are schematized in Fig. 2 and Fig. 14.A magnet side of dr = 1 cm was considered.In line with the concepts from Section 4.3, for both layouts, the possible magnet orientations conform to the face, face-edge, and face-corner polarizations (see Ref. [9]), and the number of toroidal subdivisions is the same as the number of considered coils, N tor = N .The coils were modeled as circular lines with the same current that produce 0.5 T on the VV axis.
MAGPIE assumes that the VV is centered in the permanent magnet grid.To build the shifted mesh, a grid with a larger radial extent was used as a starting point.Subsequently, the magnets outside a toroidal surface centered at the coil axis with a 20 cm radius were removed.The coils are circular and have a 20.25 cm radius, therefore this yields 0.5 cm of leeway.For the aligned case, no additional steps were required other than running MAGPIE with the adjusted inputs to the system.
Applying the ArbVec GPMO algorithm to the described designs, the optimization 0.00 0.02 0.04 0.06 0.08 0.10 0.12 0.14  curves from Fig. 15 were obtained.From these results, it is clear that the aligned case is advantageous when compared to the shifted case showing an f B that is roughly 3 orders of magnitude lower.
Examining the magnet placements for the two scenarios (Fig. 16) when the objective function, f B , plateaus, provides insight into the advantages of the aligned layout.The shifted layout shows a clear concentration of magnets closer to the VV and the spots on the low field side are unoccupied.For the aligned layout, although these spots are still The VV is also represented in low-opacity grey.Note that the B • n scale is one order of magnitude lower in the aligned case.Furthermore, the maxima in the aligned case are more localized.For the shifted case, the maximum is present on the high field side where the magnetic equilibrium is closest to the VV, due to the lack of magnetic material in this region.For the aligned case, the maximum occurs where the equilibrium is farther away from the VV due to the larger distance between the magnets and the plasma.
preferred a more uniform distribution of the magnets is observed.Since the advantage of the shifted layout is having more available space on the low field side and the positions closer to the VV and on the high field side are preferred, it is only natural that the aligned mesh produces better results.
The respective weaknesses of both configurations are further evidenced by the B • n color maps of the optimal solution represented in Fig. 17.For the shifted case, the maximum of B • n is present on the high field side where the magnetic equilibrium is closest to the VV.This results from a lack of magnetic material in this region due to the low available volume on the high field side.For the aligned case, the maximum occurs on the high field side where the magnetic equilibrium is farther away from the inside of the VV.This results from the larger distance between the magnets and the plasma.

Plasma Accessing Ports
The precise calculation of crucial parameters such as electron temperature and density is key to the success of magnetic confinement experiments.These parameters not only serve as essential inputs for fusion and plasma physics codes but also play a pivotal role in motivating future experimental studies and influencing the design of upcoming machines.As such, we will now take into account the fact that ISTTOK has a total of 33 plasma-accessing ports that serve multiple purposes.
The modeling of these ports becomes imperative for PM optimization as they reduce the available volume, which negatively impacts the attainable field quality.Furthermore, since they were designed for a tokamak, ISTTOK's ports do not follow stellarator or field period symmetry.As GPMO leverages such symmetries to reduce computation time, this greatly increases the computational cost of the design, as it requires the use of the full magnet array.For this reason, the magnet size was increased from 1 cm to 2 cm effectively reducing the free variables by a factor of 8.
The ports, illustrated in Fig. 3 and Fig. 19, were modeled as cylinders, with the radius given by one of three standard flange sizes, DN40, DN60 and DN100.The height of the cylinders was considered equal to the coil radius (see Table 1) for the ports in use and the port height plus the thickness of the standard flange sizes for the remaining ports.This means that only the currently used ports in ISTTOK would remain functional and the remaining ports would be rendered unusable in exchange for a larger available volume for magnet placement.To include ports in the magnet mesh, each PM is selectively removed if assessed to be inside the volume of the cylinders modeling the ports.
We represent a tolerance, tol, i.e., an increased distance around the ports, both in radius and in height, to guarantee a risk-averse design.With this in mind three grids were considered with tol = 1 mm, tol = 1 cm and tol = 2 cm in radius and height.The three grids were optimized with the ArbVec GPMO algorithm.The tol = 1 mm mesh was also optimized with the backtracking ArbVec GPMO algorithm considering six adjacent magnets (the first neighbors) and a threshold angle, i.e., the angle between two magnet orientations after which they are removed, of 5π/6.The resulting optimization curves are represented in Fig. 18 and the magnet configurations for the solution at a V ef f of 0.04 m 3 are represented in Fig. 19.
The introduction of diagnostic ports increases the cost function by at most 22%, with f B remaining below 10 −6 T 2 m 2 .In fact, the reduction of the error field from upgrading to the backtracking algorithm is superior to this increase.We find that even with a grid that is not stellarator or field period symmetric, it is still possible to find magnet configurations that can reproduce an intended field that has both symmetries.Furthermore, there is some freedom left when setting tolerances around the ports.With 1 cm of leeway there is an increase of 10% compared to the 1 mm case.Note that the radius of a DN40 flange is r DN40 = 3.5 cm, so a 1 cm tolerance is already substantial.The average error field, ⟨B•n⟩, is 0.18%, 0.16%, 0.20% and 0.22% for the dr = 2 cm with no ports, tol = 1 mm backtracking, tol = 1 cm and tol = 2 cm situations, respectively.A color-map of the field error is represented in Fig. 20 for the backtracking, tol = 1 cm and tol = 2 cm cases.
Although the average error field does not increase substantially with the introduction of ports, the maximum values of the error field tend to increase.This effect is more prevalent as the tolerance around the ports is increased.This is evident for the region with the largest ports, which is also responsible for the largest field error 0.00 0.02 0.04 0.06 0.08 0.10 V eff 10 6  (see Fig. 21).Defining reasonable tolerances and finding strategies for correcting the field error around ports could be key in the use of permanent magnets in magnetic confinement devices.
To confirm the quality of the fields produced by the obtained permanent magnet configurations, the Poincaré plots for the found solutions are shown in Fig. 22.The field lines in the Poincaré plots follow the intended magnetic equilibrium approximately for all cases.Furthermore, there are no detected magnetic islands.The field inaccuracy predicted by f B corresponds to an outward expansion of the magnetic field lines that is also more prevalent in the cases with higher f B , namely the 2 cm tolerance model.The Poincaré plots here presented greatly support the viability of the ISTELL design  using a precise QA equilibrium.Furthermore, the solution could be further improved by using smaller magnets and by reducing the gaps between magnets and magnet groups, although the latter entails a careful structural analysis.In the absence of ports, the reduction in f B between the scenarios with 1 cm and 2 cm cubic magnets is approximately 417%.Consequently, a comparable enhancement is anticipated even when the ports are considered.

Different Vacuum Vessel
In Section 4.2, it was concluded that a VV with the same cross-section as the equilibrium posed no significant advantage when compared to a circular VV.Therefore, the natural choice would be to keep ISTTOK's VV.However, for equilibrium optimization, it is considerably easier to choose the VV a posteriori.Even if a circular vessel is to be for the optimized solutions of the ISTELL equilibrium for a magnet mesh with 2 cm cubes and diagnostic ports at different tolerances.Even for the tol = 2 cm model the VMEC equilibrium is nicely followed and there are no magnetic islands.
used, a scan of the variation of the objective function with the minor and major radius can be performed.Furthermore, considering a different vessel enables designing the plasma accessing ports so that the stellarator and field period symmetries are kept, thus reducing the number of optimization variables and the computation time.Finally, obtaining a new VV would solve ISTTOK's current shifted configuration difficulty of not having enough space on the high field side, with the added benefits of increasing the available volume for magnets when compared to the aligned case and keeping the 24 toroidal field coils.For this purpose, we perform an equilibrium optimization allowing for the possibility of using a different VV.We recover the QA equilibrium used in Section 4 rescaled to R 0 = 0.52 m, the coil axis' radius.While such configuration would not fit ISTTOK's VV, it has a higher rotational transform, ι = 0.167, as well as a lower aspect ratio, A = 9.3, and a lower quasisymmetry residual, 9.1 × 10 −8 .Two magnet grids are considered, one that follows the equilibrium cross-section with the inner surface 1 cm away from the last closed surface of the plasma, and one that has a circular cross-section with a radius of 12.5 cm.The magnet arrays follow MAGPIE's trec design.The spacing between magnets follows the previously defined estimation.The magnets have dr = 1 cm and face, face-edge, or face-corner polarization.We revert back to using 24 coils to produce B 0 = 0.5 T and therefore, N tor = 24 groups of magnets.
To retain a similar number of ports to the ones in use for ISTTOK, a total of 20 ports (5 per half field period ) were considered.The port standards were also picked to be as close in number to ISTTOK as possible.The ports were placed between toroidal wedges to minimize the number of removed dipoles.The ports, as well as the magnet grid for a half-field period, are represented in Fig. 23.
The magnet placements were optimized using the baseline ArbVec GPMO algorithm and the corresponding optimization curves are plotted in Fig. 23.The plasma-shaped vessel shows f B > 10 −5 , considerably larger than the results obtained in the previous section.However, the circular vessel is more promising, having a minimum objective function of f B = 2.74 × 10 −6 T 2 m 2 , despite its less efficient use of space leading to a lower available volume for magnet placement.This further corroborates the claims from the uniform toroidal grid study that keeping a circular VV is advantageous for magnet optimization, even when considering a more realistic grid with spacing for a support structure and well-thought orientations.

VMEC Poincare
Figure 24: Poincaré plot calculated using the SIMSOPT framework with a tolerance of 10 −14 of the optimized solution for a QA equilibrium using a larger circular vessel than ISTTOK's with 20 ports.Although the magnetic field lines tend to follow the VMEC equilibrium, at the last represented surface, the beginning of 12 magnetic islands are visible indicating there is a resonance with the 2/12 mode.
To further evaluate the field quality, the Poincaré plot for the circular case was calculated (see Fig. 24).We see that the field lines closely follow the intended magnetic surfaces.For the last closed surface, a resonance with the 2/12 mode is observed, resulting in 12 magnetic islands.As an aside, we note that these islands could be used for the design of an island divertor, a concept that has an efficient heat load distribution, advantageous scaling with input power, and good impurity screening [43,44].A deeper understanding of island divertors could play a pivotal role in developing viable fusion reactors.Therefore, a compact magnetic confinement device that can run a large number of experiments and where design modifications are easily implemented could be very attractive.
If economically viable, switching ISTTOK's VV for another with a circular crosssection, R 0 = 0.52 m, with stellarator and field period symmetric ports and the minor radius to be defined by the chosen magnetic equilibrium would make ISTELL considerably easier from a design standpoint.Furthermore, it enables configurations with higher ι to be well replicated with permanent magnets, due to an increase in the available volume for the magnets.

Conclusions
Coil optimization, construction, and assembly have proven to be major challenges and sources of cost in the development of modern stellarators [3,4,5,45].As interest in stellarators grows, driven by recent promising results, it is important to find budgetefficient ways of building new machines.Considering a large number of tokamaks have been, and will be decommissioned over the years, one attractive possibility would be to convert tokamaks to stellarators.Although research on permanent magnet stellarators has been focused on the development of new machines, due to their versatility, low cost and only requiring TF coils, they would be a promising way of achieving this goal.In this work, the conversion of a specific tokamak, ISTTOK, into a stellarator, is explored.
In Section 4, several design choices are made using a uniform toroidal grid regarding magnetic configuration, the vessel shape, and the magnet grid.We find the QA configuration to be the most viable one, choosing a circular vessel instead of one that follows the magnetic surface shape.The chosen magnet grid is one with cubic magnets that follow face, face-edge, and face-corner polarizations.In Section 4.3, the uniform grid is upgraded to accommodate the required spacing for a mounting structure using cubic magnets with easily achievable orientations, resulting in an increase of one order of magnitude in f B , the used field quality metric.Section 5 finds an optimized equilibrium tailored to ISTTOK's characteristics.A QA equilibrium with quasisymmetry residuals of 3.49 × 10 −7 , ⟨ι⟩ = 0.122, A = 10.8, and that fits ISTTOK's vessel is found.Then, three PM optimization scenarios are evaluated: one maintaining ISTTOK's setup, one removing some coils to increase available volume on the high field side, and one replacing the vacuum vessel.For the latter two scenarios, the plasma accessing ports are modeled, leading to two viable solutions for the conversion of ISTTOK into a stellarator.
While this work has been successful in evaluating the feasibility of converting the ISTTOK tokamak into a stellarator, it is important to recognize that the design and development of a magnetic confinement device is a complex task.Hence, there are multiple remaining steps to be completed.ISTTOK's diagnostic ports do not follow any symmetries.This means that by rotating the PM grid, the available positions for the magnets change and, therefore so does the optimization result.Hence, finding the best relative position of the two could be advantageous both for port access and magnet optimization.In Section 4.3 we define the space between magnets and the toroidal spacing by using NCSX as a reference.This risk-averse strategy takes an overestimation of the required spacing in order to guarantee that the magnet grid could be built.However, ISTTOK is a much smaller machine than NCSX.Finding the required spacing to build a support structure, through rigorous structural analysis could considerably improve the error fields obtained in this work.Finally, it is important to analyze the plasma heating possibilities.ISTTOK currently uses ohmic heating exclusively.A tokamak-stellarator hybrid magnetic equilibrium (see e.g.Ref. [46]) with an induced plasma current could be considered, keeping the current heating system.This might be an attractive solution in converting a tokamak to a stellarator-like scenario.It would allow higher ι than what was obtained in the present work while keeping stellarator-like properties.Alternatively, an RF heating system would likely have to be designed and installed.

Figure 2 :
Figure 2: Cross section of ISTTOK's current setup.There are N = 24 toroidal field coils (brown).The vacuum vessel has a minor radius of 8.5 cm in its narrowest section (grey).The vessel is enveloped by a copper shell that maintains a minor radius of 10 cm for the majority of its extent.However, its widest section, corresponding to the region where the two halves of the vessel are fixed together, has a radius of 12.75 cm (orange).

Figure 3 :
Figure 3: Schematic of the vacuum vessel and plasma accessing ports of ISTTOK.Note that all ports are to good approximation cylindrical in shape.The ports adhere to one of three flange standards, DN40, DN60, or DN100.The functions of each port are merely illustrative and do not correspond to the current use of the ports.

Figure 4 :
Figure 4: Squared normal field objective function normalized by the square of the field intensity at the axis, B 20 , and the surface area of the equilibrium, A S = 4πR 2 0 /(2Anfp), as a function of ϕ edge for three magnetic field surfaces.The equilibria are more easily reproduced in the order QA, QI, and QH, with the QA configuration being the only one with an error field below 0.1%.

Figure 5 :
Figure5: Left: Optimization curves for a QA configuration using a circular cross-section VV and the equilibrium's cross-section VV with the same radial extent or maximum effective volume as the circular case.The circular cross-section leads to a more optimized solution, with a lower cost function, although it requires a larger effective volume to reach a plateau.Right: Bar chart of the solution with the minimum cost function for each case.

Figure 6 :
Figure6: Top view of the magnet configurations in the radial, toroidal and poloidal directions for uniform grids with circular cross-section (top) and with an equilibrium shaped cross section with the same r ext (bottom) and with the same V ef f (bottom).There are 21328 and 14190 magnets respectively, corresponding to the optimal solution obtained by the baseline GPMO algorithm with toroidal orientations.The colors represent the normalized magnetization direction.

Figure 7 :
Figure7: Top view of the magnet configurations in the radial toroidal and poloidal directions for the first 4300 magnets placed in the uniform grid with circular cross section (top) and the equilibrium shaped cross section with the same V ef f (bot).The magnetization is normalized.Note that the radial direction is by far the most populated one and that the positions close to the VV are preferred over farther away spots.This indicates that the equilibrium cross section is more effective for radially oriented magnets close to the VV, but is less efficient when the magnets have to be placed farther away.

Figure 8 :
Figure 8: Poincaré Plot calculated for the circular uniform grid solution.The target magnetic field surfaces (black) are superimposed with the calculated field lines (blue).

Figure 11 :
Figure11: The magnet face (red), face-edge (magenta), face-corner (yellow), corner (green), and edge (blue) polarizations are identified for the optimal solution of the curves in Fig.10.The case with only face-polarized magnets is omitted as all magnets would be red.Note how some patterns remain the same in different solutions, namely the face-polarized magnets always occupy the same spots.

Figure 12 :
Figure 12: Left: 3D plot of the last closed surface for the obtained QA equilibrium (blue) inside ISTTOK's VV (low opacity black).Right: ISTELL's equilibrium poloidal cross sections.

Figure 14 :
Figure14: Cross section of the proposed aligned layout that reduces the number of toroidal field coils from N = 24 to N = 16 to increase the available space on the high field side.The system's dimensions are identified, namely the toroidal field coils are represented in brown, the widest section of the copper shell is represented in orange and the narrowest section of the vessel is represented in grey.

Figure 15 :
Figure 15: Optimization curves for a QA equilibrium using the ArbVec algorithm for two configurations where the coil and vacuum vessel axes are either shifted or aligned.

Figure 16 :
Figure 16: Magnet configurations for 50% occupied effective volume for the shifted and aligned layouts.The low field side spots on the shifted scenario are mostly unoccupied suggesting they are not effective at reproducing the magnetic equilibrium.The aligned scenario shows a more even distribution of the magnets.

Figure 17 :
Figure 17: Field error, B • n, on the equilibrium surface for the shifted (left) and aligned cases (right).The VV is also represented in low-opacity grey.Note that the B • n scale is one order of magnitude lower in the aligned case.Furthermore, the maxima in the aligned case are more localized.For the shifted case, the maximum is present on the high field side where the magnetic equilibrium is closest to the VV, due to the lack of magnetic material in this region.For the aligned case, the maximum occurs where the equilibrium is farther away from the VV due to the larger distance between the magnets and the plasma.

Figure 18 :
Figure18: Left: PM Optimization curves for ISTELL's QA configuration using the ArbVec algorithm for a full 2 cm magnet grid with diagnostic ports considering different tolerances.The dr = 2 cm case without ports is plotted for reference.For the curve in purple, the optimization algorithm was upgraded to the backtracking version (GPMOb).Right: Bar chart of the optimal solution for each case.Introducing diagnostics increases the cost function by at most 22% and it remains below 10 −6 as long as the considered tolerances are reasonably low.The downside of introducing ports is lower than the upside of using the backtracking algorithm.

Figure 19 :
Figure 19: Magnet placement (red) for the tol = 1 mm GPMOb, tol = 1 cm and tol = 2 cm once the plateau has already been reached at V ef f = 0.04 m 3 .The ports are represented in orange.

Figure 20 :
Figure 20: Error field, B • n, color-map viewed from the top for the backtracking, tol = 1 cm and tol = 2 cm cases.

Figure 21 :
Figure 21: Close up of the B • n color-map for the region where we have the largest ports (orange), seen from the bottom.From left to right, for the backtracking, tol = 1 cm and tol = 2 cm cases.As the tolerance around the ports increases so does the maximum error field.

Figure 22 :
Figure22: Poincaré Plot calculated using the SIMSOPT framework with a tolerance of 10 −14 for the optimized solutions of the ISTELL equilibrium for a magnet mesh with 2 cm cubes and diagnostic ports at different tolerances.Even for the tol = 2 cm model the VMEC equilibrium is nicely followed and there are no magnetic islands.

Figure 23 :
Figure23: Left: PM optimization curves for a QA equilibrium using the ArbVec GPMO algorithm in two scenarios where ISTTOK's VV is replaced -one where the cross-section is circular and another where it follows the last closed surface.Right: Isometric view for a half field period of the magnet grid (red) for the circular VV with ports (grey) and ISTTOK's circular toroidal field coils (blue).

Table 2 :
Magnet polarization fraction when all array spots are filled, for the 5 considered polarization subsets.The magnet grid has a total of 52512 magnets.