Skip to content

dynamic_equil.m

Basic Information

  SYNTAX: moving_equil = dynamic_equil(inputs)

  PURPOSE: Calculate "moving equilibrium" so that delta coordinates can
   be defined. Get objects to fit model
   where we take d/dt i_PF as input disturbance or forcing function.

  INPUT: (in structure "inputs")
    shotnum = shot number
    ip0   = approximate plasma current (Amps)
    vmat = mapping of input voltages to rows in state equation, after reduction
    vdata = approximate equil. power supply voltages (V) corresponding to cols in vmat
    good_vdata = vector of flags indicating which vdata values are "good" (0 or 1)
    tok_system = system model data structure for device being modeled
    Rp = plasma resistance
    ohstates_idx = indices of PF current states that participate in Ip control
   Optional (first 3 must be included or omitted together):
    LHSconstraint = defines extra LHS * (current states) = RHS constraints
    RHSconstraint = defines extra LHS * (current states) = RHS constraints
    constraint_str = string description of these constraints
    weight_coils = scalar or length ncx vector wtg factor for fitting coil currents
             (default=100)
    weight_volts = scalar or vector wtg factor (length(vdata)) for fitting power
             supply voltages (default=10)

  OUTPUT: (in structure moving_equil)
       equil_pt   = nominal equilibrium to be used for linearization:

  RESTRICTIONS: If a particular voltage measurement is of poor or unknown quality, set
    the good_vdata flag = 0  and define a low fitting weight.

  METHOD:  Performs a weighted least squares fit of free variables (see text
    variable "var" in output structure moving_equil) to shot data and
    constraint equations containing those variables defined by model
    circuit equations and physical constraints.  "Bad" voltages are replaced by 0
    during the fitting, but plots show comparison of input and fitted values.

Dependencies