psi2rho_jd

PURPOSE ^

SYNOPSIS ^

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

DESCRIPTION ^

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

   INPUTS:

       - equil: Magnetic equilibrium structure
       - psin: poloidal flux [1:nr]
       - method: interpolation method (default: linear)

   OUTPUTS:

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

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