Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
117 changes: 100 additions & 17 deletions desc/coils.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,11 @@ def to_FourierXYZ(self, N=10, grid=None, s=None, name="", **kwargs):
Parameters
----------
N : int
Fourier resolution of the new X,Y,Z representation.
Fourier resolution of the new X,Y,Z representation. Simple geometry can have
N~3-4, while optimized modular coils often require N~8-10. For stage 2
optimization, compute time scales ~N^3 and memory ~N^2. For single stage
the coils are usually much less expensive than the equilibrium so are not
a main driver of time or memory usage.
grid : Grid, int or None
Grid used to evaluate curve coordinates on to fit with FourierXYZCoil.
If an integer, uses that many equally spaced points.
Expand Down Expand Up @@ -636,7 +640,11 @@ def to_FourierRZ(self, N=10, grid=None, NFP=None, sym=False, name="", **kwargs):
Parameters
----------
N : int
Fourier resolution of the new R,Z representation.
Fourier resolution of the new R,Z representation. Simple geometry can have
N~3-4, while optimized modular coils often require N~8-10. For stage 2
optimization, compute time scales ~N^3 and memory ~N^2. For single stage
the coils are usually much less expensive than the equilibrium so are not
a main driver of time or memory usage.
grid : Grid, int or None
Grid used to evaluate curve coordinates on to fit with FourierRZCoil.
If an integer, uses that many equally spaced points.
Expand Down Expand Up @@ -672,7 +680,11 @@ def to_FourierPlanar(self, N=10, grid=None, basis="xyz", name="", **kwargs):
Parameters
----------
N : int
Fourier resolution of the new FourierPlanarCoil representation.
Fourier resolution of the new FourierPlanarCoil representation. Simple
geometry can have N~3-4, while optimized modular coils often require N~8-10.
For stage 2 optimization, compute time scales ~N^3 and memory ~N^2. For
single stage the coils are usually much less expensive than the equilibrium
so are not a main driver of time or memory usage.
grid : Grid, int or None
Grid used to evaluate curve coordinates on to fit with FourierPlanarCoil.
If an integer, uses that many equally spaced points.
Expand Down Expand Up @@ -705,7 +717,11 @@ def to_FourierXY(self, N=10, grid=None, s=None, basis="xyz", name="", **kwargs):
Parameters
----------
N : int
Fourier resolution of the new FourierXYCoil representation.
Fourier resolution of the new FourierXYCoil representation. Simple
geometry can have N~3-4, while optimized modular coils often require N~8-10.
For stage 2 optimization, compute time scales ~N^3 and memory ~N^2. For
single stage the coils are usually much less expensive than the equilibrium
so are not a main driver of time or memory usage.
grid : Grid, int or None
Grid used to evaluate curve coordinates on to fit with FourierXYCoil.
If an integer, uses that many equally spaced points.
Expand Down Expand Up @@ -739,6 +755,11 @@ def to_FourierXY(self, N=10, grid=None, s=None, basis="xyz", name="", **kwargs):
class FourierRZCoil(_Coil, FourierRZCurve):
"""Coil parameterized by fourier series for R,Z in terms of toroidal angle phi.

Simple geometry can have N~3-4, while optimized modular coils often require N~8-10.
For stage 2 optimization, compute time scales ~N^3 and memory ~N^2. For single
stage the coils are usually much less expensive than the equilibrium so are not a
main driver of time or memory usage.

Parameters
----------
current : float
Expand Down Expand Up @@ -816,7 +837,11 @@ def from_values(cls, current, coords, N=10, NFP=1, basis="rpz", sym=False, name=
coordinates to fit a FourierRZCurve object with each column
corresponding to xyz or rpz depending on the basis argument.
N : int
Fourier resolution of the new R,Z representation.
Fourier resolution of the new R,Z representation. Simple
geometry can have N~3-4, while optimized modular coils often require N~8-10.
For stage 2 optimization, compute time scales ~N^3 and memory ~N^2. For
single stage the coils are usually much less expensive than the equilibrium
so are not a main driver of time or memory usage.
NFP : int
Number of field periods, the curve will have a discrete toroidal symmetry
according to NFP.
Expand Down Expand Up @@ -851,6 +876,11 @@ def from_values(cls, current, coords, N=10, NFP=1, basis="rpz", sym=False, name=
class FourierXYZCoil(_Coil, FourierXYZCurve):
"""Coil parameterized by Fourier series for X,Y,Z in terms of an arbitrary angle s.

