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, pressure=None, iota=None, current=None, electron_temperature=None, electron_density=None, ion_temperature=None, atomic_number=None, anisotropy=None, surface=None, axis=None, sym=None, spectral_indexing=None, check_orientation=True, ensure_nested=True, **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
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
anisotropy (Profile or ndarray) – Anisotropic pressure profile or array of mode numbers and spectral coefficients. Default is a PowerSeriesProfile with zero anisotropic pressure.
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'
check_orientation (bool) – ensure that this equilibrium has a right handed orientation. Do not set to False unless you are sure the parameterization you have given is right handed (ie, e_theta x e_zeta points outward from the surface).
ensure_nested (bool) – If True, and the default initial guess does not produce nested surfaces, run a small optimization problem to attempt to refine initial guess to improve coordinate mapping.
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_theta_coords
(flux_coords[, L_lmn, ...])Find theta_DESC for given straight field line theta_PEST.
copy
([deepcopy])Return a (deep)copy of this equilibrium.
equiv
(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_axis
()Return a representation for the magnetic axis.
get_profile
(name[, grid, kind])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, L_lmn, msg])Check that an equilibrium has properly nested flux surfaces in a plane.
load
(load_from[, file_format])Initialize from file.
map_coordinates
(coords, inbasis[, outbasis, ...])Given coordinates in inbasis, compute corresponding coordinates in outbasis.
optimize
([objective, constraints, ...])Optimize an equilibrium for an objective.
pack_params
(p)Convert a dictionary of parameters into a single array.
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[, ensure_nested])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.
Convert a single array of concatenated parameters into a dictionary.
Attributes
Net poloidal current on the sheet current at the LCFS.
Net toroidal current on the sheet current at the LCFS.
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.
coeffs of single-valued part of surface current potential.
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.
Coefficients of anisotropy profile.
Anisotropy 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).
total number of optimizable parameters.
dictionary of integers of sizes of each optimizable parameter.
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.
string names of parameters that have been declared optimizable.
Coefficients of pressure profile.
dictionary of arrays of optimizable parameters.
Pressure (Pa) profile.
Spectral and real space resolution parameters of the Equilibrium.
Type of indexing used for the spectral basis.
Geometric surface defining boundary conditions.
Whether this equilibrium is stellarator symmetric.
arrays of indices for each parameter in concatenated array.