0001 function [] = make_wave_JETlikeECflucttest
0002
0003
0004
0005
0006
0007
0008
0009 close all
0010
0011 id_wave = 'JETlikeECflucttest';
0012
0013
0014
0015 id_dkepath = '';
0016 path_dkepath = '';
0017
0018
0019
0020 id_equil = 'JETliketest';
0021 path_equil = '../EQUIL/';
0022
0023
0024
0025 id_fluct = 'noripple';
0026 path_fluct = '../FLUCT/';
0027
0028
0029
0030 [equil,dkepath,fluct] = load_structures_yp('equil',id_equil,path_equil,'dkepath',id_dkepath,path_dkepath,'fluct',id_fluct,path_fluct);
0031
0032
0033
0034
0035
0036 freq_GHz = 100;
0037
0038 R_L = 5.6;
0039 Z_L = 0.1;
0040
0041 P_L = 1e-6;
0042
0043 cone_div = 1.08;
0044 cone_ori = -0.5;
0045
0046 z_L = 0.0;
0047
0048 alpha_prater = -10;
0049 beta_prater = 22;
0050
0051
0052
0053 mdce_mode_main_C3PO_jd = 0;
0054
0055
0056
0057 C3POdisplay.ray = 0;
0058 C3POdisplay.equilibrium = 0;
0059 C3POdisplay.fluctuations = 0;
0060 C3POdisplay.p_opt = 2;
0061 C3POdisplay.mdce = 1;
0062
0063
0064
0065 waveparam.mmode = -1;
0066 waveparam.kmode = 0;
0067
0068
0069
0070
0071
0072
0073 waveparam.opt_rf = 1;
0074
0075 waveparam.dsmin = 0;
0076
0077 waveparam.nd = 1;
0078 waveparam.nchi = 1;
0079
0080 waveparam.n_rf_list = 1:2;
0081 waveparam.ns = 1;
0082
0083 waveparam.dsmin = NaN;
0084
0085
0086
0087
0088
0089 fitparam.equil.method = 'spline';
0090 fitparam.equil.nharm = NaN;
0091 fitparam.equil.ngridresample = 1001;
0092 fitparam.equil.mode_equil = 1;
0093
0094 fitparam.fluct.mode_equil = fitparam.equil.mode_equil;
0095 fitparam.fluct.method = 'pchip';
0096 fitparam.fluct.nharm = 32;
0097 fitparam.fluct.ngridresample = 201;
0098
0099
0100
0101 rayparam.testmode = 0;
0102 rayparam.tensortype = 0;
0103 rayparam.t0 = 0;
0104 rayparam.tfinal = 50000;
0105 rayparam.dt0 = 1.e-4;
0106 rayparam.dS = 1.e-4;
0107 rayparam.tol = 1e-12;
0108 rayparam.kmax = 50000;
0109 rayparam.ncyclharm = 3;
0110 rayparam.reflection = 0;
0111 rayparam.rel_opt = 1;
0112 rayparam.nperp = 1000;
0113 rayparam.pperpmax = 10;
0114 rayparam.tau_lim = 20;
0115 rayparam.kextra = 50;
0116
0117
0118
0119 launch.id = id_wave;
0120 launch.type = 'EC';
0121 launch.omega_rf = [freq_GHz]*2*pi*1e9;
0122
0123 launch.yR_L = R_L;
0124 launch.yZ_L = Z_L;
0125 launch.yphi_L = 0;
0126 launch.yalpha_L = sign(beta_prater)*pi - atan(tand(beta_prater)/cosd(alpha_prater));
0127 launch.ybeta_L = acos(cosd(beta_prater)*sind(alpha_prater));
0128 launch.yP_L = P_L*1e6;
0129 launch.dNpar0 = NaN;
0130 launch.ns = 1;
0131 launch.method = 'spline';
0132
0133 launch.w0 = 0.3/(freq_GHz*pi*cone_div*pi/180);
0134 launch.z_L = z_L;
0135
0136
0137
0138
0139
0140
0141
0142 equil_fit = fitequil_yp(equil,fitparam.equil.mode_equil,fitparam.equil.method,fitparam.equil.ngridresample,fitparam.equil.nharm);
0143 info_dke_yp(2,['Vectorial form of the magnetic equilibrium ',equil.id,' is calculated.']);
0144 if C3POdisplay.equilibrium,testfitequil_yp(equil,equil_fit);end
0145
0146
0147
0148 if ~isempty(fluct),
0149 fluct = fluctphase_yp(fluct);
0150 [fluct_fit] = fitfluct_yp(fluct,fitparam.equil.mode_equil,fitparam.fluct.method,fitparam.fluct.ngridresample,fitparam.fluct.nharm);
0151 info_dke_yp(2,['Vectorial form of the plasma fluctuations ',equil.id,'_',fluct.id,' is calculated.']);
0152 if C3POdisplay.fluctuations,testfitfluct_yp(equil_fit,fluct,fluct_fit);end
0153 end
0154
0155
0156
0157
0158
0159 C3POparam.clustermode.main_C3PO_jd.scheduler.mode = mdce_mode_main_C3PO_jd;
0160
0161
0162
0163 rayinit = main_rayinit_launch_jd(equil,launch);
0164 wave_nofluct = main_C3PO_jd(dkepath,[id_wave,'_nofluct'],equil,equil_fit,rayinit,waveparam,[],rayparam,C3POdisplay,C3POparam,[],[],0);clear mex;clear functions
0165
0166 info_dke_yp(2,'Ray trajectories calculated (interpolated magnetic equilibrium with no plasma fluctuations)');
0167
0168 rayinit = main_rayinit_launch_jd(equil,launch);
0169 [wave_fluct] = main_C3PO_jd(dkepath,[id_wave,'_fluct'],equil,equil_fit,rayinit,waveparam,[],rayparam,C3POdisplay,C3POparam,[],fluct_fit,0);
0170
0171 info_dke_yp(2,'Ray trajectories calculated (interpolated magnetic equilibrium with plasma fluctuations)');
0172
0173 save_str = ['WAVE_',id_wave,'.mat'];
0174 save(save_str,'id_wave','wave_fluct','wave_nofluct','equil_fit','fluct');
0175
0176 info_dke_yp(2,'Wave parameters saved');
0177
0178
0179
0180 waves = {wave_nofluct,wave_fluct};
0181 rays = {wave_nofluct.rays{1},wave_fluct.rays{1}};
0182
0183 legs = {'No fluct.','With fluct.';...
0184 'nofluct','fluct'};
0185
0186 filename = ['Fig_',id_wave];
0187
0188 opt.p_opt = C3POdisplay.p_opt;
0189 opt.ntheta_fit = 65;
0190 opt.nrho_fit = 15;
0191 opt.propvar = 1;
0192
0193 graph_comp_RT_jd(rays,legs,equil_fit,filename,opt)
0194
0195 diary4cvs_C3PO_yp(id_wave,dkepath,waves);
0196
0197