make_aloha_EAST_yp

PURPOSE ^

SYNOPSIS ^

function [antenna] = make_aloha_EAST_yp(aloha,antenna_measured)

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [antenna] = make_aloha_EAST_yp(aloha,antenna_measured)
0002 %
0003 optim.tolfun = 1e-2;% tolerance on targets
0004 optim.tolx = 1e-2;% tolerance on inputs
0005 optim.nitmax = 30;%
0006 %
0007 if size(aloha.power_in_modules,2) == 4, % 2.45 GHZ antenna
0008     sc = EAST_ALOHA_scenario_2dot45GHz;    
0009 elseif size(aloha.power_in_modules,2) == 6, % 4.60 GHZ antenna
0010     sc = EAST_ALOHA_scenario_4dot60GHz;
0011 else
0012     error('Wrong definition of EAST LH antenna')
0013 end
0014 %
0015 %
0016 % Calculate the coupling (ie the plasma impedance). Once the plasma impedance is calculated, because of the underlying linearity,
0017 % we can change the antenna excitation (power, phasing) to determine RC and power spectrum for a specific excitation. (J. Hillairet)
0018 %
0019 sc.antenna.a_ampl = sqrt(aloha.power_in_modules*1000);%power is given in kW form external (first row is considered for coupling calculations)
0020 sc.antenna.a_phase = pi*aloha.module_phasing/180;
0021 %
0022 if isfield(antenna_measured,'edge_ne') & isfield(antenna_measured,'rc')
0023     calcspectrum_opt = input_dke_yp('Calculation of the ALOHA power spectrum from edge density [0] or reflection coefficient [1] in external structure or from manual data input [2] ? ',0,0:2,'',[1,1]);
0024 elseif isfield(antenna_measured,'edge_ne') & ~isfield(antenna_measured,'rc')
0025     calcspectrum_opt = input_dke_yp('Calculation of the ALOHA power spectrum from edge density [0] in external structure or from manual data input [1] ? ',0,0:1,'',[1,1]);
0026     if calcspectrum_opt == 1,
0027         calcspectrum_opt = 2;
0028     end
0029 elseif ~isfield(antenna_measured,'edge_ne') & isfield(antenna_measured,'rc')
0030     calcspectrum_opt = input_dke_yp('Calculation of the ALOHA power spectrum from reflection coefficient [0] in external structure or from manual data input [1] ? ',0,0:1,'',[1,1]);
0031     if calcspectrum_opt == 1,
0032         calcspectrum_opt = 2;
0033     end
0034 elseif ~isfield(antenna_measured,'edge_ne') & ~isfield(antenna_measured,'rc')
0035     calcspectrum_opt = 2;
0036 end
0037 %
0038 if calcspectrum_opt == 0,
0039     edge_ne = antenna_measured.edge_ne;
0040     rc = '';
0041 elseif calcspectrum_opt == 1,
0042     edge_ne = '';
0043     %
0044     if size(aloha.power_in_modules,1) > 1,% all rows are considered
0045         if size(aloha.power_in_modules) == size(antenna_measured.rc)
0046             rc = antenna_measured.rc;
0047         else
0048             if size(antenna_measured.rc,1) == 1 || size(antenna_measured.rc,2) == 1
0049                 rc = ones(size(aloha.power_in_modules,1),1)*antenna_measured.rc(:)';
0050                 if size(aloha.power_in_modules) ~= size(rc)
0051                     error('Measured RC coefficients data for EAST LH antenna are inconsistent');
0052                 end
0053             else
0054                 error('Measured RC coefficients data for EAST LH antenna are inconsistent');
0055             end
0056         end
0057     else
0058         rc = antenna_measured.rc;            
0059     end
0060     %
0061     optim.tolfun = input_dke_yp('Termination tolerance on the function value ? ',optim.tolfun,'','',[1,1]);
0062     optim.tolx = input_dke_yp('Termination tolerance on x ? ',optim.tolx,'','',[1,1]);
0063     optim.nitmax = input_dke_yp('Maximum number of iterations allowed ? ',optim.nitmax,'','',[1,1]);
0064     init_ne = input_dke_yp('Initial density (low density side (1e17 m-3) or high density side (5e18 m-3) ? ',1e17,'','',[1,1]);%to be far from a possible minimum in RC as finction of ne
0065     %
0066     sc.plasma.ne0 = init_ne;
0067     %
0068 elseif calcspectrum_opt == 2,
0069     edge_ne = input_dke_yp('Edge density in front of the antenna ? ',1e18,'','',[1,1]);
0070     rc = '';
0071 end
0072 %
0073 opt_gui = false;
0074 select.style = struct;
0075 %
0076 dkepath = load_structures_yp('dkepath','','');
0077 %
0078 scheduler.remnum = iselect_jd(dkepath.remprofiles,'Remote calculation mode (mdce_remote): ',opt_gui,select.style,1)-1;
0079 if scheduler.remnum == 0,%local distribution
0080     flag_mdce = 1:length(dkepath.distprofiles);% all mdce modes
0081 else
0082     flag_mdce = 1:3;% remcomputing within mdce_remote disabled
0083 end        
0084 %
0085 scheduler.mode = iselect_jd(dkepath.distprofiles(flag_mdce),'Distributed computing mode : ',opt_gui,select.style,1) - 1;
0086 %
0087 if scheduler.mode > 2,
0088    scheduler.mode = 2 - scheduler.mode;
0089 end
0090 %
0091 antenna = build_aloha_power_spectrum_yp(sc,edge_ne,rc,optim,dkepath,scheduler);
0092 %
0093 if ~isfield(antenna,'job')
0094     %
0095     if size(aloha.power_in_modules,1) > 1
0096         %
0097         RC{1} = antenna.aloha.results.RC;
0098         dP_nz{1} = antenna.aloha.results.dP_nz;
0099         %
0100         for ii=2:size(aloha.power_in_modules,1)
0101             %
0102             antenna.aloha.antenna.a_ampl = sqrt(aloha.power_in_modules(ii,:)*1000)';%power is given in kW form external (first row is considered for coupling calculations)
0103             antenna.aloha.antenna.a_phase = pi*aloha.module_phasing(ii,:)'/180;
0104             %
0105             antenna.aloha = aloha_compute_RC(antenna.aloha); % update RC coefficients
0106             antenna.aloha = aloha_compute_spectrum(antenna.aloha);% update power spectrum coefficients
0107             %
0108             RC{ii} = antenna.aloha.results.RC;
0109             dP_nz{ii} = antenna.aloha.results.dP_nz;
0110             %
0111         end
0112     end 
0113     %
0114     antenna.aloha.results.RC = RC;
0115     antenna.aloha.results.dP_nz = dP_nz;
0116     %
0117 end
0118 
0119 
0120 
0121

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