rho2psi_jd

PURPOSE ^

SYNOPSIS ^

function [psin] = rho2psi_jd(equil,rho,method)

DESCRIPTION ^

 gives the normalized psi grid corresponding to the input normalized rho grid.

   INPUTS:

       - tokamak: identification name of the scenario
       - rho: normalized radius [1:nr]
       - method: interpolation method (default: linear)

   OUTPUTS:

       - psin: poloidal flux [1:nr]

 by Joan Decker <jodecker@alum.mit.edu> (MIT/RLE) and  Yves Peysson <yves.peysson@cea.fr> (CEA/DRFC)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [psin] = rho2psi_jd(equil,rho,method)
0002 %
0003 % gives the normalized psi grid corresponding to the input normalized rho grid.
0004 %
0005 %   INPUTS:
0006 %
0007 %       - tokamak: identification name of the scenario
0008 %       - rho: normalized radius [1:nr]
0009 %       - method: interpolation method (default: linear)
0010 %
0011 %   OUTPUTS:
0012 %
0013 %       - psin: poloidal flux [1:nr]
0014 %
0015 % by Joan Decker <jodecker@alum.mit.edu> (MIT/RLE) and  Yves Peysson <yves.peysson@cea.fr> (CEA/DRFC)
0016 %
0017 if nargin < 3
0018     method = 'linear';%Interpolation method
0019 end
0020 if nargin < 2
0021     error('no rho grid specified');
0022 end
0023 %
0024 if strcmp(equil.id,'LOCAL'),
0025     psin = rho;
0026     return
0027 end
0028 npsi = length(equil.psi_apRp);
0029 %
0030 ap =  equil.ptx(npsi,1);%plasma radius on the LFS midplane
0031 prho = equil.ptx(:,1)/ap;
0032 %
0033 psia = equil.psi_apRp(npsi);%poloidal flux at the edge
0034 %
0035 % Interpolation of calculation grid
0036 %
0037 psin = interp1(prho,equil.psi_apRp/psia,rho,method);
0038

Community support and wiki are available on Redmine. Last update: 18-Apr-2019.