Skip to content

calc_gaps.m

Basic Information

  USAGE: [gapresp,gaps,gapspec] = calc_gaps(gapspec,tok_data_struct,resp,eq,idoplot)

  PURPOSE: Calculate gaps and responses thereof at specified locations
           A gap is defined as the distance between the plasma boundary
           and the wall along a line through a specified "gap location",
           with direction of measurement defined by gradient of flux for a
           nominal equilibrium at that prescribed "gap location".
           (This nominal equilibrium is also used to generate the
           linearized plasma response model.)

  INPUTS: gapspec: gap specification on the form [r z gr gz]
                   r,z is gap location and gr,gz nominal gradient
                   If nominal gradient is 0,0 then it is taken from eq
                   This creates a gapspec with eq as nominal equilibrium
                   If gapspec is empty, a default inner, upper, outer, lower gap are set
  tok_data_struct: toksys description of tokamak
             resp: (optional) the output from a response model (gspert or rzrig)
               eq: equilibrium structure
          idoplot: flag to plot limiter, boundary, gap location, and gap vector

  OUTPUTS: gapresp: response structure with fields:
                    dgapdis: gap response to conductors [m/A]
                    dgapdip,*dli,*dbetap, etc: exogenous responses
              gaps: distances from boundary to wall through r,z along gr,gz [m]
           gapspec: Complete gap specification on form [r z gr gz].

Dependencies