-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathA_parseHFSSdata.m
More file actions
73 lines (60 loc) · 2.17 KB
/
Copy pathA_parseHFSSdata.m
File metadata and controls
73 lines (60 loc) · 2.17 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
%{
A_parseHFSSdata.m
this script processes simulation data from HFSS into a standard format for
computing tradeoffs between directivity and sensitivity. the output data
structure format exactly matches data produced by AToM, so the two datasets
can be used in all subsequent scripts for comparison between FEM (HFSS) and
MoM (AToM).
input data:
data/hfss-data
network.s21p
S-parameter data at a single frequency of interest
pattern-X.csv
single polarization electric field data in a
single cut plane.
output data:
data/opdata-MeshedHalfWaveDipolesHFSS.mat
contains R, U, F, and other relevant data for directivity /
sensitivity tradeoffs
%}
close all
clear
clc
% constants
% -------------------------------------------------------------------------
c0 = 299792458; % speed of light
N = 21; % number of dipoles
powCorrFactor = 2; % power correction factor to ensure 1 W normalization
phi0 = 0; % endfire observation angle
a = 2.5124; % smallest circumscribing sphere radius (m)
% construct radiation matrix R0 from HFSS S-parameters
% -------------------------------------------------------------------------
data = sparameters(['data/hfss-data/network.s',num2str(N),'p']);
fList = data.Frequencies;
S = data.Parameters;
Z = s2z(S,50);
R0 = 2*(eye(size(S))-S'*S)/powCorrFactor;
% construct F (single angle) and FthPatt (cutplane) operators from HFSS
% pattern data
% -------------------------------------------------------------------------
for n = 1:N
data = readmatrix(['data/hfss-data/pattern-',num2str(n),'.csv']);
FthPatt(:,n) = data(:,5)/sqrt(powCorrFactor)+1j*data(:,4)/sqrt(powCorrFactor);
end
angleVec = data(:,3)*pi/180;
[~,idx] = min(abs(angleVec-phi0));
F = FthPatt(idx,:);
% package and save output
% -------------------------------------------------------------------------
OP.zPort = Z;
OP.sPort = S;
OP.R0 = R0;
OP.F = F;
OP.FthPatt = FthPatt;
OP.FphPatt = 0*FthPatt;
OPsweep{1} = OP;
kList = 2*pi*fList/c0;
lambdaList = 2*pi./kList;
nDOF = N;
nka = 1;
save('data/opdata-MeshedHalfWaveDipolesHFSS.mat','OPsweep','a','fList','kList','lambdaList','nDOF','nka','angleVec')