Skip to content

UnityQfactor

dexter.UnityQfactor(lcfs: LastClosedFluxSurface)

Analytical q-factor profile of \(q=1\) and \(\psi=\psi_p\).

Parameters:

Example
UnityQfactor creation
>>> lcfs = LastClosedFluxSurface("Toroidal", 0.45)
>>> qfactor = dex.UnityQfactor(lcfs)

Methods:

Attributes:

  • psi_state (FluxState) –

    The state of the toroidal flux coordinate.

  • psip_state (FluxState) –

    The state of the poloidal flux coordinate.

  • equilibrium_type (EquilibriumType) –

    The object's equilibrium's type.

  • psi_last (float) –

    The value of the last closed toroidal flux surface \(\psi_{LCFS}\) in Normalized Units.

  • psip_last (float) –

    The value of the last closed poloidal flux surface \(\psi_{p,LCFS}\) in Normalized Units.

  • qlast (float) –

    The value of \(q\) at the last closed flux surface.

  • qaxis (float) –

    The value of \(q\) on the magnetic axis.

dexter.UnityQfactor.psi_state: FluxState property

The state of the toroidal flux coordinate.

dexter.UnityQfactor.psip_state: FluxState property

The state of the poloidal flux coordinate.

dexter.UnityQfactor.equilibrium_type: EquilibriumType property

The object's equilibrium's type.

dexter.UnityQfactor.psi_last: float property

The value of the last closed toroidal flux surface \(\psi_{LCFS}\) in Normalized Units.

dexter.UnityQfactor.psip_last: float property

The value of the last closed poloidal flux surface \(\psi_{p,LCFS}\) in Normalized Units.

dexter.UnityQfactor.qlast: float property

The value of \(q\) at the last closed flux surface.

dexter.UnityQfactor.qaxis: float property

The value of \(q\) on the magnetic axis.

dexter.UnityQfactor.q_of_psi(psi: ArrayLike) -> NDArray

The \(q(\psi)\) value.

Parameters:

  • psi (ArrayLike) –

    The toroidal flux \(\psi\) in Normalized Units.

dexter.UnityQfactor.q_of_psip(psip: ArrayLike) -> NDArray

The \(q(\psi_p)\) value.

Parameters:

  • psip (ArrayLike) –

    The poloidal flux \(\psi_p\) in Normalized Units.

dexter.UnityQfactor.dpsip_dpsi(psi: ArrayLike) -> NDArray

The derivative \(d\psi_p(\psi)/d\psi\) value in Normalized Units.

It's a good check that the values coincide with qfactor.iota_of_psi(psi).

Parameters:

  • psi (ArrayLike) –

    The toroidal flux \(\psi\) in Normalized Units.

dexter.UnityQfactor.dpsi_dpsip(psip: ArrayLike) -> NDArray

The derivative \(d\psi(\psi_p)/d\psi_p\) value in Normalized Units.

It's a good check that the values coincide with qfactor.q_of_psip(psip).

Parameters:

  • psip (ArrayLike) –

    The poloidal flux \(\psi_p\) in Normalized Units.

dexter.UnityQfactor.iota_of_psi(psi: ArrayLike) -> NDArray

The \(\iota(\psi) = \dfrac{1}{q(\psi)}\) value.

Parameters:

  • psi (ArrayLike) –

    The toroidal flux \(\psi\) in Normalized Units.

dexter.UnityQfactor.iota_of_psip(psip: ArrayLike) -> NDArray

The \(\iota(\psi_p) = \dfrac{1}{q(\psi_p)}\) value.

Parameters:

  • psip (ArrayLike) –

    The poloidal flux \(\psi_p\) in Normalized Units.

dexter.UnityQfactor.plot_q_of_psi(points: int = 1000, data: bool = False, show: bool = True) -> Canvas

Plots \(q(\psi)\).

Parameters:

  • points (int, default: 1000 ) –

    The number of points in which to evaluate \(q(\psi)\). Defaults to 1000.

  • data (bool, default: False ) –

    Whether or not to plot the data array points (numerical equilibria only). Defaults to False.

  • show (bool, default: True ) –

    Whether or not to call plt.show(). Defaults to True.

Returns:

  • Canvas

    The produced Figure and Ax.

dexter.UnityQfactor.plot_q_of_psip(points: int = 1000, data: bool = False, show: bool = True) -> Canvas

Plots \(q(\psi_p)\).

