sep4helmex_optim_yp

PURPOSE ^

SYNOPSIS ^

function [delta] = sep4helmex_optim_yp(X,R_sep,Z_sep)

DESCRIPTION ^

   Optimize the parameters to define the separatrix for the toroidal MHD equilibrium solver HELENA
   (helmex)

   INPUTS

       - X : parameters of the shape of the separatrix (xpoint,ap,Rp,Zp)
       - R_sep : major radius of the prescribed separatrix (m) [1,1] 
       - Z_sep : vertical shift of the prescribed separatrix (m) [1,1]

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [delta] = sep4helmex_optim_yp(X,R_sep,Z_sep)
0002 %
0003 %   Optimize the parameters to define the separatrix for the toroidal MHD equilibrium solver HELENA
0004 %   (helmex)
0005 %
0006 %   INPUTS
0007 %
0008 %       - X : parameters of the shape of the separatrix (xpoint,ap,Rp,Zp)
0009 %       - R_sep : major radius of the prescribed separatrix (m) [1,1]
0010 %       - Z_sep : vertical shift of the prescribed separatrix (m) [1,1]
0011 %
0012 ntheta = length(R_sep);
0013 if length(Z_sep) ~= ntheta,
0014     error('Inconsistent length between the major radius and the vertical shift of the input separatrix in sep4helmex_optim_yp');
0015 end
0016 %
0017 %
0018 [R_sep0,Z_sep0] = sep4helmex_yp(X,ntheta);
0019 %
0020 delta = sum(sqrt((R_sep-R_sep0).^2 + (Z_sep-Z_sep0).^2))/ntheta;
0021 %

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