0001
0002
0003
0004
0005
0006
0007
0008 clear all
0009 close all
0010
0011 display_mode = 0;
0012 p_opt = -1;
0013
0014 id_equil = 'TScirc';
0015 id_ripple = 'TSspecific';
0016
0017 ripple.id = id_ripple;
0018 ripple.equil_id = id_equil;
0019
0020
0021
0022
0023
0024 ripple.mode = 1;
0025
0026 ripple.N = 18;
0027
0028
0029
0030 ripple.B0 = 3.2;
0031 ripple.R0 = 2.4;
0032 ripple.rn = 1.0;
0033 ripple.rx = 1.48;
0034
0035
0036
0037 eval(['save RIPPLE_',id_equil,'_',id_ripple,'.mat ripple']);
0038
0039
0040
0041 load ../EQUIL_files/EQUIL_TScirc.mat
0042 [equilDKE] = equilibrium_jd(equil,NaN,display_mode);
0043 ripple_model = 3;
0044
0045 [aBx,aBy,aBz,delta_rho,delta_theta,delta_phi] = bripfield_yp(ripple,equilDKE,ripple_model);
0046
0047 imidradius = find(equilDKE.xrho==0.5);
0048 ipi = find(equilDKE.mtheta==pi);
0049
0050 if abs(display_mode) >= 2,
0051 figure('Name','Radial magnetic ripple perturbation')
0052 graph1D_jd(equilDKE.mtheta(1:ipi),delta_rho(end,1:ipi),0,0,'\theta [rd]','\delta_{\rho}','Toroidal magnetic ripple (Tore Supra)',NaN,[0,pi],'','-','none','r',2,20,gca,0.9,0.7,0.7);
0053 graph1D_jd(equilDKE.mtheta(1:ipi),delta_rho(imidradius,1:ipi),0,0,'\theta [rd]','\delta_{\rho}','Toroidal magnetic ripple (Tore Supra)',NaN,[0,pi],'','--','none','b',2,20,gca,0.9,0.7,0.7);
0054 legend('Plasma edge','Mid radius','Location','NorthEast');
0055 print_jd(p_opt,[id_equil,'_',id_ripple,'_delta_rho'],'Figures');
0056
0057 figure('Name','Poloidal magnetic ripple perturbation')
0058 graph1D_jd(equilDKE.mtheta(1:ipi),delta_theta(end,1:ipi),0,0,'\theta [rd]','\delta_{\theta}','Toroidal magnetic ripple (Tore Supra)',NaN,[0,pi],'','-','none','r',2,20,gca,0.9,0.7,0.7);
0059 graph1D_jd(equilDKE.mtheta(1:ipi),delta_theta(imidradius,1:ipi),0,0,'\theta [rd]','\delta_{\theta}','Toroidal magnetic ripple (Tore Supra)',NaN,[0,pi],'','--','none','b',2,20,gca,0.9,0.7,0.7);
0060 legend('Plasma edge','Mid radius','Location','NorthEast');
0061 print_jd(p_opt,[id_equil,'_',id_ripple,'_delta_theta'],'Figures');
0062
0063 figure('Name','Toroidal magnetic ripple perturbation')
0064 graph1D_jd(equilDKE.mtheta(1:ipi),delta_phi(end,1:ipi),0,0,'\theta [rd]','\delta_{\phi}','Toroidal magnetic ripple (Tore Supra)',NaN,[0,pi],'','-','none','r',2,20,gca,0.9,0.7,0.7);
0065 graph1D_jd(equilDKE.mtheta(1:ipi),delta_phi(imidradius,1:ipi),0,0,'\theta [rd]','\delta_{\phi}','Toroidal magnetic ripple (Tore Supra)',NaN,[0,pi],'','--','none','b',2,20,gca,0.9,0.7,0.7);
0066 legend('Plasma edge','Mid radius','Location','NorthEast');
0067 print_jd(p_opt,[id_equil,'_',id_ripple,'_delta_phi'],'Figures');
0068
0069 nphi = linspace(0,2*pi,ripple.N*100);
0070
0071 figure('Name','Toroidal magnetic ripple perturbation')
0072 graph1D_jd(nphi,aBz(end,1)*cos(ripple.N*nphi)+ equilDKE.XBphi(end,1),0,0,'\phi [rd]','B_{\phi} [T]','Toroidal magnetic ripple (Tore Supra)',NaN,[0,2*pi],[min(equilDKE.XBphi(end,:))*0.5,max(equilDKE.XBphi(end,:))*1.5],'-','none','r',2,20,gca,0.9,0.7,0.7);
0073 graph1D_jd(nphi,aBz(end,ipi)*cos(ripple.N*nphi)+ equilDKE.XBphi(end,ipi),0,0,'\phi [rd]','B_{\phi} [T]','Toroidal magnetic ripple (Tore Supra)',NaN,[0,2*pi],[min(equilDKE.XBphi(end,:))*0.5,max(equilDKE.XBphi(end,:))*1.5],'--','none','b',2,20,gca,0.9,0.7,0.7);
0074 legend('Plasma edge (LFS)','Plasma edge (HFS)','Location','NorthEast');
0075 print_jd(p_opt,[id_equil,'_',id_ripple,'_B_phi'],'Figures');
0076
0077
0078
0079 figure(1),
0080
0081 xmin = min(min(equil.ptx));
0082 xmax = max(max(equil.ptx));
0083 ymin = min(min(equil.pty));
0084 ymax = max(max(equil.pty));
0085
0086 hold on
0087 graph2D_jd(equilDKE.Xx,equilDKE.Xy,log(delta_phi).','','','',[xmin,xmax],[ymin,ymax],0,NaN,NaN,0,'-','b',2,20);
0088 hold off
0089 print_jd(p_opt,[id_equil,'_',id_ripple,'_isoripple'],'Figures');
0090 end