35 msline::msline () : circuit (2) {
36 alpha = beta = zl = ereff = 0;
59 nr_double_t er = subst->getPropertyDouble (
"er");
60 nr_double_t
h = subst->getPropertyDouble (
"h");
61 nr_double_t
t = subst->getPropertyDouble (
"t");
62 nr_double_t tand = subst->getPropertyDouble (
"tand");
63 nr_double_t rho = subst->getPropertyDouble (
"rho");
64 nr_double_t
D = subst->getPropertyDouble (
"D");
68 nr_double_t ZlEff, ErEff, WEff, ZlEffFreq, ErEffFreq;
76 ZlEffFreq, ErEffFreq);
79 analyseLoss (W, t, er, rho, D, tand, ZlEff, ZlEff, ErEff,
80 frequency,
"Hammerstad", ac, ad);
96 nr_double_t z =
zl /
z0;
97 nr_double_t
y = 1 / z;
116 nr_double_t er,
char * Model,
117 nr_double_t& ZlEff, nr_double_t& ErEff,
128 if (!strcmp (Model,
"Wheeler")) {
129 nr_double_t a, b,
c,
d,
x, dW1, dWr, Wr;
137 dWr = (1 + 1 / er) / 2 * dW1;
149 x = 2 *
M_LN2 /
M_PI + Wr / h / 2 + (er + 1) / 2 /
M_PI / er * c + d;
157 e = (er + 1) / 2 *
sqr (a / (a - b));
160 a = (er - 1) / 2 /
M_PI / er * (
qucs::log (2.1349 * Wr / h + 4.0137) -
163 e = er *
sqr ((b - a) / b);
167 else if (!strcmp (Model,
"Schneider")) {
169 nr_double_t dW = 0, u = W /
h;
172 if (t != 0 && t < W / 2) {
173 nr_double_t
arg = (u <
M_1_PI / 2) ? 2 *
M_PI * W / t : h / t;
175 if (t / dW >= 0.75) dW = 0;
177 WEff = W + dW; u = WEff /
h;
180 e = (er + 1) / 2 + (er - 1) / 2 /
qucs::sqrt (1 + 10 / u);
187 z = 1 / (u + 2.42 - 0.44 / u +
qucs::pow ((1. - 1. / u), 6.));
192 else if (!strcmp (Model,
"Hammerstad")) {
193 nr_double_t a, b, du1, du, u, ur, u1, zr, z1;
219 e = e *
sqr (z1 / zr);
230 nr_double_t ZlEff, nr_double_t ErEff,
231 nr_double_t frequency,
char * Model,
232 nr_double_t& ZlEffFreq,
233 nr_double_t& ErEffFreq) {
238 z = ZlEffFreq = ZlEff;
239 e = ErEffFreq = ErEff;
242 if (!strcmp (Model,
"Getsinger")) {
246 else if (!strcmp (Model,
"Schneider")) {
251 e = ErEff *
sqr ((1 + f) / (1 + k * f));
255 else if (!strcmp (Model,
"Yamashita")) {
263 else if (!strcmp (Model,
"Kobayashi")) {
264 nr_double_t
n, no, nc, fh, fk;
267 fh = fk / (0.75 + (0.75 - 0.332 /
qucs::pow (er, 1.73)) * W / h);
270 nc = 1 + 1.4 / (1 + W /
h) * (0.15 - 0.235 *
274 n = no * nc < 2.32 ? no * nc : 2.32;
275 e = er - (er - ErEff) / (1 +
qucs::pow (frequency / fh, n));
278 else if (!strcmp (Model,
"Pramanick")) {
279 nr_double_t Weff, We, f;
280 f = 2 *
MU0 * h * frequency *
qucs::sqrt (ErEff / er) / ZlEff;
281 e = er - (er - ErEff) / (1 +
sqr (f));
283 We = W + (Weff - W) / (1 +
sqr (f));
287 else if (!strcmp (Model,
"Hammerstad")) {
290 f = 2 *
MU0 * h * frequency / ZlEff;
291 e = er - (er - ErEff) / (1 + g *
sqr (f));
292 z = ZlEff *
qucs::sqrt (ErEff / e) * (e - 1) / (ErEff - 1);
295 else if (!strcmp (Model,
"Kirschning")) {
296 nr_double_t r17, u = W /
h, fn = frequency * h / 1e6;
316 b = 0.564 *
qucs::pow ((er - 0.9) / (er + 3), 0.053);
323 nr_double_t b, nr_double_t& e) {
324 e = (er + 1) / 2 + (er - 1) / 2 *
qucs::pow (1 + 10 / u, -a * b);
340 nr_double_t ZlEff, nr_double_t frequency,
341 nr_double_t& e, nr_double_t& z) {
343 g = 0.6 + 0.009 * ZlEff;
344 f = frequency * 2 *
MU0 * h / ZlEff;
345 e = er - (er - ErEff) / (1 + g *
sqr (f));
346 d = (er - e) * (e - ErEff) / e / (er - ErEff);
355 nr_double_t ErEff, nr_double_t& ErEffFreq) {
356 nr_double_t p, p1, p2, p3, p4;
357 p1 = 0.27488 + (0.6315 + 0.525 /
qucs::pow (1. + 0.0157 * fn, 20.)) * u -
359 p2 = 0.33622 * (1 -
qucs::exp (-0.03442 * er));
362 p = p1 * p2 *
qucs::pow ((0.1844 + p3 * p4) * fn, 1.5763);
363 ErEffFreq = er - (er - ErEff) / (1 + p);
370 nr_double_t ErEff, nr_double_t ErEffFreq,
371 nr_double_t ZlEff, nr_double_t& r17,
372 nr_double_t& ZlEffFreq) {
373 nr_double_t r1, r2, r3, r4, r5, r6, r7, r8, r9, r10;
374 nr_double_t r11, r12, r13, r14, r15, r16;
378 r4 = 0.016 +
qucs::pow (0.0514 * er, 4.524);
382 r8 = 1 + 1.275 * (1 -
qucs::exp (-0.004625 * r3 *
384 r9 = 5.086 * r4 * r5 / (0.3838 + 0.386 * r4) *
387 r10 = 0.00044 *
qucs::pow (er, 2.136) + 0.0184;
389 r12 = 1 / (1 + 0.00245 *
sqr (u));
390 r13 = 0.9408 *
qucs::pow (ErEffFreq, r8) - 0.9603;
391 r14 = (0.9408 - r9) *
qucs::pow (ErEff, r8) - 0.9603;
392 r15 = 0.707 * r10 *
qucs::pow (fn / 12.3, 1.097);
393 r16 = 1 + 0.0503 *
sqr (er) * r11 * (1 -
qucs::exp (- qucs::pow (u / 15., 6.)));
394 r17 = r7 * (1 - 1.1241 * r12 / r16 *
395 qucs::exp (-0.026 * qucs::pow (fn, 1.15656) - r15));
396 ZlEffFreq = ZlEff *
qucs::pow (r13 / r14, r17);
402 nr_double_t rho, nr_double_t
D, nr_double_t tand,
403 nr_double_t ZlEff1, nr_double_t ZlEff2,
405 nr_double_t frequency,
const char * Model,
406 nr_double_t& ac, nr_double_t& ad) {
410 if (!strcmp (Model,
"Hammerstad")) {
411 nr_double_t Rs, ds, l0, Kr, Ki;
420 "WARNING: conductor loss calculation invalid for line "
421 "height t (%g) < 3 * skin depth (%g)\n", t, 3 * ds);
427 ac = Rs / (ZlEff1 * W) * Ki * Kr;
432 ad =
M_PI * er / (er - 1) * (ErEff - 1) /
qucs::sqrt (ErEff) * tand / l0;
440 nr_double_t
t = subst->getPropertyDouble (
"t");
441 nr_double_t rho = subst->getPropertyDouble (
"rho");
443 if (t != 0.0 && rho != 0.0 && l != 0.0) {
445 nr_double_t g = t * W / rho /
l;
#define M_E
Euler's constant ( )
std::complex< nr_double_t > nr_complex_t
#define MU0
magnetic constant of vacuum ( )
static void Hammerstad_ab(nr_double_t, nr_double_t, nr_double_t &, nr_double_t &)
matrix real(matrix a)
Real part matrix.
#define T0
standard temperature
nr_complex_t coth(const nr_complex_t z)
Compute complex hyperbolic cotangent.
nr_double_t getPropertyDouble(const char *)
nr_complex_t pow(const nr_complex_t z, const nr_double_t d)
Compute power function with real exponent.
substrate * getSubstrate(void)
void setInternalVoltageSource(bool i)
static void analyseLoss(nr_double_t, nr_double_t, nr_double_t, nr_double_t, nr_double_t, nr_double_t, nr_double_t, nr_double_t, nr_double_t, nr_double_t, const char *, nr_double_t &, nr_double_t &)
void setVoltageSources(int)
nr_complex_t atan(const nr_complex_t z)
Compute complex arc tangent.
#define K
Absolute 0 in centigrade.
void calcPropagation(nr_double_t)
static const nr_double_t z0
int getSize(void)
Get the number of ports the circuit element has.
nr_complex_t cosh(const nr_complex_t z)
Compute complex hyperbolic cosine.
nr_complex_t sqr(const nr_complex_t z)
Square of complex number.
#define M_PI_2
Half of Archimedes' constant ( )
nr_complex_t sqrt(const nr_complex_t z)
Compute principal value of square root.
static void Getsinger_disp(nr_double_t, nr_double_t, nr_double_t, nr_double_t, nr_double_t, nr_double_t &, nr_double_t &)
nr_complex_t cosech(const nr_complex_t z)
Compute complex argument hyperbolic cosec.
nr_double_t quadr(const nr_double_t r)
Quartic function.
static void Kirschning_zl(nr_double_t, nr_double_t, nr_double_t, nr_double_t, nr_double_t, nr_double_t, nr_double_t &, nr_double_t &)
nr_complex_t log10(const nr_complex_t z)
Compute principal value of decimal logarithm of z.
#define M_LN2
Natural logarithm of 2 ( )
nr_complex_t sech(const nr_complex_t z)
Compute complex hyperbolic secant.
#define M_PI
Archimedes' constant ( )
static void Hammerstad_zl(nr_double_t, nr_double_t &)
matrix transpose(matrix a)
Matrix transposition.
static void Kirschning_er(nr_double_t, nr_double_t, nr_double_t, nr_double_t, nr_double_t &)
void calcNoiseAC(nr_double_t)
void setY(int, int, nr_complex_t)
void saveCharacteristics(nr_double_t)
void allocMatrixMNA(void)
#define M_1_PI
Inverse of Archimedes' constant ( )
static void Hammerstad_er(nr_double_t, nr_double_t, nr_double_t, nr_double_t, nr_double_t &)
nr_complex_t sinh(const nr_complex_t z)
Compute complex hyperbolic sine.
#define C0
speed of light in vacuum ( )
void voltageSource(int, int, int, nr_double_t value=0.0)
matrix eye(int rs, int cs)
Create identity matrix with specified number of rows and columns.
static void analyseQuasiStatic(nr_double_t, nr_double_t, nr_double_t, nr_double_t, char *, nr_double_t &, nr_double_t &, nr_double_t &)
nr_complex_t exp(const nr_complex_t z)
Compute complex exponential.
void setS(int, int, nr_complex_t)
matrix conj(matrix a)
Conjugate complex matrix.
static void analyseDispersion(nr_double_t, nr_double_t, nr_double_t, nr_double_t, nr_double_t, nr_double_t, char *, nr_double_t &, nr_double_t &)
void setCharacteristic(const char *, nr_double_t)
char * getPropertyString(const char *)
void logprint(int level, const char *format,...)
nr_complex_t log(const nr_complex_t z)
Compute principal value of natural logarithm of z.
#define Z0
Wave impedance in vacuum ( )
matrix arg(matrix a)
Computes the argument of each matrix element.
void calcNoiseSP(nr_double_t)