30 #include "component.h"
34 cpwline::cpwline () :
circuit (2) {
48 else if (isinf (arg) && arg < 0) {
53 nr_double_t a,
b,
c, f,
s, fk = 1, fe = 1,
t, da =
arg;
56 fk = 1 /
sqrt (1 - arg);
58 da = -arg / (1 -
arg);
65 for (i = 0; i < iMax; i++) {
100 kp =
sqrt (1 - k * k);
116 void cpwline::initPropagation (
void) {
132 nr_double_t k1, kk1, kpk1, k2, k3, q1, q2, q3 = 0, qz, er0 = 0;
135 k1 = W / (W + s +
s);
153 er0 = 1 + q3 * qz * (er - 1);
154 zl_factor =
Z0 / 2 * qz;
164 er0 = 1 + (er - 1) / 2 * q2 / q1;
165 zl_factor =
Z0 / 4 / q1;
170 nr_double_t d, se, We, ke, qe;
171 d = (t * 1.25 /
M_PI) * (1 +
log (4 *
M_PI * W / t));
176 ke = We / (We + se + se);
185 er0 = 1 + q3 * qz * (er - 1);
186 zl_factor =
Z0 / 2 * qz;
190 zl_factor =
Z0 / 4 / qe;
194 er0 = er0 - (0.7 * (er0 - 1) * t / s) / (q1 + (0.7 * t /
s));
202 fte = (
C0 / 4) / (h *
sqrt (er - 1));
205 nr_double_t p =
log (W / h);
206 nr_double_t u = 0.54 - (0.64 - 0.015 * p) * p;
207 nr_double_t v = 0.43 - (0.86 - 0.54 * p) * p;
208 G =
exp (u *
log (W / s) + v);
214 nr_double_t
n = (1 - k1) * 8 *
M_PI / (t * (1 + k1));
215 nr_double_t a = W / 2;
216 nr_double_t
b = a +
s;
219 ac_factor = ac / (4 *
Z0 * kk1 * kpk1 * (1 - k1 * k1));
221 ad_factor = (er / (er - 1)) * tand *
M_PI /
C0;
223 bt_factor = 2 *
M_PI /
C0;
226 void cpwline::calcAB (nr_double_t f, nr_double_t& zl, nr_double_t& al,
228 nr_double_t sr_er_f = sr_er0;
229 nr_double_t ac = ac_factor;
230 nr_double_t ad = ad_factor;
236 sr_er_f += (sr_er - sr_er0) / (1 + G *
pow (f / fte, -1.8));
243 ad *= f * (sr_er_f - 1 / sr_er_f);
244 ac *=
sqrt (f) * sr_er0;
260 nr_double_t zl = zl_factor;
261 nr_double_t beta = bt_factor;
264 calcAB (frequency, zl, alpha, beta);
267 nr_double_t z = zl /
z0;
268 nr_double_t y = 1 / z;
282 nr_double_t t, nr_double_t er,
int backMetal,
283 nr_double_t& ZlEff, nr_double_t& ErEff) {
286 nr_double_t k1, k2, k3, q1, q2, q3 = 0, qz;
292 k1 = W / (W + s +
s);
300 ErEff = 1 + q3 * qz * (er - 1);
307 ErEff = 1 + (er - 1) / 2 * q2 / q1;
313 nr_double_t d, se, We, ke, qe;
314 d = (t * 1.25 /
M_PI) * (1 +
log (4 *
M_PI * W / t));
319 ke = We / (We + se + se);
325 ErEff = 1 + q3 * qz * (er - 1);
334 ErEff = ErEff - (0.7 * (ErEff - 1) * t / s) / (q1 + (0.7 * t /
s));
336 ErEff =
sqrt (ErEff);
344 nr_double_t er, nr_double_t ZlEff,
345 nr_double_t ErEff, nr_double_t frequency,
346 nr_double_t& ZlEffFreq,
347 nr_double_t& ErEffFreq) {
352 ZlEffFreq = ZlEff * ErEff;
355 fte = (
C0 / 4) / (h *
sqrt (er - 1));
358 nr_double_t p =
log (W / h);
359 nr_double_t u = 0.54 - (0.64 - 0.015 * p) * p;
360 nr_double_t v = 0.43 - (0.86 - 0.54 * p) * p;
361 G =
exp (u *
log (W / s) + v);
364 ErEffFreq += (
sqrt (er) - ErEff) / (1 + G *
pow (frequency / fte, -1.8));
367 ZlEffFreq /= ErEffFreq;
399 nr_double_t zl = zl_factor;
400 nr_double_t beta = bt_factor;
403 calcAB (frequency, zl, alpha, beta);