freegs.machine.Circuit#

class freegs.machine.Circuit(coils, current=0.0, control=True)[source]#

Bases: object

Represents a collection of coils connected to the same circuit

Public members#

current Current in the circuit [Amps] control Use feedback control? [bool]

__init__(coils, current=0.0, control=True)[source]#

coils - A list [ (label, Coil, multiplier) ]

Methods

Br(R, Z)

Calculate radial magnetic field Br at (R,Z)

Bz(R, Z)

Calculate vertical magnetic field Bz at (R,Z)

__init__(coils[, current, control])

coils - A list [ (label, Coil, multiplier) ]

calcPsiFromGreens(pgreen)

Calculate psi from Greens functions

controlBr(R, Z)

Calculate radial magnetic field Br at (R,Z) due to a unit current

controlBz(R, Z)

Calculate vertical magnetic field Bz at (R,Z) due to a unit current

controlPsi(R, Z)

Calculate poloidal flux at (R,Z) due to a unit current

createPsiGreens(R, Z)

Calculate Greens functions

from_numpy_array(value)

getForces(equilibrium)

Calculate forces on the coils

inShape(polygon)

plot([axis, show])

Plot the coils in the circuit Returns the axis used

psi(R, Z)

Calculate poloidal flux at (R,Z)

to_numpy_array()

Helper method for writing output

Attributes

Br(R, Z)[source]#

Calculate radial magnetic field Br at (R,Z)

Bz(R, Z)[source]#

Calculate vertical magnetic field Bz at (R,Z)

calcPsiFromGreens(pgreen)[source]#

Calculate psi from Greens functions

property control: bool#
controlBr(R, Z)[source]#

Calculate radial magnetic field Br at (R,Z) due to a unit current

controlBz(R, Z)[source]#

Calculate vertical magnetic field Bz at (R,Z) due to a unit current

controlPsi(R, Z)[source]#

Calculate poloidal flux at (R,Z) due to a unit current

createPsiGreens(R, Z)[source]#

Calculate Greens functions

property current: float#
dtype = dtype([('label', 'O'), ('coil', [('R', '<f8'), ('Z', '<f8'), ('current', '<f8'), ('turns', '<i8'), ('control', '?')]), ('multiplier', '<f8')])#
classmethod from_numpy_array(value)[source]#
getForces(equilibrium)[source]#

Calculate forces on the coils

Returns a dictionary of coil label -> force

inShape(polygon)[source]#
plot(axis=None, show=False)[source]#

Plot the coils in the circuit Returns the axis used

psi(R, Z)[source]#

Calculate poloidal flux at (R,Z)

string_dtype = dtype('O')#
to_numpy_array()[source]#

Helper method for writing output