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 1L (int (optional)) – Radial resolution. Default 2*M for
spectral_indexing=='fringe'
, else MM (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.
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
Maximum radial mode number.
Spectral basis for lambda.
Radial resolution of grid in real space.
Spectral coefficients of lambda.
Maximum poloidal fourier mode number.
Poloidal resolution of grid in real space.
Maximum toroidal fourier mode number.
Number of (toroidal) field periods.
Toroidal resolution of grid in real space.
Total toroidal flux within the last closed flux surface in Webers.
Spectral basis for R.
Spectral coefficients of R.
R coefficients for axis Fourier series.
Spectral coefficients of R at the boundary.
Coefficients of electron temperature profile.
Coefficients of ion temperature profile.
Spectral basis for Z.
Spectral coefficients of Z.
Z coefficients for axis Fourier series.
Spectral coefficients of Z at the boundary.
Coefficients of effective atomic number profile.
Effective atomic number (Z_eff) profile.
object representing the magnetic axis.
Method for specifying boundary condition.
Coefficients of current profile.
Toroidal current profile (I).
Electron density (m^-3) profile.
Electron temperature (eV) profile.
Coefficients of iota profile.
ion temperature (eV) profile.
Rotational transform (iota) profile.
Coefficients of electron density profile.
Pattern for placement of nodes in curvilinear coordinates.
Coefficients of pressure profile.
Pressure (Pa) profile.
Spectral and real space resolution parameters of the Equilibrium.
Whether the equilibrium has been solved.
Type of indexing used for the spectral basis.
Geometric surface defining boundary conditions.
Whether this equilibrium is stellarator symmetric.