Parameters:

  • points (int, default: 1000 ) –

    The number of points in which to evaluate \(q(\psi_p)\). Defaults to 1000.

  • data (bool, default: False ) –

    Whether or not to plot the data array points (numerical equilibria only). Defaults to False.

  • show (bool, default: True ) –

    Whether or not to call plt.show(). Defaults to True.

Returns:

  • Canvas

    The produced Figure and Ax.

dexter.UnityQfactor.plot_dpsip_dpsi(points: int = 1000, show: bool = True) -> Canvas

Plots \(d\psi_p(\psi)/d\psi\) and \(\iota(\psi)\).

This is a check to make sure the two quantities do indeed overlap.

Parameters:

  • points (int, default: 1000 ) –

    The number of points in which to evaluate the two splines. Defaults to 1000.

  • show (bool, default: True ) –

    Whether or not to call plt.show(). Defaults to True.

Returns:

  • Canvas

    The produced Figure and Ax.

dexter.UnityQfactor.plot_dpsi_dpsip(points: int = 1000, show: bool = True) -> Canvas

Plots \(d\psi(\psi_p)/d\psi_p\) and \(q(\psi_p)\).

This is a check to make sure the two quantities do indeed overlap.

Parameters:

  • points (int, default: 1000 ) –

    The number of points in which to evaluate the two splines. Defaults to 1000.

  • show (bool, default: True ) –

    Whether or not to call plt.show(). Defaults to True.

Returns:

  • Canvas

    The produced Figure and Ax.

dexter.UnityQfactor.plot_iota_of_psi(points: int = 1000, show: bool = True) -> Canvas

Plots \(\iota(\psi)\).

Parameters:

  • points (int, default: 1000 ) –

    The number of points in which to evaluate \(\iota(\psi)\). Defaults to 1000.

  • show (bool, default: True ) –

    Whether or not to call plt.show(). Defaults to True.

Returns:

  • Canvas

    The produced Figure and Ax.

dexter.UnityQfactor.plot_iota_of_psip(points: int = 1000, show: bool = True) -> Canvas

Plots \(\iota(\psi_p)\).

Parameters:

  • points (int, default: 1000 ) –

    The number of points in which to evaluate \(\iota(\psi_p)\). Defaults to 1000.

  • show (bool, default: True ) –

    Whether or not to call plt.show(). Defaults to True.

Returns:

  • Canvas

    The produced Figure and Ax.

dexter.UnityQfactor.psip_of_psi(psi: ArrayLike) -> NDArray

The \(\psi_p(\psi)\) value in Normalized Units.

Parameters:

  • psi (ArrayLike) –

    The toroidal flux \(\psi\) in Normalized Units.

dexter.UnityQfactor.psi_of_psip(psip: ArrayLike) -> NDArray

The \(\psi(\psi_p)\) value in Normalized Units.

Parameters:

  • psip (ArrayLike) –

    The poloidal flux \(\psi_p\) in Normalized Units.

dexter.UnityQfactor.plot_psip_of_psi(points: int = 1000, data: bool = False, show: bool = True) -> Canvas

Plots \(\psi(\psi_p)\).

Parameters:

  • points (int, default: 1000 ) –

    The number of points in which to evaluate \(\psi_p(\psi)\). Defaults to 1000.

  • data (bool, default: False ) –

    Whether or not to plot the data array points (numerical equilibria only). Defaults to False.

  • show (bool, default: True ) –

    Whether or not to call plt.show(). Defaults to True.

Returns:

  • Canvas

    The produced Figure and Ax.

dexter.UnityQfactor.plot_psi_of_psip(points: int = 1000, data: bool = False, show: bool = True) -> Canvas

Plots \(\psi(\psi_p)\).

Parameters:

  • points (int, default: 1000 ) –

    The number of points in which to evaluate \(\psi(\psi_p)\). Defaults to 1000.

  • data (bool, default: False ) –

    Whether or not to plot the data array points (numerical equilibria only). Defaults to False.

  • show (bool, default: True ) –

    Whether or not to call plt.show(). Defaults to True.

Returns:

  • Canvas

    The produced Figure and Ax.

dexter.UnityQfactor.psi_of_q(q: ArrayLike) -> NDArray

The toroidal flux \(\psi\) in Normalized Units.

Parameters:

  • q (ArrayLike) –

    The q-factor value \(q\).

dexter.UnityQfactor.psip_of_q(q: ArrayLike) -> NDArray

The poloidal flux \(\psi_p\) in Normalized Units.

Parameters:

  • q (ArrayLike) –

    The q-factor value \(q\).