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 permission = test_permissions_yp;
0014
0015 if ~permission
0016 disp('Please move the script to a local folder where you have write permission before to run it')
0017 return;
0018 end
0019
0020
0021
0022 id_simul = 'LH_karney_betath';
0023 path_simul = '';
0024
0025 psin_S = [];
0026 rho_S = [0.5];
0027
0028 id_path = '';
0029 path_path = '';
0030
0031 id_equil = 'TScyl';
0032 path_equil = '';
0033
0034 id_dkeparam = 'UNIFORM10010020';
0035 path_dkeparam = '';
0036
0037 id_display = 'NO_DISPLAY';
0038 path_display = '';
0039
0040 id_ohm = '';
0041 path_ohm = '';
0042
0043 ids_wave = {''};
0044 paths_wave = {''};
0045
0046 id_transpfaste = '';
0047 path_transpfaste = '';
0048
0049 id_ripple = '';
0050 path_ripple = '';
0051
0052
0053
0054
0055
0056 [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);
0057
0058
0059
0060 wavestruct.omega_lh = [4]*2*pi*1e9;
0061
0062
0063
0064 wavestruct.opt_lh = 2;
0065
0066
0067
0068
0069 wavestruct.norm_ref = 1;
0070
0071 wavestruct.yvparmin_lh = [3];
0072 wavestruct.yvparmax_lh = [5];
0073
0074 wavestruct.yNparmin_lh = [NaN];
0075 wavestruct.yNparmax_lh = [NaN];
0076 wavestruct.yNpar_lh = [NaN];
0077 wavestruct.ydNpar_lh = [NaN];
0078
0079
0080 wavestruct.yD0_in_c_lh = [1];
0081
0082 wavestruct.yD0_in_lh_prof = [0];
0083 wavestruct.ypeak_lh = [NaN];
0084 wavestruct.ywidth_lh = [NaN];
0085
0086 wavestruct.ythetab_lh = [0]*pi/180;
0087
0088
0089
0090
0091 if exist('dmumpsmex');dkeparam.invproc = -2;end
0092
0093 dkeparam.boundary_mode_f = 0;
0094 dkeparam.norm_mode_f = 1;
0095 dkeparam.tn = [50000,100000];
0096
0097 dkeparam.np_S = 201;
0098 dkeparam.nmhu_S = 201;
0099
0100 dkeparam.psin_S = psin_S;
0101 dkeparam.rho_S = rho_S;
0102
0103
0104
0105 betath_list = [logspace(-5,-2,7),logspace(-1.85,-0.35,11)];
0106
0107 [qe,me,mp,mn,e0,mu0,re,mc2] = pc_dke_yp;
0108
0109 nbetath = length(betath_list);
0110
0111 j_0 = NaN(1,nbetath);
0112 j_1 = NaN(1,nbetath);
0113 j_2 = NaN(1,nbetath);
0114 P_0 = NaN(1,nbetath);
0115 P_1 = NaN(1,nbetath);
0116 P_2 = NaN(1,nbetath);
0117
0118 for ibetath = 1:nbetath,
0119
0120 betath = betath_list(ibetath);
0121
0122 equil.pTe = betath^2*mc2*ones(size(equil.pTe));
0123 equil.pzTi = betath^2*mc2*ones(size(equil.pzTi));
0124
0125 waves{1} = make_idealLHwave_jd(equil,wavestruct);
0126
0127 dkeparam.coll_mode = 0;
0128 [dummy,Zcurr,ZP0] = main_dke_yp(id_simul,dkepath,equil,dkeparam,dkedisplay,ohm,waves,transpfaste,ripple,[],[]);
0129 j_0(ibetath) = Zcurr.x_0;
0130 P_0(ibetath) = ZP0.x_rf_fsav;
0131
0132 dkeparam.coll_mode = 1;
0133 [dummy,Zcurr,ZP0] = main_dke_yp(id_simul,dkepath,equil,dkeparam,dkedisplay,ohm,waves,transpfaste,ripple,[],[]);
0134 j_1(ibetath) = Zcurr.x_0;
0135 P_1(ibetath) = ZP0.x_rf_fsav;
0136
0137 dkeparam.coll_mode = 2;
0138 [dummy,Zcurr,ZP0,dke_out] = main_dke_yp(id_simul,dkepath,equil,dkeparam,dkedisplay,ohm,waves,transpfaste,ripple,[],[]);
0139
0140 if dke_out.residu_f{end}(end) <= dkeparam.prec0_f,
0141 j_2(ibetath) = Zcurr.x_0;
0142 P_2(ibetath) = ZP0.x_rf_fsav;
0143 end
0144
0145
0146
0147
0148
0149
0150 end
0151
0152 eta_0 = j_0./P_0;
0153 eta_1 = j_1./P_1;
0154 eta_2 = j_2./P_2;
0155
0156
0157 j_0_nr_Karney = 0.05759;
0158 P_0_nr_Karney = 0.004012;
0159 eta_0_nr_Karney = 14.35;
0160
0161 j_2_nr_Karney = 0.07092;
0162 P_2_nr_Karney = 0.004294;
0163 eta_2_nr_Karney = 16.52;
0164
0165
0166
0167 figure(1),clf
0168
0169
0170 leg = {'Linearized','High v limit','Maxwellian'};
0171 xlim = 10.^[-5,0];
0172 ylim = [0,0.1];
0173 xlab = '\beta_T';
0174 ylab = 'j';
0175 tit = '';
0176 siz = 20+14i;
0177
0178 graph1D_jd(betath_list,j_2,1,0,xlab,ylab,tit,NaN,xlim,ylim,'-','none','r',2,siz,gca,0.9,0.7,0.7);
0179 graph1D_jd(betath_list,j_1,1,0,'','','',NaN,xlim,ylim,'-','none','b',2,siz,gca);
0180
0181 graph1D_jd(betath_list,j_0,1,0,'','','',leg,xlim,ylim,'-','none','g',2,siz,gca);
0182 graph1D_jd(xlim,[j_2_nr_Karney,j_2_nr_Karney],0,0,'','','',NaN,xlim,ylim,'--','none','r',2,siz,gca);
0183 graph1D_jd(xlim,[j_0_nr_Karney,j_0_nr_Karney],0,0,'','','',NaN,xlim,ylim,'--','none','m',2,siz,gca);
0184
0185 set(gca,'ytick',[0:0.2:1]*ylim(2))
0186 set(gca,'xtick',[1e-05 0.0001 0.001 0.01 0.1 1])
0187
0188 set(gca,'XMinorGrid','off')
0189 set(gca,'XMinorTick','on')
0190
0191 figure(2),clf
0192
0193 ylim = [0,0.005];
0194 ylab = 'P';
0195
0196 graph1D_jd(betath_list,P_2,1,0,xlab,ylab,tit,NaN,xlim,ylim,'-','none','r',2,siz,gca,0.9,0.7,0.7);
0197 graph1D_jd(betath_list,P_1,1,0,'','','',NaN,xlim,ylim,'-','none','b',2,siz,gca);
0198
0199 graph1D_jd(betath_list,P_0,1,0,'','','',leg,xlim,ylim,'-','none','g',2,siz,gca);
0200 graph1D_jd(xlim,[P_2_nr_Karney,P_2_nr_Karney],0,0,'','','',NaN,xlim,ylim,'--','none','r',2,siz,gca);
0201 graph1D_jd(xlim,[P_0_nr_Karney,P_0_nr_Karney],0,0,'','','',NaN,xlim,ylim,'--','none','m',2,siz,gca);
0202
0203 set(gca,'ytick',[0:0.2:1]*ylim(2))
0204 set(gca,'xtick',[1e-05 0.0001 0.001 0.01 0.1 1])
0205
0206 set(gca,'XMinorGrid','off')
0207 set(gca,'XMinorTick','on')
0208
0209 figure(3),clf
0210
0211 ylim = [0,20];
0212 ylab = 'j/P';
0213
0214 graph1D_jd(betath_list,eta_2,1,0,xlab,ylab,tit,NaN,xlim,ylim,'-','none','r',2,siz,gca,0.9,0.7,0.7);
0215 graph1D_jd(betath_list,eta_1,1,0,'','','',NaN,xlim,ylim,'-','none','b',2,siz,gca);
0216
0217 graph1D_jd(betath_list,eta_0,1,0,'','','',leg,xlim,ylim,'-','none','g',2,siz,gca);
0218 graph1D_jd(xlim,[eta_2_nr_Karney,eta_2_nr_Karney],0,0,'','','',NaN,xlim,ylim,'--','none','r',2,siz,gca);
0219 graph1D_jd(xlim,[eta_0_nr_Karney,eta_0_nr_Karney],0,0,'','','',NaN,xlim,ylim,'--','none','m',2,siz,gca);
0220
0221 set(gca,'ytick',[0:0.2:1]*ylim(2))
0222 set(gca,'xtick',[1e-05 0.0001 0.001 0.01 0.1 1])
0223
0224 set(gca,'XMinorGrid','off')
0225 set(gca,'XMinorTick','on')
0226
0227 print_jd(p_opt,'fig_j_betath','./figures',1)
0228 print_jd(p_opt,'fig_P_betath','./figures',2)
0229 print_jd(p_opt,'fig_eta_betath','./figures',3)
0230
0231
0232
0233 eval(['save ',path_simul,'DKE_RESULTS_',id_equil,'_',id_simul,'.mat']);
0234 info_dke_yp(2,['Data saved in ',path_simul,'DKE_RESULTS_',id_equil,'_',id_simul,'.mat']);