desc.coils.FourierXYCoil

class desc.coils.FourierXYCoil(current=1, center=[10, 0, 0], normal=[0, 1, 0], X_n=[0, 2], Y_n=[2, 0], modes=None, basis='xyz', name='')Source

Coil that lies in a plane.

Parameterized by a point (the center of the coil), a vector (normal to the plane), and Fourier series defining the X and Y coordinates in the plane as a function of an arbitrary angle s.

Parameters:
  • current (float) – Current through the coil, in Amperes.

  • center (array-like, shape(3,)) – Coordinates of center of curve, in system determined by basis.

  • normal (array-like, shape(3,)) – Components of normal vector to planar surface, in system determined by basis.

  • X_n (array-like) – Fourier coefficients of the X coordinate in the plane.

  • Y_n (array-like) – Fourier coefficients of the Y coordinate in the plane.

  • modes (array-like) – Mode numbers associated with X_n and Y_n. The n=0 mode will be ignored.

  • basis ({'xyz', 'rpz'}) – Coordinate system for center and normal vectors. Default = ‘xyz’.

  • name (str) – Name for this coil.

Methods

change_resolution([N])

Change the maximum angular resolution.

compute(names[, grid, params, transforms, ...])

Compute the quantity given by name on grid.

compute_Bnormal(surface[, eval_grid, ...])

Compute Bnormal from self on the given surface.

compute_magnetic_field(coords[, params, ...])

Compute magnetic field at a set of points.

compute_magnetic_vector_potential(coords[, ...])

Compute magnetic vector potential at a set of points.

copy([deepcopy])

Return a (deep)copy of this object.

equiv(other)

Compare equivalence between DESC objects.

flip([normal])

Flip the curve about the plane with specified normal in X,Y,Z coordinates.

from_values(current, coords[, N, s, basis, name])

Fit coordinates to FourierXYCoil representation.

get_coeffs(n)

Get Fourier coefficients for given mode number(s).

load(load_from[, file_format])

Initialize from file.

pack_params(p)

Convert a dictionary of parameters into a single array.

rotate([axis, angle])

Rotate the curve by a fixed angle about axis in X,Y,Z coordinates.

save(file_name[, file_format, file_mode])

Save the object.

save_BNORM_file(surface, fname[, basis_M, ...])

Create BNORM-style .txt file containing Bnormal Fourier coefficients.

save_mgrid(path, Rmin, Rmax, Zmin, Zmax[, ...])

Save the magnetic field to an mgrid NetCDF file in "raw" format.

set_coeffs(n[, X, Y])

Set specific Fourier coefficients.

to_FourierPlanar([N, grid, basis, name])

Convert Coil to FourierPlanarCoil representation.

to_FourierRZ([N, grid, NFP, sym, name])

Convert Coil to FourierRZCoil representation.

to_FourierXY([N, grid, s, basis, name])

Convert Coil to FourierXYCoil representation.

to_FourierXYZ([N, grid, s, name])

Convert coil to FourierXYZCoil representation.

to_SplineXYZ([knots, grid, method, name])

Convert coil to SplineXYZCoil.

translate([displacement])

Translate the curve by a rigid displacement in X,Y,Z coordinates.

unpack_params(x)

Convert a single array of concatenated parameters into a dictionary.

Attributes

N

Maximum mode number.

X_basis

Spectral basis for X Fourier series.

X_n

Spectral coefficients for X.

Y_basis

Spectral basis for Y Fourier series.

Y_n

Spectral coefficients for Y.

basis

Coordinate system for center and normal vectors.

center

Center of planar curve.

current

Current passing through the coil, in Amperes.

dim_x

total number of optimizable parameters.

dimensions

dictionary of integers of sizes of each optimizable parameter.

name

Name of the curve.

normal

Normal vector to plane.

num_coils

Number of coils.

optimizable_params

string names of parameters that have been declared optimizable.

params_dict

dictionary of arrays of optimizable parameters.

rotmat

Rotation matrix of curve in X, Y, Z.

shift

Displacement of curve in X, Y, Z.

x_idx

arrays of indices for each parameter in concatenated array.