-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathanisotropicTL.m
122 lines (102 loc) · 3.02 KB
/
anisotropicTL.m
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
function TL = anisotropicTL(RES,DEV,SIG)
% anisotropicTL: Anisotropic transmission line analysis.
%
% INPUT ARGUMENTS
% ==============================================================================
% RES Grid resolution
% RES(1) Resolution along x
% RES(2) Resolution along y
%
% DEV Device structure
% .ERxx Permittivity tensor
% .ERxy Permittivity tensor
% .ERyx Permittivity tensor
% .ERyy Permittivity tensor
%
% SIG Conductor structure
% .GND Ground plane matrix
% .SIG1 Signal 1 matrix
% .SIGn nth Signal matrix
% .V Array containing forced potential values for each conductor. ...
% nSIG + GND = lenght(SIG.V)
%
% OUTPUT ARGUMENTS
% ==============================================================================
% TL Transmission line analysis results
% .V Electric Potential
% .Ex Electric field intensity along x
% .Ey Electric field intensity along y
% .C Distributed capacitance of transmission line
% .L Distributed inductance of transmission line
% .Z0 Characteristic impedance of transmission line
% .nEff Effective refractive index of transmission line
% Units and constants
seconds = 1;
meters = 1;
e0 = 8.8541878176e-12 * 1/meters;
c0 = 299792458 * meters/seconds;
% Extract Parameters
dx = RES(1);
dy = RES(2);
[Nx, Ny] = size(SIG.GND);
M = Nx*Ny;
I = speye(M,M);
% Determine number of signal traces
pot = SIG.V;
SIG = rmfield(SIG,'V');
signals = fieldnames(SIG);
nSig = length(signals);
% Construct derivative matrix operators
NS = [Nx Ny];
BC = [0 0];
[DVX,DVY,DEX,DEY] = yeeder(NS,RES,BC);
% Form interpolation matrix from derivative operators
RXP = (dx/2)*abs(DVX);
RYM = (dy/2)*abs(DEY);
R = RXP*RYM;
% Diagonalize material tensors
ERxx = diag(sparse(DEV.ERxx(:)));
ERxy = diag(sparse(DEV.ERxy(:)));
ERyx = diag(sparse(DEV.ERyx(:)));
ERyy = diag(sparse(DEV.ERyy(:)));
% Construct composite tensor
ER = [ERxx , R*ERxy ; R'*ERyx , ERyy];
% Build inhomogeneous case
L = [DEX DEY] * ER * [DVX ; DVY];
% Build homogeneous case
Lh = [DEX DEY] * [DVX ; DVY];
% Force known potentials
F = zeros(Nx,Ny);
vf = F;
for i = 1 : nSig
F = F | SIG.(char(signals(i)));
vf = vf + pot(i)*SIG.(char(signals(i)));
end
F = diag(sparse(F(:)));
L = (I - F)*L + F;
Lh = (I - F)*Lh + F;
b = F*vf(:);
% Compute potentials
v = L\b;
vh = Lh\b;
% Compute E Fields
e = -[DVX ; DVY]*v;
eh = -[DVX ; DVY]*vh;
% Compute D fields
d = ER*e;
dh = eh;
% Compute TL parameters
TL.C = (e0*dx*dy) * d' * e; % Distributed capacitance
Ch = (e0*dx*dy) * dh' * eh;
TL.L = 1/(c0^2*Ch); % Distributed inductance
TL.Z0 = sqrt(TL.L/TL.C); % Characteristic impedance
% Obtain fields
TL.Ex = e(1:M);
TL.Ey = e(M+1:2*M);
% Reshape to 2D Grid
TL.V = reshape(v,Nx,Ny);
TL.Ex = reshape(TL.Ex,Nx,Ny);
TL.Ey = reshape(TL.Ey,Nx,Ny);
% Calculate effective refractive index
TL.nEff = c0*sqrt(TL.L*TL.C);
end