46 if (aux_ms)
delete aux_ms;
57 double c_microstrip::delta_u_thickness_single(
double u,
double t_h)
62 delta_u = (1.25 * t_h /
M_PI) * (1.0 +
log((2.0 + (4.0 *
M_PI * u - 2.0) / (1.0 +
exp(-100.0 * (u - 1.0 / (2.0 *
M_PI))))) / t_h));
78 void c_microstrip::delta_u_thickness()
80 double e_r, u, g, t_h;
81 double delta_u, delta_t, delta_u_e, delta_u_o;
90 delta_u = delta_u_thickness_single(u, t_h);
91 delta_t = t_h / (g * e_r);
93 delta_u_e = delta_u * (1.0 - 0.5 *
exp(-0.69 * delta_u / delta_t));
94 delta_u_o = delta_u_e + delta_t;
96 delta_u_e = delta_u_o = 0.0;
99 w_t_e = w + delta_u_e * h;
100 w_t_o = w + delta_u_o * h;
106 void c_microstrip::compute_single_line()
109 double Z0_single, er_eff_single;
126 aux_ms->microstrip_Z0();
127 aux_ms->dispersion();
129 er_eff_single = aux_ms->er_eff_0;
130 Z0_single = aux_ms->Z0_0;
138 double c_microstrip::filling_factor_even(
double u,
double g,
double e_r)
140 double v, v3, v4, a_e, b_e, q_inf;
142 v = u * (20.0 + g * g) / (10.0 + g * g) + g *
exp(-g);
145 a_e = 1.0 +
log((v4 + v * v / 2704.0) / (v4 + 0.432)) / 49.0 +
log(1.0 + v3 / 5929.741)
147 b_e = 0.564 *
pow(((e_r - 0.9) / (e_r + 3.0)), 0.053);
150 q_inf =
pow((1.0 + 10.0 / v), -a_e * b_e);
159 double c_microstrip::filling_factor_odd(
double u,
double g,
double e_r)
161 double b_o, c_o, d_o, q_inf;
163 b_o = 0.747 * e_r / (0.15 + e_r);
164 c_o = b_o - (b_o - 0.207) *
exp(-0.414 * u);
165 d_o = 0.593 + 0.694 *
exp(-0.562 * u);
168 q_inf =
exp(-c_o *
pow(g, d_o));
178 double c_microstrip::delta_q_cover_even(
double h2h)
183 q_c =
tanh(1.626 + 0.107 * h2h - 1.733 /
sqrt(h2h));
195 double c_microstrip::delta_q_cover_odd(
double h2h)
200 q_c =
tanh(9.575 / (7.0 - h2h) - 2.965 + 1.68 * h2h - 0.311 * h2h * h2h);
216 void c_microstrip::er_eff_static()
218 double u_t_e, u_t_o, g, h2, h2h;
219 double a_o, t_h, q, q_c, q_t, q_inf;
220 double er_eff_single;
223 compute_single_line();
224 er_eff_single = aux_ms->er_eff_0;
234 q_inf = filling_factor_even(u_t_e, g, er);
236 q_c = delta_q_cover_even(h2h);
238 q_t = aux_ms->delta_q_thickness(u_t_e, t_h);
240 q = (q_inf - q_t) * q_c;
242 er_eff_e_0 = 0.5 * (er + 1.0) + 0.5 * (er - 1.0) * q;
245 q_inf = filling_factor_odd(u_t_o, g, er);
247 q_c = delta_q_cover_odd(h2h);
249 q_t = aux_ms->delta_q_thickness(u_t_o, t_h);
251 q = (q_inf - q_t) * q_c;
253 a_o = 0.7287 * (er_eff_single - 0.5 * (er + 1.0)) * (1.0 -
exp(-0.179 * u_t_o));
256 er_eff_o_0 = (0.5 * (er + 1.0) + a_o - er_eff_single) * q + er_eff_single;
267 double c_microstrip::delta_Z0_even_cover(
double g,
double u,
double h2h)
269 double f_e, g_e, delta_Z0_even;
270 double x, y,
A,
B,
C,
D,
E, F;
272 A = -4.351 /
pow(1.0 + h2h, 1.842);
273 B = 6.639 /
pow(1.0 + h2h, 1.861);
274 C = -2.291 /
pow(1.0 + h2h, 1.90);
275 f_e = 1.0 -
atanh(A + (B + C * u) * u);
277 x =
pow(10.0, 0.103 * g - 0.159);
278 y =
pow(10.0, 0.0492 * g - 0.073);
279 D = 0.747 /
sin(0.5 *
M_PI * x);
280 E = 0.725 *
sin(0.5 *
M_PI * y);
281 F =
pow(10.0, 0.11 - 0.0947 * g);
282 g_e = 270.0 * (1.0 -
tanh(D + E *
sqrt(1.0 + h2h) - F / (1.0 + h2h)));
284 delta_Z0_even = f_e * g_e;
286 return delta_Z0_even;
297 double c_microstrip::delta_Z0_odd_cover(
double g,
double u,
double h2h)
299 double f_o, g_o, delta_Z0_odd;
302 J =
tanh(
pow(1.0 + h2h, 1.585) / 6.0);
305 G = 2.178 - 0.796 * g;
312 L = 2.51 *
pow(g, -0.462);
316 g_o = 270.0 * (1.0 -
tanh(G + K *
sqrt(1.0 + h2h) - L / (1.0 + h2h)));
318 delta_Z0_odd = f_o * g_o;
332 void c_microstrip::Z0_even_odd()
334 double er_eff, h2, u_t_e, u_t_o, g, h2h;
335 double Q_1, Q_2, Q_3, Q_4, Q_5, Q_6, Q_7, Q_8, Q_9, Q_10;
336 double delta_Z0_e_0, delta_Z0_o_0, Z0_single, er_eff_single;
344 Z0_single = aux_ms->Z0_0;
345 er_eff_single = aux_ms->er_eff_0;
349 Q_1 = 0.8695 *
pow(u_t_e, 0.194);
350 Q_2 = 1.0 + 0.7519 * g + 0.189 *
pow(g, 2.31);
351 Q_3 = 0.1975 +
pow((16.6 +
pow((8.4 / g), 6.0)), -0.387) +
log(
pow(g, 10.0) / (1.0 +
pow(g / 3.4, 10.0))) / 241.0;
352 Q_4 = 2.0 * Q_1 / (Q_2 * (
exp(-g) *
pow(u_t_e, Q_3) + (2.0 -
exp(-g)) *
pow(u_t_e, -Q_3)));
354 Z0_e_0 = Z0_single *
sqrt(er_eff_single / er_eff) / (1.0 -
sqrt(er_eff_single) * Q_4 * Z0_single /
ZF0);
356 delta_Z0_e_0 = delta_Z0_even_cover(g, u_t_e, h2h) /
sqrt(er_eff);
358 Z0_e_0 = Z0_e_0 - delta_Z0_e_0;
362 Q_5 = 1.794 + 1.14 *
log(1.0 + 0.638 / (g + 0.517 *
pow(g, 2.43)));
363 Q_6 = 0.2305 +
log(
pow(g, 10.0) / (1.0 +
pow(g / 5.8, 10.0))) / 281.3 +
log(1.0 + 0.598 *
pow(g, 1.154)) / 5.1;
364 Q_7 = (10.0 + 190.0 * g * g) / (1.0 + 82.3 * g * g * g);
365 Q_8 =
exp(-6.5 - 0.95 *
log(g) -
pow(g / 0.15, 5.0));
366 Q_9 =
log(Q_7) * (Q_8 + 1.0 / 16.5);
367 Q_10 = (Q_2 * Q_4 - Q_5 *
exp(
log(u_t_o) * Q_6 *
pow(u_t_o, -Q_9))) / Q_2;
370 Z0_o_0 = Z0_single *
sqrt(er_eff_single / er_eff) / (1.0 -
sqrt(er_eff_single) * Q_10 * Z0_single /
ZF0);
372 delta_Z0_o_0 = delta_Z0_odd_cover(g, u_t_o, h2h) /
sqrt(er_eff);
374 Z0_o_0 = Z0_o_0 - delta_Z0_o_0;
381 double c_microstrip::calc_mur_eff()
392 void c_microstrip::er_eff_freq()
394 double P_1, P_2, P_3, P_4, P_5, P_6, P_7;
395 double P_8, P_9, P_10, P_11, P_12, P_13, P_14, P_15;
397 double er_eff, u, g, f_n;
406 P_1 = 0.27488 + (0.6315 + 0.525 /
pow(1.0 + 0.0157 * f_n, 20.0)) * u - 0.065683 *
exp(-8.7513 * u);
407 P_2 = 0.33622 * (1.0 -
exp(-0.03442 * er));
408 P_3 = 0.0363 *
exp(-4.6 * u) * (1.0 -
exp(-
pow(f_n / 38.7, 4.97)));
409 P_4 = 1.0 + 2.751 * (1.0 -
exp(-
pow(er / 15.916, 8.0)));
410 P_5 = 0.334 *
exp(-3.3 *
pow(er / 15.0, 3.0)) + 0.746;
411 P_6 = P_5 *
exp(-
pow(f_n / 18.0, 0.368));
412 P_7 = 1.0 + 4.069 * P_6 *
pow(g, 0.479) *
exp(-1.347 *
pow(g, 0.595) - 0.17 *
pow(g, 2.5));
414 F_e = P_1 * P_2 *
pow((P_3 * P_4 + 0.1844 * P_7) * f_n, 1.5763);
416 er_eff_e = er - (er - er_eff) / (1.0 + F_e);
419 P_8 = 0.7168 * (1.0 + 1.076 / (1.0 + 0.0576 * (er - 1.0)));
420 P_9 = P_8 - 0.7913 * (1.0 -
exp(-
pow(f_n / 20.0, 1.424))) *
atan(2.481 *
pow(er / 8.0, 0.946));
421 P_10 = 0.242 *
pow(er - 1.0, 0.55);
422 P_11 = 0.6366 * (
exp(-0.3401 * f_n) - 1.0) *
atan(1.263 *
pow(u / 3.0, 1.629));
423 P_12 = P_9 + (1.0 - P_9) / (1.0 + 1.183 *
pow(u, 1.376));
424 P_13 = 1.695 * P_10 / (0.414 + 1.605 * P_10);
425 P_14 = 0.8928 + 0.1072 * (1.0 -
exp(-0.42 *
pow(f_n / 20.0, 3.215)));
426 P_15 = fabs(1.0 - 0.8928 * (1.0 + P_11) * P_12 *
exp(-P_13 *
pow(g, 1.092)) / P_14);
428 F_o = P_1 * P_2 *
pow((P_3 * P_4 + 0.1844) * f_n * P_15, 1.5763);
430 er_eff_o = er - (er - er_eff) / (1.0 + F_o);
437 void c_microstrip::conductor_losses()
439 double e_r_eff_e_0, e_r_eff_o_0, Z0_h_e, Z0_h_o, delta;
440 double K, R_s, Q_c_e, Q_c_o, alpha_c_e, alpha_c_o;
442 e_r_eff_e_0 = er_eff_e_0;
443 e_r_eff_o_0 = er_eff_o_0;
444 Z0_h_e = Z0_e_0 *
sqrt(e_r_eff_e_0);
445 Z0_h_o = Z0_o_0 *
sqrt(e_r_eff_o_0);
450 K =
exp(-1.2 *
pow((Z0_h_e + Z0_h_o) / (2.0 *
ZF0), 0.7));
452 R_s = 1.0 / (
sigma * delta);
454 R_s *= 1.0 + ((2.0 /
M_PI) *
atan(1.40 *
pow((rough / delta), 2.0)));
457 Q_c_e = (
M_PI * Z0_h_e * w *
f) / (R_s *
C0 * K);
459 alpha_c_e = (20.0 *
M_PI /
log(10.0)) *
f *
sqrt(e_r_eff_e_0) / (
C0 * Q_c_e);
462 Q_c_o = (
M_PI * Z0_h_o * w *
f) / (R_s *
C0 * K);
464 alpha_c_o = (20.0 *
M_PI /
log(10.0)) *
f *
sqrt(e_r_eff_o_0) / (
C0 * Q_c_o);
466 alpha_c_e = alpha_c_o = 0.0;
469 atten_cond_e = alpha_c_e * l;
470 atten_cond_o = alpha_c_o * l;
478 void c_microstrip::dielectric_losses()
480 double e_r, e_r_eff_e_0, e_r_eff_o_0;
481 double alpha_d_e, alpha_d_o;
484 e_r_eff_e_0 = er_eff_e_0;
485 e_r_eff_o_0 = er_eff_o_0;
487 alpha_d_e = (20.0 *
M_PI /
log(10.0)) * (
f /
C0) * (e_r /
sqrt(e_r_eff_e_0)) * ((e_r_eff_e_0 - 1.0) / (e_r - 1.0)) * tand;
488 alpha_d_o = (20.0 *
M_PI /
log(10.0)) * (
f /
C0) * (e_r /
sqrt(e_r_eff_o_0)) * ((e_r_eff_o_0 - 1.0) / (e_r - 1.0)) * tand;
490 atten_dielectric_e = alpha_d_e * l;
491 atten_dielectric_o = alpha_d_o * l;
499 void c_microstrip::attenuation()
510 void c_microstrip::line_angle()
512 double e_r_eff_e, e_r_eff_o;
513 double v_e, v_o, lambda_g_e, lambda_g_o;
515 e_r_eff_e = er_eff_e;
516 e_r_eff_o = er_eff_o;
519 v_e =
C0 /
sqrt(e_r_eff_e);
521 v_o =
C0 /
sqrt(e_r_eff_o);
523 lambda_g_e = v_e /
f;
525 lambda_g_o = v_o /
f;
527 ang_l_e = 2.0 *
M_PI * l / lambda_g_e;
528 ang_l_o = 2.0 *
M_PI * l / lambda_g_o;
532 void c_microstrip::syn_err_fun(
double *f1,
double *f2,
double s_h,
double w_h,
double e_r,
double w_h_se,
double w_h_so)
540 *f1 = (2.0 /
M_PI) *
acosh((2.0 * h - g + 1.0) / (g + 1.0));
541 *f2 = (2.0 /
M_PI) *
acosh((2.0 * h - g - 1.0) / (g - 1.0));
543 *f2 += (4.0 / (
M_PI * (1.0 + e_r / 2.0))) *
acosh(1.0 + 2.0 * w_h / s_h);
545 *f2 += (1.0 /
M_PI) *
acosh(1.0 + 2.0 * w_h / s_h);
558 void c_microstrip::synth_width()
561 double w_h_se, w_h_so, w_h, a, ce, co, s_h;
562 double f1, f2, ft1, ft2, j11, j12, j21, j22, d_s_h, d_w_h, err;
570 a =
exp(Z0 *
sqrt(e_r + 1.0) / 42.4) - 1.0;
571 w_h_se = 8.0 *
sqrt(a * ((7.0 + 4.0 / e_r) / 11.0) + ((1.0 + 1.0 / e_r) / 0.81)) / a;
575 a =
exp(Z0 *
sqrt(e_r + 1.0) / 42.4) - 1.0;
576 w_h_so = 8.0 *
sqrt(a * ((7.0 + 4.0 / e_r) / 11.0) + ((1.0 + 1.0 / e_r) / 0.81)) / a;
581 s_h = (2.0 /
M_PI) *
acosh((ce + co - 2.0) / (co - ce));
583 w_h =
acosh((ce * co - 1.0) / (co - ce)) /
M_PI - s_h / 2.0;
588 syn_err_fun(&f1, &f2, s_h, w_h, e_r, w_h_se, w_h_so);
594 syn_err_fun(&ft1, &ft2, s_h + eps, w_h, e_r, w_h_se, w_h_so);
595 j11 = (ft1 - f1) / eps;
596 j21 = (ft2 - f2) / eps;
597 syn_err_fun(&ft1, &ft2, s_h, w_h + eps, e_r, w_h_se, w_h_so);
598 j12 = (ft1 - f1) / eps;
599 j22 = (ft2 - f2) / eps;
602 d_s_h = (-f1 * j22 + f2 * j12) / (j11 * j22 - j21 * j12);
603 d_w_h = (-f2 * j11 + f1 * j21) / (j11 * j22 - j21 * j12);
612 syn_err_fun(&f1, &f2, s_h, w_h, e_r, w_h_se, w_h_so);
614 err =
sqrt(f1 * f1 + f2 * f2);
616 }
while (err > 1
e-04);
628 void c_microstrip::Z0_dispersion()
631 double Q_11, Q_12, Q_13, Q_14, Q_15, Q_16, Q_17, Q_18, Q_19, Q_20, Q_21;
632 double Q_22, Q_23, Q_24, Q_25, Q_26, Q_27, Q_28, Q_29;
633 double r_e, q_e, p_e, d_e, C_e;
634 double e_r_eff_o_f, e_r_eff_o_0;
635 double e_r_eff_single_f, e_r_eff_single_0, Z0_single_f;
636 double f_n, g, u, e_r;
637 double R_1, R_2, R_7, R_10, R_11, R_12, R_15, R_16, tmpf;
647 e_r_eff_single_f = aux_ms->er_eff;
648 e_r_eff_single_0 = aux_ms->er_eff_0;
649 Z0_single_f = aux_ms->Z0;
651 e_r_eff_o_f = er_eff_o;
652 e_r_eff_o_0 = er_eff_o_0;
654 Q_11 = 0.893 * (1.0 - 0.3 / (1.0 + 0.7 * (e_r - 1.0)));
655 Q_12 = 2.121 * (
pow(f_n / 20.0, 4.91) / (1.0 + Q_11 *
pow(f_n / 20.0, 4.91))) *
exp(-2.87 * g) *
pow(g, 0.902);
656 Q_13 = 1.0 + 0.038 *
pow(e_r / 8.0, 5.1);
657 Q_14 = 1.0 + 1.203 *
pow(e_r / 15.0, 4.0) / (1.0 +
pow(e_r / 15.0, 4.0));
658 Q_15 = 1.887 *
exp(-1.5 *
pow(g, 0.84)) *
pow(g, Q_14) / (1.0 + 0.41 *
pow(f_n / 15.0, 3.0) *
pow(u, 2.0 / Q_13) / (0.125 +
pow(u, 1.626 / Q_13)));
659 Q_16 = (1.0 + 9.0 / (1.0 + 0.403 *
pow(e_r - 1.0, 2))) * Q_15;
660 Q_17 = 0.394 * (1.0 -
exp(-1.47 *
pow(u / 7.0, 0.672))) * (1.0 -
exp(-4.25 *
pow(f_n / 20.0, 1.87)));
661 Q_18 = 0.61 * (1.0 -
exp(-2.13 *
pow(u / 8.0, 1.593))) / (1.0 + 6.544 *
pow(g, 4.17));
662 Q_19 = 0.21 * g * g * g * g / ((1.0 + 0.18 *
pow(g, 4.9)) * (1.0 + 0.1 * u * u) * (1.0 +
pow(f_n / 24.0, 3.0)));
663 Q_20 = (0.09 + 1.0 / (1.0 + 0.1 *
pow(e_r - 1, 2.7))) * Q_19;
664 Q_21 = fabs(1.0 - 42.54 *
pow(g, 0.133) *
exp(-0.812 * g) *
pow(u, 2.5) / (1.0 + 0.033 *
pow(u, 2.5)));
666 r_e =
pow(f_n / 28.843, 12);
667 q_e = 0.016 +
pow(0.0514 * e_r * Q_21, 4.524);
668 p_e = 4.766 *
exp(-3.228 *
pow(u, 0.641));
669 d_e = 5.086 * q_e * (r_e / (0.3838 + 0.386 * q_e)) * (
exp(-22.2 *
pow(u, 1.92)) / (1.0 + 1.2992 * r_e)) * (
pow(e_r - 1.0, 6.0) / (1.0 + 10 *
pow(e_r - 1.0, 6.0)));
670 C_e = 1.0 + 1.275 * (1.0 -
exp(-0.004625 * p_e *
pow(e_r, 1.674) *
pow(f_n / 18.365, 2.745))) - Q_12 + Q_16 - Q_17 + Q_18 + Q_20;
673 R_1 = 0.03891 *
pow(e_r, 1.4);
674 R_2 = 0.267 *
pow(u, 7.0);
675 R_7 = 1.206 - 0.3144 *
exp(-R_1) * (1.0 -
exp(-R_2));
676 R_10 = 0.00044 *
pow(e_r, 2.136) + 0.0184;
677 tmpf =
pow(f_n / 19.47, 6.0);
678 R_11 = tmpf / (1.0 + 0.0962 * tmpf);
679 R_12 = 1.0 / (1.0 + 0.00245 * u * u);
680 R_15 = 0.707 * R_10 *
pow(f_n / 12.3, 1.097);
681 R_16 = 1.0 + 0.0503 * e_r * e_r * R_11 * (1.0 -
exp(-
pow(u / 15.0, 6.0)));
682 Q_0 = R_7 * (1.0 - 1.1241 * (R_12 / R_16) *
exp(-0.026 *
pow(f_n, 1.15656) - R_15));
685 Z0e = Z0_e_0 *
pow(0.9408 *
pow(e_r_eff_single_f, C_e) - 0.9603, Q_0) /
pow((0.9408 - d_e) *
pow(e_r_eff_single_0, C_e) - 0.9603, Q_0);
687 Q_29 = 15.16 / (1.0 + 0.196 *
pow(e_r - 1.0, 2.0));
688 tmpf =
pow(e_r - 1.0, 3.0);
689 Q_28 = 0.149 * tmpf / (94.5 + 0.038 * tmpf);
690 tmpf =
pow(e_r - 1.0, 1.5);
691 Q_27 = 0.4 *
pow(g, 0.84) * (1.0 + 2.5 * tmpf / (5.0 + tmpf));
692 tmpf =
pow((e_r - 1.0) / 13.0, 12.0);
693 Q_26 = 30.0 - 22.2 * (tmpf / (1.0 + 3.0 * tmpf)) - Q_29;
694 tmpf = (e_r - 1.0) * (e_r - 1.0);
695 Q_25 = (0.3 * f_n * f_n / (10.0 + f_n * f_n)) * (1.0 + 2.333 * tmpf / (5.0 + tmpf));
696 Q_24 = 2.506 * Q_28 *
pow(u, 0.894) *
pow((1.0 + 1.3 * u) * f_n / 99.25, 4.29) / (3.575 +
pow(u, 0.894));
697 Q_23 = 1.0 + 0.005 * f_n * Q_27 / ((1.0 + 0.812 *
pow(f_n / 15.0, 1.9)) * (1.0 + 0.025 * u * u));
698 Q_22 = 0.925 *
pow(f_n / Q_26, 1.536) / (1.0 + 0.3 *
pow(f_n / 30.0, 1.536));
701 Z0o = Z0_single_f + (Z0_o_0 *
pow(e_r_eff_o_f / e_r_eff_o_0, Q_22) - Z0_single_f * Q_23) / (1.0 + Q_24 +
pow(0.46 * g, 2.2) * Q_25);
705 void c_microstrip::calc()
716 mur_eff = calc_mur_eff();
730 void c_microstrip::get_c_microstrip_sub()
747 void c_microstrip::get_c_microstrip_comp()
757 void c_microstrip::get_c_microstrip_elec()
771 void c_microstrip::get_c_microstrip_phys()
779 void c_microstrip::show_results()
803 get_c_microstrip_sub();
805 get_c_microstrip_comp();
807 get_c_microstrip_phys();
816 void c_microstrip::syn_fun(
double *f1,
double *f2,
double s_h,
double w_h,
double Z0_e,
double Z0_o)
834 double f1, f2, ft1, ft2, j11, j12, j21, j22, d_s_h, d_w_h, err;
836 double w_h, s_h, le, lo;
839 get_c_microstrip_sub();
842 get_c_microstrip_comp();
845 get_c_microstrip_elec();
849 get_c_microstrip_phys();
865 syn_fun(&ft1, &ft2, s_h + eps, w_h, Z0_e, Z0_o);
866 j11 = (ft1 - f1) / eps;
867 j21 = (ft2 - f2) / eps;
868 syn_fun(&ft1, &ft2, s_h, w_h + eps, Z0_e, Z0_o);
869 j12 = (ft1 - f1) / eps;
870 j22 = (ft2 - f2) / eps;
873 d_s_h = (-f1 * j22 + f2 * j12) / (j11 * j22 - j21 * j12);
874 d_w_h = (-f2 * j11 + f1 * j21) / (j11 * j22 - j21 * j12);
880 syn_fun(&f1, &f2, s_h, w_h, Z0_e, Z0_o);
881 err =
sqrt(f1 * f1 + f2 * f2);
884 }
while (err > 1
e-04);
896 le =
C0 /
f /
sqrt(er_eff_e * mur_eff) * ang_l_e / 2.0 /
M_PI;
897 lo =
C0 /
f /
sqrt(er_eff_o * mur_eff) * ang_l_o / 2.0 /
M_PI;