freegs.picard.solve

Contents

freegs.picard.solve#

freegs.picard.solve(eq, profiles, constrain=None, rtol=0.001, atol=1e-10, blend=0.0, show=False, axis=None, pause=0.0001, psi_bndry=None, maxits=50, convergenceInfo=False, check_limited=False, wait_for_limited=False, limit_it=0)[source]#

Perform Picard iteration to find solution to the Grad-Shafranov equation

Parameters:
  • eq – an Equilibrium object (equilibrium.py)

  • profiles – A Profile object for toroidal current (jtor.py)

  • rtol – Relative tolerance (change in psi)/( max(psi) - min(psi) )

  • atol – Absolute tolerance, change in psi

  • blend

    Blending of previous and next psi solution

    psi{n+1} <- psi{n+1} * (1-blend) + blend * psi{n}

  • show – If true, plot the plasma equilibrium at each nonlinear step

  • axis – Specify a figure to plot onto. Default (None) creates a new figure

  • pause – Delay between output plots. If negative, waits for window to be closed

  • maxits – Maximum number of iterations. Set to None for no limit. If this limit is exceeded then a RuntimeError is raised.

  • convergenceInfo – True/False toggle for outputting convergence data.

  • check_limited – True/False toggle to control checking for limited plasmas.

  • wait_for_limited – True/False toggle to keep iterating until the plasma is limited.

  • limit_it – Sometimes waiting some number of interations before checking if a plasma is limited can improve convergence. This sets the number of iterations to wait.