Simple geometry can have N~3-4, while optimized modular coils often require N~8-10.
For stage 2 optimization, compute time scales ~N^3 and memory ~N^2. For single
stage the coils are usually much less expensive than the equilibrium so are not a
main driver of time or memory usage.

Parameters
----------
current : float
Expand Down Expand Up @@ -921,8 +951,11 @@ def from_values(cls, current, coords, N=10, s=None, basis="xyz", name=""):
coords: ndarray
Coordinates to fit a FourierXYZCoil object with.
N : int
Fourier resolution of the new X,Y,Z representation.
default is 10
Fourier resolution of the new X,Y,Z representation. Simple
geometry can have N~3-4, while optimized modular coils often require N~8-10.
For stage 2 optimization, compute time scales ~N^3 and memory ~N^2. For
single stage the coils are usually much less expensive than the equilibrium
so are not a main driver of time or memory usage. Default is 10
s : ndarray
arbitrary curve parameter to use for the fitting.
Should be monotonic, 1D array of same length as
Expand Down Expand Up @@ -957,6 +990,11 @@ class FourierPlanarCoil(_Coil, FourierPlanarCurve):
and a Fourier series defining the radius from the center as a function of the polar
angle theta.

Simple geometry can have N~3-4, while optimized modular coils often require N~8-10.
For stage 2 optimization, compute time scales ~N^3 and memory ~N^2. For single
stage the coils are usually much less expensive than the equilibrium so are not a
main driver of time or memory usage.

Parameters
----------
current : float
Expand Down Expand Up @@ -1036,7 +1074,11 @@ def from_values(cls, current, coords, N=10, basis="xyz", name=""):
Coordinates to fit a FourierPlanarCurve object with each column
corresponding to xyz or rpz depending on the basis argument.
N : int
Fourier resolution of the new r representation.
Fourier resolution of the new r representation. Simple
geometry can have N~3-4, while optimized modular coils often require N~8-10.
For stage 2 optimization, compute time scales ~N^3 and memory ~N^2. For
single stage the coils are usually much less expensive than the equilibrium
so are not a main driver of time or memory usage.
basis : {"rpz", "xyz"}
Basis for input coordinates. Defaults to "xyz".
name : str
Expand Down Expand Up @@ -1067,6 +1109,11 @@ class FourierXYCoil(_Coil, FourierXYCurve):
and Fourier series defining the X and Y coordinates in the plane as a function of
an arbitrary angle s.

Simple geometry can have N~3-4, while optimized modular coils often require N~8-10.
For stage 2 optimization, compute time scales ~N^3 and memory ~N^2. For single
stage the coils are usually much less expensive than the equilibrium so are not a
main driver of time or memory usage.

