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 % 0002 % This script generates the data file of an ideal circular equilibrium based on 0003 % equilibrium profile parameters 0004 % 0005 % By J. Decker <jodecker@alum.mit.edu> and Y. Peysson <yves.peysson@cea.fr> 0006 % Created Feb. 17, 2004 0007 % 0008 clear all 0009 % 0010 id = 'TScyl';% scenario identification 0011 % 0012 [qe,me,mp,mn,e0,mu0,re,mc2,clum] = pc_dke_yp; 0013 % 0014 npsi = 101;% number of points in psi grid 0015 ntheta = 65;% number of points in theta grid 0016 qopt = 0;%Option for q profile. (0): constant (default, uniform current, psi=rho^2), (1): from qmin and eq 0017 % 0018 % Equilibrium parameters 0019 % 0020 ap = 0.7;% Plasma minor radius on LFS midplane (m) 0021 Rp = Inf;% Plasma major radius on axis (m) 0022 Zp = 0;% Global plasma vertical shift (m) 0023 Ip = 1.0;% Signed value of the plasma current (MA) (with R,Z,phi direct) 0024 Bt = 3.6;% 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 = [0,1,0];% Hydrogen isotopic fraction (H/D/T) [1,3] (WARNING: only used when hydrogen plasmas are considered) 0029 % 0030 qmin_Rpap = NaN;% Safety factor q0 at plasma center multiplied by Rp/ap 0031 eq = NaN;% Exponent for q radial profile (q_Rpap = (qmax_Rpap - qmin_Rpap)*(r/ap).^eq + qmin_Rpap, qmax calaculated by the Ampere's theorem at the plasma edge with a circular plasma cross-section) multiplied by Rp/ap 0032 % 0033 beta0 = 0.1;% 0034 % 0035 Te0 = beta0^2*mc2;% Core electron temperature (keV) 0036 Tea = Te0;% Edge electron temperature (keV) 0037 eTe = 0;% Exponent for Te profile (Te(r) = (Te0-Tea)*(1-(r/a)^2)^eTe + Tea) 0038 % 0039 ne0 = 2.0e19;% Core electron density (m-3) 0040 nea = ne0;% Edge electron density (m-3) 0041 ene = 0;% Exponent for ne profile (ne(r) = (ne0-nea)*(1-(r/a)^2)^ene + nea) 0042 % 0043 Ti0 = Te0;% Core ion temperature (keV) 0044 Tia = Ti0;% Edge ion temperature (keV) 0045 eTi = 0;% Exponent for Ti profile (Ti(r) = (Ti0-Tia)*(1-(r/a)^2)^eTi + Tia) 0046 % 0047 Zeff0 = 1;% Core effective charge (a.u.) 0048 Zeffa = 1;% Edge effective charge (a.u.) 0049 eZeff = 0;% Exponent for the effective charge (Zeff(r) = (Zeff0-Zeffa)*(1-(r/a)^2)^eZeff + Zeffa) 0050 % 0051 % Plasma parameters 0052 % 0053 [prho,equil_prof.pTe,equil_prof.pne,equil_prof.pzTi,equil_prof.pzni,equil_prof.zZi,equil_prof.zmi,fi,pkin] = idealprof_yp(Zi,mi,fi,Te0,Tea,2,eTe,ne0,nea,2,ene,Ti0,Tia,2,eTi,Zeff0,Zeffa,eZeff,NaN,npsi);%Profiles 0054 % 0055 %Magnetic equilibrium 0056 % 0057 [ppsin,ppsi_apRp,theta,x,y,Bx,By,BPHI,pBpp,pq_Rpap,pj,pmag,Ip_test] = idealequilcyl_yp(ap,Rp,Zp,Bt,Ip,qmin_Rpap,eq,qopt,npsi,ntheta);%Cylindrical magnetic equilibrium 0058 % 0059 equil_magnetic.theta = theta; 0060 equil_magnetic.ptx = x; 0061 equil_magnetic.pty = y; 0062 equil_magnetic.ptBx = Bx; 0063 equil_magnetic.ptBy = By; 0064 equil_magnetic.ptBPHI = BPHI; 0065 % 0066 equil_magnetic.psi_apRp = ppsi_apRp; %poloidal flux profile 0067 equil_magnetic.Rp = Rp; 0068 equil_magnetic.Zp = Zp; 0069 % 0070 equil = conc_struct_jd(equil_magnetic,equil_prof); 0071 equil.id = id; 0072 % 0073 filename = ['EQUIL_',equil.id,'.mat']; 0074 % 0075 eval(['save ',filename,' equil'])