luke_disp_equils_mt

PURPOSE ^

LUKE_DISP_EQUILS_MT [ output_args ] = luke_disp_equils_mt( equils, plt, ax )

SYNOPSIS ^

function [ output_args ] = luke_disp_equils_mt( equils, plt, ax, style )

DESCRIPTION ^

LUKE_DISP_EQUILS_MT [ output_args ] = luke_disp_equils_mt( equils, plt, ax )
   plots the equilibrium profiles for multi times

 INPUT:
   equils .... cell with equilibrium structures from LUKE (multi times)
   plt ....... plot type ( 1,2 or 3 )
   ax ........ axis handle of axis where the plot should be done.
               default: open a new figure
   style ..... plot style parameters for iluke integration (optional) 

 OUTPUT:
   none

 PLOT KINDS
   1. time evolution of density, temperature, Zeff
   2. time evolution of Ip, Bphi, q0 and q95
   3. time evolution of axis z position, Shafranov shift, kappa, delta


   J. Kamleitner, CRPP, EPFL, Feb 2014

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [ output_args ] = luke_disp_equils_mt( equils, plt, ax, style )
0002 %LUKE_DISP_EQUILS_MT [ output_args ] = luke_disp_equils_mt( equils, plt, ax )
0003 %   plots the equilibrium profiles for multi times
0004 %
0005 % INPUT:
0006 %   equils .... cell with equilibrium structures from LUKE (multi times)
0007 %   plt ....... plot type ( 1,2 or 3 )
0008 %   ax ........ axis handle of axis where the plot should be done.
0009 %               default: open a new figure
0010 %   style ..... plot style parameters for iluke integration (optional)
0011 %
0012 % OUTPUT:
0013 %   none
0014 %
0015 % PLOT KINDS
0016 %   1. time evolution of density, temperature, Zeff
0017 %   2. time evolution of Ip, Bphi, q0 and q95
0018 %   3. time evolution of axis z position, Shafranov shift, kappa, delta
0019 %
0020 %
0021 %   J. Kamleitner, CRPP, EPFL, Feb 2014
0022 
0023 % dependencies:
0024 % equilmoments_jd.m
0025 % gti_plot_symcol.m
0026 % qfactors_dke_yp.m
0027 
0028 if(nargin<3 || isempty(ax))
0029     figure;
0030     ax=gca();
0031 end
0032 
0033 % init plt parameters
0034 ntr=[3 4 4];
0035 % reference values and units
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 % create basic traces and profiles
0072 neq=numel(equils);
0073 % nrho=numel(equils{1}.psi_apRp);
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             % data
0083             dat(1,i)=equils{i}.pne(1)/neref;
0084             dat(2,i)=equils{i}.pTe(1)/Teref;
0085 %            dat(3,i)=equils{i}.pzTi(1)/Tiref;
0086 %             dat(4,i)=mean(sum(equils{i}.pzni.*repmat(equils{i}.zZi'.^2,1,nrho))./equils{i}.pne);
0087 %            dat(4,i)=sum(equils{i}.pzni(:,1).*equils{i}.zZi'.^2)./equils{i}.pne(1)/Zeffref;
0088             dat(3,i)=sum(equils{i}.pzni(:,1).*equils{i}.zZi'.^2)./equils{i}.pne(1)/Zeffref;
0089             % legend
0090             legstr={sprintf('n_{e,0}/%s',sneref),sprintf('T_{e,0}/%s',sTeref),sprintf('Z_{eff,0}/%s',sZeffref)};%,sprintf('T_{i,0}/%s',sTiref)
0091         case 2
0092             % data
0093             dat(1,i)=equils{i}.ip/ipref;
0094             dat(2,i)=equils{i}.ptBPHI(1)/Bphiref;
0095             % function qfactors computes q;
0096             % see also equilibrium_jd function for correct usage
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             % legend
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             %data
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             % dat(3,i)=pelong(end)/kapparef;
0109             dat(3,i)=(pelong(end) - 1)/kapparef;
0110             dat(4,i)=ptrian(end)/deltaref;
0111             % legend
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 % do the plotting
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 % end of function
0150 
0151 end
0152

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