Hostname: page-component-76fb5796d-5g6vh Total loading time: 0 Render date: 2024-04-25T07:24:13.971Z Has data issue: false hasContentIssue false

Constrained stellarator coil curvature optimization with FOCUS

Published online by Cambridge University Press:  09 March 2021

Thomas G. Kruger*
Affiliation:
HSX Laboratory, University of Wisconsin, Madison, WI53706, USA
C. Zhu
Affiliation:
Princeton Plasma Physics Laboratory, Princeton University, Princeton, NJ08540, USA
A. Bader
Affiliation:
HSX Laboratory, University of Wisconsin, Madison, WI53706, USA
D. T. Anderson
Affiliation:
HSX Laboratory, University of Wisconsin, Madison, WI53706, USA
L. Singh
Affiliation:
HSX Laboratory, University of Wisconsin, Madison, WI53706, USA
*
Email address for correspondence: tkruger@wisc.edu
Rights & Permissions [Opens in a new window]

Abstract

Finding less complicated coils that have adequately low field errors is a crucial step in stellarator development. One coil metric that is of high importance is the maximum curvature of the coil centreline, or coil single filament. Conductors cannot be bent below some threshold minimum radius of curvature. High coil curvatures can cause strains to exceed acceptable levels, especially in superconducting coils. We investigate three ways to optimize coil curvature and find that applying penalty functions to the coil curvature solves for coils that have a constrained maximum curvature and low field error. Penalty functions are implemented in FOCUS and coil solutions optimized for an HSX-like ‘plasma boundary’ are presented.

Keywords

