changeq.m
USAGE: [eq, eqx] = changeq(eq0,eq_target,tok_data_struct,options,idoplot)
PURPOSE: Change an equilibrium from eq0 to eq_target
Targeted variables are: (rbbbs,zbbbs), cc, cpasma, betap, li
Bus constraint such as the VFI on DIII-D can be imposed on cc
INPUTS: eq0: Original equilibrium structure on toksys format
eq_target: Equilibrium structure containing target quantities
Specify NaN for variables to adjust in order to achieve target
example: if cc can be adjusted then set eq_target.cc(:) = NaN;
tok_data_struct: standard toksys object for tokamak description
options.converrmax = upper limit on flux error in resulting eq
options.maxiter: maximum convergence iterations, default = 25;
options.cccirc: standard toksys assignment of circuit numbers to coils,
options.bus_code: indices are 1 for coils on bus, 0 for others
For DIII-D do: PP_objs = get_PP_objs(shot)
options.bus_code = [0 0 PP_objs.bus_code]
idoplot: plot each iteration for idoplot seconds, default 0 = no plot
OUTPUTS: eq: structure containing new converged equilibrium on tok_data_struct grid
eqx: structure containing extra information (see eqx.descriptions)
RESTRICTIONS: MAXIMUM grid size is 65x65
Only these quantities are updated for the new equilibrium:
rbbbs, zbbbs, jphi, psizr, pprime, ffprim, pres, fpol
cc, psimag, psibry, cpasma, rmaxis, zmaxis, rg, zg, dr, dz
nw, nh, psirz, ssibry, ssimag, qpsi
METHOD: Linear solution is found by gspert and converged with convergeq
Dependencies