gcmotion.Tokamak#

class gcmotion.Tokamak(R: Quantity, a: Quantity, qfactor: QFactor, bfield: MagneticField, efield: ElectricField)#

Creates a tokamak device.

A Tokamak entity holds information about the devices dimensions, as well as the objects defining the configuration’s qfactor and electromagnetic field.

Parameters:
RQuantity

The tokamak’s major radius dimensions of [length].

aQuantity, optional

The tokamak’s minor radius dimensions of [length]. This parameter must be passed in analytical equilibria, otherwise the unit [psi_wall] cannot be defined. In the case of numerical equilibria, \(\alpha\) itself cannot be defined, and the unit [psi_wall] is defined automatically from the data.

qfactorQFactor

Qfactor object that supports query methods for getting values of \(q(\psi)\) and \(\psi_p(\psi)\).

bfieldMagneticField

Magnetic Field Object that supports query methods for getting values of the field magnitude, plasma currents and their derivatives.

efieldElectricField

Electric Field Object that supports query methods for getting values of the field itself and the derivatives of its potential.

Attributes:
R, RNUQuantities

The tokamak’s major radius in [meters]/[NUmeters].

a, aNUQuantities

The tokamak’s minor radius in [meters]/[NUmeters]. Purely decorative when dealing with reconstructed equilibria.

B0, B0NUQuantities

The strength of the magnetic field on the magnetic field in [Tesla]/[NUTesla].

psi_wall, psi_wallNUQuantities

The \(\psi\) value in the tokamak’s wall.

psip_wall, psip_wallNUQuantities

The \(\psi_p\) value in the tokamak’s wall.

QQuantity Constructor

Examples

How to initialize a PhysicalParameters object:

>>> import gcmotion as gcm
>>>
>>> # Quantity Constructor
>>> Rnum = 1.65
>>> anum = 0.5
>>> B0num = 1
>>> species = "p"
>>> Q = gcm.QuantityConstructor(R=Rnum, a=anum, B0=B0num, species=species)
>>>
>>> # Intermediate values
>>> R = Q(Rnum, "meters")
>>> a = Q(anum, "meters")
>>> B0 = Q(B0num, "Tesla")
>>> i = Q(0, "NUPlasma_current")
>>> g = Q(1, "NUPlasma_current")
>>> Ea = Q(73500, "Volts/meter")
>>>
>>> tokamak = gcm.Tokamak(
...     R=R,
...     a=a,
...     qfactor=gcm.qfactor.Hypergeometric(a, B0, q0=1.1, q_wall=3.8, n=2),
...     bfield=gcm.bfield.LAR(B0=B0, i=i, g=g),
...     efield=gcm.efield.Radial(a, Ea, B0, peak=0.98, rw=1 / 50),
... )

Methods