freegs.control.ConstrainPsi2D#
- class freegs.control.ConstrainPsi2D(target_psi, weights=None)[source]#
Bases:
objectAdjusts 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