0001
0002
0003
0004 clear all
0005 clear mex
0006 clear functions
0007 close all
0008 warning off
0009 global nfig
0010
0011 p_opt = 2;
0012
0013
0014
0015 id_simul = 'LH_karney_time';
0016 path_simul = '';
0017
0018 psin_S = [];
0019 rho_S = [0.5];
0020
0021 id_path = '';
0022 path_path = '';
0023
0024 id_equil = 'TScyl';
0025 path_equil = '';
0026
0027 id_dkeparam = 'UNIFORM10010020';
0028 path_dkeparam = '';
0029
0030 id_display = 'NO_DISPLAY';
0031 path_display = '';
0032
0033 id_ohm = '';
0034 path_ohm = '';
0035
0036 ids_wave = {''};
0037 paths_wave = {''};
0038
0039 id_transpfaste = '';
0040 path_transpfaste = '';
0041
0042 id_ripple = '';
0043 path_ripple = '';
0044
0045
0046
0047
0048
0049 [dkepath,equil,dkeparam,dkedisplay,ohm,waves,transpfaste,ripple] = load_structures_yp('dkepath',id_path,path_path,'equil',id_equil,path_equil,'dkeparam',id_dkeparam,path_dkeparam,'dkedisplay',id_display,path_display,'ohm',id_ohm,path_ohm,'waves',ids_wave,paths_wave,'transpfaste',id_transpfaste,path_transpfaste,'ripple',id_ripple,path_ripple);
0050
0051
0052
0053 wavestruct.omega_lh = [4]*2*pi*1e9;
0054
0055
0056
0057 wavestruct.opt_lh = 2;
0058
0059
0060
0061
0062 wavestruct.norm_ref = 1;
0063
0064 wavestruct.yvparmin_lh = [3];
0065 wavestruct.yvparmax_lh = [5];
0066
0067 wavestruct.yNparmin_lh = [NaN];
0068 wavestruct.yNparmax_lh = [NaN];
0069 wavestruct.yNpar_lh = [NaN];
0070 wavestruct.ydNpar_lh = [NaN];
0071
0072
0073 wavestruct.yD0_in_c_lh = [1];
0074
0075 wavestruct.yD0_in_lh_prof = [0];
0076 wavestruct.ypeak_lh = [NaN];
0077 wavestruct.ywidth_lh = [NaN];
0078
0079 wavestruct.ythetab_lh = [0]*pi/180;
0080
0081
0082
0083
0084 if exist('dmumpsmex');dkeparam.invproc = -2;end
0085
0086 dkeparam.boundary_mode_f = 0;
0087 dkeparam.norm_mode_f = 1;
0088 dkeparam.timevol = 1;
0089
0090 dkeparam.nmhu_S = 201;
0091 dkeparam.np_S = 201;
0092
0093 dkeparam.psin_S = psin_S;
0094 dkeparam.rho_S = rho_S;
0095
0096 nit = 141;
0097 tn = logspace(-2,5,nit);
0098
0099 dkeparam.tn = tn;
0100 dkeparam.dtn = NaN;
0101
0102 [qe,me,mp,mn,e0,mu0,re,mc2] = pc_dke_yp;
0103
0104 betath = 0.001;
0105 equil.pTe = betath^2*mc2*ones(size(equil.pTe));
0106 equil.pzTi = betath^2*mc2*ones(size(equil.pzTi));
0107
0108 waves{1} = make_idealLHwave_jd(equil,wavestruct);
0109
0110 dkeparam.coll_mode = 0;
0111 [dummy,Zcurr,ZP0] = main_dke_yp(id_simul,dkepath,equil,dkeparam,dkedisplay,ohm,waves,transpfaste,ripple,[],[]);
0112
0113 j_0 = NaN(1,nit);
0114 P_0 = NaN(1,nit);
0115 for it = 1:nit,
0116 j_0(it) = Zcurr(it).x_0;
0117 P_0(it) = ZP0(it).x_rf_fsav;
0118 end
0119
0120 dkeparam.coll_mode = 1;
0121 [dummy,Zcurr,ZP0] = main_dke_yp(id_simul,dkepath,equil,dkeparam,dkedisplay,ohm,waves,transpfaste,ripple,[],[]);
0122
0123 j_1 = NaN(1,nit);
0124 P_1 = NaN(1,nit);
0125 for it = 1:nit,
0126 j_1(it) = Zcurr(it).x_0;
0127 P_1(it) = ZP0(it).x_rf_fsav;
0128 end
0129
0130 dkeparam.coll_mode = 2;
0131 [dummy,Zcurr,ZP0,dke_out] = main_dke_yp(id_simul,dkepath,equil,dkeparam,dkedisplay,ohm,waves,transpfaste,ripple,[],[]);
0132
0133 residue_2 = NaN(1,nit);
0134 j_2 = NaN(1,nit);
0135 P_2 = NaN(1,nit);
0136 for it = 1:nit,
0137 residue_2(it) = dke_out.residu_f{it}(end);
0138 j_2(it) = Zcurr(it).x_0;
0139 P_2(it) = ZP0(it).x_rf_fsav;
0140 end
0141 j_2(residue_2 > dkeparam.prec0_f) = NaN;
0142 P_2(residue_2 > dkeparam.prec0_f) = NaN;
0143
0144 dkeparam.boundary_mode_f = 0;
0145 dkeparam.norm_mode_f = 0;
0146
0147 [dummy,Zcurr,ZP0,dke_out] = main_dke_yp(id_simul,dkepath,equil,dkeparam,dkedisplay,ohm,waves,transpfaste,ripple,[],[]);
0148
0149 residue_2_0 = NaN(1,nit);
0150 j_2_0 = NaN(1,nit);
0151 P_2_0 = NaN(1,nit);
0152 for it = 1:nit,
0153 residue_2_0(it) = dke_out.residu_f{it}(end);
0154 j_2_0(it) = Zcurr(it).x_0;
0155 P_2_0(it) = ZP0(it).x_rf_fsav;
0156 end
0157 j_2_0(residue_2_0 > dkeparam.prec0_f) = NaN;
0158 P_2_0(residue_2_0 > dkeparam.prec0_f) = NaN;
0159
0160 dkeparam.boundary_mode_f = 1;
0161 dkeparam.norm_mode_f = 0;
0162
0163 [dummy,Zcurr,ZP0,dke_out] = main_dke_yp(id_simul,dkepath,equil,dkeparam,dkedisplay,ohm,waves,transpfaste,ripple,[],[]);
0164
0165 residue_2_1 = NaN(1,nit);
0166 j_2_1 = NaN(1,nit);
0167 P_2_1 = NaN(1,nit);
0168 for it = 1:nit,
0169 residue_2_1(it) = dke_out.residu_f{it}(end);
0170 j_2_1(it) = Zcurr(it).x_0;
0171 P_2_1(it) = ZP0(it).x_rf_fsav;
0172 end
0173 j_2_1(residue_2_1 > dkeparam.prec0_f) = NaN;
0174 P_2_1(residue_2_1 > dkeparam.prec0_f) = NaN;
0175
0176 eta_0 = j_0./P_0;
0177 eta_1 = j_1./P_1;
0178 eta_2 = j_2./P_2;
0179 eta_2_0 = j_2_0./P_2_0;
0180 eta_2_1 = j_2_1./P_2_1;
0181
0182 j_0_nr_Karney = 0.05759;
0183 P_0_nr_Karney = 0.004012;
0184 eta_0_nr_Karney = 14.35;
0185
0186 j_2_nr_Karney = 0.07092;
0187 P_2_nr_Karney = 0.004294;
0188 eta_2_nr_Karney = 16.52;
0189
0190
0191
0192
0193 figure(1),clf
0194
0195 leg = {'Linearized','High v limit','Maxwellian'};
0196 xlim = 10.^[-2,5];
0197 ylim = [0,0.1];
0198 xlab = 't/\tau_c';
0199 ylab = 'j';
0200 tit = '';
0201 siz = 20+14i;
0202
0203 graph1D_jd(tn,j_2,1,0,xlab,ylab,tit,NaN,xlim,ylim,'-','none','r',2,siz,gca,0.9,0.7,0.7);
0204 graph1D_jd(tn,j_1,1,0,'','','',NaN,xlim,ylim,'-','none','b',2,siz,gca);
0205 graph1D_jd(tn,j_0,1,0,'','','',leg,xlim,ylim,'-','none','g',2,siz,gca);
0206 graph1D_jd(xlim,[j_2_nr_Karney,j_2_nr_Karney],1,0,'','','',NaN,xlim,ylim,'--','none','r',2,siz,gca);
0207 graph1D_jd(xlim,[j_0_nr_Karney,j_0_nr_Karney],1,0,'','','',NaN,xlim,ylim,'--','none','g',2,siz,gca);
0208
0209 set(gca,'ytick',[0:0.02:0.1])
0210 set(gca,'xtick',10.^[-2:5])
0211 set(gca,'XMinorGrid','off')
0212 set(gca,'XMinorTick','on')
0213
0214 figure(2),clf
0215
0216 ylim = [0,0.015];
0217 ylab = 'P';
0218
0219 graph1D_jd(tn,P_2,1,0,xlab,ylab,tit,NaN,xlim,ylim,'-','none','r',2,siz,gca,0.9,0.7,0.7);
0220 graph1D_jd(tn,P_1,1,0,'','','',NaN,xlim,ylim,'-','none','b',2,siz,gca);
0221 graph1D_jd(tn,P_0,1,0,'','','',leg,xlim,ylim,'-','none','g',2,siz,gca);
0222 graph1D_jd(xlim,[P_2_nr_Karney,P_2_nr_Karney],1,0,'','','',NaN,xlim,ylim,'--','none','r',2,siz,gca);
0223 graph1D_jd(xlim,[P_0_nr_Karney,P_0_nr_Karney],1,0,'','','',NaN,xlim,ylim,'--','none','g',2,siz,gca);
0224
0225 set(gca,'ytick',[0:0.0025:0.015])
0226 set(gca,'xtick',10.^[-2:5])
0227 set(gca,'XMinorGrid','off')
0228 set(gca,'XMinorTick','on')
0229
0230 figure(3),clf
0231
0232 ylim = [0,20];
0233 ylab = 'j/P';
0234
0235 graph1D_jd(tn,eta_2,1,0,xlab,ylab,tit,NaN,xlim,ylim,'-','none','r',2,siz,gca,0.9,0.7,0.7);
0236 graph1D_jd(tn,eta_1,1,0,'','','',NaN,xlim,ylim,'-','none','b',2,siz,gca);
0237 graph1D_jd(tn,eta_0,1,0,'','','',leg,xlim,ylim,'-','none','g',2,siz,gca);
0238 graph1D_jd(xlim,[eta_2_nr_Karney,eta_2_nr_Karney],1,0,'','','',NaN,xlim,ylim,'--','none','r',2,siz,gca);
0239 graph1D_jd(xlim,[eta_0_nr_Karney,eta_0_nr_Karney],1,0,'','','',NaN,xlim,ylim,'--','none','g',2,siz,gca);
0240
0241 set(gca,'ytick',[0:4:20])
0242 set(gca,'xtick',10.^[-2:5])
0243 set(gca,'XMinorGrid','off')
0244 set(gca,'XMinorTick','on')
0245
0246 figure(4),clf
0247
0248 leg = {'Free Mode','Fixed point','Normalization'};
0249 ylim = [0,0.1];
0250 ylab = 'j';
0251
0252 graph1D_jd(tn,j_2_0,1,0,xlab,ylab,tit,NaN,xlim,ylim,'-','none','b',2,siz,gca,0.9,0.7,0.7);
0253 graph1D_jd(tn,j_2_1,1,0,'','','',NaN,xlim,ylim,'-','none','g',2,siz,gca);
0254 graph1D_jd(tn,j_2,1,0,'','','',leg,xlim,ylim,'-','none','r',2,siz,gca);
0255 graph1D_jd(xlim,[j_2_nr_Karney,j_2_nr_Karney],1,0,'','','',NaN,xlim,ylim,'--','none','r',2,siz,gca);
0256
0257 set(gca,'ytick',[0:0.02:0.1])
0258 set(gca,'xtick',10.^[-2:5])
0259 set(gca,'XMinorGrid','off')
0260 set(gca,'XMinorTick','on')
0261
0262 figure(5),clf
0263
0264 ylim = [0,0.015];
0265 ylab = 'P';
0266
0267 graph1D_jd(tn,P_2_0,1,0,xlab,ylab,tit,NaN,xlim,ylim,'-','none','b',2,siz,gca,0.9,0.7,0.7);
0268 graph1D_jd(tn,P_2_1,1,0,'','','',NaN,xlim,ylim,'-','none','g',2,siz,gca);
0269 graph1D_jd(tn,P_2,1,0,'','','',leg,xlim,ylim,'-','none','r',2,siz,gca);
0270 graph1D_jd(xlim,[P_2_nr_Karney,P_2_nr_Karney],1,0,'','','',NaN,xlim,ylim,'--','none','r',2,siz,gca);
0271
0272 set(gca,'ytick',[0:0.0025:0.015])
0273 set(gca,'xtick',10.^[-2:5])
0274 set(gca,'XMinorGrid','off')
0275 set(gca,'XMinorTick','on')
0276
0277 figure(6),clf
0278
0279 ylim = [0,20];
0280 ylab = 'j/P';
0281
0282 graph1D_jd(tn,eta_2_0,1,0,xlab,ylab,tit,NaN,xlim,ylim,'-','none','b',2,siz,gca,0.9,0.7,0.7);
0283 graph1D_jd(tn,eta_2_1,1,0,'','','',NaN,xlim,ylim,'-','none','g',2,siz,gca);
0284 graph1D_jd(tn,eta_2,1,0,'','','',leg,xlim,ylim,'-','none','r',2,siz,gca);
0285 graph1D_jd(xlim,[eta_2_nr_Karney,eta_2_nr_Karney],1,0,'','','',NaN,xlim,ylim,'--','none','r',2,siz,gca);
0286
0287 set(gca,'ytick',[0:4:20])
0288 set(gca,'xtick',10.^[-2:5])
0289 set(gca,'XMinorGrid','off')
0290 set(gca,'XMinorTick','on')
0291
0292 print_jd(p_opt,'fig_j_coll_time','./figures',1)
0293 print_jd(p_opt,'fig_P_coll_time','./figures',2)
0294 print_jd(p_opt,'fig_eta_coll_time','./figures',3)
0295 print_jd(p_opt,'fig_j_norm_time','./figures',4)
0296 print_jd(p_opt,'fig_P_norm_time','./figures',5)
0297 print_jd(p_opt,'fig_eta_norm_time','./figures',6)
0298
0299
0300
0301 eval(['save ',path_simul,'DKE_RESULTS_',id_equil,'_',id_simul,'.mat']);
0302 info_dke_yp(2,['Data saved in ',path_simul,'DKE_RESULTS_',id_equil,'_',id_simul,'.mat']);