freegs.control.ConstrainPsiNorm2DAdvanced#

class freegs.control.ConstrainPsiNorm2DAdvanced(target_psinorm, weights=1.0, current_lims=None)[source]#

Bases: object

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

Attempts to also constrain the coil currents as in the ‘constrain’ class.

__init__(target_psinorm, weights=1.0, current_lims=None)[source]#
target_psinorm2D (R,Z) array

Must be the same size as the equilibrium psi

weightsfloat or 2D array of same size as target_psinorm

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.

current_bounds: List of tuples

Optional list of tuples representing constraints on coil currents to be used when reconstructing the equilibrium from the geqdsk file. [(l1,u1),(l2,u2)…(lN,uN)]

Create an instance, specifying the constraints to apply

Methods

__init__(target_psinorm[, weights, current_lims])

target_psinorm : 2D (R,Z) array

psinorm_difference(currents, eq)

Sum of the squares of the differences between the achieved normalised psi and the target normalised psi.

psinorm_difference(currents, eq)[source]#

Sum of the squares of the differences between the achieved normalised psi and the target normalised psi.