0001 function [ output_args ] = luke_disp_equils_mt( equils, plt, ax, style )
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028 if(nargin<3 || isempty(ax))
0029 figure;
0030 ax=gca();
0031 end
0032
0033
0034 ntr=[3 4 4];
0035
0036 Bphiunit='T';
0037 Bphiref=1;
0038 sBphiref=sprintf('%s',Bphiunit);
0039 deltaunit='1';
0040 deltaref=1;
0041 sdeltaref=sprintf('%s',deltaunit);
0042 Deltaunit='1';
0043 Deltaref=0.1;
0044 sDeltaref=sprintf('0.%s',Deltaunit);
0045 ipunit='A';
0046 ipref=1e5;
0047 kappaunit='1';
0048 kapparef=1;
0049 skapparef=sprintf('%s',kappaunit);
0050 sipref=sprintf('100k%s',ipunit);
0051 neunit='m^{-3}';
0052 neref=1e19;
0053 sneref=sprintf('1e19%s',neunit);
0054 qunit='1';
0055 qref=1;
0056 sqref=sprintf('%s',qunit);
0057 Teunit='keV';
0058 Teref=1;
0059 sTeref=sprintf('%s',Teunit);
0060 Tiunit='keV';
0061 Tiref=0.1;
0062 sTiref=sprintf('100%s',Tiunit(2:end));
0063 zunit='m';
0064 zref=1;
0065 szref=sprintf('%s',zunit);
0066 Zeffunit='1';
0067 Zeffref=1;
0068 sZeffref=sprintf('%s',Zeffunit);
0069
0070
0071
0072 neq=numel(equils);
0073
0074 time=zeros(1,neq);
0075 if(any(plt==[1 2 3]))
0076 dat=zeros(ntr(plt),neq);
0077 end
0078 for i=1:neq
0079 time(i)=equils{i}.shotime;
0080 switch plt
0081 case 1
0082
0083 dat(1,i)=equils{i}.pne(1)/neref;
0084 dat(2,i)=equils{i}.pTe(1)/Teref;
0085
0086
0087
0088 dat(3,i)=sum(equils{i}.pzni(:,1).*equils{i}.zZi'.^2)./equils{i}.pne(1)/Zeffref;
0089
0090 legstr={sprintf('n_{e,0}/%s',sneref),sprintf('T_{e,0}/%s',sTeref),sprintf('Z_{eff,0}/%s',sZeffref)};
0091 case 2
0092
0093 dat(1,i)=equils{i}.ip/ipref;
0094 dat(2,i)=equils{i}.ptBPHI(1)/Bphiref;
0095
0096
0097 q=qfactors_dke_yp(1,equils{i}.Rp,equils{i}.ptx(end),equils{i}.ptx,equils{i}.pty,equils{i}.ptBx,equils{i}.ptBy,equils{i}.ptBPHI)* equils{i}.ptx(end)/equils{i}.Rp/qref;
0098 dat(3,i)=q(2);
0099 rhopol=sqrt(equils{1}.psi_apRp/equils{1}.psi_apRp(end));
0100 dat(4,i)=interp1(rhopol(2:end),q(2:end),0.95,'spline');
0101
0102 legstr={sprintf('I_p/%s',sipref),sprintf('B_{\\phi,0}/%s',sBphiref),sprintf('q_0/%s',sqref),sprintf('q_{95}/%s',sqref)};
0103 case 3
0104
0105 dat(1,i)=equils{i}.Zp/zref;
0106 [pshift,pelong,ptrian]=equilmoments_jd(equils{i}.theta,equils{i}.ptx,equils{i}.pty);
0107 dat(2,i)=-pshift(end)/Deltaref;
0108
0109 dat(3,i)=(pelong(end) - 1)/kapparef;
0110 dat(4,i)=ptrian(end)/deltaref;
0111
0112 legstr={sprintf('z_{axis}/%s',szref),sprintf('\\Delta/%s',sDeltaref),sprintf('(\\kappa - 1)/%s',skapparef),sprintf('\\delta/%s',sdeltaref)};
0113 end
0114 end
0115
0116
0117 if(any(plt==[1 2 3]))
0118 if nargin < 4 || isempty(style),
0119 for j=1:ntr(plt)
0120 plot(ax,time,dat(j,:),gti_plot_symcol('sym',j,ntr(plt)),'Color',gti_plot_symcol('col',j,ntr(plt)));
0121 if(j==1)
0122 hold on;
0123 end
0124 end
0125 hold off;
0126 legend(legstr);
0127 YL=ylim;
0128 if(YL(1)>0)
0129 ylim([0 YL(2)]);
0130 elseif(YL(2)<0)
0131 ylim([YL(1) 0]);
0132 end
0133 else
0134 for j=1:ntr(plt),
0135 if min(dat(j,:)) + max(dat(j,:)) < 0,
0136 dat(j,:) = -dat(j,:);
0137 legstr{j} = ['-',legstr{j}];
0138 end
0139 end
0140 colors = {'r','b',[0,0.5,0],'k'};
0141 markers = {'s','d','+','o'};
0142 for j=1:ntr(plt)-1
0143 [ax] = graph1D_jd(time,dat(j,:),0,0,'','','',NaN,NaN,NaN,'-',markers{j},colors{j},2,style,ax);
0144 end
0145 [ax] = graph1D_jd(time,dat(ntr(plt),:),0,0,'t (s)','','',legstr,0,0,'-',markers{ntr(plt)},colors{ntr(plt)},2,style,ax);
0146 end
0147 end
0148
0149
0150
0151 end
0152