Initial Conditions¶
Types associated with Particle and Queue initialization.
dexter.InitialConditions()
¶
Initial conditions set for a Particle.
This type is instantiated through the Boozer and
Mixed class methods.
Attributes:
-
t0(float) –The initial time $t_0$.
-
flux0(MagneticFlux) –The initial magnetic flux $\psi_{t,0}$ or $\psi_{p,0}$.
-
theta0(float) –The initial $\theta$ angle.
-
theta0(float) –The initial $\zeta$ angle.
-
rho0(float) –The initial $\rho_{||,0}$. If the set was initialized from
Mixedand no particle routines have run, raisesAttributeError. -
pzeta0(float) –The initial $P_{\zeta,0}$. If the set was initialized from
Boozerand no particle routines have run, raisesAttributeError. -
coordinate_set(CoordinateSet) –The kind of initial conditions set.
Boozer(t0: float, flux0: MagneticFlux, theta0: float, zeta0: float, rho0: float, mu0: float) -> InitialConditions
classmethod
¶
Creates initial conditions for a Particle in Boozer coordinates.
The initial conditions are defined on the
$(t, \psi_t, \theta, \zeta, \rho, \mu)$ or
$(t, \psi_p, \theta, \zeta, \rho, \mu)$
space, depending on the value of flux0.
Parameters:
-
t0(float) –The initial time, in Normalized Units.
-
flux0(MagneticFlux) –The initial $\psi$, in Normalized Units.
-
theta0(float) –The initial $\theta$ angle, in rads.
-
zeta0(float) –The initial $\zeta$ angle, in rads.
-
rho0(float) –The initial $\rho_{||}$, in Normalized Units.
-
mu0(float) –The initial magnetic moment $\mu$, in Normalized Units.
Mixed(t0: float, flux0: MagneticFlux, theta0: float, zeta0: float, pzeta0: float | MagneticFlux, mu0: float) -> InitialConditions
classmethod
¶
Creates initial conditions for a Particle in Mixed coordinates.
The initial conditions are defined on the
$(t, \psi_t, \theta, \zeta, P_\zeta, \mu)$ or
$(t, \psi_p, \theta, \zeta, P_\zeta, \mu)$
space, depending on the value of flux0.
Parameters:
-
t0(float) –The initial time, in Normalized Units.
-
flux0(MagneticFlux) –The initial $\psi$, in Normalized Units.
-
theta0(float) –The initial $\theta$ angle, in rads.
-
zeta0(float) –The initial $\zeta$ angle, in rads.
-
pzeta0(float | MagneticFlux) –The initial $P_\zeta$, in Normalized Units.
-
mu0(float) –The initial magnetic moment $\mu$, in Normalized Units.
dexter.MagneticFluxArray()
¶
A container of multiple magnetic flux values and their kind.
This type is instantiated through the Toroidal and
Poloidal class methods.
Attributes:
-
values(Array1) –The contained values as a 1D Array.
-
kind(MagneticFluxKind) –The magnetic flux' kind.
Toroidal(array: ArrayLike) -> MagneticFluxArray
classmethod
¶
Defines an array of toroidal fluxes $\psi_t$.
Parameters:
-
array(ArrayLike) –The values of the toroidal magnetic fluxes.
Poloidal(array: ArrayLike) -> MagneticFluxArray
classmethod
¶
Defines an array of poloidal fluxes $\psi_p$.
Parameters:
-
array(ArrayLike) –The values of the poloidal magnetic fluxes.
__len__() -> int
¶
Returns the number of contained values.
__getitem__(index: int) -> MagneticFlux
¶
Returns a MagneticFlux of the same kind and value of
self.values[index].
dexter.QueueInitialConditions()
¶
Sets of initial conditions for initializing a Queue.
This type is instantiated through the Boozer and
Mixed class methods.
Boozer(t0: Array1, flux0: MagneticFluxArray, theta0: Array1, zeta0: Array1, rho0: Array1, mu0: Array1) -> QueueInitialConditions
classmethod
¶
Creates sets of initial conditions for a Particle in Boozer coordinates.
The initial conditions are defined on the
$(t, \psi_t, \theta, \zeta, \rho, \mu)$ or
$(t, \psi_p, \theta, \zeta, \rho, \mu)$
space, depending on the value of flux0.
Parameters:
-
t0(Array1) –The initial times, in Normalized Units.
-
flux0(MagneticFluxArray) –The initial $\psi$ values, in Normalized Units.
-
theta0(Array1) –The initial $\theta$ angles, in rads.
-
zeta0(Array1) –The initial $\zeta$ angles, in rads.
-
rho0(Array1) –The initial $\rho_{||}$ values, in Normalized Units.
-
mu0(Array1) –The initial magnetic moments $\mu$, in Normalized Units.
Example
>>> num = 10
>>> psit0s = dex.MagneticFluxArray.Toroidal(np.linspace(0, 0.05, num))
>>> initial_conditions = dex.QueueInitialConditions.Boozer(
... t0=np.zeros(num),
... flux0=psit0s,
... theta0=np.zeros(num),
... zeta0=np.zeros(num),
... rho0=np.full(num, 1e-5),
... mu0=np.full(num, 1e-6),
... )
Mixed(t0: Array1, flux0: MagneticFluxArray, theta0: Array1, zeta0: Array1, pzeta0: Array1, mu0: Array1) -> QueueInitialConditions
classmethod
¶
Creates sets of initial conditions for a Particle in Boozer coordinates.
The initial conditions are defined on the
$(t, \psi_t, \theta, \zeta, P_\zeta, \mu)$ or
$(t, \psi_p, \theta, \zeta, P_\zeta, \mu)$
space, depending on the value of flux0.
Parameters:
-
t0(Array1) –The initial times, in Normalized Units.
-
flux0(MagneticFluxArray) –The initial $\psi$ values, in Normalized Units.
-
theta0(Array1) –The initial $\theta$ angles, in rads.
-
zeta0(Array1) –The initial $\zeta$ angles, in rads.
-
pzeta0(Array1) –The initial $P_\zeta$ values, in Normalized Units.
-
mu0(Array1) –The initial magnetic moments $\mu$, in Normalized Units.
Example
>>> num = 10
>>> psip0s = dex.MagneticFluxArray.Poloidal(np.linspace(0, 0.05, num))
>>> initial_conditions = dex.QueueInitialConditions.Mixed(
... t0=np.zeros(num),
... flux0=psip0s,
... theta0=np.zeros(num),
... zeta0=np.zeros(num),
... pzeta0=np.full(num, -0.02),
... mu0=np.full(num, 1e-6),
... )