29 #include "component.h"
34 mscoupled::mscoupled () :
circuit (4) {
56 nr_double_t Zle, ErEffe, Zlo, ErEffo;
60 nr_double_t ZleFreq, ErEffeFreq, ZloFreq, ErEffoFreq;
61 analyseDispersion (W, h, s, er, Zle, Zlo, ErEffe, ErEffo, frequency, DModel,
62 ZleFreq, ZloFreq, ErEffeFreq, ErEffoFreq);
65 nr_double_t ace, aco, ade, ado;
67 frequency,
"Hammerstad", ace, ade);
69 frequency,
"Hammerstad", aco, ado);
72 nr_double_t k0 = 2 *
M_PI * frequency /
C0;
75 be =
sqrt (ErEffeFreq) * k0;
76 bo =
sqrt (ErEffoFreq) * k0;
103 De = 2 * ze *
z0 *
cosh (ge * l) + Ee;
104 Do = 2 * zo *
z0 *
cosh (go * l) + Eo;
137 nr_double_t
t, nr_double_t er,
138 char * SModel, nr_double_t& Zle,
139 nr_double_t& Zlo, nr_double_t& ErEffe,
140 nr_double_t& ErEffo) {
142 ErEffe = ErEffo = er;
143 Zlo = 42.2; Zle = 55.7;
146 nr_double_t u = W / h;
147 nr_double_t g = s / h;
150 if (!strcmp (SModel,
"Hammerstad")) {
151 nr_double_t Zl1, Fe, Fo, a,
b, fo, Mu, Alpha, Beta, ErEff;
152 nr_double_t Pe, Po, r, fo1, q, p,
n, Psi, Phi, m, Theta;
155 m = 0.2175 +
pow (4.113 +
pow (20.36 / g, 6), -0.251) +
156 log (
pow (g, 10) / (1 +
pow (g / 13.8, 10))) / 323;
157 Alpha = 0.5 *
exp (-g);
158 Psi = 1 + g / 1.45 +
pow (g, 2.09) / 3.95;
159 Phi = 0.8645 *
pow (u, 0.172);
160 Pe = Phi / (Psi * (Alpha *
pow (u, m) + (1 - Alpha) *
pow (u, -m)));
164 n = (1 / 17.7 +
exp (-6.424 - 0.76 *
log (g) -
pow (g / 0.23, 5))) *
165 log ((10 + 68.3 *
sqr (g)) / (1 + 32.5 *
pow (g, 3.093)));
166 Beta = 0.2306 +
log (
pow (g, 10) / (1 +
pow (g / 3.73, 10))) / 301.8 +
167 log (1 + 0.646 *
pow (g, 1.175)) / 5.3;
168 Theta = 1.729 + 1.175 *
log (1 + 0.627 / (g + 0.327 *
pow (g, 2.17)));
169 Po = Pe - Theta / Psi *
exp (Beta *
pow (u, -n) *
log (u));
172 r = 1 + 0.15 * (1 -
exp (1 -
sqr (er - 1) / 8.2) / (1 +
pow (g, -6)));
173 fo1 = 1 -
exp (-0.179 *
pow (g, 0.15) -
175 q =
exp (-1.366 - g);
179 Mu = g *
exp (-g) + u * (20 +
sqr (g)) / (10 +
sqr (g));
181 Fe =
pow (1 + 10 / Mu, -a * b);
183 Fo = fo *
pow (1 + 10 / u, -a * b);
186 ErEffe = (er + 1) / 2 + (er - 1) / 2 * Fe;
187 ErEffo = (er + 1) / 2 + (er - 1) / 2 * Fo;
192 Zl1 =
Z0 / (u + 1.98 *
pow (u, 0.172));
199 Zle = Zl1 / (1 - Zl1 * Pe /
Z0);
200 Zlo = Zl1 / (1 - Zl1 * Po /
Z0);
203 else if (!strcmp (SModel,
"Kirschning")) {
204 nr_double_t a,
b, ae, be, ao, bo, v, co, d, ErEff, Zl1;
205 nr_double_t q1, q2, q3, q4, q5, q6, q7, q8, q9, q10;
210 if (t != 0 && s > 10 * (2 * t)) {
214 dW = t * (1 +
log (2 * h / t)) /
M_PI;
218 nr_double_t dt = 2 * t * h / s / er;
219 nr_double_t We = W + dW * (1 - 0.5 *
exp (-0.69 * dW / dt));
220 nr_double_t Wo = We + dt;
226 v = ue * (20 +
sqr (g)) / (10 +
sqr (g)) + g *
exp (-g);
233 d = 0.593 + 0.694 *
exp (-0.562 * uo);
234 bo = 0.747 * er / (0.15 + er);
235 co = bo - (bo - 0.207) *
exp (-0.414 * uo);
236 ao = 0.7287 * (ErEff - (er + 1) / 2) * (1 -
exp (-0.179 * uo));
237 ErEffo = ((er + 1) / 2 + ao - ErEff) *
exp (-co *
pow (g, d)) + ErEff;
244 q1 = 0.8695 *
pow (ue, 0.194);
245 q2 = 1 + 0.7519 * g + 0.189 *
pow (g, 2.31);
246 q3 = 0.1975 +
pow (16.6 +
pow (8.4 / g, 6), -0.387) +
247 log (
pow (g, 10) / (1 +
pow (g / 3.4, 10))) / 241;
249 (
exp (-g) *
pow (ue, q3) + (2 -
exp (-g)) *
pow (ue, -q3));
250 Zle =
sqrt (ErEff / ErEffe) * Zl1 / (1 - Zl1 *
sqrt (ErEff) * q4 /
Z0);
253 q5 = 1.794 + 1.14 *
log (1 + 0.638 / (g + 0.517 *
pow (g, 2.43)));
254 q6 = 0.2305 +
log (
pow (g, 10) / (1 +
pow (g / 5.8, 10))) / 281.3 +
255 log (1 + 0.598 *
pow (g, 1.154)) / 5.1;
256 q7 = (10 + 190 *
sqr (g)) / (1 + 82.3 *
cubic (g));
257 q8 =
exp (-6.5 - 0.95 *
log (g) -
pow (g / 0.15, 5));
258 q9 =
log (q7) * (q8 + 1 / 16.5);
259 q10 = (q2 * q4 - q5 *
exp (
log (uo) * q6 *
pow (uo, -q9))) / q2;
260 Zlo =
sqrt (ErEff / ErEffo) * Zl1 / (1 - Zl1 *
sqrt (ErEff) * q10 /
Z0);
268 nr_double_t er, nr_double_t Zle,
269 nr_double_t Zlo, nr_double_t ErEffe,
270 nr_double_t ErEffo, nr_double_t frequency,
271 char * DModel, nr_double_t& ZleFreq,
272 nr_double_t& ZloFreq,
273 nr_double_t& ErEffeFreq,
274 nr_double_t& ErEffoFreq) {
283 nr_double_t u = W / h;
284 nr_double_t g = s / h;
287 if (!strcmp (DModel,
"Getsinger")) {
290 frequency, ErEffeFreq, ZleFreq);
294 frequency, ErEffoFreq, ZloFreq);
298 else if (!strcmp (DModel,
"Kirschning")) {
299 nr_double_t p1, p2, p3, p4, p5, p6, p7, Fe;
300 nr_double_t fn = frequency * h * 1
e-6;
303 p1 = 0.27488 * (0.6315 + 0.525 /
pow (1 + 0.0157 * fn, 20)) * u -
304 0.065683 *
exp (-8.7513 * u);
305 p2 = 0.33622 * (1 -
exp (-0.03442 * er));
306 p3 = 0.0363 *
exp (-4.6 * u) * (1 -
exp (-
pow (fn / 38.7, 4.97)));
307 p4 = 1 + 2.751 * (1 -
exp (-
pow (er / 15.916, 8)));
308 p5 = 0.334 *
exp (-3.3 *
cubic (er / 15)) + 0.746;
309 p6 = p5 *
exp (-
pow (fn / 18, 0.368));
310 p7 = 1 + 4.069 * p6 *
pow (g, 0.479) *
311 exp (-1.347 *
pow (g, 0.595) - 0.17 *
pow (g, 2.5));
312 Fe = p1 * p2 *
pow ((p3 * p4 + 0.1844 * p7) * fn, 1.5763);
313 ErEffeFreq = er - (er - ErEffe) / (1 + Fe);
316 nr_double_t p8, p9, p10, p11, p12, p13, p14, p15, Fo;
317 p8 = 0.7168 * (1 + 1.076 / (1 + 0.0576 * (er - 1)));
318 p9 = p8 - 0.7913 * (1 -
exp (- pow (fn / 20, 1.424))) *
319 atan (2.481 * pow (er / 8, 0.946));
320 p10 = 0.242 *
pow (er - 1, 0.55);
321 p11 = 0.6366 * (
exp (-0.3401 * fn) - 1) *
322 atan (1.263 * pow (u / 3, 1.629));
323 p12 = p9 + (1 - p9) / (1 + 1.183 * pow (u, 1.376));
324 p13 = 1.695 * p10 / (0.414 + 1.605 * p10);
325 p14 = 0.8928 + 0.1072 * (1 -
exp (-0.42 * pow (fn / 20, 3.215)));
326 p15 = fabs (1 - 0.8928 * (1 + p11) *
327 exp (-p13 * pow (g, 1.092)) * p12 / p14);
328 Fo = p1 * p2 *
pow ((p3 * p4 + 0.1844) * fn * p15, 1.5763);
329 ErEffoFreq = er - (er - ErEffo) / (1 + Fo);
332 nr_double_t
t, q11, q12, q13, q14, q15, q16, q17, q18, q19, q20, q21;
333 q11 = 0.893 * (1 - 0.3 / (1 + 0.7 * (er - 1)));
334 t =
pow (fn / 20, 4.91);
335 q12 = 2.121 * t / (1 + q11 *
t) * exp (-2.87 * g) *
pow (g, 0.902);
336 q13 = 1 + 0.038 *
pow (er / 8, 5.1);
338 q14 = 1 + 1.203 * t / (1 +
t);
339 q15 = 1.887 *
exp (-1.5 * pow (g, 0.84)) *
pow (g, q14) /
340 (1 + 0.41 *
pow (fn / 15, 3) *
341 pow (u, 2 / q13) / (0.125 +
pow (u, 1.626 / q13)));
342 q16 = q15 * (1 + 9 / (1 + 0.403 *
sqr (er - 1)));
343 q17 = 0.394 * (1 -
exp (-1.47 * pow (u / 7, 0.672))) *
344 (1 - exp (-4.25 * pow (fn / 20, 1.87)));
345 q18 = 0.61 * (1 -
exp (-2.31 * pow (u / 8, 1.593))) /
346 (1 + 6.544 * pow (g, 4.17));
347 q19 = 0.21 *
quadr (g) / (1 + 0.18 *
pow (g, 4.9)) / (1 + 0.1 *
sqr (u)) /
348 (1 + pow (fn / 24, 3));
349 q20 = q19 * (0.09 + 1 / (1 + 0.1 *
pow (er - 1, 2.7)));
351 q21 = fabs (1 - 42.54 * pow (g, 0.133) * exp (-0.812 * g) * t /
354 nr_double_t re, qe, pe, de, Ce, q0, ZlFreq, ErEffFreq;
357 re =
pow (fn / 28.843, 12);
358 qe = 0.016 +
pow (0.0514 * er * q21, 4.524);
359 pe = 4.766 *
exp (-3.228 * pow (u, 0.641));
361 de = 5.086 * qe * re / (0.3838 + 0.386 * qe) *
362 exp (-22.2 * pow (u, 1.92)) / (1 + 1.2992 * re) * t / (1 + 10 *
t);
363 Ce = 1 + 1.275 * (1 -
exp (-0.004625 * pe * pow (er, 1.674) *
364 pow (fn / 18.365, 2.745))) - q12 + q16 - q17 + q18 + q20;
365 ZleFreq = Zle *
pow ((0.9408 * pow (ErEffFreq, Ce) - 0.9603) /
366 ((0.9408 - de) * pow (ErEffe, Ce) - 0.9603), q0);
369 nr_double_t q22, q23, q24, q25, q26, q27, q28, q29;
372 q29 = 15.16 / (1 + 0.196 *
sqr (er - 1));
374 q25 = 0.3 *
sqr (fn) / (10 +
sqr (fn)) * (1 + 2.333 * t / (5 + t));
375 t =
pow ((er - 1) / 13, 12);
376 q26 = 30 - 22.2 * t / (1 + 3 *
t) - q29;
377 t =
pow (er - 1, 1.5);
378 q27 = 0.4 *
pow (g, 0.84) * (1 + 2.5 * t / (5 +
t));
380 q28 = 0.149 * t / (94.5 + 0.038 *
t);
381 q22 = 0.925 *
pow (fn / q26, 1.536) / (1 + 0.3 *
pow (fn / 30, 1.536));
382 q23 = 1 + 0.005 * fn * q27 / (1 + 0.812 *
pow (fn / 15, 1.9)) /
383 (1 + 0.025 *
sqr (u));
385 q24 = 2.506 * q28 * t / (3.575 +
t) *
386 pow ((1 + 1.3 * u) * fn / 99.25, 4.29);
387 ZloFreq = ZlFreq + (Zlo *
pow (ErEffoFreq / ErEffo, q22) - ZlFreq * q23) /
388 (1 + q24 + pow (0.46 * g, 2.2) * q25);
400 if (t != 0.0 && rho != 0.0) {
402 nr_double_t g = t * W / rho / l;
438 De = 0.5 / (ze *
sinh (ge * l));
439 Do = 0.5 / (zo *
sinh (go * l));