36 mscoupled::mscoupled () : circuit (4) {
50 nr_double_t er = subst->getPropertyDouble (
"er");
51 nr_double_t
h = subst->getPropertyDouble (
"h");
52 nr_double_t
t = subst->getPropertyDouble (
"t");
53 nr_double_t tand = subst->getPropertyDouble (
"tand");
54 nr_double_t rho = subst->getPropertyDouble (
"rho");
55 nr_double_t
D = subst->getPropertyDouble (
"D");
58 nr_double_t Zle, ErEffe, Zlo, ErEffo;
62 nr_double_t ZleFreq, ErEffeFreq, ZloFreq, ErEffoFreq;
63 analyseDispersion (W, h, s, er, Zle, Zlo, ErEffe, ErEffo, frequency, DModel,
64 ZleFreq, ZloFreq, ErEffeFreq, ErEffoFreq);
67 nr_double_t ace, aco, ade, ado;
69 frequency,
"Hammerstad", ace, ade);
71 frequency,
"Hammerstad", aco, ado);
74 nr_double_t k0 = 2 *
M_PI * frequency /
C0;
105 De = 2 *
ze *
z0 *
cosh (ge * l) + Ee;
106 Do = 2 *
zo *
z0 *
cosh (go * l) + Eo;
139 nr_double_t
t, nr_double_t er,
140 char * SModel, nr_double_t& Zle,
141 nr_double_t& Zlo, nr_double_t& ErEffe,
142 nr_double_t& ErEffo) {
144 ErEffe = ErEffo = er;
145 Zlo = 42.2; Zle = 55.7;
148 nr_double_t u = W /
h;
149 nr_double_t g = s /
h;
152 if (!strcmp (SModel,
"Hammerstad")) {
153 nr_double_t Zl1, Fe, Fo, a, b, fo, Mu, Alpha, Beta, ErEff;
154 nr_double_t Pe, Po,
r, fo1, q, p,
n, Psi, Phi, m, Theta;
160 Psi = 1 + g / 1.45 +
qucs::pow (g, 2.09) / 3.95;
185 Fo = fo *
qucs::pow (1 + 10 / u, -a * b);
188 ErEffe = (er + 1) / 2 + (er - 1) / 2 * Fe;
189 ErEffo = (er + 1) / 2 + (er - 1) / 2 * Fo;
201 Zle = Zl1 / (1 - Zl1 * Pe /
Z0);
202 Zlo = Zl1 / (1 - Zl1 * Po /
Z0);
205 else if (!strcmp (SModel,
"Kirschning")) {
206 nr_double_t a, b,
ae,
be,
ao,
bo,
v, co,
d, ErEff, Zl1;
207 nr_double_t q1, q2, q3, q4, q5, q6, q7, q8, q9, q10;
212 if (t != 0 && s > 10 * (2 * t)) {
220 nr_double_t dt = 2 * t * h / s / er;
221 nr_double_t We = W + dW * (1 - 0.5 *
qucs::exp (-0.69 * dW / dt));
222 nr_double_t Wo = We + dt;
235 d = 0.593 + 0.694 *
qucs::exp (-0.562 * uo);
236 bo = 0.747 * er / (0.15 + er);
237 co = bo - (bo - 0.207) *
qucs::exp (-0.414 * uo);
238 ao = 0.7287 * (ErEff - (er + 1) / 2) * (1 -
qucs::exp (-0.179 * uo));
247 q2 = 1 + 0.7519 * g + 0.189 *
qucs::pow (g, 2.31);
258 q7 = (10 + 190 *
sqr (g)) / (1 + 82.3 *
cubic (g));
270 nr_double_t er, nr_double_t Zle,
271 nr_double_t Zlo, nr_double_t ErEffe,
272 nr_double_t ErEffo, nr_double_t frequency,
273 char * DModel, nr_double_t& ZleFreq,
274 nr_double_t& ZloFreq,
275 nr_double_t& ErEffeFreq,
276 nr_double_t& ErEffoFreq) {
285 nr_double_t u = W /
h;
286 nr_double_t g = s /
h;
289 if (!strcmp (DModel,
"Getsinger")) {
292 frequency, ErEffeFreq, ZleFreq);
296 frequency, ErEffoFreq, ZloFreq);
300 else if (!strcmp (DModel,
"Kirschning")) {
301 nr_double_t p1, p2, p3, p4, p5, p6, p7, Fe;
302 nr_double_t fn = frequency * h * 1e-6;
305 p1 = 0.27488 * (0.6315 + 0.525 /
qucs::pow (1 + 0.0157 * fn, 20.)) * u -
307 p2 = 0.33622 * (1 -
qucs::exp (-0.03442 * er));
312 p7 = 1 + 4.069 * p6 *
qucs::pow (g, 0.479) *
314 Fe = p1 * p2 *
qucs::pow ((p3 * p4 + 0.1844 * p7) * fn, 1.5763);
315 ErEffeFreq = er - (er - ErEffe) / (1 + Fe);
318 nr_double_t p8, p9, p10, p11, p12, p13, p14, p15, Fo;
319 p8 = 0.7168 * (1 + 1.076 / (1 + 0.0576 * (er - 1)));
320 p9 = p8 - 0.7913 * (1 -
qucs::exp (- qucs::pow (fn / 20, 1.424))) *
321 qucs::atan (2.481 * qucs::pow (er / 8, 0.946));
323 p11 = 0.6366 * (
qucs::exp (-0.3401 * fn) - 1) *
324 qucs::atan (1.263 * qucs::pow (u / 3, 1.629));
325 p12 = p9 + (1 - p9) / (1 + 1.183 * qucs::pow (u, 1.376));
326 p13 = 1.695 * p10 / (0.414 + 1.605 * p10);
327 p14 = 0.8928 + 0.1072 * (1 -
qucs::exp (-0.42 * qucs::pow (fn / 20, 3.215)));
328 p15 = fabs (1 - 0.8928 * (1 + p11) *
329 qucs::exp (-p13 * qucs::pow (g, 1.092)) * p12 / p14);
330 Fo = p1 * p2 *
qucs::pow ((p3 * p4 + 0.1844) * fn * p15, 1.5763);
331 ErEffoFreq = er - (er - ErEffo) / (1 + Fo);
334 nr_double_t
t, q11, q12, q13, q14, q15, q16, q17, q18, q19, q20, q21;
335 q11 = 0.893 * (1 - 0.3 / (1 + 0.7 * (er - 1)));
337 q12 = 2.121 * t / (1 + q11 *
t) * qucs::exp (-2.87 * g) *
qucs::pow (g, 0.902);
338 q13 = 1 + 0.038 *
qucs::pow (er / 8, 5.1);
340 q14 = 1 + 1.203 * t / (1 +
t);
344 q16 = q15 * (1 + 9 / (1 + 0.403 *
sqr (er - 1)));
345 q17 = 0.394 * (1 -
qucs::exp (-1.47 * qucs::pow (u / 7, 0.672))) *
346 (1 - qucs::exp (-4.25 * qucs::pow (fn / 20, 1.87)));
347 q18 = 0.61 * (1 -
qucs::exp (-2.31 * qucs::pow (u / 8, 1.593))) /
348 (1 + 6.544 * qucs::pow (g, 4.17));
350 (1 + qucs::pow (fn / 24, 3.));
351 q20 = q19 * (0.09 + 1 / (1 + 0.1 *
qucs::pow (er - 1, 2.7)));
353 q21 = fabs (1 - 42.54 * qucs::pow (g, 0.133) * qucs::exp (-0.812 * g) * t /
356 nr_double_t re, qe, pe, de, Ce, q0, ZlFreq, ErEffFreq;
360 qe = 0.016 +
qucs::pow (0.0514 * er * q21, 4.524);
361 pe = 4.766 *
qucs::exp (-3.228 * qucs::pow (u, 0.641));
363 de = 5.086 * qe * re / (0.3838 + 0.386 * qe) *
364 qucs::exp (-22.2 * qucs::pow (u, 1.92)) / (1 + 1.2992 * re) * t / (1 + 10 *
t);
365 Ce = 1 + 1.275 * (1 -
qucs::exp (-0.004625 * pe * qucs::pow (er, 1.674) *
366 qucs::pow (fn / 18.365, 2.745))) - q12 + q16 - q17 + q18 + q20;
367 ZleFreq = Zle *
qucs::pow ((0.9408 * qucs::pow (ErEffFreq, Ce) - 0.9603) /
368 ((0.9408 - de) * qucs::pow (ErEffe, Ce) - 0.9603), q0);
371 nr_double_t q22, q23, q24, q25, q26, q27, q28, q29;
374 q29 = 15.16 / (1 + 0.196 *
sqr (er - 1));
376 q25 = 0.3 *
sqr (fn) / (10 +
sqr (fn)) * (1 + 2.333 * t / (5 + t));
378 q26 = 30 - 22.2 * t / (1 + 3 *
t) - q29;
380 q27 = 0.4 *
qucs::pow (g, 0.84) * (1 + 2.5 * t / (5 +
t));
382 q28 = 0.149 * t / (94.5 + 0.038 *
t);
384 q23 = 1 + 0.005 * fn * q27 / (1 + 0.812 *
qucs::pow (fn / 15, 1.9)) /
385 (1 + 0.025 *
sqr (u));
387 q24 = 2.506 * q28 * t / (3.575 +
t) *
388 qucs::pow ((1 + 1.3 * u) * fn / 99.25, 4.29);
389 ZloFreq = ZlFreq + (Zlo *
qucs::pow (ErEffoFreq / ErEffo, q22) - ZlFreq * q23) /
390 (1 + q24 + qucs::pow (0.46 * g, 2.2) * q25);
399 nr_double_t
t = subst->getPropertyDouble (
"t");
400 nr_double_t rho = subst->getPropertyDouble (
"rho");
402 if (t != 0.0 && rho != 0.0) {
404 nr_double_t g = t * W / rho /
l;
#define M_E
Euler's constant ( )
static void analyseDispersion(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, char *, nr_double_t &, nr_double_t &, nr_double_t &, nr_double_t &)
std::complex< nr_double_t > nr_complex_t
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
#define PROP_RNG_STR2(s1, s2)
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.
void setD(int, int, nr_complex_t)
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.
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.
nr_complex_t sqrt(const nr_complex_t z)
Compute principal value of square root.
void calcNoiseSP(nr_double_t)
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 sin(const nr_complex_t z)
Compute complex sine.
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_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 setY(int, int, nr_complex_t)
void calcPropagation(nr_double_t)
void allocMatrixMNA(void)
#define M_1_PI
Inverse of Archimedes' constant ( )
void calcNoiseAC(nr_double_t)
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.
nr_complex_t exp(const nr_complex_t z)
Compute complex exponential.
static void analysQuasiStatic(nr_double_t, nr_double_t, nr_double_t, nr_double_t, nr_double_t, char *, nr_double_t &, nr_double_t &, nr_double_t &, nr_double_t &)
void setS(int, int, nr_complex_t)
matrix conj(matrix a)
Conjugate complex matrix.
void saveCharacteristics(nr_double_t)
void setCharacteristic(const char *, nr_double_t)
char * getPropertyString(const char *)
nr_complex_t log(const nr_complex_t z)
Compute principal value of natural logarithm of z.
#define Z0
Wave impedance in vacuum ( )