Type
Letter
Creative Commons
Creative Common License - CCCreative Common License - BY
This is an Open Access article, distributed under the terms of the Creative Commons Attribution licence (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted re-use, distribution, and reproduction in any medium, provided the original work is properly cited.
Copyright
Copyright © The Author(s), 2021. Published by Cambridge University Press

1. Introduction

Stellarators possess inherent advantages that are important to consider for future fusion power plant designs, including steady-state operation, resiliency to disruptions and theoretically high beta stability limits (Gates et al. Reference Gates, Anderson, Anderson, Zarnstorff, Spong, Weitzner, Neilson, Ruzic, Andruczyk and Harris2018). Although stellarators have desirable physics properties, they also require complicated engineering. Generally, stellarators do not require current drive to achieve reasonable rotational transform profiles. To produce non-axisymmetric magnetic fields, non-planar coils are typically used (Merkel Reference Merkel1987; Drevlak Reference Drevlak1999; Landreman Reference Landreman2017). Non-planar coils complicate coil design, engineering, assembly and supports. Difficulties arising from non-planar coils led to significant delays during the construction of the W7-X experiment (Riße Reference Riße2009) and to the cancellation of the NCSX experiment at the Princeton Plasma Physics Laboratory (Neilson et al. Reference Neilson, Gruber, Harris, Rej, Simmons and Strykowsky2010).

There is a trade-off between coils that accurately reproduce a desired magnetic field and coils that are simple to manufacture. Stellarator coils need to satisfy engineering constraints such as maximum coil curvature, minimum coil-to-coil separation and minimum coil-to-plasma separation. After such engineering constraints are satisfied one can also optimize for additional considerations such as coil resiliency to displacements, coil spacing for auxiliary systems, coil cost and coil complexity. Coil complexity is left ambiguous here and we do not intend to define a set of quantitative metrics for it. Coil complexity is necessarily dependent on the manufacturing process, whereas the coil maximum curvature is important independent of the manufacturing process. This letter investigates the maximum curvature engineering constraint, just one of many coil considerations.

Previously, both the ONSET and COILOPT codes used curvature objective functions to target coil curvature. The ONSET code uses a penalty function that quadratically penalizes curvatures that exceed some input maximum curvature (see (5) and (6) of Drevlak (Reference Drevlak1998)). This curvature objective function is not differentiable, which limits the applicability of the objective function to different optimization schemes. Additionally the curvature objective function is dependent on coil lengths. The COILOPT code used an exponentially weighted function to heavily penalize high coil curvatures (see (4) of Strickler, Berry & Hirshman (Reference Strickler, Berry and Hirshman2002)). One difference between the COILOPT exponential function and our penalty function is that the exponential function penalizes all values of curvature, not just values that are above the maximum. Furthermore, in COILOPT, coils are constrained to lie on a predefined winding surface which greatly limits flexibility.

In this letter we compare three curvature objective functions. In doing so we attempt to elucidate the salient properties of penalty functions that constrain curvatures below some maximum value and objective functions that try to reduce the integrated curvature. While both the ONSET and COILOPT formulations target curvature and are able to reduce coil curvatures, there has not yet been a systematic effort to understand what specific choices of the curvature function yield. This letter provides a first attempt at resolving these questions.

The first two curvature objective functions minimize a coil's average curvature and average curvature squared. The third curvature objective function uses penalty functions to explicitly constrain a coil's maximum curvature. The maximum curvature constraint is of crucial importance since it directly determines whether a coil set can be constructed. For instance, if the minimum radius of curvature is greater than half the small dimension of a coil width, then the coil will self-intersect. Also, smaller radii of curvature directly increase coil strain and can increase the magnetic field strength in the coil, both of which can violate engineering constraints for superconducting coils.

To optimize for a coil's maximum curvature, we will use the single-filament coil optimization code FOCUS (Zhu et al. Reference Zhu, Hudson, Song and Wan2017). Single-filament coils are initial approximations where the coil cross-section is taken to be a point. This coil approximation is appropriate for any type of coil such as low-temperature superconducting, high-temperature superconducting and copper coils. Depending on the size of the coil cross-sections relative to the coil–plasma distances, a multi-filament coil optimization can be done as a subsequent step (Singh et al. Reference Singh, Kruger, Bader, Zhu, Hudson and Anderson2020). For this letter it is assumed that coil means single-filament coil.

Our motivation and method for constraining maximum coil curvature are described in the rest of this letter. Newly implemented FOCUS objective functions are described in § 2. Coils optimized with these objective functions are shown in § 3. The objective functions and resulting coils are discussed in § 4. Conclusions and future work are discussed in § 5.

2. FOCUS objective functions

FOCUS is a stellarator coil optimization code that takes advantage of parallel computing. FOCUS solves nonlinear coil optimization problems of the following form:

(2.1)\begin{equation} \min \sum_i w_i f_i, \end{equation}

where $w_i$ is a user-specified weighting associated with the objective function $f_i$. These objective functions are dependent on and minimized by changing coil geometries and currents. Objective functions in FOCUS are twice differentiable. These objective functions are minimized with gradient-based optimization algorithms, like the conjugate gradient method, or with Hessian-based algorithms, like the Newton method (Zhu et al. Reference Zhu, Hudson, Song and Wan2018). Coils in FOCUS are approximated as space curves and defined using truncated Fourier series as

(2.2)\begin{align} \boldsymbol{r}(t) &= x(t) \hat{\boldsymbol{x}}+ y(t)\,\hat{\boldsymbol{y}}+ z(t)\,\hat{\boldsymbol{z}} = \sum_{n=0}^{N_F} \left[\left(X_{c,n}\cos(nt)+X_{s,n}\sin(nt)\right) \hat{\boldsymbol{x}} \right.\nonumber\\ &\quad \left.+ \, \left(Y_{c,n}\cos(nt)+Y_{s,n}\sin(nt)\right) \hat{\boldsymbol{y}} + \left(Z_{c,n}\cos(nt)+Z_{s,n}\sin(nt)\right) \hat{\boldsymbol{z}}\right], \end{align}

where $t \in [0,2{\rm \pi} ]$ is our parameterizing variable and $N_F$ defines the highest Fourier mode frequency to be used in the optimization. The optimization variables are the Fourier mode amplitudes $X_{c,n}, X_{s,n}, Y_{c,n}, Y_{s,n}, Z_{c,n}$ and $Z_{s,n}$ and coil current for each coil.

The primary objective of coil optimization is to satisfy a normal field boundary condition on an input surface. This surface can be arbitrary, but typically is a ‘plasma boundary’ from a fixed boundary equilibrium. The normal field boundary condition can also be arbitrary, but is typically set by plasma currents and any fixed external current sources. For this letter we use a quadratic, normalized flux objective function:

(2.3)\begin{equation} f_{Bn}=\int_S \frac{1}{2} \left( \frac{\boldsymbol{B_v}\boldsymbol{\cdot} {\boldsymbol{n}}-{T_{Bn}}}{|{\boldsymbol{B_v}}|} \right)^2\,\textrm{d}S, \end{equation}

where $\boldsymbol {B_v}$ is the magnetic field from coils, ${\boldsymbol {n}}$ is the input surface unit normal and ${T_{Bn}}$ is the normal field boundary condition. This objective function will be referred to as a field error objective function. We optimize coils to reconstruct magnetic fields from a zero-beta, fixed boundary equilibrium. This allows us to use the plasma boundary from the equilibrium as our input surface and allows us to set the normal field boundary condition to zero.

If the Neumann boundary condition is set to zero, coil currents are not held fixed and the quadratic flux objective function is not normalized by field strength, an additional objective function that optimizes for toroidal flux needs to be included. If it is not included in the optimization, a trivial solution will be solved for where coil currents go to zero, causing the normal field on the boundary to consequently also be zero. For this letter we keep coil currents held fixed, and use the normalized flux objective function (2.3); therefore a toroidal flux objective function is not needed.

‘Coil ripple’ errors are caused because field strength is large at surface positions close to coils and smaller in between coils. These errors are associated with high toroidal mode numbers corresponding to the number of coils. Coil ripple can be reduced by moving coils farther away from the boundary. Coil ripple errors are visible as varying stripes of minimum and maximum error on the boundary, as in figure 1(a). At larger coil distances it is more difficult to match the general plasma boundary shape even if the field is generated by an external current-carrying surface (Landreman & Boozer Reference Landreman and Boozer2016). We refer to errors of this type as ‘non-ripple errors’.

Figure 1. The $({\boldsymbol {B_v} \boldsymbol {\cdot } {\boldsymbol {n}}})/{|\boldsymbol {B_v}|}$ distributions plotted on a half-period of the HSX boundary from coils optimized with our penalty curvature objective function (a) and from coils optimized with a quadratic curvature objective function (b).

The inverse of the Biot–Savart law is ill-posed and additional regularization is required in coil optimizations. FOCUS uses coil length as one of the primary regularizations. If there is no penalty on coil length, coils can become arbitrarily long to reduce coil ripple. To obtain the results in this letter we use a quadratic penalty on coil length given as

(2.4)\begin{equation} f_{L}=\frac{1}{N_c}\sum_{i=1}^{N_c} \frac{1}{2}\frac{\left( L_i - L_{i,0} \right)^2}{L_{i,0}^2}, \end{equation}

where $N_c$ is the total number of coils, $L_i$ is the length of the $i$th coil and $L_{i,0}$ is the user-specified target length of the $i$th coil. Including a curvature objective function further regularizes the optimization, but it is still important to include a coil length objective function to ensure that coil solutions are reasonable.

Coils optimized with only field error and length objective functions are discussed in § 3. These coils have a maximum curvature that is roughly an order of magnitude larger than that of the Helically Symmetric Experiment (HSX) coils, and therefore motivate the need for a curvature objective function. We now present three candidate curvature objective functions. Including a curvature objective function gives an optimization problem of the following form:

(2.5)\begin{equation} \min w_{Bn}f_{Bn}+w_Lf_L+w_{\kappa}f_{\kappa ,j}, \end{equation}

where $j=1,2,3$ correspond to three possible forms of the curvature objective function.

The first curvature objective function $(j=1)$ is given as

(2.6)\begin{gather} f_{\kappa ,1}=\frac{1}{N_c}\sum_{i=1}^{N_c} \frac{1}{L_i} \int_0^{2{\rm \pi}}\kappa_i \left| \boldsymbol{r_i}' \right|\,\textrm{d}t, \end{gather}
(2.7)\begin{gather} \kappa = \frac{ \left| \boldsymbol{r}' \times \boldsymbol{r}'' \right| }{ \left| \boldsymbol{r}' \right|^3 }, \end{gather}

with each coil's curvature, $\kappa _i$, appearing linearly. Alternatively, it may be desirable to penalize areas of high curvature more than areas of low curvature. A second curvature objective function that optimizes for the square of the curvature should accomplish this. This function $(j=2)$ is given as

(2.8)\begin{equation} f_{\kappa ,2}=\frac{1}{N_c}\sum_{i=1}^{N_c} \frac{1}{L_i} \int_0^{2{\rm \pi}}\kappa_i^2 \left| \boldsymbol{r_i}' \right|\,\textrm{d}t. \end{equation}

It is important that we integrate over the coil's arc length $| \boldsymbol {r_i}' | \,\textrm {d}t$ and not the parameterizing variable $\textrm {d}t$. If we were to integrate over the parameterizing variable, the objective function would be parameterization-dependent. This means coils with the same shape could have different parameterizations and consequently different values for the objective functions. It is also important that we normalize each integral by the corresponding coil length. If we do not do this, coil lengths can decrease to minimize the objective functions despite having regions of higher curvature. The curvature objective functions (2.6) and (2.8) attempt to minimize an integrated function of coil curvature, but they do not constrain it. Therefore we are solving an unconstrained optimization problem. In order to constrain the coil curvature, the third curvature objective function $(j=3)$ uses a penalty function, making this a constrained optimization problem.

We apply a constraint on coil curvature so that it is below some maximum value $\kappa _0$ at all points in the set of coils. That is, $\kappa _i(t) \leq \kappa _0=1/R_0 \ \forall t \ \text {and} \ \forall i$, where $R_0$ corresponds to the minimum radius of curvature. To apply this constraint we can use the following third curvature objective function which uses a penalty function:

(2.9)\begin{equation} \left. \begin{gathered} f_{\kappa,3}=\frac{1}{N_c}\sum_{i=1}^{N_c} \frac{1}{L_i} \int_0^{2{\rm \pi}} H_{\kappa_0}(\kappa_i) \left( \cosh\left(\alpha \left( \kappa_i - \kappa_0 \right) \right) - 1 \right)^2 \left| \boldsymbol{r_i}' \right|\,\textrm{d}t,\\ \alpha > 0\quad \kappa_0 > 0, \end{gathered} \right\} \end{equation}
(2.10)\begin{equation} H_{\kappa_0}(\kappa_i) \equiv H(\kappa_i-\kappa_0) = \begin{cases} 0, & \kappa_i < \kappa_0, \\ \frac{1}{2}, & \kappa_i = \kappa_0, \\ 1, & \kappa_i > \kappa_0. \end{cases} \end{equation}

The third curvature objective function includes a Heaviside function defined in (2.10) which is discontinuous. It is important to notice that at the Heaviside function discontinuity, the term $\cosh (\alpha (\kappa _i-\kappa _0))-1$ goes to zero which can be seen in figure 2. This preserves the objective function's continuity and moreover its differentiability. This objective function is twice differentiable, $f_{\kappa ,3} \in C^2$. FOCUS has multiple optimization algorithms implemented. If the user were to choose one of the quasi-Newton methods, superlinear convergence can be observed since the FOCUS objective functions are twice differentiable (Nocedal & Wright Reference Nocedal and Wright2006).

Figure 2. (a) The penalty function used in the $f_{\kappa ,3}$ objective function, where the variable $\kappa _i$ is changed to $x$ and the value of $\kappa _0$ is set to $5$. Multiple values of the penalty variable $\alpha$ are plotted. (b) The derivative of this penalty function.

The penalty function only penalizes coil locations where coil curvature exceeds the specified maximum curvature, $\kappa _0$. The value of $H_{\kappa _0}(\kappa _i) (\cosh (\alpha ( \kappa _i - \kappa _0 )) - 1 )^2$ is zero if $\kappa _i \leq \kappa _0$, positive if $\kappa _i > \kappa _0$ and increases exponentially with the constraint violation $\kappa _i-\kappa _0$. To guarantee a constraint on coil curvature, the value of $\alpha$ needs to be iteratively increased to $\infty$. Here $\alpha$ is called our penalty variable. As $\alpha \rightarrow \infty$, the value of $f_{\kappa ,3} \rightarrow \infty$, if any coil has a location where the coil's curvature exceeds the maximum curvature. This forces all local minima to have coil geometries with curvature less than or equal to the input maximum curvature. To obtain coils using $f_{\kappa ,3}$ for this letter, the initial value of $\alpha$ is set to $0$ and the optimization is run until a local minimum is found. Coils from the initial optimization are then input back into FOCUS with $\alpha$ increased to $0.1$ and the optimization is again run until a local minimum is found. This process is repeated with $\alpha$ increasing after each optimization. Coils with a constrained maximum curvature are found after $\alpha$ is increased to $4$.

3. Applications

FOCUS is used to solve for coils, targeting an idealized boundary similar to that of the HSX that has been smoothed to remove errors produced by the actual HSX coils. We refer to this smoothed boundary as the HSX boundary. HSX is a four-field-period device with 48 coils. Because of symmetries, there are only six unique coil shapes. The normal field boundary condition is set to zero, $T_{Bn}=0$, representing a zero beta equilibrium with no fixed external magnets. We initialize the optimizations with filamentary coils that are roughly equal to the centroids of the HSX finite build coil cross-sections. For the remainder of this letter, the term ‘HSX coils’ refers to these filamentary coils.

We present four optimizations to compare the different objective functions: one with no curvature optimization and one for each of the three curvature objective functions. Coils in these optimizations have equal currents of 151 kA and currents are held fixed during optimization. We do not change each coil's target length between optimizations, we use the nonlinear conjugate gradient algorithm and strong Wolfe conditions (Nocedal & Wright Reference Nocedal and Wright2006) and we set Fourier series truncation to be $N_F=16$ for the coils in each optimization. Target coil lengths are chosen to be slightly larger than the HSX coil lengths. The four optimizations are run until local minima are found.

Choice of objective function weightings will significantly change the solution space and resulting coil solutions. Objective function weightings are given in table 1. The value of coil length objective function weightings is chosen such that the difference between the resulting coil lengths and target coil lengths is of the order of centimetres for each of the four optimization runs. Weighting for the linear curvature objective function was adjusted until the field error objective function value $f_{Bn}$ for the resulting coils was close to the $f_{Bn}$ value for the HSX coils. Weighting for the quadratic curvature objective function is set in the same way. It should be noted that the penalty function variable $\alpha$ is more important than the penalty curvature objective function weighting.

Table 1. Objective function weightings for the four optimization runs. Here $w_{Bn}$, $w_L$ and $w_\kappa$ are the field error, length and curvature objective function weightings, respectively.

To evaluate each optimization result, we compare against the HSX coils. The HSX coils and the four FOCUS-optimized coil sets can be seen in figure 3. A comparison of the coil curvatures can be seen in figure 4. Important metrics to consider for each coil set are the field error objective function, maximum field error, maximum curvature and minimum coil-to-coil separation. These values are given in table 2. For the penalty curvature objective function, the value of $\kappa _0$ is set equal to the HSX coil maximum curvature and we can see that our penalty curvature objective function has been used to successfully constrain the coil curvature.

Figure 3. Coils optimized for the HSX boundary are shown. HSX coils that are not optimized are plotted in black and are included in both panels. (a) FOCUS coils with no curvature optimization are plotted in blue and FOCUS coils optimized with linear curvature are plotted in red. (b) FOCUS coils optimized with quadratic curvature are plotted in green and FOCUS coils optimized with our penalty curvature objective function are plotted in magenta. Parameter $|\boldsymbol {B_v}|$ from coils with no curvature optimization is plotted on a half-period of the HSX boundary in (a) and $|\boldsymbol {B_v}|$ from coils optimized with our penalty curvature objective function is plotted on a half-period of the HSX boundary in (b). High $|\boldsymbol {B_v}|$ is plotted in black and low $|\boldsymbol {B_v}|$ is plotted in yellow.

Figure 4. Coil curvature is plotted against the length around the fifth coil. HSX coils that are not optimized are plotted in black and are included in both panels. (a) FOCUS coils with no curvature optimization are plotted in blue and FOCUS coils optimized with linear curvature are plotted in red. (b) FOCUS coils optimized with quadratic curvature are plotted in green and FOCUS coils optimized with our penalty curvature objective function are plotted in magenta. The plot in (a) is truncated to a maximum curvature of $65 \ (\textrm {m}^{-1})$. The blue spike that is cut off in (a) extends to a maximum value of $246$.

Table 2. Important coil metrics for the initial HSX coils and four optimization runs are given. The normalized field error objective function is given as $f_{Bn}$. Maximum normalized field error is given as $\max | ({\boldsymbol {B_v} \boldsymbol {\cdot } {\boldsymbol {n}}})/{|\boldsymbol {B_v}|} |$. Maximum curvature is given as $\max \kappa \ (\textrm {m}^{-1})$. Minimum coil-to-coil separation is given as $\min ccsep \ (\textrm {cm})$.

4. Discussion

4.1. No curvature optimization

If $N_F=16$ and coil curvature is not optimized for, it is evident that FOCUS does not solve for reasonable coils due to high coil curvatures, with radius of curvature in places reduced below 1 cm. One technique to reduce coil curvatures is to decrease the value of $N_F$. Even for low values of $N_F$, coil curvature can still become too high. Using a low value of $N_F$ restricts coil shaping and leads to higher field errors.

4.2. Linear curvature optimization

Including the linear curvature objective function produces coils with low average curvature. Unfortunately, the maximum curvature of these coils is $74.4 \ \textrm {m}^{-1}$ which is significantly larger than that of the HSX coils that have a maximum curvature of $12.3 \ \textrm {m}^{-1}$, and both coil sets have roughly equal $f_{Bn}$ values. After close inspection it can be concluded that some regions of the coils have been straightened out while other regions of the coils still have sharp bends. High curvatures are not heavily penalized as long as they exist over short arc lengths.

4.3. Quadratic curvature optimization

The quadratic curvature objective function should penalize regions with high curvatures more than does the linear curvature function. Coils generated with the quadratic curvature function have a maximum curvature of $7.62 \ \textrm {m}^{-1}$ which is lower than the HSX coil's maximum curvature of $12.3 \ \textrm {m}^{-1}$. Again both coil sets have roughly equal values of $f_{Bn}$. It can be seen from figure 1(b) that the field error distribution does not appear to be dominated by coil ripple. A large portion of the error comes from non-ripple error. For roughly equal values of $f_{Bn}$, it appears that the quadratic curvature objective function outperforms the linear curvature objective function with regards to the maximum curvature. Coils optimized with the linear curvature objective function have a maximum curvature that is ${\approx} 10$ times higher than coils optimized with the quadratic curvature objective function.

4.4. Penalty function curvature optimization

The penalty function is designed to only penalize positions on the coils where the curvature exceeds a prescribed maximum, here set to be the HSX coil curvature maximum, $\kappa _0 = 12.3$. Coils solved for with the penalty function are shown to have a maximum curvature equal to that of the HSX coils. The value of $f_{Bn}$ is more than an order of magnitude lower than that of the HSX coils. Remarkably, the value of $f_{Bn}$ for these coils is close to the value of $f_{Bn}$ from the FOCUS coils that are not optimized for curvature. Since we do not penalize locations of coils that have curvatures below our specified maximum curvature, the coils have more flexibility to accurately reconstruct the plasma boundary. It can be seen from figure 1(a) that the field error distribution appears to be dominated by coil ripple and the normalized ripple error is roughly 0.25 %. This means that the normalized non-ripple error is even lower than 0.25 % and because of this we have higher confidence that the general shape of the ‘plasma boundary’ is reconstructed well.

5. Conclusions

Without a curvature objective function, optimizations in FOCUS can quickly solve for coils that have unreasonably high curvatures. There are techniques that can be used to limit coil curvatures, but typically at the cost of increasing field errors. Because of this, multiple curvature objective functions have been implemented in FOCUS. We see that a quadratic curvature objective function seems to outperform a linear curvature objective function with respect to maximum coil curvature, but does not outperform with respect to maximum field error. Neither result is satisfactory. This motivated a constraint on maximum curvature as opposed to optimizing for curvature at every location of the coil. To apply this constraint we used penalty functions. The resulting coils with the penalty functions outperformed both the linear and quadratic objective functions with regard to matching the target boundary while still remaining below the maximum curvature threshold.

If coil buildability is our primary concern, then a coil's maximum curvature seems to be a more apt metric than the average coil curvature or average squared curvature. We see that constraining a coil's maximum curvature with a penalty function can solve for coils with a very low value of the field error objective function, $f_{Bn}$. A hyperbolic cosine penalty function was chosen for the optimization mainly due to its exponential penalty and its differentiability.

The penalty objective function achieves the desired behaviour of only penalizing locations of the coils where curvatures exceed a maximum curvature. However, we can see in figure 3(b) that there are small wiggles in the coils produced with the penalty objective function. These deviations may decrease field errors by a small amount, but more importantly, they may also significantly increase ‘coil complexity’. Removing these additional wiggles is a topic that can be addressed with additional curvature objective functions that specifically target coil complexity. This is left for a future publication.

In this letter we demonstrate how to use penalty functions to constrain coil curvature. We intend to also use penalty functions to constrain the minimum coil-to-coil separation. Many more useful applications of penalty functions exist outside of coil optimization. For instance, when optimizing for stellarator equilibria, it is often desirable to constrain rotational transform profiles so as to not cross low-order rational values. Penalty functions are easy to implement and do not require additional optimization algorithms for their implementation.

Acknowledgements

This work was supported by the US Department of Energy (T.G.K., contract number DE-FG02-93ER54222; C.Z., contract number DE-AC02-09CH11466; A.B., contract number DE-FG02-93ER54222; D.T.A., contract number DE-FG02-93ER54222; L.S., contract number DE-FG02-93ER54222) and the University of Wisconsin-Madison (T.G.K., grant number 135AAD3116; A.B., grant number 135AAD3116).

Editor William Dorland thanks the referees for their advice in evaluating this article.

Declaration of interests

The authors report no conflict of interest.

Data availability statement

The data that support the findings of this study are openly available in the HSX documents repository at https://hsx.wisc.edu/documents/constrained-stellarator-coil-curvature-optimization-with-focus/.

Appendix A. Objective function derivatives

First derivatives of the three curvature objective functions are now given. Here $X_i$ is an arbitrary Fourier mode amplitude, $X_i \in \{ X_{c,0,i},\ldots , X_{c,N_F,i}, X_{s,1,i},\ldots , X_{s,N_F,i} \}$, that defines the $x$ position of the $i$th coil. Derivatives for $Y_i$ or $Z_i$ Fourier mode amplitudes take a similar form. The equation for ${\partial L_i}/{\partial X_i}$ is given in (15) in Zhu et al. (Reference Zhu, Hudson, Song and Wan2017). The derivatives are

(A 1)\begin{align} \frac{\partial f_{\kappa,1}}{\partial X_i} &={-}\frac{1}{N_c} \frac{1}{L_i^2} \frac{\partial L_i}{\partial X_i} \int_0^{2{\rm \pi}} \kappa_i \left| \boldsymbol{r_i}' \right| \,\textrm{d}t + \frac{1}{N_c} \frac{1}{L_i} \int_0^{2{\rm \pi}}\frac{\partial \kappa_i}{\partial X_i} \left| \boldsymbol{r_i}' \right|\,\textrm{d}t\nonumber\\ &\quad + \frac{1}{N_c} \frac{1}{L_i} \int_0^{2{\rm \pi}} \kappa_i \frac{ \partial \left| \boldsymbol{r_i}' \right| }{\partial X_i}\,\textrm{d}t,\end{align}
(A 2)\begin{align} \frac{\partial f_{\kappa,2}}{\partial X_i} &={-}\frac{1}{N_c} \frac{1}{L_i^2} \frac{\partial L_i}{\partial X_i} \int_0^{2{\rm \pi}} \kappa_i^2 \left| \boldsymbol{r_i}' \right|\,\textrm{d}t + \frac{1}{N_c} \frac{1}{L_i} \int_0^{2{\rm \pi}} 2 \kappa_i \frac{\partial \kappa_i}{\partial X_i} \left| \boldsymbol{r_i}' \right|\,\textrm{d}t\nonumber\\ &\quad + \frac{1}{N_c} \frac{1}{L_i} \int_0^{2{\rm \pi}} \kappa_i^2 \frac{ \partial \left| \boldsymbol{r_i}' \right| }{\partial X_i}\,\textrm{d}t,\end{align}
(A 3)\begin{align} \frac{\partial f_{\kappa,3}}{\partial X_i} &={-}\frac{1}{N_c} \frac{1}{L_i^2} \frac{\partial L_i}{\partial X_i} \int_0^{2{\rm \pi}} H_{\kappa_0}(\kappa_i) \left(\cosh\left( \alpha \left( \kappa_i - \kappa_0 \right) \right) - 1 \right)^2 \left| \boldsymbol{r_i}' \right|\,\textrm{d}t\nonumber\\ &\quad + \frac{1}{N_c} \frac{1}{L_i} \int_0^{2{\rm \pi}} H_{\kappa_0}(\kappa_i) 2 \alpha \left(\cosh\left(\alpha \left(\kappa_i - \kappa_0\right)\right) - 1\right) \sinh\left(\alpha \left( \kappa_i - \kappa_0 \right) \right) \frac{\partial \kappa_i}{\partial X_i} \left| \boldsymbol{r_i}' \right|\,\textrm{d}t\notag\\ &\quad + \frac{1}{N_c} \frac{1}{L_i} \int_0^{2{\rm \pi}} H_{\kappa_0}(\kappa_i) \left(\cosh\left(\alpha \left( \kappa_i - \kappa_0\right)\right) - 1 \right)^2 \frac{ \partial \left| \boldsymbol{r_i}' \right| }{\partial X_i}\,\textrm{d}t . \end{align}

The $i$ coil indices are dropped for convenience. Now we give the derivative of curvature with respect to an arbitrary $x$ Fourier mode amplitude:

(A 4)\begin{equation} \frac{\partial \kappa}{\partial X} = \frac{ \left( \boldsymbol{r}' \times \boldsymbol{r}'' \right) \boldsymbol{\cdot} \left( \dfrac{\partial x'}{\partial X} \hat{\boldsymbol x} \times \boldsymbol{r}'' + \dfrac{\partial x''}{\partial X} \boldsymbol{r}' \times \hat{\boldsymbol x} \right)}{\left| \boldsymbol{r}' \times \boldsymbol{r}'' \right| \left| \boldsymbol{r}' \right|^3 } - \frac{3 \left| \boldsymbol{r}' \times \boldsymbol{r}'' \right| x' \dfrac{\partial x'}{\partial X}}{\left| \boldsymbol{r}' \right|^{5}} . \end{equation}

References

Drevlak, M. 1998 Automated optimization of stellarator coils. Fusion Technol. 33 (2), 106117.CrossRefGoogle Scholar
Drevlak, M. 1999 Optimization of heterogenous magnet systems. In Proceedings of the 12th International Stellarator Workshop.Google Scholar
Gates, D. A., Anderson, D.vid, Anderson, S., Zarnstorff, M., Spong, D. A., Weitzner, H., Neilson, G. H., Ruzic, D., Andruczyk, D., Harris, J. H., et al. 2018 Stellarator research opportunities: a report of the national stellarator coordinating committee. J. Fusion Energy 37 (1), 5194.CrossRefGoogle Scholar
Landreman, M. 2017 An improved current potential method for fast computation of stellarator coil shapes. Nucl. Fusion 57 (4), 046003.CrossRefGoogle Scholar
Landreman, M. & Boozer, A. H. 2016 Efficient magnetic fields for supporting toroidal plasmas. Phys. Plasmas 23 (3), 032506.CrossRefGoogle Scholar
Merkel, P. 1987 Solution of stellarator boundary value problems with external currents. Nucl. Fusion 27 (5), 867.CrossRefGoogle Scholar
Neilson, G. H., Gruber, C. O., Harris, J. H., Rej, D. J., Simmons, R. T. & Strykowsky, R. L. 2010 Lessons learned in risk management on NCSX. IEEE Trans. Plasma Sci. 38 (3), 320327.CrossRefGoogle Scholar
Nocedal, J. & Wright, S. 2006 Numerical Optimization. Springer Science & Business Media.Google Scholar
Riße, K. 2009 Experiences from design and production of Wendelstein 7-X magnets. Fusion Engng Des. 84 (7–11), 16191622.CrossRefGoogle Scholar
Singh, L., Kruger, T. G., Bader, A., Zhu, C., Hudson, S. R. & Anderson, D. T. 2020 Optimization of finite-build stellarator coils. J. Plasma Phys. 86 (4).CrossRefGoogle Scholar
Strickler, D. J., Berry, L. A. & Hirshman, S. P. 2002 Designing coils for compact stellarators. Fusion Sci. Technol. 41 (2), 107115.CrossRefGoogle Scholar
Zhu, C., Hudson, S. R., Song, Y. & Wan, Y. 2017 New method to design stellarator coils without the winding surface. Nucl. Fusion 58 (1), 016008.CrossRefGoogle Scholar
Zhu, C., Hudson, S. R., Song, Y. & Wan, Y. 2018 Designing stellarator coils by a modified Newton method using FOCUS. Plasma Phys. Control. Fusion 60 (6), 065008.CrossRefGoogle Scholar
Figure 0

Figure 1. The $({\boldsymbol {B_v} \boldsymbol {\cdot } {\boldsymbol {n}}})/{|\boldsymbol {B_v}|}$ distributions plotted on a half-period of the HSX boundary from coils optimized with our penalty curvature objective function (a) and from coils optimized with a quadratic curvature objective function (b).

Figure 1

Figure 2. (a) The penalty function used in the $f_{\kappa ,3}$ objective function, where the variable $\kappa _i$ is changed to $x$ and the value of $\kappa _0$ is set to $5$. Multiple values of the penalty variable $\alpha$ are plotted. (b) The derivative of this penalty function.

Figure 2

Table 1. Objective function weightings for the four optimization runs. Here $w_{Bn}$, $w_L$ and $w_\kappa$ are the field error, length and curvature objective function weightings, respectively.

Figure 3

Figure 3. Coils optimized for the HSX boundary are shown. HSX coils that are not optimized are plotted in black and are included in both panels. (a) FOCUS coils with no curvature optimization are plotted in blue and FOCUS coils optimized with linear curvature are plotted in red. (b) FOCUS coils optimized with quadratic curvature are plotted in green and FOCUS coils optimized with our penalty curvature objective function are plotted in magenta. Parameter $|\boldsymbol {B_v}|$ from coils with no curvature optimization is plotted on a half-period of the HSX boundary in (a) and $|\boldsymbol {B_v}|$ from coils optimized with our penalty curvature objective function is plotted on a half-period of the HSX boundary in (b). High $|\boldsymbol {B_v}|$ is plotted in black and low $|\boldsymbol {B_v}|$ is plotted in yellow.

Figure 4

Figure 4. Coil curvature is plotted against the length around the fifth coil. HSX coils that are not optimized are plotted in black and are included in both panels. (a) FOCUS coils with no curvature optimization are plotted in blue and FOCUS coils optimized with linear curvature are plotted in red. (b) FOCUS coils optimized with quadratic curvature are plotted in green and FOCUS coils optimized with our penalty curvature objective function are plotted in magenta. The plot in (a) is truncated to a maximum curvature of $65 \ (\textrm {m}^{-1})$. The blue spike that is cut off in (a) extends to a maximum value of $246$.

Figure 5

Table 2. Important coil metrics for the initial HSX coils and four optimization runs are given. The normalized field error objective function is given as $f_{Bn}$. Maximum normalized field error is given as $\max | ({\boldsymbol {B_v} \boldsymbol {\cdot } {\boldsymbol {n}}})/{|\boldsymbol {B_v}|} |$. Maximum curvature is given as $\max \kappa \ (\textrm {m}^{-1})$. Minimum coil-to-coil separation is given as $\min ccsep \ (\textrm {cm})$.