Parameters
----------
current : float
Expand Down Expand Up @@ -1116,7 +1163,11 @@ def from_values(cls, current, coords, N=10, s=None, basis="xyz", name=""):
Coordinates to fit a FourierXYCurve object with each column
corresponding to xyz or rpz depending on the basis argument.
N : int
Fourier resolution of the new X & Y representation.
Fourier resolution of the new X & Y representation. Simple
geometry can have N~3-4, while optimized modular coils often require N~8-10.
For stage 2 optimization, compute time scales ~N^3 and memory ~N^2. For
single stage the coils are usually much less expensive than the equilibrium
so are not a main driver of time or memory usage.
s : ndarray or "arclength"
Arbitrary curve parameter to use for the fitting.
Should be monotonic, 1D array of same length as
Expand Down Expand Up @@ -2352,7 +2403,11 @@ def to_FourierPlanar(
Parameters
----------
N : int
Fourier resolution of the new FourierPlanarCoil representation.
Fourier resolution of the new FourierPlanarCoil representation. Simple
geometry can have N~3-4, while optimized modular coils often require N~8-10.
For stage 2 optimization, compute time scales ~N^3 and memory ~N^2. For
single stage the coils are usually much less expensive than the equilibrium
so are not a main driver of time or memory usage.
grid : Grid, int or None
Grid used to evaluate curve coordinates on to fit with FourierPlanarCoil.
If an integer, uses that many equally spaced points.
Expand Down Expand Up @@ -2391,7 +2446,11 @@ def to_FourierXY(
Parameters
----------
N : int
Fourier resolution of the new FourierXYCoil representation.
Fourier resolution of the new FourierXYCoil representation. Simple
geometry can have N~3-4, while optimized modular coils often require N~8-10.
For stage 2 optimization, compute time scales ~N^3 and memory ~N^2. For
single stage the coils are usually much less expensive than the equilibrium
so are not a main driver of time or memory usage.
grid : Grid, int or None
Grid used to evaluate curve coordinates on to fit with FourierXYCoil.
If an integer, uses that many equally spaced points.
Expand Down Expand Up @@ -2433,7 +2492,11 @@ def to_FourierRZ(
Parameters
----------
N : int
Fourier resolution of the new R,Z representation.
Fourier resolution of the new R,Z representation. Simple
geometry can have N~3-4, while optimized modular coils often require N~8-10.
For stage 2 optimization, compute time scales ~N^3 and memory ~N^2. For
single stage the coils are usually much less expensive than the equilibrium
so are not a main driver of time or memory usage.
grid : Grid, int or None
Grid used to evaluate curve coordinates on to fit with FourierRZCoil.
If an integer, uses that many equally spaced points.
Expand Down Expand Up @@ -2468,7 +2531,11 @@ def to_FourierXYZ(self, N=10, grid=None, s=None, name="", check_intersection=Tru
Parameters
----------
N : int
Fourier resolution of the new X,Y,Z representation.
Fourier resolution of the new X,Y,Z representation. Simple
geometry can have N~3-4, while optimized modular coils often require N~8-10.
For stage 2 optimization, compute time scales ~N^3 and memory ~N^2. For
single stage the coils are usually much less expensive than the equilibrium
so are not a main driver of time or memory usage.
grid : Grid, int or None
Grid used to evaluate curve coordinates on to fit with FourierXYZCoil.
If an integer, uses that many equally spaced points.
Expand Down Expand Up @@ -2972,7 +3039,11 @@ def to_FourierPlanar(
Parameters
----------
N : int
Fourier resolution of the new FourierPlanarCoil representation.
Fourier resolution of the new FourierPlanarCoil representation. Simple
geometry can have N~3-4, while optimized modular coils often require N~8-10.
For stage 2 optimization, compute time scales ~N^3 and memory ~N^2. For
single stage the coils are usually much less expensive than the equilibrium
so are not a main driver of time or memory usage.
grid : Grid, int or None
Grid used to evaluate curve coordinates on to fit with FourierPlanarCoil.
If an integer, uses that many equally spaced points.
Expand Down Expand Up @@ -3010,7 +3081,11 @@ def to_FourierXY(
Parameters
----------
N : int
Fourier resolution of the new FourierXYCoil representation.
Fourier resolution of the new FourierXYCoil representation. Simple
geometry can have N~3-4, while optimized modular coils often require N~8-10.
For stage 2 optimization, compute time scales ~N^3 and memory ~N^2. For
single stage the coils are usually much less expensive than the equilibrium
so are not a main driver of time or memory usage.
grid : Grid, int or None
Grid used to evaluate curve coordinates on to fit with FourierXYCoil.
If an integer, uses that many equally spaced points.
Expand Down Expand Up @@ -3051,7 +3126,11 @@ def to_FourierRZ(
Parameters
----------
N : int
Fourier resolution of the new R,Z representation.
Fourier resolution of the new R,Z representation. Simple
geometry can have N~3-4, while optimized modular coils often require N~8-10.
For stage 2 optimization, compute time scales ~N^3 and memory ~N^2. For
single stage the coils are usually much less expensive than the equilibrium
so are not a main driver of time or memory usage.
grid : Grid, int or None
Grid used to evaluate curve coordinates on to fit with FourierRZCoil.
If an integer, uses that many equally spaced points.
Expand Down Expand Up @@ -3085,7 +3164,11 @@ def to_FourierXYZ(self, N=10, grid=None, s=None, name="", check_intersection=Tru
Parameters
----------
N : int
Fourier resolution of the new X,Y,Z representation.
Fourier resolution of the new X,Y,Z representation. Simple
geometry can have N~3-4, while optimized modular coils often require N~8-10.
For stage 2 optimization, compute time scales ~N^3 and memory ~N^2. For
single stage the coils are usually much less expensive than the equilibrium
so are not a main driver of time or memory usage.
grid : Grid, int or None
Grid used to evaluate curve coordinates on to fit with FourierXYZCoil.
If an integer, uses that many equally spaced points.
Expand Down
Loading
Loading