make_wavelaunchs_cronos_lh

PURPOSE ^

SYNOPSIS ^

function [launchs] = make_wavelaunchs_cronos_lh(gene,par,cons,signe,conf,lob,freqlh,aloha_mode)

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [launchs] = make_wavelaunchs_cronos_lh(gene,par,cons,signe,conf,lob,freqlh,aloha_mode)
0002 %
0003 if nargin >= 8,
0004     par.aloha_mode = aloha_mode;
0005 end
0006 %
0007 if nargin >= 7,
0008     par.freqlh = freqlh;
0009 end
0010 %
0011 if nargin >= 6,
0012     par.lob = lob;
0013 end
0014 %
0015 if nargin >= 5,
0016     par.conf = conf;
0017 end
0018 %
0019 if nargin >= 4,
0020     gene.signe = signe;
0021 end
0022 %
0023 if isempty(cons),
0024     launchs = cell(0,1);
0025     return
0026 else
0027     nlh = length(cons);
0028 end
0029 %
0030 if isfield(par,'lob')
0031     lob = par.lob;
0032 else
0033     lob = 'No';
0034 end
0035 %
0036 if isfield(par,'freqlh')
0037     freqlh = par.freqlh;
0038 else
0039     freqlh = NaN;
0040 end
0041 %
0042 conf = par.conf;
0043 %
0044 signe = gene.signe;
0045 %
0046 if ~isempty(strfind(conf,' (TS)'))
0047     conf = conf(1:(strfind(conf,' (TS)')-1));    
0048 end
0049 %
0050 if isfield(par,'aloha_mode')
0051     for ilh = 1:nlh,
0052         aloha(ilh).mode    = par.aloha_mode(ilh);
0053         aloha(ilh).param   = par.aloha_param(ilh) + 1i*par.aloha_param0(ilh);
0054         aloha(ilh).file    = fullfile(fileparts(gene.file),strtrim(par.aloha_file{ilh}));
0055         aloha(ilh).scen    = par.aloha_scen(ilh);
0056     end
0057 else
0058    for ilh = 1:nlh,
0059      aloha(ilh).mode = 0;
0060    end
0061 end
0062 %
0063 % Create the structure launch for CRONOS
0064 %
0065 %by Y.Peysson <yves.peysson@cea.fr> (CEA-DRFC) and J. Decker <joan.decker@cea.fr> (CEA-DRFC)
0066 %
0067 % -------------------------------- Tore Supra --------------------------------
0068 %
0069 if strcmp(conf,'TS');%For the Lower Hybrid wave simulations
0070     %
0071     % ------- LH antenna #1 (C1) -------
0072     %
0073     if nlh ~= 2,
0074         error('Mismatch in antenna number between LH cons and make_wavelaunchs_cronos_lh')
0075     end
0076     %
0077     if isnan(freqlh),
0078         freqlh = [4.6,4.6];
0079     end
0080     %
0081     launchs{1}.id = 'Coupleur_C1';
0082     launchs{1}.type = 'LH';
0083     launchs{1}.omega_rf = freqlh(1)*2*pi*1e9;%wave angular frequency (rad/s) [1,1]
0084     %
0085     directivity = [0.7];%Antenna directivity [1,1]
0086     %
0087     [Plhtot,Npar0] = lhspectrum_cronos(directivity,signe,cons(1),lob);%Power and parallel refractive index [1,n_lobe]
0088     launchs{1}.bPlhtot = Plhtot;%initial power in the ray (W) [1,n_lobe]
0089     launchs{1}.bNpar0 = Npar0;%Initial Npar value [1,n_lobe]
0090     %
0091     launchs{1}.bdNpar0 = [0.2]*ones(size(Npar0));%ray spectral width for Fokker-Planck calculations [1,n_lobe]
0092     %
0093     launchs{1}.rZ0 = [-0.155,-0.075,0.075,0.155];%vertical launching positions (m) [1,m_pol]
0094     %
0095     launchs{1}.m0 = [0];%initial poloidal mode number [1,1]
0096     launchs{1}.phi0 = [0];%toroidal angle position [1,1]
0097     launchs{1}.i_ref = -1;%Initial radial position index [1,1]
0098     launchs{1}.LFS = [1];% (-1) high field side launching, (1) low field side launching [1,1]
0099     launchs{1}.mmode = -1;% (-1) for slow wave, (1) for fast wave
0100     %
0101     % ------- LH antenna #2 (C2) -------
0102     %
0103     launchs{2}.id = 'Coupleur_C2';
0104     launchs{2}.type = 'LH';
0105     launchs{2}.omega_rf = freqlh(2)*2*pi*1e9;%wave angular frequency (rad/s) [1,1]
0106     %
0107     directivity = [0.7];%Antenna directivity [1,1]
0108     %
0109     [Plhtot,Npar0] = lhspectrum_cronos(directivity,signe,cons(2),lob);%Power and parallel refractive index [1,n_lobe]
0110     launchs{2}.bPlhtot = Plhtot;%initial power in the ray (W) [1,n_lobe]
0111     launchs{2}.bNpar0 = Npar0;%Initial Npar value [1,n_lobe]
0112     %
0113     launchs{2}.bdNpar0  = [0.2]*ones(size(Npar0));%ray spectral width for Fokker-Planck calculations [1,n_lobe]
0114     %
0115     launchs{2}.rZ0 = [-0.244,-0.162,-0.080,0.080,0.162,0.244];%vertical launching positions (m) [1,m_pol]
0116     %
0117     launchs{2}.m0 = [0];%initial poloidal mode number [1,1]
0118     launchs{2}.phi0 = [0];%toroidal angle position [1,1]
0119     launchs{2}.i_ref = -1;%Initial radial position index [1,1]
0120     launchs{2}.LFS = [1];% (-1) high field side launching, (1) low field side launching [1,1]
0121     launchs{2}.mmode = -1;% (-1) for slow wave, (1) for fast wave
0122 %
0123 % -------------------------------- Tore Supra Mixte --------------------------------
0124 %
0125 elseif strcmp(conf,'MIXTE') || strcmp(conf,'MIXTE (TS)') ;%For the Lower Hybrid wave simulations
0126     %
0127     % ------- LH antenna #1 (C2) -------
0128     %
0129     if nlh ~= 2,
0130         error('Mismatch in antenna number between LH cons and make_wavelaunchs_cronos_lh')
0131     end
0132     %
0133     if isnan(freqlh),
0134         freqlh = [4.6,4.6];
0135     end
0136     %
0137     launchs{1}.id = 'Coupleur_C2';
0138     launchs{1}.type = 'LH';
0139     launchs{1}.omega_rf = freqlh(1)*2*pi*1e9;%wave angular frequency (rad/s) [1,1]
0140     %
0141     directivity = [0.7];%Antenna directivity [1,1]
0142     %
0143     [Plhtot,Npar0] = lhspectrum_cronos(directivity,signe,cons(1),lob);%Power and parallel refractive index [1,n_lobe]
0144     launchs{1}.bPlhtot = Plhtot;%initial power in the ray (W) [1,n_lobe]
0145     launchs{1}.bNpar0 = Npar0;%Initial Npar value [1,n_lobe]
0146     %
0147     launchs{1}.bdNpar0 = [0.2]*ones(size(Npar0));%ray spectral width for Fokker-Planck calculations [1,n_lobe]
0148     %
0149     launchs{1}.rZ0 = [-0.155,-0.075,0.075,0.155];%vertical launching positions (m) [1,m_pol]
0150     %
0151     launchs{1}.m0 = [0];%initial poloidal mode number [1,1]
0152     launchs{1}.phi0 = [0];%toroidal angle position [1,1]
0153     launchs{1}.i_ref = -1;%Initial radial position index [1,1]
0154     launchs{1}.LFS = [1];% (-1) high field side launching, (1) low field side launching [1,1]
0155     launchs{1}.mmode = -1;% (-1) for slow wave, (1) for fast wave
0156     %
0157     % ------- LH antenna #2 (C3) -------
0158     %
0159     launchs{2}.id = 'Coupleur_C3';
0160     launchs{2}.type = 'LH';
0161     launchs{2}.omega_rf = freqlh(2)*2*pi*1e9;%wave angular frequency (rad/s) [1,1]
0162     %
0163     directivity = [0.6];%Antenna directivity [1,1]
0164     %
0165     [Plhtot,Npar0] = lhspectrum_cronos(directivity,signe,cons(2),lob);%Power and parallel refractive index [1,n_lobe]
0166     launchs{2}.bPlhtot = Plhtot;%initial power in the ray (W) [1,n_lobe]
0167     launchs{2}.bNpar0 = Npar0;%Initial Npar value [1,n_lobe]
0168     %
0169     launchs{2}.bdNpar0 = [0.2]*ones(size(Npar0));%ray spectral width for Fokker-Planck calculations (main lobe) [1,n_lobe]
0170     %
0171     launchs{2}.rZ0 = [-0.244,-0.162,-0.080,0.080,0.162,0.244];%vertical launching positions (m) [1,m_pol]
0172     %
0173     launchs{2}.m0 = [0];%initial poloidal mode number [1,1]
0174     launchs{2}.phi0 = [0];%toroidal angle position [1,1]
0175     launchs{2}.i_ref = -1;%Initial radial position index [1,1]
0176     launchs{2}.LFS = [1];% (-1) high field side launching, (1) low field side launching [1,1]
0177     launchs{2}.mmode = -1;% (-1) for slow wave, (1) for fast wave
0178 %
0179 % -------------------------------- Tore Supra CIEL --------------------------------
0180 %
0181 elseif strcmp(conf,'CIEL') | strcmp(conf,'CIEL (TS)') ;%For the Lower Hybrid wave simulations
0182     %
0183     % ------- LH antenna #1 (C2) -------
0184     %
0185     if nlh ~= 2,
0186         error('Mismatch in antenna number between LH cons and make_wavelaunchs_cronos_lh')
0187     end
0188     %
0189     if isnan(freqlh),
0190         freqlh = [4.6,4.6];
0191     end
0192     %
0193     launchs{1}.id = 'Coupleur_C1';
0194     launchs{1}.type = 'LH';
0195     launchs{1}.omega_rf = freqlh(1)*2*pi*1e9;%wave angular frequency (rad/s) [1,1]
0196     %
0197     directivity = [0.6];%Antenna directivity [1,1]
0198     %
0199     [Plhtot,Npar0] = lhspectrum_cronos(directivity,signe,cons(1),lob);%Power and parallel refractive index [1,n_lobe]
0200     launchs{1}.bPlhtot = Plhtot;%initial power in the ray (W) [1,n_lobe]
0201     launchs{1}.bNpar0 = Npar0;%Initial Npar value [1,n_lobe]
0202     %
0203     launchs{1}.bdNpar0 = [0.2]*ones(size(Npar0));%ray spectral width for Fokker-Planck calculations [1,n_lobe]
0204     %
0205     launchs{1}.rZ0 = [-0.155,-0.075,0.075,0.155];%vertical launching positions (m) [1,m_pol]
0206     %
0207     launchs{1}.m0 = [0];%initial poloidal mode number [1,1]
0208     launchs{1}.phi0 = [0];%toroidal angle position [1,1]
0209     launchs{1}.i_ref = -1;%Initial radial position index [1,1]
0210     launchs{1}.LFS = [1];% (-1) high field side launching, (1) low field side launching [1,1]
0211     launchs{1}.mmode = -1;% (-1) for slow wave, (1) for fast wave
0212     %
0213     % ------- LH antenna #2 (C3) -------
0214     %
0215     launchs{2}.id = 'Coupleur_C3';
0216     launchs{2}.type = 'LH';
0217     launchs{2}.omega_rf = freqlh(2)*2*pi*1e9;%wave angular frequency (rad/s) [1,1]
0218     %
0219     directivity = [0.6];%Antenna directivity [1,1]
0220     %
0221     [Plhtot,Npar0] = lhspectrum_cronos(directivity,signe,cons(2),lob);%Power and parallel refractive index [1,n_lobe]
0222     launchs{2}.bPlhtot = Plhtot;%initial power in the ray (W) [1,n_lobe]
0223     launchs{2}.bNpar0 = Npar0;%Initial Npar value [1,n_lobe]
0224     %
0225     launchs{2}.bdNpar0 = [0.2]*ones(size(Npar0));%ray spectral width for Fokker-Planck calculations (main lobe) [1,n_lobe]
0226     %
0227     launchs{2}.rZ0 = [-0.244,-0.162,-0.080,0.080,0.162,0.244];%vertical launching positions (m) [1,m_pol]
0228     %
0229     launchs{2}.m0 = [0];%initial poloidal mode number [1,1]
0230     launchs{2}.phi0 = [0];%toroidal angle position [1,1]
0231     launchs{2}.i_ref = -1;%Initial radial position index [1,1]
0232     launchs{2}.LFS = [1];% (-1) high field side launching, (1) low field side launching [1,1]
0233     launchs{2}.mmode = -1;% (-1) for slow wave, (1) for fast wave
0234     %
0235     % -------------------------------- C-MOD --------------------------------
0236     %
0237 elseif strcmp(conf,'CMOD');%For the Lower Hybrid wave simulations
0238     %
0239     % ------- LH antenna #1 -------
0240     %
0241     if nlh ~= 1,
0242         error('Mismatch in antenna number between LH cons and make_wavelaunchs_cronos_lh')
0243     end
0244 %
0245    launchs{1}.id = 'Antenna_1';
0246    launchs{1}.type = 'LH';
0247    launchs{1}.omega_rf = freqlh(1)*2*pi*1e9;%wave angular frequency (rad/s) [1,1]
0248 %
0249    directivity = [1.0];%Antenna directivity [1,1]
0250 %
0251    [Plhtot,Npar0] = lhspectrum_cronos(directivity,signe,cons,lob);%Power and parallel refractive index [1,n_lobe]
0252    launchs{1}.bPlhtot = Plhtot;%initial power in the ray (W) [1,n_lobe]
0253    launchs{1}.bNpar0 = Npar0;%Initial Npar value [1,n_lobe]
0254  %
0255    launchs{1}.bdNpar0 = [0.2]*ones(size(Npar0));%ray spectral width for Fokker-Planck calculations [1,n_lobe]
0256 %
0257    launchs{1}.rZ0 = [0,0,0,0];%vertical launching positions (m) [1,m_pol]
0258 %
0259    launchs{1}.m0 = [0];%initial poloidal mode number [1,1]
0260    launchs{1}.phi0 = [0];%toroidal angle position [1,1]
0261    launchs{1}.i_ref = -1;%Initial radial position index [1,1]
0262    launchs{1}.LFS = [1];% (-1) high field side launching, (1) low field side launching [1,1]
0263    launchs{1}.mmode = -1;% (-1) for slow wave, (1) for fast wave
0264 %
0265 % -------------------------------- JET --------------------------------
0266 %
0267 elseif strcmp(conf,'JET');%For the Lower Hybrid wave simulations
0268     %
0269     if ~any(nlh == [1,2]),
0270         error('Mismatch in antenna number between LH cons and make_wavelaunchs_cronos_lh')
0271     end
0272     %
0273     % ------- LH antenna #1 -------
0274     %
0275     if isnan(freqlh),
0276         freqlh = [3.7,3.7];
0277     end
0278     %
0279     launchs{1}.id = 'Antenna_1';
0280     launchs{1}.type = 'LH';
0281     launchs{1}.omega_rf = freqlh(1)*2*pi*1e9;%wave angular frequency (rad/s) [1,1]
0282     %
0283     directivity = [0.7];%Antenna directivity [1,1]
0284     %
0285     [Plhtot,Npar0] = lhspectrum_cronos(directivity,signe,cons(1),lob);%Power and parallel refractive index [1,n_lobe]
0286     launchs{1}.bPlhtot = Plhtot;%initial power in the ray (W) [1,n_lobe]
0287     launchs{1}.bNpar0 = Npar0;%Initial Npar value [1,n_lobe]
0288     %
0289     launchs{1}.bdNpar0 = 0.2*ones(size(Npar0));%ray spectral width for Fokker-Planck calculations [1,n_lobe]
0290     %
0291     launchs{1}.rZ0 = [0.370 0.222 0.074 -0.074 -0.222 -0.370];%vertical launching positions (m) [1,m_pol]
0292     %
0293     launchs{1}.m0 = [0];%initial poloidal mode number [1,1]
0294     launchs{1}.phi0 = [0];%toroidal angle position [1,1]
0295     launchs{1}.i_ref = -2;%Initial radial position index [1,1]
0296     launchs{1}.LFS = [1];% (-1) high field side launching, (1) low field side launching [1,1]
0297     launchs{1}.mmode = -1;% (-1) for slow wave, (1) for fast wave
0298     %
0299     % ------- LH antenna #2 -------
0300     %
0301     if nlh > 1,
0302         launchs{2}.id = 'Antenna_2';
0303         launchs{2}.type = 'LH';
0304         launchs{2}.omega_rf = freqlh(2)*2*pi*1e9;%wave angular frequency (rad/s) [1,1]
0305         %
0306         directivity = [0.7];%Antenna directivity [1,1]
0307         %
0308         [Plhtot,Npar0] = lhspectrum_cronos(directivity,signe,cons(2),lob);%Power and parallel refractive index [1,n_lobe]
0309         launchs{2}.bPlhtot = Plhtot;%initial power in the ray (W) [1,n_lobe]
0310         launchs{2}.bNpar0 = Npar0;%Initial Npar value [1,n_lobe]
0311         %
0312         launchs{2}.bdNpar0 = 0.2*ones(size(Npar0));%ray spectral width for Fokker-Planck calculations (main lobe) [1,n_lobe]
0313         %
0314         launchs{2}.rZ0 = [0.370 0.222 0.074 -0.074 -0.222 -0.370];%vertical launching positions (m) [1,m_pol]
0315         %
0316         launchs{2}.m0 = [0];%initial poloidal mode number [1,1]
0317         launchs{2}.phi0 = [0];%toroidal angle position [1,1]
0318         launchs{2}.i_ref = -2;%Initial radial position index [1,1]
0319         launchs{2}.LFS = [1];% (-1) high field side launching, (1) low field side launching [1,1]
0320         launchs{2}.mmode = -1;% (-1) for slow wave, (1) for fast wave
0321     end
0322     %
0323 %
0324 % -------------------------------- ITER@3.7GHz --------------------------------
0325 %
0326 elseif strcmp(conf,'ITER');%For the Lower Hybrid wave simulations
0327 %
0328 % ------- LH antenna #1 -------
0329 %
0330     if nlh ~= 1,
0331         error('Mismatch in antenna number between LH cons and make_wavelaunchs_cronos_lh')
0332     end
0333     %
0334    launchs{1}.id = 'Antenna_1';
0335    launchs{1}.type = 'LH';
0336    launchs{1}.omega_rf = freqlh(1)*2*pi*1e9;%wave angular frequency (rad/s) [1,1]
0337 %
0338    directivity = [0.7];%Antenna directivity [1,1]
0339 %
0340    [Plhtot,Npar0] = lhspectrum_cronos(directivity,signe,cons(1),lob);%Power and parallel refractive index [1,n_lobe]
0341    launchs{1}.bPlhtot = Plhtot;%initial power in the ray (W) [1,n_lobe]
0342    launchs{1}.bNpar0 = Npar0;%Initial Npar value [1,n_lobe]
0343 %
0344    launchs{1}.bdNpar0 = [0.2]*ones(size(Npar0));%ray spectral width for Fokker-Planck calculations [1,n_lobe]
0345 %
0346    launchs{1}.rZ0 = [0.15,1.15];%vertical launching positions (m) [1,m_pol]
0347 %
0348    launchs{1}.m0 = [0];%initial poloidal mode number [1,1]
0349    launchs{1}.phi0 = [0];%toroidal angle position [1,1]
0350    launchs{1}.i_ref = -1;%Initial radial position index [1,1]
0351    launchs{1}.LFS = [1];% (-1) high field side launching, (1) low field side launching [1,1]
0352    launchs{1}.mmode = -1;% (-1) for slow wave, (1) for fast wave
0353 %
0354 % ------- LH antenna #2 -------
0355 %
0356 %   launchs{2}.id = 'Antenna_2';
0357 %   launchs{2}.type = 'LH';
0358 %   launchs{2}.omega_rf = [3.7]*2*pi*1e9;%wave angular frequency (rad/s) [1,1]
0359 %
0360 %   directivity = [0.7];%Antenna directivity [1,1]
0361 %
0362 %   [Plhtot,Npar0] = lhspectrum_cronos(directivity,signe,cons);%Power and parallel refractive index [1,n_lobe]
0363 %   launchs{2}.bPlhtot = Plhtot;%initial power in the ray (W) [1,n_lobe]
0364 %   launchs{2}.bNpar0 = Npar0;%Initial Npar value [1,n_lobe]
0365 %
0366 %   launchs{2}.bdNpar0 = [0.2,1.8];%ray spectral width for Fokker-Planck calculations (main lobe) [1,n_lobe]
0367 %
0368 %   launchs{2}.rZ0 = [0.15,1.15];%vertical launching positions (m) [1,m_pol]
0369 %
0370 %   launchs{2}.m0 = [0];%initial poloidal mode number [1,1]
0371 %   launchs{2}.phi0 = [0];%toroidal angle position [1,1]
0372 %   launchs{2}.i_ref = -1;%Initial radial position index [1,1]
0373 %   launchs{2}.LFS = [1];% (-1) high field side launching, (1) low field side launching [1,1]
0374 %   launchs{2}.mmode = -1;% (-1) for slow wave, (1) for fast wave
0375 
0376 
0377 %
0378 % -------------------------------- FT-U --------------------------------
0379 %
0380 elseif strcmp(conf,'FTU')
0381 %
0382 % ------- LH antenna #1 -------
0383 %
0384     if nlh ~= 1,
0385         error('Mismatch in antenna number between LH cons and make_wavelaunchs_cronos_lh')
0386     end
0387     %
0388    launchs{1}.id = 'Antenna_1';
0389    launchs{1}.type = 'LH';
0390    launchs{1}.omega_rf = freqlh(1)*2*pi*1e9;%wave angular frequency (rad/s) [1,1]
0391 %
0392    directivity = [0.85];%Antenna directivity [1,1]
0393 %
0394    [Plhtot,Npar0] = lhspectrum_cronos(directivity,signe,cons(1),lob);%Power and parallel refractive index [1,n_lobe]
0395    launchs{1}.bPlhtot = Plhtot;%initial power in the ray (W) [1,n_lobe]
0396    launchs{1}.bNpar0 = Npar0;%Initial Npar value [1,n_lobe]
0397  %
0398    launchs{1}.bdNpar0 = [0.2]*ones(size(Npar0));%ray spectral width for Fokker-Planck calculations [1,n_lobe]
0399 %
0400    launchs{1}.rZ0 = [0];%vertical launching positions (m) [1,m_pol]
0401 %
0402    launchs{1}.m0 = [0];%initial poloidal mode number [1,1]
0403    launchs{1}.phi0 = [0];%toroidal angle position [1,1]
0404    launchs{1}.i_ref = -1;%Initial radial position index [1,1]
0405    launchs{1}.LFS = [1];% (-1) high field side launching, (1) low field side launching [1,1]
0406    launchs{1}.mmode = -1;% (-1) for slow wave, (1) for fast wave
0407 %
0408 % -------------------------------- SST-1 --------------------------------
0409 %
0410 elseif strcmp(conf,'SST1')
0411 %
0412 % ------- LH antenna #1 -------
0413 %
0414     if nlh ~= 1,
0415         error('Mismatch in antenna number between LH cons and make_wavelaunchs_cronos_lh')
0416     end
0417     %
0418    launchs{1}.id = 'Antenna_1';
0419    launchs{1}.type = 'LH';
0420    launchs{1}.omega_rf = freqlh(1)*2*pi*1e9;%wave angular frequency (rad/s) [1,1]
0421 %
0422    directivity = [0.75];%Antenna directivity [1,1]
0423 %
0424    [Plhtot,Npar0] = lhspectrum_cronos(directivity,signe,cons(1),lob);%Power and parallel refractive index [1,n_lobe]
0425    launchs{1}.bPlhtot = Plhtot;%initial power in the ray (W) [1,n_lobe]
0426    launchs{1}.bNpar0 = Npar0;%Initial Npar value [1,n_lobe]
0427  %
0428    launchs{1}.bdNpar0 = [0.2]*ones(size(Npar0));%ray spectral width for Fokker-Planck calculations [1,n_lobe]
0429 %
0430    launchs{1}.rZ0 = [0];%vertical launching positions (m) [1,m_pol]
0431 %
0432    launchs{1}.m0 = [0];%initial poloidal mode number [1,1]
0433    launchs{1}.phi0 = [0];%toroidal angle position [1,1]
0434    launchs{1}.i_ref = -1;%Initial radial position index [1,1]
0435    launchs{1}.LFS = [1];% (-1) high field side launching, (1) low field side launching [1,1]
0436    launchs{1}.mmode = -1;% (-1) for slow wave, (1) for fast wave
0437 %
0438 % -------------------------------- DEMO --------------------------------
0439 %
0440 elseif strcmp(conf,'DEMO')
0441 %
0442 % ------- LH antenna #1 -------
0443 %
0444     if nlh ~= 2,
0445         error('Mismatch in antenna number between LH cons and make_wavelaunchs_cronos_lh')
0446     end
0447     %
0448    launchs{1}.id = 'Antenna_1';
0449    launchs{1}.type = 'LH';
0450    launchs{1}.omega_rf = freqlh(1)*2*pi*1e9;%wave angular frequency (rad/s) [1,1]
0451 %
0452    directivity = [0.7];%Antenna directivity [1,1]
0453 %
0454    [Plhtot,Npar0] = lhspectrum_cronos(directivity,signe,cons(1),lob);%Power and parallel refractive index [1,n_lobe]
0455    launchs{1}.bPlhtot = Plhtot;%initial power in the ray (W) [1,n_lobe]
0456    launchs{1}.bNpar0 = Npar0;%Initial Npar value [1,n_lobe]
0457 %
0458    launchs{1}.bdNpar0 = [0.2]*ones(size(Npar0));%ray spectral width for Fokker-Planck calculations [1,n_lobe]
0459 %
0460    launchs{1}.rZ0 = [0];%vertical launching positions (m) [1,m_pol]
0461 %
0462    launchs{1}.m0 = [0];%initial poloidal mode number [1,1]
0463    launchs{1}.phi0 = [0];%toroidal angle position [1,1]
0464    launchs{1}.i_ref = -1;%Initial radial position index [1,1]
0465    launchs{1}.LFS = [1];% (-1) high field side launching, (1) low field side launching [1,1]
0466    launchs{1}.mmode = -1;% (-1) for slow wave, (1) for fast wave
0467 %
0468 % ------- LH antenna #2 -------
0469 %
0470    launchs{2}.id = 'Antenna_2';
0471    launchs{2}.type = 'LH';
0472    launchs{2}.omega_rf = freqlh(2)*2*pi*1e9;%wave angular frequency (rad/s) [1,1]
0473 %
0474    directivity = [0.7];%Antenna directivity [1,1]
0475 %
0476    [Plhtot,Npar0] = lhspectrum_cronos(directivity,signe,cons(2),lob);%Power and parallel refractive index [1,n_lobe]
0477    launchs{2}.bPlhtot = Plhtot;%initial power in the ray (W) [1,n_lobe]
0478    launchs{2}.bNpar0 = Npar0;%Initial Npar value [1,n_lobe]
0479 %
0480    launchs{2}.bdNpar0 = [0.2]*ones(size(Npar0));%ray spectral width for Fokker-Planck calculations (main lobe) [1,n_lobe]
0481 %
0482    launchs{2}.rZ0 = [0];%vertical launching positions (m) [1,m_pol]
0483 %
0484    launchs{2}.m0 = [0];%initial poloidal mode number [1,1]
0485    launchs{2}.phi0 = [0];%toroidal angle position [1,1]
0486    launchs{2}.i_ref = -1;%Initial radial position index [1,1]
0487    launchs{2}.LFS = [1];% (-1) high field side launching, (1) low field side launching [1,1]
0488    launchs{2}.mmode = -1;% (-1) for slow wave, (1) for fast wave
0489 %
0490 % -------------------------------- COMPASS --------------------------------
0491 %
0492 elseif strcmp(conf,'COMPASS');%For the Lower Hybrid wave simulations
0493 %
0494 % ------- LH antenna #1 -------
0495 %
0496     if nlh ~= 1,
0497         error('Mismatch in antenna number between LH cons and make_wavelaunchs_cronos_lh')
0498     end
0499     %
0500    launchs{1}.id = 'Antenna_1';
0501    launchs{1}.type = 'LH';
0502    launchs{1}.omega_rf = freqlh(1)*2*pi*1e9;%wave angular frequency (rad/s) [1,1]
0503 %
0504    directivity = [0.7];%Antenna directivity [1,1]
0505 %
0506    [Plhtot,Npar0] = lhspectrum_cronos(directivity,signe,cons(1),lob);%Power and parallel refractive index [1,n_lobe]
0507    launchs{1}.bPlhtot = Plhtot;%initial power in the ray (W) [1,n_lobe]
0508    launchs{1}.bNpar0 = Npar0;%Initial Npar value [1,n_lobe]
0509 %
0510    launchs{1}.bdNpar0 = [0.2]*ones(size(Npar0));%ray spectral width for Fokker-Planck calculations [1,n_lobe]
0511 %
0512    launchs{1}.rZ0 = [-0.0535;0.0001;0.0535];%vertical launching positions (m) [1,m_pol]
0513 %
0514    launchs{1}.m0 = [0];%initial poloidal mode number [1,1]
0515    launchs{1}.phi0 = [0];%toroidal angle position [1,1]
0516    launchs{1}.i_ref = -1;%Initial radial position index [1,1]
0517    launchs{1}.LFS = [1];% (-1) high field side launching, (1) low field side launching [1,1]
0518    launchs{1}.mmode = -1;% (-1) for slow wave, (1) for fast wave
0519    
0520 elseif strcmp(conf,'AUG') || strcmp(conf,'ASDEX');%For the Lower Hybrid wave simulations
0521 %
0522 % ------- LH antenna #1 -------
0523 %
0524     if nlh ~= 2,
0525         error('Mismatch in antenna number between LH cons and make_wavelaunchs_cronos_lh')
0526     end
0527     %
0528    launchs{1}.id = 'Antenna_1';
0529    launchs{1}.type = 'LH';
0530    launchs{1}.omega_rf = freqlh(1)*2*pi*1e9;%wave angular frequency (rad/s) [1,1]
0531 %
0532    directivity = [0.7];%Antenna directivity [1,1]
0533 %
0534    [Plhtot,Npar0] = lhspectrum_cronos(directivity,signe,cons(1),lob);%Power and parallel refractive index [1,n_lobe]
0535    launchs{1}.bPlhtot = Plhtot;%initial power in the ray (W) [1,n_lobe]
0536    launchs{1}.bNpar0 = Npar0;%Initial Npar value [1,n_lobe]
0537 %
0538    launchs{1}.bdNpar0 = [0.5]*ones(size(Npar0));%ray spectral width for Fokker-Planck calculations [1,n_lobe]
0539 %
0540    launchs{1}.rZ0 = [linspace(-0.35,-0.05,6) linspace(0.05,0.35,6)];%[-0.35,0,0.35];%vertical launching positions (m) [1,m_pol]
0541 %
0542    launchs{1}.m0 = [0];%initial poloidal mode number [1,1]
0543    launchs{1}.phi0 = [0];%toroidal angle position [1,1]
0544    launchs{1}.i_ref = -1;%Initial radial position index [1,1]
0545    launchs{1}.LFS = [1];% (-1) high field side launching, (1) low field side launching [1,1]
0546    launchs{1}.mmode = -1;% (-1) for slow wave, (1) for fast wave
0547 %
0548 % ------- LH antenna #2 -------
0549 %
0550    launchs{2}.id = 'Antenna_2';
0551    launchs{2}.type = 'LH';
0552    launchs{2}.omega_rf = [3.7]*2*pi*1e9;%wave angular frequency (rad/s) [1,1]
0553 %
0554    directivity = [0.7];%Antenna directivity [1,1]
0555 %
0556    [Plhtot,Npar0] = lhspectrum_cronos(directivity,signe,cons(2),lob);%Power and parallel refractive index [1,n_lobe]
0557    launchs{2}.bPlhtot = Plhtot;%initial power in the ray (W) [1,n_lobe]
0558    launchs{2}.bNpar0 = Npar0;%Initial Npar value [1,n_lobe]
0559 %
0560    launchs{2}.bdNpar0 = [0.5]*ones(size(Npar0));%ray spectral width for Fokker-Planck calculations [1,n_lobe]
0561 %
0562    launchs{2}.rZ0 = [linspace(-0.35,-0.05,6) linspace(0.05,0.35,6)];%vertical launching positions (m) [1,m_pol]
0563 %
0564    launchs{2}.m0 = [0];%initial poloidal mode number [1,1]
0565    launchs{2}.phi0 = [0];%toroidal angle position [1,1]
0566    launchs{2}.i_ref = -1;%Initial radial position index [1,1]
0567    launchs{2}.LFS = [1];% (-1) high field side launching, (1) low field side launching [1,1]
0568    launchs{2}.mmode = -1;% (-1) for slow wave, (1) for fast wave
0569 elseif strcmp(conf,'EAST');%For the Lower Hybrid wave simulations
0570 %
0571 % ------- LH antenna #1 -------
0572 %
0573     if nlh ~= 1,
0574         error('Mismatch in antenna number between LH cons and make_wavelaunchs_cronos_lh')
0575     end
0576     %
0577    launchs{1}.id = 'Antenna_1';
0578    launchs{1}.type = 'LH';
0579    launchs{1}.omega_rf = freqlh(1)*2*pi*1e9;%wave angular frequency (rad/s) [1,1]
0580 %
0581    directivity = [0.7];%Antenna directivity [1,1]
0582 %
0583    [Plhtot,Npar0] = lhspectrum_cronos(directivity,signe,cons(1),lob);%Power and parallel refractive index [1,n_lobe]
0584    launchs{1}.bPlhtot = Plhtot;%initial power in the ray (W) [1,n_lobe]
0585    launchs{1}.bNpar0 = Npar0;%Initial Npar value [1,n_lobe]
0586  %
0587    launchs{1}.bdNpar0 = [0.5]*ones(size(Npar0));%ray spectral width for Fokker-Planck calculations [1,n_lobe]
0588    launchs{1}.rZ0 = [-0.05 0 0.05];%[-0.35,0,0.35];%vertical launching positions (m) [1,m_pol]
0589 %
0590    launchs{1}.m0 = [0];%initial poloidal mode number [1,1]
0591    launchs{1}.phi0 = [0];%toroidal angle position [1,1]
0592    launchs{1}.i_ref = -1;%Initial radial position index [1,1]
0593    launchs{1}.LFS = [1];% (-1) high field side launching, (1) low field side launching [1,1]
0594    launchs{1}.mmode = -1;% (-1) for slow wave, (1) for fast wave
0595 else
0596    error('The launch configuration name does not exists')      
0597 end
0598 %
0599 % ============================= ALOHA =====================================
0600 %
0601 for ilh=1:nlh,
0602     if aloha(ilh).mode == 1 && abs(cons(ilh)) > 0,
0603         %
0604         disp(['use ALOHA file for the power spectrum of LH wave # ',num2str(ilh)])
0605         %
0606         load(aloha(ilh).file);
0607         scheme  = scenario(aloha(ilh).scen);
0608         results = scheme.results;
0609         redfac = abs(cons(ilh))/(sum(results.dP_nz)*results.dnz);
0610         param = aloha(ilh).param;%number of fitted peaks + number of peaks left intact
0611         opt_optim = 0; %(if 1 use  toolbox optimisation)
0612         [bNpar0,bdNpar0,bPlhtot] = proc_aloha_spec_jd(results.nz,NaN,results.dP_nz,redfac,param,opt_optim);
0613         %
0614         if strcmp(lob,'No');
0615             mask = bNpar0 > 0;
0616             bNpar0 = bNpar0(mask);
0617             bdNpar0 = bdNpar0(mask);
0618             bPlhtot = bPlhtot(mask);
0619         end
0620         %
0621         bNpar0 = -signe.ip*signe.b0*bNpar0;%sign in aloha is positive
0622         %
0623         launchs{ilh}.bdNpar0    = bdNpar0;
0624         launchs{ilh}.bNpar0     = bNpar0;
0625         launchs{ilh}.bPlhtot    = bPlhtot;
0626     end
0627     %
0628     launchs{ilh}.aloha  = aloha(ilh);
0629 end
0630 %
0631 % ====================== OTHER PARAMETERS ==========================
0632 %
0633 %
0634 for ilh=1:nlh,
0635     %
0636     launch = launchs{ilh};
0637     %
0638     if isfield(par,'nparp') && par.nparp(ilh) ~= 0,
0639         for ib = 1:length(launch.bNpar0),
0640             disp(['artificial upshift for LH wave ',num2str(ilh),...
0641                 ' Npar0: ',num2str(launch.bNpar0(ib)),' ==> ',num2str(launch.bNpar0(ib) + sign(launch.bNpar0(ib)).*par.nparp(ilh))])
0642             launch.bNpar0(ib) = launch.bNpar0(ib) + sign(launch.bNpar0(ib)).*par.nparp(ilh);
0643         end
0644     else
0645         launch.nparp = 0;
0646     end
0647     %
0648     if isfield(par,'a_sdNpar') && par.a_sdNpar(ilh) ~= 0,
0649         launch.a_sdNpar = par.a_sdNpar(ilh);
0650         disp(['artificial upshift for LH wave ',num2str(ilh),...
0651             ': a_sdNpar = ',num2str(par.a_sdNpar(ilh))])
0652     else
0653         launch.a_sdNpar = 0;
0654     end
0655     %
0656     launchs{ilh} = launch;
0657     %
0658 end
0659 %
0660 
0661 
0662

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