freegs.control.ConstrainPsi2D#

class freegs.control.ConstrainPsi2D(target_psi, weights=None)[source]#

Bases: object

Adjusts coil currents to minimise the square differences between psi[R,Z] and a target psi.

Ignores constant offset differences between psi array

__init__(target_psi, weights=None)[source]#
target_psi2D (R,Z) array

Must be the same size as the equilibrium psi

weightsfloat or 2D array of same size as target_psi

Relative importance of each (R,Z) point in the fitting By default every point is equally weighted Set points to zero to ignore them in fitting.

Methods

__init__(target_psi[, weights])

target_psi : 2D (R,Z) array

psi_difference(currents, eq)

Difference between psi from equilibrium with the given currents and the target psi

psi_difference(currents, eq)[source]#

Difference between psi from equilibrium with the given currents and the target psi