desc.equilibrium.Equilibrium

class desc.equilibrium.Equilibrium(Psi=1.0, NFP=None, L=None, M=None, N=None, L_grid=None, M_grid=None, N_grid=None, node_pattern=None, pressure=None, iota=None, current=None, electron_temperature=None, electron_density=None, ion_temperature=None, atomic_number=None, surface=None, axis=None, sym=None, spectral_indexing=None, **kwargs)[source]

Equilibrium is an object that represents a plasma equilibrium.

It contains information about a plasma state, including the shapes of flux surfaces and profile inputs. It can compute additional information, such as the magnetic field and plasma currents, as well as “solving” itself by finding the equilibrium fields, and perturbing those fields to find nearby equilibria.

Parameters:
  • Psi (float (optional)) – total toroidal flux (in Webers) within LCFS. Default 1.0

  • NFP (int (optional)) – number of field periods Default surface.NFP or 1

  • L (int (optional)) – Radial resolution. Default 2*M for spectral_indexing=='fringe', else M

  • M (int (optional)) – Poloidal resolution. Default surface.M or 1

  • N (int (optional)) – Toroidal resolution. Default surface.N or 0

  • L_grid (int (optional)) – resolution of real space nodes in radial direction

  • M_grid (int (optional)) – resolution of real space nodes in poloidal direction

  • N_grid (int (optional)) – resolution of real space nodes in toroidal direction

  • node_pattern (str (optional)) – pattern of nodes in real space. Default is 'jacobi'

  • pressure (Profile or ndarray shape(k,2) (optional)) – Pressure profile or array of mode numbers and spectral coefficients. Default is a PowerSeriesProfile with zero pressure

  • iota (Profile or ndarray shape(k,2) (optional)) – Rotational transform profile or array of mode numbers and spectral coefficients

  • current (Profile or ndarray shape(k,2) (optional)) – Toroidal current profile or array of mode numbers and spectral coefficients Default is a PowerSeriesProfile with zero toroidal current

  • electron_temperature (Profile or ndarray shape(k,2) (optional)) – Electron temperature (eV) profile or array of mode numbers and spectral coefficients. Must be supplied with corresponding density. Cannot specify both kinetic profiles and pressure.

  • electron_density (Profile or ndarray shape(k,2) (optional)) – Electron density (m^-3) profile or array of mode numbers and spectral coefficients. Must be supplied with corresponding temperature. Cannot specify both kinetic profiles and pressure.

  • ion_temperature (Profile or ndarray shape(k,2) (optional)) – Ion temperature (eV) profile or array of mode numbers and spectral coefficients. Default is to assume electrons and ions have the same temperature.

  • atomic_number (Profile or ndarray shape(k,2) (optional)) – Effective atomic number (Z_eff) profile or ndarray of mode numbers and spectral coefficients. Default is 1

  • surface (Surface or ndarray shape(k,5) (optional)) – Fixed boundary surface shape, as a Surface object or array of spectral mode numbers and coefficients of the form [l, m, n, R, Z]. Default is a FourierRZToroidalSurface with major radius 10 and minor radius 1

  • axis (Curve or ndarray shape(k,3) (optional)) – Initial guess for the magnetic axis as a Curve object or ndarray of mode numbers and spectral coefficients of the form [n, R, Z]. Default is the centroid of the surface.

  • sym (bool (optional)) – Whether to enforce stellarator symmetry. Default surface.sym or False.

  • spectral_indexing (str (optional)) – Type of Zernike indexing scheme to use. Default 'ansi'

Methods

change_resolution([L, M, N, L_grid, M_grid, ...])

Set the spectral resolution and real space grid resolution.

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

Compute the quantity given by name on grid.

compute_flux_coords(real_coords[, R_lmn, ...])

Find the (rho, theta, zeta) that correspond to given (R, phi, Z).

compute_theta_coords(flux_coords[, L_lmn, ...])

Find geometric theta for given straight field line theta.

copy([deepcopy])

Return a (deep)copy of this equilibrium.

eq(other)

Compare equivalence between DESC objects.

from_near_axis(na_eq[, r, L, M, N, ntheta, ...])

Initialize an Equilibrium from a near-axis solution.

get_profile(name[, grid])

Return a SplineProfile of the desired quantity.

get_surface_at([rho, theta, zeta])

Return a representation for a given coordinate surface.

is_nested([grid, R_lmn, Z_lmn, msg])

Check that an equilibrium has properly nested flux surfaces in a plane.

load(load_from[, file_format])

Initialize from file.

optimize([objective, constraints, ...])

Optimize an equilibrium for an objective.

perturb(deltas[, objective, constraints, ...])

Perturb an equilibrium.

resolution_summary()

Print a summary of the spectral and real space resolution.

save(file_name[, file_format, file_mode])

Save the object.

set_initial_guess(*args)

Set the initial guess for the flux surfaces, eg R_lmn, Z_lmn, L_lmn.

solve([objective, constraints, optimizer, ...])

Solve to find the equilibrium configuration.

to_sfl([L, M, N, L_grid, M_grid, N_grid, ...])

Transform this equilibrium to use straight field line coordinates.

Attributes

L

Maximum radial mode number.

L_basis

Spectral basis for lambda.

L_grid

Radial resolution of grid in real space.

L_lmn

Spectral coefficients of lambda.

M

Maximum poloidal fourier mode number.

M_grid

Poloidal resolution of grid in real space.

N

Maximum toroidal fourier mode number.

NFP

Number of (toroidal) field periods.

N_grid

Toroidal resolution of grid in real space.

Psi

Total toroidal flux within the last closed flux surface in Webers.

R_basis

Spectral basis for R.

R_lmn

Spectral coefficients of R.

Ra_n

R coefficients for axis Fourier series.

Rb_lmn

Spectral coefficients of R at the boundary.

Te_l

Coefficients of electron temperature profile.

Ti_l

Coefficients of ion temperature profile.

Z_basis

Spectral basis for Z.

Z_lmn

Spectral coefficients of Z.

Za_n

Z coefficients for axis Fourier series.

Zb_lmn

Spectral coefficients of Z at the boundary.

Zeff_l

Coefficients of effective atomic number profile.

atomic_number

Effective atomic number (Z_eff) profile.

axis

object representing the magnetic axis.

bdry_mode

Method for specifying boundary condition.

c_l

Coefficients of current profile.

current

Toroidal current profile (I).

electron_density

Electron density (m^-3) profile.

electron_temperature

Electron temperature (eV) profile.

i_l

Coefficients of iota profile.

ion_temperature

ion temperature (eV) profile.

iota

Rotational transform (iota) profile.

ne_l

Coefficients of electron density profile.

node_pattern

Pattern for placement of nodes in curvilinear coordinates.

p_l

Coefficients of pressure profile.

pressure

Pressure (Pa) profile.

resolution

Spectral and real space resolution parameters of the Equilibrium.

solved

Whether the equilibrium has been solved.

spectral_indexing

Type of indexing used for the spectral basis.

surface

Geometric surface defining boundary conditions.

sym

Whether this equilibrium is stellarator symmetric.