fproc_quench

PURPOSE ^

SYNOPSIS ^

function fproc_quench(xTe,Efield,J,pfM,pf0,pfbM,savedata,trbetath,graph,p_opt,f_opt,c_opt,id_simul)

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function fproc_quench(xTe,Efield,J,pfM,pf0,pfbM,savedata,trbetath,graph,p_opt,f_opt,c_opt,id_simul)
0002 %
0003 tn = savedata.t;
0004 %
0005 figure(1),clf
0006 %
0007 if ~c_opt,
0008     leg = {'Prescr.','LUKE','Bulk','Supra.'};%,'Max.'
0009 else
0010 %     leg = {'Prescr.','Max.','LUKE'};
0011     leg = {'Prescr.','LUKE Bulk','LUKE Full'};
0012 end
0013 xlim = [0,max(tn)];
0014 ylim = NaN;%[0,1.4];%
0015 ytick = 0:0.2:1.4;
0016 xlab = 't/\tau_c';
0017 ylab = 'T_e/T_{e0}';
0018 tit = '';
0019 siz = 20+14i;
0020 %
0021 graph1D_jd(tn,trbetath.^2,0,0,'','','',NaN,xlim,ylim,'-','none','k',0.5,siz,gca);
0022 if 0,%c_opt,
0023     graph1D_jd(tn,xTe.normM,0,0,'','','',NaN,xlim,ylim,'--','none','b',2,siz,gca);
0024 end
0025 graph1D_jd(tn,xTe.normb,0,0,'','','',NaN,xlim,ylim,'none','o','b',2,siz,gca);
0026 graph1D_jd(tn,xTe.norm0,0,0,'','','',NaN,xlim,ylim,'-','none','r',2,siz,gca);
0027 if ~c_opt,
0028     graph1D_jd(tn,xTe.normb,0,0,'','','',NaN,xlim,ylim,'--','none','b',2,siz,gca);
0029     graph1D_jd(tn,xTe.norms,0,0,'','','',NaN,xlim,ylim,'-','none',[0,0.5,0],2,siz,gca);
0030 end
0031 % graph1D_jd(tn,xTe.delta,0,0,xlab,ylab,tit,leg,xlim,ylim,'-','none',[0.5,0,0.5],2,siz,gca,0.9,0.7,0.7);
0032 graph1D_jd(tn,NaN*xTe.delta,0,0,xlab,ylab,tit,leg,xlim,ylim,'-','none',[0.5,0,0.5],2,siz,gca,0.9,0.7,0.7);
0033 %
0034 %set(gca,'ytick',ytick)
0035 %
0036 print_jd(p_opt,['fig_',id_simul,'_T'],'./figures',1)
0037 %
0038 figure(2),clf
0039 %
0040 ylim = NaN;%[0,1.4];%
0041 ytick = NaN;%0:0.2:1.4;
0042 ylab = 'E/E_c';
0043 tit = '';
0044 siz = 20+14i;
0045 %
0046 graph1D_jd(tn,Efield,0,0,'','','',NaN,xlim,ylim,'-','none','r',2,siz,gca);
0047 graph1D_jd(xlim,[1,1],0,0,xlab,ylab,tit,NaN,xlim,ylim,'-','none','k',2,siz,gca,0.9,0.7,0.7);
0048 %
0049 %set(gca,'ytick',ytick)
0050 %
0051 print_jd(p_opt,['fig_',id_simul,'_E'],'./figures',2)
0052 %
0053 figure(3),clf
0054 %
0055 leg = {'Spitzer','Hot','Internal RE','External RE','Total'};%,'Max.'
0056 ylim = [0,1.2];%
0057 ytick = 0:0.2:1.2;
0058 ylab = 'J/J_0';
0059 tit = '';
0060 siz = 20+14i;
0061 %
0062 graph1D_jd(tn,J.lin/J.j0,0,0,'','','',NaN,xlim,ylim,'-','none','b',2,siz,gca);
0063 graph1D_jd(tn,J.hot/J.j0,0,0,'','','',NaN,xlim,ylim,'-','none','r',2,siz,gca);
0064 graph1D_jd(tn,J.rei/J.j0,0,0,'','','',NaN,xlim,ylim,'-','none',[0,0.5,0],2,siz,gca);
0065 graph1D_jd(tn,J.ree/J.j0,0,0,'','','',NaN,xlim,ylim,'-','none',[0.5,0,0.5],2,siz,gca);
0066 graph1D_jd(tn,J.tot/J.j0,0,0,xlab,ylab,tit,leg,xlim,ylim,'-','none','k',2,siz,gca,0.9,0.7,0.7);
0067 %
0068 set(gca,'ytick',ytick)
0069 %
0070 print_jd(p_opt,['fig_',id_simul,'_J'],'./figures',3)
0071 %
0072 if f_opt,
0073     nit_disp = length(graph.it_disp);
0074     colors = {'r','b',[0,0.5,0],'m','c','y'};
0075     %
0076     if c_opt,% cylindrical display
0077         %
0078         dp_cyl = 0.1;
0079         %
0080         % spherical to cylindrical transformation
0081         %
0082         [logXf00_cyl_ref,ppar_cyl_ref,dppar_cyl_ref,pperp_cyl_ref,dpperp_cyl_ref] = s2c_dke_yp(log(savedata.f(:,:,1)),savedata.pn,savedata.mhu,dp_cyl);%Spherical to cylindrical coordinate transformation
0083         Xf00_cyl_ref = exp(logXf00_cyl_ref);%For accurate representation in figures
0084         %
0085         logXf0M_cyl_ref = s2c_dke_yp(log(savedata.fM),savedata.pn,savedata.mhu,dp_cyl);%Spherical to cylindrical coordinate transformation
0086         Xf0M_cyl_ref = exp(logXf0M_cyl_ref);%For accurate representation in figures
0087         %
0088         Xppar_cyl_ref = ones(length(pperp_cyl_ref),1)*ppar_cyl_ref(:)';%Grid for the distribution functions only
0089         Xpperp_cyl_ref = pperp_cyl_ref(:)*ones(1,length(ppar_cyl_ref));
0090         Xp_cyl_ref = sqrt(Xppar_cyl_ref.*Xppar_cyl_ref + Xpperp_cyl_ref.*Xpperp_cyl_ref);
0091         %
0092         Xf00_cyl_ref = Xf00_cyl_ref.*(Xf00_cyl_ref>0);%Remove negative values
0093         Xf00_cyl_ref = Xf00_cyl_ref.*(Xp_cyl_ref<=max(ppar_cyl_ref));%Remove values above max(ppar)
0094         Xf00_cyl_ref(isnan(Xf00_cyl_ref)) = 0;%Remove NaN values
0095         %
0096         Xf0M_cyl_ref = Xf0M_cyl_ref.*(Xf0M_cyl_ref>0);%Remove negative values
0097         Xf0M_cyl_ref = Xf0M_cyl_ref.*(Xp_cyl_ref<=max(ppar_cyl_ref));%Remove values above max(ppar)
0098         Xf0M_cyl_ref(isnan(Xf0M_cyl_ref)) = 0;%Remove NaN values
0099         %
0100         % Remove values less than computer accuracy
0101         %
0102         pnmax_0 = min(min(Xp_cyl_ref(abs(Xf00_cyl_ref) < eps)));
0103         pnmax = min([pnmax_0,max(savedata.pn)]);
0104         %
0105         Xmask = Xp_cyl_ref >= pnmax;    
0106         %
0107         Xf00_cyl_ref(Xmask) = 0;
0108         Xf0M_cyl_ref(Xmask) = 0;
0109         %
0110         Fpar00_cyl_ref = 2*pi*integral_dke_jd(dpperp_cyl_ref,Xpperp_cyl_ref.*Xf00_cyl_ref,1);
0111         Fpar0M_cyl_ref = 2*pi*integral_dke_jd(dpperp_cyl_ref,Xpperp_cyl_ref.*Xf0M_cyl_ref,1);
0112         %
0113         Fpar0_cyl_ref = cell(1,nit_disp);
0114         FparM_cyl_ref = cell(1,nit_disp);
0115         leg = cell(1,nit_disp);
0116         %
0117         for iit = 1:nit_disp,
0118             %
0119             it = it_disp(iit);
0120             %
0121             logXf0_cyl_ref = s2c_dke_yp(log(savedata.f(:,:,it+1)),savedata.pn,savedata.mhu,dp_cyl);%Spherical to cylindrical coordinate transformation
0122             Xf0_cyl_ref = exp(logXf0_cyl_ref);%For accurate representation in figures
0123             %
0124             logXfM_cyl_ref = s2c_dke_yp(log(savedata.fM(:,:,it+1)),savedata.pn,savedata.mhu,dp_cyl);%Spherical to cylindrical coordinate transformation
0125             XfM_cyl_ref = exp(logXfM_cyl_ref);%For accurate representation in figures
0126             %
0127             Xf0_cyl_ref = Xf0_cyl_ref.*(Xf0_cyl_ref>0);%Remove negative values
0128             Xf0_cyl_ref = Xf0_cyl_ref.*(Xp_cyl_ref<=max(ppar_cyl_ref));%Remove values above max(ppar)
0129             Xf0_cyl_ref(isnan(Xf0_cyl_ref)) = 0;%Remove NaN values
0130             %
0131             XfM_cyl_ref = XfM_cyl_ref.*(XfM_cyl_ref>0);%Remove negative values
0132             XfM_cyl_ref = XfM_cyl_ref.*(Xp_cyl_ref<=max(ppar_cyl_ref));%Remove values above max(ppar)
0133             XfM_cyl_ref(isnan(XfM_cyl_ref)) = 0;%Remove NaN values
0134             %
0135             % Remove values less than computer accuracy
0136             %
0137             Xf0_cyl_ref(Xmask) = 0;
0138             XfM_cyl_ref(Xmask) = 0;
0139             %
0140             Fpar0_cyl_ref{iit} = 2*pi*integral_dke_jd(dpperp_cyl_ref,Xpperp_cyl_ref.*Xf0_cyl_ref,1);
0141             FparM_cyl_ref{iit} = 2*pi*integral_dke_jd(dpperp_cyl_ref,Xpperp_cyl_ref.*XfM_cyl_ref,1);
0142             %
0143             leg{iit} = ['t/\tau_c = ',num2str(tn(it))];
0144         end
0145         %
0146         leg = ['t/\tau_c = 0',leg];
0147         %
0148         figure(10),clf
0149         %
0150         xlab = 'p_{||}/p_{Te}';
0151         xlim = [-pnmax,pnmax];
0152         ylab = 'F_{||}';
0153         ylim = [eps,1];
0154         %
0155         graph1D_jd(ppar_cyl_ref,Fpar00_cyl_ref,0,1,'','','',NaN,xlim,ylim,'-','none','k',2,siz,gca);
0156         %
0157         for iit = 1:nit_disp-1,
0158             graph1D_jd(ppar_cyl_ref,Fpar0_cyl_ref{iit},0,1,'','','',NaN,xlim,ylim,'-','none',colors{iit},2,siz,gca);
0159         end
0160         %
0161         graph1D_jd(ppar_cyl_ref,Fpar0_cyl_ref{nit_disp},0,1,xlab,ylab,tit,leg,xlim,ylim,'-','none',colors{nit_disp},2,siz,gca,0.9,0.7,0.7);
0162         %
0163         graph1D_jd(ppar_cyl_ref,Fpar0M_cyl_ref,0,1,'','','',NaN,xlim,ylim,'-','none','k',0.5,siz,gca);
0164         %
0165         for iit = 1:nit_disp,
0166             graph1D_jd(ppar_cyl_ref,FparM_cyl_ref{iit},0,1,'','','',NaN,xlim,ylim,'-','none',colors{iit},0.5,siz,gca);
0167         end
0168         %
0169         print_jd(p_opt,['fig_',id_simul,'_f1D'],'./figures',10)
0170         %
0171     else% mhu-averaged distribution
0172         %
0173         % Ignore values less than computer accuracy
0174         %
0175         pnmax_0 = min(min(savedata.pn(pf0{1} < eps)));
0176         pnmax = min([pnmax_0,max(savedata.pn)]);
0177         %
0178         leg = cell(1,nit_disp);
0179         for iit = 1:nit_disp,
0180             leg{iit} = ['t/\tau_c = ',num2str(tn(it_disp(iit)))];
0181         end
0182         leg = ['t/\tau_c = 0',leg];
0183         %
0184         figure(10),clf
0185         %
0186         xlab = 'p/p_{Te}';
0187         xlim = [0,pnmax];
0188         ylab = 'F_p';
0189         ylim = [eps,max(pfM{end})];
0190         %
0191         graph1D_jd(pn,pf0{1},0,1,'','','',NaN,xlim,ylim,'-','none','k',2,siz,gca);
0192         %
0193         for iit = 1:nit_disp-1,
0194             graph1D_jd(pn,pf0{1+it_disp(iit)},0,1,'','','',NaN,xlim,ylim,'-','none',colors{iit},2,siz,gca);
0195         end
0196         %
0197         graph1D_jd(pn,pf0{1+it_disp(nit_disp)},0,1,xlab,ylab,tit,leg,xlim,ylim,'-','none',colors{nit_disp},2,siz,gca,0.9,0.7,0.7);
0198         %
0199         graph1D_jd(pn,pfM{1},0,1,'','','',NaN,xlim,ylim,'-','none','k',0.5,siz,gca);
0200         %
0201         for iit = 1:nit_disp,
0202             graph1D_jd(pn,pfM{1+it_disp(iit)},0,1,'','','',NaN,xlim,ylim,'-','none',colors{iit},0.5,siz,gca);
0203             graph1D_jd(pn,pfbM{1+it_disp(iit)},0,1,'','','',NaN,xlim,ylim,'--','none',colors{iit},0.5,siz,gca);
0204         end
0205         %
0206         print_jd(p_opt,['fig_',id_simul,'_f1Dp'],'./figures',10)
0207         %
0208     end
0209     %
0210 end

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