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
0064
0065
0066
0067
0068
0069 if strcmp(conf,'TS');
0070
0071
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;
0084
0085 directivity = [0.7];
0086
0087 [Plhtot,Npar0] = lhspectrum_cronos(directivity,signe,cons(1),lob);
0088 launchs{1}.bPlhtot = Plhtot;
0089 launchs{1}.bNpar0 = Npar0;
0090
0091 launchs{1}.bdNpar0 = [0.2]*ones(size(Npar0));
0092
0093 launchs{1}.rZ0 = [-0.155,-0.075,0.075,0.155];
0094
0095 launchs{1}.m0 = [0];
0096 launchs{1}.phi0 = [0];
0097 launchs{1}.i_ref = -1;
0098 launchs{1}.LFS = [1];
0099 launchs{1}.mmode = -1;
0100
0101
0102
0103 launchs{2}.id = 'Coupleur_C2';
0104 launchs{2}.type = 'LH';
0105 launchs{2}.omega_rf = freqlh(2)*2*pi*1e9;
0106
0107 directivity = [0.7];
0108
0109 [Plhtot,Npar0] = lhspectrum_cronos(directivity,signe,cons(2),lob);
0110 launchs{2}.bPlhtot = Plhtot;
0111 launchs{2}.bNpar0 = Npar0;
0112
0113 launchs{2}.bdNpar0 = [0.2]*ones(size(Npar0));
0114
0115 launchs{2}.rZ0 = [-0.244,-0.162,-0.080,0.080,0.162,0.244];
0116
0117 launchs{2}.m0 = [0];
0118 launchs{2}.phi0 = [0];
0119 launchs{2}.i_ref = -1;
0120 launchs{2}.LFS = [1];
0121 launchs{2}.mmode = -1;
0122
0123
0124
0125 elseif strcmp(conf,'MIXTE') || strcmp(conf,'MIXTE (TS)') ;
0126
0127
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;
0140
0141 directivity = [0.7];
0142
0143 [Plhtot,Npar0] = lhspectrum_cronos(directivity,signe,cons(1),lob);
0144 launchs{1}.bPlhtot = Plhtot;
0145 launchs{1}.bNpar0 = Npar0;
0146
0147 launchs{1}.bdNpar0 = [0.2]*ones(size(Npar0));
0148
0149 launchs{1}.rZ0 = [-0.155,-0.075,0.075,0.155];
0150
0151 launchs{1}.m0 = [0];
0152 launchs{1}.phi0 = [0];
0153 launchs{1}.i_ref = -1;
0154 launchs{1}.LFS = [1];
0155 launchs{1}.mmode = -1;
0156
0157
0158
0159 launchs{2}.id = 'Coupleur_C3';
0160 launchs{2}.type = 'LH';
0161 launchs{2}.omega_rf = freqlh(2)*2*pi*1e9;
0162
0163 directivity = [0.6];
0164
0165 [Plhtot,Npar0] = lhspectrum_cronos(directivity,signe,cons(2),lob);
0166 launchs{2}.bPlhtot = Plhtot;
0167 launchs{2}.bNpar0 = Npar0;
0168
0169 launchs{2}.bdNpar0 = [0.2]*ones(size(Npar0));
0170
0171 launchs{2}.rZ0 = [-0.244,-0.162,-0.080,0.080,0.162,0.244];
0172
0173 launchs{2}.m0 = [0];
0174 launchs{2}.phi0 = [0];
0175 launchs{2}.i_ref = -1;
0176 launchs{2}.LFS = [1];
0177 launchs{2}.mmode = -1;
0178
0179
0180
0181 elseif strcmp(conf,'CIEL') | strcmp(conf,'CIEL (TS)') ;
0182
0183
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;
0196
0197 directivity = [0.6];
0198
0199 [Plhtot,Npar0] = lhspectrum_cronos(directivity,signe,cons(1),lob);
0200 launchs{1}.bPlhtot = Plhtot;
0201 launchs{1}.bNpar0 = Npar0;
0202
0203 launchs{1}.bdNpar0 = [0.2]*ones(size(Npar0));
0204
0205 launchs{1}.rZ0 = [-0.155,-0.075,0.075,0.155];
0206
0207 launchs{1}.m0 = [0];
0208 launchs{1}.phi0 = [0];
0209 launchs{1}.i_ref = -1;
0210 launchs{1}.LFS = [1];
0211 launchs{1}.mmode = -1;
0212
0213
0214
0215 launchs{2}.id = 'Coupleur_C3';
0216 launchs{2}.type = 'LH';
0217 launchs{2}.omega_rf = freqlh(2)*2*pi*1e9;
0218
0219 directivity = [0.6];
0220
0221 [Plhtot,Npar0] = lhspectrum_cronos(directivity,signe,cons(2),lob);
0222 launchs{2}.bPlhtot = Plhtot;
0223 launchs{2}.bNpar0 = Npar0;
0224
0225 launchs{2}.bdNpar0 = [0.2]*ones(size(Npar0));
0226
0227 launchs{2}.rZ0 = [-0.244,-0.162,-0.080,0.080,0.162,0.244];
0228
0229 launchs{2}.m0 = [0];
0230 launchs{2}.phi0 = [0];
0231 launchs{2}.i_ref = -1;
0232 launchs{2}.LFS = [1];
0233 launchs{2}.mmode = -1;
0234
0235
0236
0237 elseif strcmp(conf,'CMOD');
0238
0239
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;
0248
0249 directivity = [1.0];
0250
0251 [Plhtot,Npar0] = lhspectrum_cronos(directivity,signe,cons,lob);
0252 launchs{1}.bPlhtot = Plhtot;
0253 launchs{1}.bNpar0 = Npar0;
0254
0255 launchs{1}.bdNpar0 = [0.2]*ones(size(Npar0));
0256
0257 launchs{1}.rZ0 = [0,0,0,0];
0258
0259 launchs{1}.m0 = [0];
0260 launchs{1}.phi0 = [0];
0261 launchs{1}.i_ref = -1;
0262 launchs{1}.LFS = [1];
0263 launchs{1}.mmode = -1;
0264
0265
0266
0267 elseif strcmp(conf,'JET');
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
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;
0282
0283 directivity = [0.7];
0284
0285 [Plhtot,Npar0] = lhspectrum_cronos(directivity,signe,cons(1),lob);
0286 launchs{1}.bPlhtot = Plhtot;
0287 launchs{1}.bNpar0 = Npar0;
0288
0289 launchs{1}.bdNpar0 = 0.2*ones(size(Npar0));
0290
0291 launchs{1}.rZ0 = [0.370 0.222 0.074 -0.074 -0.222 -0.370];
0292
0293 launchs{1}.m0 = [0];
0294 launchs{1}.phi0 = [0];
0295 launchs{1}.i_ref = -2;
0296 launchs{1}.LFS = [1];
0297 launchs{1}.mmode = -1;
0298
0299
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;
0305
0306 directivity = [0.7];
0307
0308 [Plhtot,Npar0] = lhspectrum_cronos(directivity,signe,cons(2),lob);
0309 launchs{2}.bPlhtot = Plhtot;
0310 launchs{2}.bNpar0 = Npar0;
0311
0312 launchs{2}.bdNpar0 = 0.2*ones(size(Npar0));
0313
0314 launchs{2}.rZ0 = [0.370 0.222 0.074 -0.074 -0.222 -0.370];
0315
0316 launchs{2}.m0 = [0];
0317 launchs{2}.phi0 = [0];
0318 launchs{2}.i_ref = -2;
0319 launchs{2}.LFS = [1];
0320 launchs{2}.mmode = -1;
0321 end
0322
0323
0324
0325
0326 elseif strcmp(conf,'ITER');
0327
0328
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;
0337
0338 directivity = [0.7];
0339
0340 [Plhtot,Npar0] = lhspectrum_cronos(directivity,signe,cons(1),lob);
0341 launchs{1}.bPlhtot = Plhtot;
0342 launchs{1}.bNpar0 = Npar0;
0343
0344 launchs{1}.bdNpar0 = [0.2]*ones(size(Npar0));
0345
0346 launchs{1}.rZ0 = [0.15,1.15];
0347
0348 launchs{1}.m0 = [0];
0349 launchs{1}.phi0 = [0];
0350 launchs{1}.i_ref = -1;
0351 launchs{1}.LFS = [1];
0352 launchs{1}.mmode = -1;
0353
0354
0355
0356
0357
0358
0359
0360
0361
0362
0363
0364
0365
0366
0367
0368
0369
0370
0371
0372
0373
0374
0375
0376
0377
0378
0379
0380 elseif strcmp(conf,'FTU')
0381
0382
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;
0391
0392 directivity = [0.85];
0393
0394 [Plhtot,Npar0] = lhspectrum_cronos(directivity,signe,cons(1),lob);
0395 launchs{1}.bPlhtot = Plhtot;
0396 launchs{1}.bNpar0 = Npar0;
0397
0398 launchs{1}.bdNpar0 = [0.2]*ones(size(Npar0));
0399
0400 launchs{1}.rZ0 = [0];
0401
0402 launchs{1}.m0 = [0];
0403 launchs{1}.phi0 = [0];
0404 launchs{1}.i_ref = -1;
0405 launchs{1}.LFS = [1];
0406 launchs{1}.mmode = -1;
0407
0408
0409
0410 elseif strcmp(conf,'SST1')
0411
0412
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;
0421
0422 directivity = [0.75];
0423
0424 [Plhtot,Npar0] = lhspectrum_cronos(directivity,signe,cons(1),lob);
0425 launchs{1}.bPlhtot = Plhtot;
0426 launchs{1}.bNpar0 = Npar0;
0427
0428 launchs{1}.bdNpar0 = [0.2]*ones(size(Npar0));
0429
0430 launchs{1}.rZ0 = [0];
0431
0432 launchs{1}.m0 = [0];
0433 launchs{1}.phi0 = [0];
0434 launchs{1}.i_ref = -1;
0435 launchs{1}.LFS = [1];
0436 launchs{1}.mmode = -1;
0437
0438
0439
0440 elseif strcmp(conf,'DEMO')
0441
0442
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;
0451
0452 directivity = [0.7];
0453
0454 [Plhtot,Npar0] = lhspectrum_cronos(directivity,signe,cons(1),lob);
0455 launchs{1}.bPlhtot = Plhtot;
0456 launchs{1}.bNpar0 = Npar0;
0457
0458 launchs{1}.bdNpar0 = [0.2]*ones(size(Npar0));
0459
0460 launchs{1}.rZ0 = [0];
0461
0462 launchs{1}.m0 = [0];
0463 launchs{1}.phi0 = [0];
0464 launchs{1}.i_ref = -1;
0465 launchs{1}.LFS = [1];
0466 launchs{1}.mmode = -1;
0467
0468
0469
0470 launchs{2}.id = 'Antenna_2';
0471 launchs{2}.type = 'LH';
0472 launchs{2}.omega_rf = freqlh(2)*2*pi*1e9;
0473
0474 directivity = [0.7];
0475
0476 [Plhtot,Npar0] = lhspectrum_cronos(directivity,signe,cons(2),lob);
0477 launchs{2}.bPlhtot = Plhtot;
0478 launchs{2}.bNpar0 = Npar0;
0479
0480 launchs{2}.bdNpar0 = [0.2]*ones(size(Npar0));
0481
0482 launchs{2}.rZ0 = [0];
0483
0484 launchs{2}.m0 = [0];
0485 launchs{2}.phi0 = [0];
0486 launchs{2}.i_ref = -1;
0487 launchs{2}.LFS = [1];
0488 launchs{2}.mmode = -1;
0489
0490
0491
0492 elseif strcmp(conf,'COMPASS');
0493
0494
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;
0503
0504 directivity = [0.7];
0505
0506 [Plhtot,Npar0] = lhspectrum_cronos(directivity,signe,cons(1),lob);
0507 launchs{1}.bPlhtot = Plhtot;
0508 launchs{1}.bNpar0 = Npar0;
0509
0510 launchs{1}.bdNpar0 = [0.2]*ones(size(Npar0));
0511
0512 launchs{1}.rZ0 = [-0.0535;0.0001;0.0535];
0513
0514 launchs{1}.m0 = [0];
0515 launchs{1}.phi0 = [0];
0516 launchs{1}.i_ref = -1;
0517 launchs{1}.LFS = [1];
0518 launchs{1}.mmode = -1;
0519
0520 elseif strcmp(conf,'AUG') || strcmp(conf,'ASDEX');
0521
0522
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;
0531
0532 directivity = [0.7];
0533
0534 [Plhtot,Npar0] = lhspectrum_cronos(directivity,signe,cons(1),lob);
0535 launchs{1}.bPlhtot = Plhtot;
0536 launchs{1}.bNpar0 = Npar0;
0537
0538 launchs{1}.bdNpar0 = [0.5]*ones(size(Npar0));
0539
0540 launchs{1}.rZ0 = [linspace(-0.35,-0.05,6) linspace(0.05,0.35,6)];
0541
0542 launchs{1}.m0 = [0];
0543 launchs{1}.phi0 = [0];
0544 launchs{1}.i_ref = -1;
0545 launchs{1}.LFS = [1];
0546 launchs{1}.mmode = -1;
0547
0548
0549
0550 launchs{2}.id = 'Antenna_2';
0551 launchs{2}.type = 'LH';
0552 launchs{2}.omega_rf = [3.7]*2*pi*1e9;
0553
0554 directivity = [0.7];
0555
0556 [Plhtot,Npar0] = lhspectrum_cronos(directivity,signe,cons(2),lob);
0557 launchs{2}.bPlhtot = Plhtot;
0558 launchs{2}.bNpar0 = Npar0;
0559
0560 launchs{2}.bdNpar0 = [0.5]*ones(size(Npar0));
0561
0562 launchs{2}.rZ0 = [linspace(-0.35,-0.05,6) linspace(0.05,0.35,6)];
0563
0564 launchs{2}.m0 = [0];
0565 launchs{2}.phi0 = [0];
0566 launchs{2}.i_ref = -1;
0567 launchs{2}.LFS = [1];
0568 launchs{2}.mmode = -1;
0569 elseif strcmp(conf,'EAST');
0570
0571
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;
0580
0581 directivity = [0.7];
0582
0583 [Plhtot,Npar0] = lhspectrum_cronos(directivity,signe,cons(1),lob);
0584 launchs{1}.bPlhtot = Plhtot;
0585 launchs{1}.bNpar0 = Npar0;
0586
0587 launchs{1}.bdNpar0 = [0.5]*ones(size(Npar0));
0588 launchs{1}.rZ0 = [-0.05 0 0.05];
0589
0590 launchs{1}.m0 = [0];
0591 launchs{1}.phi0 = [0];
0592 launchs{1}.i_ref = -1;
0593 launchs{1}.LFS = [1];
0594 launchs{1}.mmode = -1;
0595 else
0596 error('The launch configuration name does not exists')
0597 end
0598
0599
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;
0611 opt_optim = 0;
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;
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
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