This script generates the data file of an ideal circular equilibrium based on equilibrium profile parameters By J. Decker <jodecker@alum.mit.edu> and Y. Peysson <yves.peysson@cea.fr> Created Feb. 17, 2004
0001 function [] = make_equil_VERSATOR2test 0002 % 0003 % 0004 % This script generates the data file of an ideal circular equilibrium based on 0005 % equilibrium profile parameters 0006 % 0007 % By J. Decker <jodecker@alum.mit.edu> and Y. Peysson <yves.peysson@cea.fr> 0008 % Created Feb. 17, 2004 0009 % 0010 [qe,me,mp,mn,e0,mu0,re,mc2,clum] = pc_dke_yp; 0011 % 0012 npsi = 101;% number of points in psi grid 0013 ntheta = 65;% number of points in theta grid 0014 qopt = 1;%Option for q profile. (0): constant (default, uniform current, psi=rho^2), 0015 % (1): linear (psi=rho), 0016 % (2): from qmin and eq 0017 % 0018 % Equilibrium parameters 0019 % 0020 Rp = 0.4;%Plasma major radius on axis (m) 0021 Zp = 0.0;% Plasma vertical position (m) 0022 ap = 0.325*Rp;%Plasmaminor radius (m) 0023 Ip = 0.05;% Signed value of the plasma current (MA) (with R,Z,phi direct) 0024 Bt = 1.4;% Signed value of the toroidal magnetic field on the magnetic axis (T) (with R,Z,phi direct) 0025 % 0026 Zi = [1,1,1,6];% Ion types: (1) H/D/T, (2) He, ..., (6) C [1,p] (WARNING: Zi must be [1,1,1,imp1,imp2] for hydrogen plasmas) 0027 mi = [1,2,3,12];% Ion mass (uma) [1,p] (WARNING: Zi must be [1,2,3,mimp1,mimp2] for hydrogen plasmas) 0028 fi = [1,0,0];% Hydrogen isotopic fraction (H/D/T) [1,3] (WARNING: only used when hydrogen plasmas are considered) 0029 % 0030 qmin_Rpap = 1*Rp/ap;%Normalized safety factor q0 at plasma center 0031 eq = 2;% Exponent for q radial profile (q = (qmax - qmin)*(r/a).^eq + qmin, qmax calaculated by the Ampere's theorem at the plasma edge with a circular plasma cross-section) 0032 % 0033 Te0 = 0.40;% Core electron temperature (keV) 0034 Tea = 0.02;% Edge electron temperature (keV) 0035 eTe = 3.94;% Exponent for Te profile (Te(r) = (Te0-Tea)*(1-(r/a)^2)^eTe + Tea) 0036 % 0037 ne0 = 2.0e19;% Core electron density (m-3) 0038 nea = 2e18;% Edge electron density (m-3) 0039 ene = 0.1;% Exponent for ne profile (ne(r) = (ne0-nea)*(1-(r/a)^2)^ene + nea) 0040 % 0041 Ti0 = 0.15;% Core ion temperature (keV) 0042 Tia = 0.02;% Edge ion temperature (keV) 0043 eTi = 3.94;% Exponent for Ti profile (Ti(r) = (Ti0-Tia)*(1-(r/a)^2)^eTi + Tia) 0044 % 0045 Zeff0 = 2;% Core effective charge (a.u.) 0046 Zeffa = 2;% Edge effective charge (a.u.) 0047 eZeff = 0;% Exponent for the effective charge (Zeff(r) = (Zeff0-Zeffa)*(1-(r/a)^2)^eZeff + Zeffa) 0048 % 0049 % Plasma parameters 0050 % 0051 [prho,equil_prof.pTe,equil_prof.pne,equil_prof.pzTi,equil_prof.pzni,equil_prof.zZi,equil_prof.zmi,equil_prof.fi,pkin] = idealprof_yp(Zi,mi,fi,Te0,Tea,eTe,NaN,ne0,nea,ene,NaN,Ti0,Tia,eTi,NaN,Zeff0,Zeffa,eZeff,NaN,npsi);%Profiles 0052 % 0053 % Magnetic equilibrium 0054 % 0055 [ppsin,equil_mag.psi_apRp,equil_mag.theta,equil_mag.ptx,equil_mag.pty,equil_mag.ptBx,equil_mag.ptBy,equil_mag.ptBPHI,pBpp,pq_Rpap,pj,pmag,Ip_test] = idealequilcyl_yp(ap,Rp,Zp,Bt,Ip,qmin_Rpap,eq,qopt,npsi,ntheta);%Cylindrical magnetic equilibrium 0056 % 0057 equil_mag.Rp = Rp; 0058 equil_mag.Zp = Zp; 0059 % 0060 equil = conc_struct_jd(equil_mag,equil_prof); 0061 equil.id = 'VERSATOR2test';% scenario identification 0062 % 0063 filename = ['EQUIL_',equil.id,'.mat']; 0064 % 0065 eval(['save ',filename,' equil'])