-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdefineFloquetModesMATLAB
More file actions
33 lines (27 loc) · 1.24 KB
/
defineFloquetModesMATLAB
File metadata and controls
33 lines (27 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
function defineFloquetModes(mws, nModes)
% Check if FloquetPort exists
try
% Attempt to reset Floquet Port
invoke(mws, 'AddToHistory', 'Reset FloquetPort', 'With FloquetPort\n.Reset\nEnd With');
% Configure Zmin Port
zminCommands = sprintf(['With FloquetPort\n',...
'.Port "Zmin"\n',...
'.SetNumberOfModesConsidered "%d"\n',...
'.SetDistanceToReferencePlane "0.0"\n',...
'.SetUseCircularPolarization "False"\n',...
'End With'], nModes);
invoke(mws, 'AddToHistory', 'Configure Zmin Port', zminCommands);
% Configure Zmax Port
zmaxCommands = sprintf(['With FloquetPort\n',...
'.Port "Zmax"\n',...
'.SetNumberOfModesConsidered "%d"\n',...
'.SetDistanceToReferencePlane "0.0"\n',...
'.SetUseCircularPolarization "False"\n',...
'End With'], nModes);
invoke(mws, 'AddToHistory', 'Configure Zmax Port', zmaxCommands);
catch ME
% Handle errors related to object references
fprintf('Error occurred while defining Floquet modes: %s\n', ME.message);
disp('Ensure that the Floquet ports are properly defined in CST.');
end
end