ALOHA scenario example VERSION : 1.5 (20/09/2011) This file is a function which create an ALOHA scenario. All the parameters needed by ALOHA to make a run are stored inside this file, except the antenna description. All the parameters are detailled below. This function returns a matlab stucture "scenario" which contains all the parameters used in ALOHA. This structure is used an input argument of the "aloha_scenario" functiion. Once its calculation done, ALOHA returns a similar structure "scenrio" which contains the results in addition (in the field scenario.results). INPUT: none OUPUT: - scenario <structure>: ALOHA scenario AUTHOR:JH
0001 function scenario = scenario_example 0002 % ALOHA scenario example 0003 % VERSION : 1.5 (20/09/2011) 0004 % 0005 % This file is a function which create an ALOHA scenario. 0006 % 0007 % All the parameters needed by ALOHA to make a run are stored inside 0008 % this file, except the antenna description. All the parameters are detailled below. 0009 % 0010 % This function returns a matlab stucture "scenario" which contains all the parameters 0011 % used in ALOHA. This structure is used an input argument of the "aloha_scenario" 0012 % functiion. Once its calculation done, ALOHA returns a similar structure "scenrio" 0013 % which contains the results in addition (in the field scenario.results). 0014 % 0015 % 0016 % INPUT: none 0017 % 0018 % OUPUT: 0019 % - scenario <structure>: ALOHA scenario 0020 % 0021 % AUTHOR:JH 0022 0023 % ################################################################## 0024 % RESULTS SAVING 0025 % ################################################################## 0026 % Automatic saving of the scenario (once calculated) ? 0027 options.bool_save = false; 0028 % matlab result filename 0029 % (avoid spaces if possible) 0030 options.scenario_filename = ''; 0031 % Commentaire sur le scenario 0032 options.comment = ['EAST 2.45GHz launcher modeling - ASIPP S parameters']; 0033 0034 % ================================================================== 0035 % ANTENNA DESCRIPTION 0036 % ================================================================== 0037 0038 %% ##################### 0039 % antenna architecture: 0040 % 'antenne_C2', 'antenne_C3', 'antenne_C4' ... 0041 % Ces valeurs correspondent aux noms des fichiers disponibles dans 0042 % le dossier 'achitecture_antenne'. 0043 % 0044 antenna.architecture = 'EAST_antenna_2dot45GHz'; 0045 0046 0047 %% ##################### 0048 % Antenna excitation 0049 % 0050 0051 % source frequency [Hz] 0052 % 0053 antenna.freq = 2.45e9; 0054 0055 % Use Tore Supra data ? true/false 0056 % 0057 % - true : on dispose de mesures reelles 0058 % - false : on utilise les valeurs predefinies (dans aloha_antenna_excitation) 0059 % 0060 options.bool_mesure = false; 0061 0062 % Use a predefenite excitation (true) 0063 % or a user excitation (false) [only if bool_mesure = false] 0064 options.bool_homeMadeExcitation = true; 0065 0066 % User-made excitation. 0067 % [only if bool_homeMadeExcitation = true & bool_mesure = false] 0068 % 0069 % Warning : the length of the array must be correct 0070 % in respect to the number of module of your antenna ! 0071 % help aloha_antenna_excitation for some examples 0072 antenna.a_ampl = sqrt(100e3)*ones(4,1); 0073 antenna.a_phase = 90*(pi/180)*(0:3)'; 0074 0075 0076 % [bool_mesure=true only] 0077 % Quel queusot doit-on utiliser pour fournir les informations d'excitation des antennes ? 0078 % Which Tore Supra port should we use for feeding antenna input ? 0079 % 0080 % 'Q6A' [C2 before 2009, C3 after] ou 'Q6B' [C3 before 2009, C4 after] 0081 options.TSport = 'Q6B'; 0082 0083 % [bool_mesure=true only] 0084 % numero du choc Tore Supra 0085 % Tore Supra pulse number 0086 options.choc = 45155; 0087 0088 % [bool_mesure=true only] 0089 % Temps debut et fin de lecture [s]. 0090 % Les valeurs mesurees sont moyennees entre ces deux valeurs. 0091 % Start and stop times for averaging experimental data [s] 0092 options.tps_1 = 7; % s 0093 options.tps_2 = 8; % s 0094 0095 0096 0097 % ================================================================== 0098 % PLASMA DESCRIPTION 0099 % ================================================================== 0100 %% ##################### 0101 % Modele d'ALOHA : '1D' ou '2D' 0102 options.version_code = '1D'; 0103 0104 %% ##################### 0105 % Nombre de modes utilise pour decrire le champ dans les guides 0106 % (Modele electromagnetique 1D) 0107 % 0108 Nmh = 1; % nbre de modes TE 0109 Nme = 2; % nbre de modes TM 0110 0111 %% ##################### 0112 % Plasma model 0113 % 0114 % --------- 1D (TEM/TM modes, slow wave only) ------------ 0115 % version_plasma_1D = 3: 1 linear profile 0116 % version_plasma_1D = 6: 2 linear profiles + eventually a vacuum gap 0117 version_plasma_1D = 6; 0118 0119 % --------- 2D (TE/TM modes, slow and fast waves) ------------ 0120 % FORTRAN 90 version 0121 % version_plasma_2D = 1 : 1 gradient, FEM admittance 0122 % 0123 % 0124 % FORTRAN 77 versions [obsolete] 0125 % version_plasma_2D = 10 : 1 gradient. analytical admittance 0126 % version_plasma_2D = 20 : 1 gradient, FEM admittance 0127 % version_plasma_2D = 60 : 2 gradients, FEM admittance 0128 version_plasma_2D = 1; 0129 0130 %% ##################### 0131 % Should we use the same density profile for each rows of waveguides ? 0132 % [1D Plasma model ONLY] 0133 % 0134 % true : each row has same density profile 0135 % => ne0 and lambdas are scalar values. e.g. : ne0 = 0.2e18 0136 % false : each row has a distinct density profile 0137 % => ne0 and lambdas are array. e.g. : ne0 = [0.2,0.4,0.2]*1e18 0138 % NB : the array length should be equal to the number of waveguide rows 0139 % 0140 options.bool_lignes_identiques = true; 0141 0142 %% ##################### 0143 % Initial electron density of the first plasma layer [m^-3] 0144 % 0145 % Densite electronique minimale devant l'antenne (x=0). [m^-3] 0146 % Rappels : 0147 % - densite de coupure 3.7GHz sur TS : 1.71e17 m^-3 0148 % Examples: 0149 plasma.ne0 = 1e18; 0150 0151 %% ##################### 0152 % Scrape-off length (lambda_n) of the first plasma layer [m] 0153 % 0154 % reminder: lambda_n = ne/grad_ne 0155 % 0156 % longueur de decroissance 0157 % pour la premiere couche de plasma en partant de l'antenne. [m] 0158 % 0159 % Example : 0160 plasma.lambda_n(1) = 2e-2; 0161 0162 %% ##################### 0163 % Width of the first plasma layer [version_plasma_1D=6 only]. [m] 0164 % 0165 % Epaisseur de la premiere couche de plasma [version=6 only]. [m] 0166 % 0167 % Example : 2e-3 (2mm) 0168 plasma.d_couche = 2e-3; 0169 0170 %% ##################### 0171 % Scrape-off length of the second plasma layer [m] 0172 % 0173 % longueur de decroissance 0174 % pour la deuxieme couche de plasma (version_plasma_1D=6). [m] 0175 % 0176 % Exemple : 0177 plasma.lambda_n(2) = 2e-2+plasma.d_couche; 0178 0179 0180 0181 %% ##################### 0182 % Vacuum gap width between the antenna [m] (version_plasma_1D=6) 0183 % and the first layer of the plasma [m] 0184 % 0185 % Epaisseur de vide entre l'antenne et le plasma [m] 0186 plasma.d_vide = 0; 0187 % plasma.d_vide = [0;0;0]*1e-3; % if bool_lignes_identiques = false 0188 0189 %% #################### 0190 % Intensite du champ magnetique devant l'antenne. [T] 0191 % [version_plasma_2D only] 0192 options.B0 = 2.95; 0193 0194 %% ##################### 0195 % 2D or 3D normalization choice 0196 % 0197 % In SWAN, the waveguides were described as parallel plate waveguides (2D). 0198 % In ALOHA-1D, the waveguides are parallel plate waveguides (2D) 0199 % In ALOHA-2D, the waveguides are rectangular waveguides (3D). 0200 % 0201 % In order to be able to compare the Electric field amplitudes given 0202 % between ALOHA-1D and ALOHA-2D, one must renormalize the ALOHA-1D results 0203 % and to take into account the height of the waveguide ("a" parameter). 0204 % 0205 % Moreover, if one want to compare the scattering parameters given 0206 % by ALOHA-1D/2D and SWAN, the scattering parameters reference impedance is 0207 % not the same between the two codes. So a impedance renormalization if necessary. 0208 % (in SWAN, the ref impedance is the vaccuum impedance, while it is the rectangular 0209 % waveguide impedance in ALOHA) 0210 % 0211 % type_swan_aloha = 0: 0212 % - SWAN reference impedance in S-parameters (parallel plate wg, TEM+TM mode) 0213 % - Electric field does not depends of the height of the waveguide ("a") 0214 % ALOHA-1D E-field should be of the same order than a 2D full wave simulation 0215 % 0216 % type_swan_aloha = 1: (default) 0217 % - ALOHA reference impedance in S-parameters (rectangular waveguide, TE+TM modes) 0218 % - Electric field depends of the waveguide height ("a"). 0219 % ALOHA-1D or ALOHA-2D E-field should be of the same order. 0220 options.type_swan_aloha = 1; 0221 0222 0223 % ================================================================== 0224 % ALOHA options (true/false) 0225 % ================================================================== 0226 % display electronic density profile 0227 options.bool_display_density_profile = false; 0228 0229 % N_parallel spectrum 0230 options.bool_compute_spectrum = true; % compute n// spectrum 0231 options.bool_display_spectrum = false; % display n// spectrum 0232 0233 % Directivity 0234 % NB : The spectrum is needed to compute the directivity ! 0235 options.bool_compute_directivity = false; 0236 options.bool_display_directivity = false; 0237 0238 % directivity definition : 0239 % * definition_directivite=1 : 0240 % D = (1/P)*int{nz=[+1,+inf]}(dP) 0241 % This is the most usual definition : ratio of the positive part of the spectrum 0242 % over total power. This results may be considered in percents. 0243 % 0244 % * definition_directivite=2 : 0245 % D = delta_cd = (1-R)*nz0^2/P*( int{nz=+1,+inf}(dP) - int{nz=-inf,-1}(dP)) 0246 % This is the 'weighted directivity' as defined in [Litaudon & Moreau, Nucl Fusion 30 (1990), 471] 0247 % This directivity definition is based on the Fish current drive efficiency of the LH waves. 0248 % It is a quantitative measure, based on the CD efficiency which decrease as 1/n//^2, 0249 % and of the quality of the launched spectrum with regard to an ideal Dirac spectrum, 0250 % centered on n//0. 0251 % 0252 % * definition_directivite=3 : 0253 % D = (1/P)*int{+1,+inf}(dP/nz^2); 0254 options.definition_directivite = 1; 0255 0256 % Compute and display the Efield in the waveguides at the mouth of the antenna 0257 options.bool_compute_total_field = false; 0258 options.bool_display_total_field = false; 0259 0260 % Compute and display the Efield inside the few mm of the plasma 0261 % The domain of calculation (a rectangle in front of the waveguides) 0262 % should be defined in the parameters below. 0263 options.bool_compute_plasma_field = false; 0264 options.bool_display_plasma_field = false; 0265 0266 0267 0268 0269 0270 % ================================================================== 0271 % ================================================================== 0272 % ================================================================== 0273 % 0274 % DO NOT EDIT AFTER THIS LINE 0275 % (unless you know what you are doing ! :) 0276 % 0277 % ================================================================== 0278 % ================================================================== 0279 % ================================================================== 0280 0281 % ##################### 0282 % path to the main root of the ALOHA code 0283 if exist('aloha_utils_getRootPath') == 0 0284 disp('!!!! ERROR : the ALOHA functions are not registered into the MATLAB PATH !!!!'); 0285 error('Please correct the previous error before restarting ALOHA. See INSTALL.m'); 0286 else 0287 options.aloha_path = aloha_utils_getRootPath; 0288 end 0289 0290 % ##################### 0291 % Debug mode option 0292 % If true, display more informations. 0293 % 0294 options.bool_debug = false; 0295 0296 % ##################### 0297 % Plasma edge properties 0298 % 0299 % plasma electronic density model 0300 if options.version_code == '1D' 0301 plasma.version = version_plasma_1D; 0302 elseif options.version_code == '2D' 0303 plasma.version = version_plasma_2D; 0304 else 0305 error('Bad defined variables : ''version_code'''); 0306 end 0307 0308 % gradient de la premiere couche de plasma 0309 plasma.dne(:,1) = plasma.ne0./plasma.lambda_n(:,1); 0310 % gradient de densite couche ne2 [version=6 only] 0311 plasma.dne(:,2) = (1+plasma.d_couche./plasma.lambda_n(:,1)).*plasma.ne0./plasma.lambda_n(:,2); 0312 0313 % EM modes 0314 options.modes = [Nmh, Nme]; 0315 0316 % ##################### 0317 % Retrieve antenna excitation 0318 % 0319 % It depends on the choice the user made: 0320 % - use a predefinite excitation 0321 % - or use Tore Supra data 0322 % 0323 if (options.bool_mesure) 0324 [antenna.a_ampl, antenna.a_phase] = ... 0325 aloha_antenna_excitation(options.choc, options.tps_1, options.tps_2, options.TSport); 0326 else 0327 if not(options.bool_homeMadeExcitation) % predefinite excitation 0328 [antenna.a_ampl, antenna.a_phase] = ... 0329 aloha_antenna_excitation(antenna.architecture); 0330 end 0331 end 0332 0333 0334 0335 0336 % %%%%%%%%%%% 0337 % % Affiche le profile du plasma de bord. 0338 % % 0339 % % TODO 0340 % if bool_display_density_profile 0341 % switch(version) 0342 % case 3 0343 % figure; aloha_plotDensityProfile(ne0, lambda_n0); 0344 % case 6 0345 % figure; aloha_plotDensityProfile(ne0, lambda_n0, d_couche, lambda_n1); 0346 % end 0347 % 0348 % if bool_debug 0349 % disp('Appuyez sur une touche pour continuer'); 0350 % pause 0351 % end 0352 % end 0353 0354 % ##################### 0355 % spectre computing parameters 0356 % 0357 % WARNING : depending of these parameter values, 0358 % aloha 2D may crash (seg fault). If it occurs, 0359 % increase the dnz or dny values or decrease nz_min/max, ny_min/max ! 0360 % TODO : aloha 2D spectrum/nz,ny memory bug 0361 options.nz_min = -20; % depart en nz 0362 options.nz_max = 20; % arrivee en nz 0363 options.dnz = 0.01; % pas en nz 0364 0365 options.ny_min = -2; % depart en ny 0366 options.ny_max = 2; % arrivee en ny 0367 options.dny = 0.1; % pas en ny 0368 0369 % NB JH 01/2009 : compatibilite avec code 2D 0370 options.nbre_ny=(options.ny_max-options.ny_min)/options.dny; 0371 options.nbre_nz=(options.nz_max-options.nz_min)/options.dnz; 0372 0373 % ##################### TODO 0374 % trace du chp dans le plasma 0375 % (pour les versions 3 et 6) 0376 % 0377 options.z_coord_min = -0.015; % coordonnees dans le plasma 0378 options.z_coord_max = 0.075; 0379 options.nbre_z_coord = 60; 0380 options.x_coord_max = 0.05; 0381 options.nbre_x_coord = 8; 0382 0383 options.pas_nz_fig_plasma = 0.1; % description du chp spatial e partir de la description spectrale 0384 % !! => periodisation du chp suivant z Tz=lambda/pas_nz 0385 options.fig_Ez_ou_EzHy = 1; % description chp Ez ou vecteur de poynthing S = Ez.Hy* : = 1 Ez / = 0 Ez.Hy* 0386 options.lig_fig_plasma = 1; % numero de la ligne 0387 0388 %%%%%%%%%%%%%%%%%%%%%%%% making void structures in order to avoid bugs later in filling the structure... 0389 results.S_plasma = []; 0390 antenna_lh.setup = []; 0391 0392 % ##################### 0393 % Creation du scenario 0394 % 0395 scenario = aloha_setfield([], plasma, antenna, options, results); 0396 0397 % Load the antenna structure into the scenario 0398 % 0399 % NB : in previous version of ALOHA, this was made inside the aloha_scenario function. 0400 % However, in order to allow batch on antenna's dimension, the antenne dimensions have 0401 % been inserted into the scenario : this must be done before aloha_scenario, thus here. 0402 scenario = aloha_setAntenna(scenario, antenna.architecture);