Qucs-core  0.0.18
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
bjt.cpp
Go to the documentation of this file.
1 /*
2  * bjt.cpp - bipolar junction transistor class implementation
3  *
4  * Copyright (C) 2004, 2005, 2006, 2008 Stefan Jahn <stefan@lkcc.org>
5  *
6  * This is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2, or (at your option)
9  * any later version.
10  *
11  * This software is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this package; see the file COPYING. If not, write to
18  * the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20  *
21  * $Id$
22  *
23  */
24 
25 #if HAVE_CONFIG_H
26 # include <config.h>
27 #endif
28 
29 #include "component.h"
30 #include "device.h"
31 #include "bjt.h"
32 
33 #define NEWSGP 0
34 
35 #define NODE_B 0 /* base node */
36 #define NODE_C 1 /* collector node */
37 #define NODE_E 2 /* emitter node */
38 #define NODE_S 3 /* substrate node */
39 
40 using namespace qucs;
41 using namespace qucs::device;
42 
43 bjt::bjt () : circuit (4) {
44  cbcx = rb = re = rc = NULL;
45  type = CIR_BJT;
46 }
47 
48 void bjt::calcSP (nr_double_t frequency) {
49  // build admittance matrix and convert it to S-parameter matrix
50  setMatrixS (ytos (calcMatrixY (frequency)));
51 }
52 
53 matrix bjt::calcMatrixY (nr_double_t frequency) {
54 
55  // fetch computed operating points
56  nr_double_t Cbe = getOperatingPoint ("Cbe");
57  nr_double_t gbe = getOperatingPoint ("gpi");
58  nr_double_t Cbci = getOperatingPoint ("Cbci");
59  nr_double_t gbc = getOperatingPoint ("gmu");
60  nr_double_t Ccs = getOperatingPoint ("Ccs");
61 #if NEWSGP
62  nr_double_t gm = getOperatingPoint ("gmf");
63  nr_double_t gmr = getOperatingPoint ("gmr");
64 #else
65  nr_double_t gm = getOperatingPoint ("gm");
66  nr_double_t go = getOperatingPoint ("go");
67 #endif
68  nr_double_t Ptf = getPropertyDouble ("Ptf");
69  nr_double_t Tf = getPropertyDouble ("Tf");
70 
71  // compute admittance matrix entries
72  nr_complex_t Ybe = nr_complex_t (gbe, 2.0 * M_PI * frequency * Cbe);
73  nr_complex_t Ybc = nr_complex_t (gbc, 2.0 * M_PI * frequency * Cbci);
74  nr_complex_t Ycs = nr_complex_t (0.0, 2.0 * M_PI * frequency * Ccs);
75 
76  // admittance matrix entries for "transcapacitance"
77  nr_complex_t Ybebc = nr_complex_t (0.0, 2.0 * M_PI * frequency * dQbedUbc);
78 
79  // compute influence of excess phase
80  nr_double_t phase = rad (Ptf) * Tf * 2 * M_PI * frequency;
81 #if NEWSGP
82  nr_complex_t gmf = qucs::polar (gm, -phase);
83 #else
84  nr_complex_t gmf = qucs::polar (gm + go, -phase) - go;
85 #endif
86 
87  // build admittance matrix
88  matrix y (4);
89 #if NEWSGP
90  // for some reason this small signal equivalent can't be used
91  y.set (NODE_B, NODE_B, Ybc + Ybe + Ybebc);
92  y.set (NODE_B, NODE_C, -Ybc - Ybebc);
93  y.set (NODE_B, NODE_E, -Ybe);
94  y.set (NODE_B, NODE_S, 0);
95  y.set (NODE_C, NODE_B, -Ybc + gmf + gmr);
96  y.set (NODE_C, NODE_C, Ybc - gmr + Ycs);
97  y.set (NODE_C, NODE_E, -gmf);
98  y.set (NODE_C, NODE_S, -Ycs);
99  y.set (NODE_E, NODE_B, -Ybe - gmf - gmr - Ybebc);
100  y.set (NODE_E, NODE_C, gmr + Ybebc);
101  y.set (NODE_E, NODE_E, Ybe + gmf);
102  y.set (NODE_E, NODE_S, 0);
103  y.set (NODE_S, NODE_B, 0);
104  y.set (NODE_S, NODE_C, -Ycs);
105  y.set (NODE_S, NODE_E, 0);
106  y.set (NODE_S, NODE_S, Ycs);
107 #else /* !NEWSGP */
108  y.set (NODE_B, NODE_B, Ybc + Ybe + Ybebc);
109  y.set (NODE_B, NODE_C, -Ybc - Ybebc);
110  y.set (NODE_B, NODE_E, -Ybe);
111  y.set (NODE_B, NODE_S, 0);
112  y.set (NODE_C, NODE_B, -Ybc + gmf);
113  y.set (NODE_C, NODE_C, Ybc + Ycs + go);
114  y.set (NODE_C, NODE_E, -gmf - go);
115  y.set (NODE_C, NODE_S, -Ycs);
116  y.set (NODE_E, NODE_B, -Ybe - gmf - Ybebc);
117  y.set (NODE_E, NODE_C, -go + Ybebc);
118  y.set (NODE_E, NODE_E, Ybe + gmf + go);
119  y.set (NODE_E, NODE_S, 0);
120  y.set (NODE_S, NODE_B, 0);
121  y.set (NODE_S, NODE_C, -Ycs);
122  y.set (NODE_S, NODE_E, 0);
123  y.set (NODE_S, NODE_S, Ycs);
124 #endif /* !NEWSGP */
125  return y;
126 }
127 
128 void bjt::calcNoiseSP (nr_double_t frequency) {
129  setMatrixN (cytocs (calcMatrixCy (frequency) * z0, getMatrixS ()));
130 }
131 
132 matrix bjt::calcMatrixCy (nr_double_t frequency) {
133 
134  // fetch computed operating points
135  nr_double_t Ibe = fabs (getOperatingPoint ("Ibe"));
136  nr_double_t Ice = fabs (getOperatingPoint ("Ice"));
137 
138  // get model properties
139  nr_double_t Kf = getPropertyDouble ("Kf");
140  nr_double_t Af = getPropertyDouble ("Af");
141  nr_double_t Ffe = getPropertyDouble ("Ffe");
142  nr_double_t Kb = getPropertyDouble ("Kb");
143  nr_double_t Ab = getPropertyDouble ("Ab");
144  nr_double_t Fb = getPropertyDouble ("Fb");
145 
146  nr_double_t ib = 2 * Ibe * QoverkB / T0 + // shot noise
147  (Kf * qucs::pow (Ibe, Af) / qucs::pow (frequency, Ffe) + // flicker noise
148  Kb * qucs::pow (Ibe, Ab) / (1 + sqr (frequency / Fb))) // burst noise
149  / kB / T0;
150  nr_double_t ic = 2 * Ice * QoverkB / T0; // shot noise
151 
152  /* build noise current correlation matrix and convert it to
153  noise-wave correlation matrix */
154  matrix cy = matrix (4);
155  cy.set (NODE_B, NODE_B, ib);
156  cy.set (NODE_B, NODE_E, -ib);
157  cy.set (NODE_C, NODE_C, ic);
158  cy.set (NODE_C, NODE_E, -ic);
159  cy.set (NODE_E, NODE_B, -ib);
160  cy.set (NODE_E, NODE_C, -ic);
161  cy.set (NODE_E, NODE_E, ic + ib);
162  return cy;
163 }
164 
165 void bjt::initModel (void) {
166  // fetch necessary device properties
167  nr_double_t T = getPropertyDouble ("Temp");
168  nr_double_t Tn = getPropertyDouble ("Tnom");
169  nr_double_t A = getPropertyDouble ("Area");
170 
171  // compute Is temperature and area dependency
172  nr_double_t Is = getPropertyDouble ("Is");
173  nr_double_t Xti = getPropertyDouble ("Xti");
174  nr_double_t Eg = getPropertyDouble ("Eg");
175  nr_double_t T1, T2, IsT;
176  T2 = kelvin (T);
177  T1 = kelvin (Tn);
178  IsT = pnCurrent_T (T1, T2, Is, Eg, 1, Xti);
179  setScaledProperty ("Is", IsT * A);
180 
181  // compute Vje, Vjc and Vjs temperature dependencies
182  nr_double_t Vje = getPropertyDouble ("Vje");
183  nr_double_t Vjc = getPropertyDouble ("Vjc");
184  nr_double_t Vjs = getPropertyDouble ("Vjs");
185  nr_double_t VjeT, VjcT, VjsT;
186  VjeT = pnPotential_T (T1,T2, Vje);
187  VjcT = pnPotential_T (T1,T2, Vjc);
188  VjsT = pnPotential_T (T1,T2, Vjs);
189  setScaledProperty ("Vje", VjeT);
190  setScaledProperty ("Vjc", VjcT);
191  setScaledProperty ("Vjs", VjsT);
192 
193  // compute Bf and Br temperature dependencies
194  nr_double_t Bf = getPropertyDouble ("Bf");
195  nr_double_t Br = getPropertyDouble ("Br");
196  nr_double_t Xtb = getPropertyDouble ("Xtb");
197  nr_double_t F = qucs::exp (Xtb * qucs::log (T2 / T1));
198  setScaledProperty ("Bf", Bf * F);
199  setScaledProperty ("Br", Br * F);
200 
201  // compute Ise and Isc temperature and area dependencies
202  nr_double_t Ise = getPropertyDouble ("Ise");
203  nr_double_t Isc = getPropertyDouble ("Isc");
204  nr_double_t Ne = getPropertyDouble ("Ne");
205  nr_double_t Nc = getPropertyDouble ("Nc");
206  nr_double_t G = qucs::log (IsT / Is);
207  nr_double_t F1 = qucs::exp (G / Ne);
208  nr_double_t F2 = qucs::exp (G / Nc);
209  Ise = Ise / F * F1;
210  Isc = Isc / F * F2;
211  setScaledProperty ("Ise", Ise * A);
212  setScaledProperty ("Isc", Isc * A);
213 
214  // check unphysical parameters
215  nr_double_t Nf = getPropertyDouble ("Nf");
216  nr_double_t Nr = getPropertyDouble ("Nr");
217  if (Nf < 1.0) {
218  logprint (LOG_ERROR, "WARNING: Unphysical model parameter Nf = %g in "
219  "BJT `%s'\n", Nf, getName ());
220  }
221  if (Nr < 1.0) {
222  logprint (LOG_ERROR, "WARNING: Unphysical model parameter Nr = %g in "
223  "BJT `%s'\n", Nr, getName ());
224  }
225  if (Ne < 1.0) {
226  logprint (LOG_ERROR, "WARNING: Unphysical model parameter Ne = %g in "
227  "BJT `%s'\n", Ne, getName ());
228  }
229  if (Nc < 1.0) {
230  logprint (LOG_ERROR, "WARNING: Unphysical model parameter Nc = %g in "
231  "BJT `%s'\n", Nc, getName ());
232  }
233 
234  /* Originally Vtf was expected to be PROP_POS_RANGE, but there are models
235  * which use negative values. Instead of failing, warn the user.
236  * \todo Provide a way to silece such warnings
237  */
238  nr_double_t Vtf = getPropertyDouble ("Vtf");
239  if (Vtf < 0.0) {
240  logprint (LOG_ERROR, "WARNING: Unphysical model parameter Vtf = %g in "
241  "BJT `%s'\n", Vtf, getName ());
242  }
243 
244  // compute Cje, Cjc and Cjs temperature and area dependencies
245  nr_double_t Cje = getPropertyDouble ("Cje");
246  nr_double_t Cjc = getPropertyDouble ("Cjc");
247  nr_double_t Cjs = getPropertyDouble ("Cjs");
248  nr_double_t Mje = getPropertyDouble ("Mje");
249  nr_double_t Mjc = getPropertyDouble ("Mjc");
250  nr_double_t Mjs = getPropertyDouble ("Mjs");
251  Cje = pnCapacitance_T (T1, T2, Mje, VjeT / Vje, Cje);
252  Cjc = pnCapacitance_T (T1, T2, Mjc, VjcT / Vjc, Cjc);
253  Cjs = pnCapacitance_T (T1, T2, Mjs, VjsT / Vjs, Cjs);
254  setScaledProperty ("Cje", Cje * A);
255  setScaledProperty ("Cjc", Cjc * A);
256  setScaledProperty ("Cjs", Cjs * A);
257 
258  // compute Rb, Rc, Re and Rbm area dependencies
259  nr_double_t Rb = getPropertyDouble ("Rb");
260  nr_double_t Re = getPropertyDouble ("Re");
261  nr_double_t Rc = getPropertyDouble ("Rc");
262  nr_double_t Rbm = getPropertyDouble ("Rbm");
263  setScaledProperty ("Rb", Rb / A);
264  setScaledProperty ("Re", Re / A);
265  setScaledProperty ("Rc", Rc / A);
266  setScaledProperty ("Rbm", Rbm / A);
267 
268  // compute Ikf, Ikr, Irb and Itf area dependencies
269  nr_double_t Ikf = getPropertyDouble ("Ikf");
270  nr_double_t Ikr = getPropertyDouble ("Ikr");
271  nr_double_t Irb = getPropertyDouble ("Irb");
272  nr_double_t Itf = getPropertyDouble ("Itf");
273  setScaledProperty ("Ikf", Ikf * A);
274  setScaledProperty ("Ikr", Ikr * A);
275  setScaledProperty ("Irb", Irb * A);
276  setScaledProperty ("Itf", Itf * A);
277 }
278 
279 void bjt::initDC (void) {
280 
281  // no transient analysis
282  doTR = false;
283 
284  // allocate MNA matrices
285  allocMatrixMNA ();
286 
287  // initialize scalability
288  initModel ();
289 
290  // apply polarity of BJT
291  char * type = getPropertyString ("Type");
292  pol = !strcmp (type, "pnp") ? -1 : 1;
293 
294  // get simulation temperature
295  nr_double_t T = getPropertyDouble ("Temp");
296 
297  // initialize starting values
298  restartDC ();
299 
300  // disable additional base-collector capacitance
301  if (deviceEnabled (cbcx)) {
302  disableCapacitor (this, cbcx);
303  }
304 
305  // possibly insert series resistance at emitter
306  nr_double_t Re = getScaledProperty ("Re");
307  if (Re != 0.0) {
308  // create additional circuit if necessary and reassign nodes
309  re = splitResistor (this, re, "Re", "emitter", NODE_E);
310  re->setProperty ("R", Re);
311  re->setProperty ("Temp", T);
312  re->setProperty ("Controlled", getName ());
313  re->initDC ();
314  }
315  // no series resistance at emitter
316  else {
317  disableResistor (this, re, NODE_E);
318  }
319 
320  // possibly insert series resistance at collector
321  nr_double_t Rc = getScaledProperty ("Rc");
322  if (Rc != 0.0) {
323  // create additional circuit if necessary and reassign nodes
324  rc = splitResistor (this, rc, "Rc", "collector", NODE_C);
325  rc->setProperty ("R", Rc);
326  rc->setProperty ("Temp", T);
327  rc->setProperty ("Controlled", getName ());
328  rc->initDC ();
329  }
330  // no series resistance at collector
331  else {
332  disableResistor (this, rc, NODE_C);
333  }
334 
335  // possibly insert base series resistance
336  nr_double_t Rb = getScaledProperty ("Rb");
337  nr_double_t Rbm = getScaledProperty ("Rbm");
338  if (Rbm <= 0.0) Rbm = Rb; // Rbm defaults to Rb if zero
339  if (Rb < Rbm) Rbm = Rb; // Rbm must be less or equal Rb
340  setScaledProperty ("Rbm", Rbm);
341  if (Rbm != 0.0) {
342  // create additional circuit and reassign nodes
343  rb = splitResistor (this, rb, "Rbb", "base", NODE_B);
344  rb->setProperty ("R", Rb);
345  rb->setProperty ("Temp", T);
346  rb->setProperty ("Controlled", getName ());
347  rb->initDC ();
348  }
349  // no series resistance at base
350  else {
351  disableResistor (this, rb, NODE_B);
352  Rbb = 0.0; // set this operating point
353  setProperty ("Xcjc", 1.0); // other than 1 is senseless here
354  }
355 }
356 
357 void bjt::restartDC (void) {
358  // apply starting values to previous iteration values
359  UbePrev = real (getV (NODE_B) - getV (NODE_E)) * pol;
360  UbcPrev = real (getV (NODE_B) - getV (NODE_C)) * pol;
361 }
362 
363 #define cexState 6 // extra excess phase state
364 
365 void bjt::calcDC (void) {
366 
367  // fetch device model parameters
368  nr_double_t Is = getScaledProperty ("Is");
369  nr_double_t Nf = getPropertyDouble ("Nf");
370  nr_double_t Nr = getPropertyDouble ("Nr");
371  nr_double_t Vaf = getPropertyDouble ("Vaf");
372  nr_double_t Var = getPropertyDouble ("Var");
373  nr_double_t Ikf = getScaledProperty ("Ikf");
374  nr_double_t Ikr = getScaledProperty ("Ikr");
375  nr_double_t Bf = getScaledProperty ("Bf");
376  nr_double_t Br = getScaledProperty ("Br");
377  nr_double_t Ise = getScaledProperty ("Ise");
378  nr_double_t Isc = getScaledProperty ("Isc");
379  nr_double_t Ne = getPropertyDouble ("Ne");
380  nr_double_t Nc = getPropertyDouble ("Nc");
381  nr_double_t Rb = getScaledProperty ("Rb");
382  nr_double_t Rbm = getScaledProperty ("Rbm");
383  nr_double_t Irb = getScaledProperty ("Irb");
384  nr_double_t T = getPropertyDouble ("Temp");
385 
386  nr_double_t Ut, Q1, Q2;
387  nr_double_t Iben, Ibcn, Ibei, Ibci, Ibc, gbe, gbc, gtiny;
388  nr_double_t IeqB, IeqC, IeqE, IeqS, UbeCrit, UbcCrit;
389  nr_double_t gm, go;
390 
391  // interpret zero as infinity for these model parameters
392  Ikf = Ikf > 0 ? 1.0 / Ikf : 0;
393  Ikr = Ikr > 0 ? 1.0 / Ikr : 0;
394  Vaf = Vaf > 0 ? 1.0 / Vaf : 0;
395  Var = Var > 0 ? 1.0 / Var : 0;
396 
397  T = kelvin (T);
398  Ut = T * kBoverQ;
399  Ube = real (getV (NODE_B) - getV (NODE_E)) * pol;
400  Ubc = real (getV (NODE_B) - getV (NODE_C)) * pol;
401 
402  // critical voltage necessary for bad start values
403  UbeCrit = pnCriticalVoltage (Is, Nf * Ut);
404  UbcCrit = pnCriticalVoltage (Is, Nr * Ut);
405  UbePrev = Ube = pnVoltage (Ube, UbePrev, Ut * Nf, UbeCrit);
406  UbcPrev = Ubc = pnVoltage (Ubc, UbcPrev, Ut * Nr, UbcCrit);
407 
408  Uce = Ube - Ubc;
409 
410  // base-emitter diodes
411  gtiny = Ube < - 10 * Ut * Nf ? (Is + Ise) : 0;
412 #if 0
413  If = pnCurrent (Ube, Is, Ut * Nf);
414  Ibei = If / Bf;
415  gif = pnConductance (Ube, Is, Ut * Nf);
416  gbei = gif / Bf;
417  Iben = pnCurrent (Ube, Ise, Ut * Ne);
418  gben = pnConductance (Ube, Ise, Ut * Ne);
419  Ibe = Ibei + Iben + gtiny * Ube;
420  gbe = gbei + gben + gtiny;
421 #else
422  pnJunctionBIP (Ube, Is, Ut * Nf, If, gif);
423  Ibei = If / Bf;
424  gbei = gif / Bf;
425  pnJunctionBIP (Ube, Ise, Ut * Ne, Iben, gben);
426  Iben += gtiny * Ube;
427  gben += gtiny;
428  Ibe = Ibei + Iben;
429  gbe = gbei + gben;
430 #endif
431 
432  // base-collector diodes
433  gtiny = Ubc < - 10 * Ut * Nr ? (Is + Isc) : 0;
434 #if 0
435  Ir = pnCurrent (Ubc, Is, Ut * Nr);
436  Ibci = Ir / Br;
437  gir = pnConductance (Ubc, Is, Ut * Nr);
438  gbci = gir / Br;
439  Ibcn = pnCurrent (Ubc, Isc, Ut * Nc);
440  gbcn = pnConductance (Ubc, Isc, Ut * Nc);
441  Ibc = Ibci + Ibcn + gtiny * Ubc;
442  gbc = gbci + gbcn + gtiny;
443 #else
444  pnJunctionBIP (Ubc, Is, Ut * Nr, Ir, gir);
445  Ibci = Ir / Br;
446  gbci = gir / Br;
447  pnJunctionBIP (Ubc, Isc, Ut * Nc, Ibcn, gbcn);
448  Ibcn += gtiny * Ubc;
449  gbcn += gtiny;
450  Ibc = Ibci + Ibcn;
451  gbc = gbci + gbcn;
452 #endif
453 
454  // compute base charge quantities
455  Q1 = 1 / (1 - Ubc * Vaf - Ube * Var);
456  Q2 = If * Ikf + Ir * Ikr;
457  nr_double_t SArg = 1.0 + 4.0 * Q2;
458  nr_double_t Sqrt = SArg > 0 ? qucs::sqrt (SArg) : 1;
459  Qb = Q1 * (1 + Sqrt) / 2;
460  dQbdUbe = Q1 * (Qb * Var + gif * Ikf / Sqrt);
461  dQbdUbc = Q1 * (Qb * Vaf + gir * Ikr / Sqrt);
462 
463  // during transient analysis only
464  if (doTR) {
465  // calculate excess phase influence
466  If /= Qb;
467  excessPhase (cexState, If, gif);
468  If *= Qb;
469  }
470 
471  // compute transfer current
472  It = (If - Ir) / Qb;
473 
474  // compute forward and backward transconductance
475  gitf = (+gif - It * dQbdUbe) / Qb;
476  gitr = (-gir - It * dQbdUbc) / Qb;
477 
478  // compute old SPICE values
479  go = -gitr;
480  gm = +gitf - go;
481  setOperatingPoint ("gm", gm);
482  setOperatingPoint ("go", go);
483 
484  // calculate current-dependent base resistance
485  if (Rbm != 0.0) {
486  if (Irb != 0.0) {
487  nr_double_t a, b, z;
488  a = (Ibci + Ibcn + Ibei + Iben) / Irb;
489  a = MAX (a, NR_TINY); // enforce positive values
490  z = (qucs::sqrt (1 + 144 / sqr (M_PI) * a) - 1) / 24 * sqr (M_PI) / qucs::sqrt (a);
491  b = qucs::tan (z);
492  Rbb = Rbm + 3 * (Rb - Rbm) * (b - z) / z / sqr (b);
493  }
494  else {
495  Rbb = Rbm + (Rb - Rbm) / Qb;
496  }
497  rb->setScaledProperty ("R", Rbb);
498  rb->calcDC ();
499  }
500 
501  // compute autonomic current sources
502  IeqB = Ibe - Ube * gbe;
503  IeqC = Ibc - Ubc * gbc;
504 #if NEWSGP
505  IeqE = It - Ube * gitf - Ubc * gitr;
506 #else
507  IeqE = It - Ube * gm - Uce * go;
508 #endif
509  IeqS = 0;
510  setI (NODE_B, (-IeqB - IeqC) * pol);
511  setI (NODE_C, (+IeqC - IeqE - IeqS) * pol);
512  setI (NODE_E, (+IeqB + IeqE) * pol);
513  setI (NODE_S, (+IeqS) * pol);
514 
515  // apply admittance matrix elements
516 #if NEWSGP
517  setY (NODE_B, NODE_B, gbc + gbe);
518  setY (NODE_B, NODE_C, -gbc);
519  setY (NODE_B, NODE_E, -gbe);
520  setY (NODE_B, NODE_S, 0);
521  setY (NODE_C, NODE_B, -gbc + gitf + gitr);
522  setY (NODE_C, NODE_C, gbc - gitr);
523  setY (NODE_C, NODE_E, -gitf);
524  setY (NODE_C, NODE_S, 0);
525  setY (NODE_E, NODE_B, -gbe - gitf - gitr);
526  setY (NODE_E, NODE_C, gitr);
527  setY (NODE_E, NODE_E, gbe + gitf);
528  setY (NODE_E, NODE_S, 0);
529  setY (NODE_S, NODE_B, 0);
530  setY (NODE_S, NODE_C, 0);
531  setY (NODE_S, NODE_E, 0);
532  setY (NODE_S, NODE_S, 0);
533 #else
534  setY (NODE_B, NODE_B, gbc + gbe);
535  setY (NODE_B, NODE_C, -gbc);
536  setY (NODE_B, NODE_E, -gbe);
537  setY (NODE_B, NODE_S, 0);
538  setY (NODE_C, NODE_B, -gbc + gm);
539  setY (NODE_C, NODE_C, go + gbc);
540  setY (NODE_C, NODE_E, -go - gm);
541  setY (NODE_C, NODE_S, 0);
542  setY (NODE_E, NODE_B, -gbe - gm);
543  setY (NODE_E, NODE_C, -go);
544  setY (NODE_E, NODE_E, gbe + go + gm);
545  setY (NODE_E, NODE_S, 0);
546  setY (NODE_S, NODE_B, 0);
547  setY (NODE_S, NODE_C, 0);
548  setY (NODE_S, NODE_E, 0);
549  setY (NODE_S, NODE_S, 0);
550 #endif
551 }
552 
554  nr_double_t Vbe, Vbc;
555  Vbe = real (getV (NODE_B) - getV (NODE_E)) * pol;
556  Vbc = real (getV (NODE_B) - getV (NODE_C)) * pol;
557  Ucs = real (getV (NODE_S) - getV (NODE_C)) * pol;
558  setOperatingPoint ("Vbe", Vbe);
559  setOperatingPoint ("Vbc", Vbc);
560  setOperatingPoint ("Vce", Vbe - Vbc);
561  setOperatingPoint ("Vcs", Ucs);
562  if (deviceEnabled (cbcx)) {
563  Ubx = real (cbcx->getV (NODE_1) - cbcx->getV (NODE_2)) * pol;
564  setOperatingPoint ("Vbx", Ubx);
565  }
566 }
567 
569  Ube = getOperatingPoint ("Vbe");
570  Ubc = getOperatingPoint ("Vbc");
571  Uce = getOperatingPoint ("Vce");
572  Ucs = getOperatingPoint ("Vcs");
573 }
574 
576 
577  // fetch device model parameters
578  nr_double_t Cje0 = getScaledProperty ("Cje");
579  nr_double_t Vje = getScaledProperty ("Vje");
580  nr_double_t Mje = getPropertyDouble ("Mje");
581  nr_double_t Cjc0 = getScaledProperty ("Cjc");
582  nr_double_t Vjc = getScaledProperty ("Vjc");
583  nr_double_t Mjc = getPropertyDouble ("Mjc");
584  nr_double_t Xcjc = getPropertyDouble ("Xcjc");
585  nr_double_t Cjs0 = getScaledProperty ("Cjs");
586  nr_double_t Vjs = getScaledProperty ("Vjs");
587  nr_double_t Mjs = getPropertyDouble ("Mjs");
588  nr_double_t Fc = getPropertyDouble ("Fc");
589  nr_double_t Vtf = getPropertyDouble ("Vtf");
590  nr_double_t Tf = getPropertyDouble ("Tf");
591  nr_double_t Xtf = getPropertyDouble ("Xtf");
592  nr_double_t Itf = getScaledProperty ("Itf");
593  nr_double_t Tr = getPropertyDouble ("Tr");
594 
595  nr_double_t Cbe, Cbci, Cbcx, Ccs;
596 
597  // interpret zero as infinity for that model parameter
598  Vtf = Vtf > 0 ? 1.0 / Vtf : 0;
599 
600  // depletion capacitance of base-emitter diode
601  Cbe = pnCapacitance (Ube, Cje0, Vje, Mje, Fc);
602  Qbe = pnCharge (Ube, Cje0, Vje, Mje, Fc);
603 
604  // diffusion capacitance of base-emitter diode
605  if (If != 0.0) {
606  nr_double_t e, Tff, dTffdUbe, dTffdUbc, a;
607  a = 1 / (1 + Itf / If);
608  e = 2 * qucs::exp (MIN (Ubc * Vtf, 709));
609  Tff = Tf * (1 + Xtf * sqr (a) * e);
610  dTffdUbe = Tf * Xtf * 2 * gif * Itf * cubic (a) / sqr (If) * e;
611  Cbe += (If * dTffdUbe + Tff * (gif - If / Qb * dQbdUbe)) / Qb;
612  Qbe += If * Tff / Qb;
613  dTffdUbc = Tf * Xtf * Vtf * sqr (a) * e;
614  dQbedUbc = If / Qb * (dTffdUbc - Tff / Qb * dQbdUbc);
615  }
616 
617  // depletion and diffusion capacitance of base-collector diode
618  Cbci = pnCapacitance (Ubc, Cjc0 * Xcjc, Vjc, Mjc, Fc) + Tr * gir;
619  Qbci = pnCharge (Ubc, Cjc0 * Xcjc, Vjc, Mjc, Fc) + Tr * Ir;
620 
621  // depletion and diffusion capacitance of external base-collector capacitor
622  Cbcx = pnCapacitance (Ubx, Cjc0 * (1 - Xcjc), Vjc, Mjc, Fc);
623  Qbcx = pnCharge (Ubx, Cjc0 * (1 - Xcjc), Vjc, Mjc, Fc);
624 
625  // depletion capacitance of collector-substrate diode
626  Ccs = pnCapacitance (Ucs, Cjs0, Vjs, Mjs);
627  Qcs = pnCharge (Ucs, Cjs0, Vjs, Mjs);
628 
629  // finally save the operating points
630  setOperatingPoint ("Cbe", Cbe);
631  setOperatingPoint ("Cbci", Cbci);
632  setOperatingPoint ("Cbcx", Cbcx);
633  setOperatingPoint ("Ccs", Ccs);
634  setOperatingPoint ("gmf", gitf);
635  setOperatingPoint ("gmr", gitr);
636  setOperatingPoint ("gmu", gbci + gbcn);
637  setOperatingPoint ("gpi", gbei + gben);
638  setOperatingPoint ("Rbb", Rbb);
639  setOperatingPoint ("Ibe", Ibe);
640  setOperatingPoint ("Ice", It);
641 }
642 
643 void bjt::initSP (void) {
644  allocMatrixS ();
645  processCbcx ();
646  if (deviceEnabled (cbcx)) {
647  cbcx->initSP ();
648  cbcx->initNoiseSP ();
649  }
650 }
651 
652 void bjt::processCbcx (void) {
653  nr_double_t Xcjc = getPropertyDouble ("Xcjc");
654  nr_double_t Rbm = getScaledProperty ("Rbm");
655  nr_double_t Cjc0 = getScaledProperty ("Cjc");
656 
657  /* if necessary then insert external capacitance between internal
658  collector node and external base node */
659  if (Rbm != 0.0 && Cjc0 != 0.0 && Xcjc != 1.0) {
660  if (!deviceEnabled (cbcx)) {
661  cbcx = splitCapacitor (this, cbcx, "Cbcx", rb->getNode (NODE_1),
662  getNode (NODE_C));
663  }
664  cbcx->setProperty ("C", getOperatingPoint ("Cbcx"));
665  }
666  else {
667  disableCapacitor (this, cbcx);
668  }
669 }
670 
671 void bjt::initAC (void) {
672  allocMatrixMNA ();
673  processCbcx ();
674  if (deviceEnabled (cbcx)) {
675  cbcx->initAC ();
676  cbcx->initNoiseAC ();
677  }
678 }
679 
680 void bjt::calcAC (nr_double_t frequency) {
681  setMatrixY (calcMatrixY (frequency));
682 }
683 
684 void bjt::calcNoiseAC (nr_double_t frequency) {
685  setMatrixN (calcMatrixCy (frequency));
686 }
687 
688 #define qbeState 0 // base-emitter charge state
689 #define cbeState 1 // base-emitter current state
690 #define qbcState 2 // base-collector charge state
691 #define cbcState 3 // base-collector current state
692 #define qcsState 4 // collector-substrate charge state
693 #define ccsState 5 // collector-substrate current state
694 
695 #define qbxState 0 // external base-collector charge state
696 #define cbxState 1 // external base-collector current state
697 
698 void bjt::initTR (void) {
699  setStates (7);
700  initDC ();
701  doTR = true;
702 
703  // handle external base-collector capacitance appropriately
704  processCbcx ();
705  if (deviceEnabled (cbcx)) {
706  cbcx->initTR ();
707  cbcx->setProperty ("Controlled", getName ());
708  }
709 }
710 
711 void bjt::calcTR (nr_double_t t) {
712  calcDC ();
716 
717  nr_double_t Cbe = getOperatingPoint ("Cbe");
718  nr_double_t Ccs = getOperatingPoint ("Ccs");
719  nr_double_t Cbci = getOperatingPoint ("Cbci");
720  nr_double_t Cbcx = getOperatingPoint ("Cbcx");
721 
722  // handle Rbb and Cbcx appropriately
723  if (Rbb != 0.0) {
724  rb->setScaledProperty ("R", Rbb);
725  rb->calcTR (t);
726  if (deviceEnabled (cbcx)) {
727  cbcx->clearI ();
728  cbcx->clearY ();
730  }
731  }
732 
733  // usual capacitances
737 
738  // trans-capacitances
740 }
741 
742 void bjt::excessPhase (int istate, nr_double_t& i, nr_double_t& g) {
743 
744  // fetch device properties
745  nr_double_t Ptf = getPropertyDouble ("Ptf");
746  nr_double_t Tf = getPropertyDouble ("Tf");
747  nr_double_t td = rad (Ptf) * Tf;
748 
749  // return if nothing todo
750  if (td == 0.0) return;
751 
752  // fill-in current history during initialization
753  if (getMode () & MODE_INIT) fillState (istate, i);
754 
755  // calculate current coefficients C1, C2 and C3
756  nr_double_t * delta = getDelta ();
757  nr_double_t c3, c2, c1, dn, ra;
758  c1 = delta[0] / td;
759  c2 = 3 * c1;
760  c1 = c2 * c1;
761  dn = 1 + c1 + c2;
762  c1 = c1 / dn;
763  ra = delta[0] / delta[1];
764  c2 = (1 + ra + c2) / dn;
765  c3 = ra / dn;
766 
767  // update and save current, update transconductance
768  i = i * c1 + getState (istate, 1) * c2 - getState (istate, 2) * c3;
769  setState (istate, i);
770  g = g * c1;
771 }
772 
773 // properties
774 PROP_REQ [] = {
775  { "Is", PROP_REAL, { 1e-16, PROP_NO_STR }, PROP_POS_RANGE },
776  { "Nf", PROP_REAL, { 1, PROP_NO_STR }, PROP_RNGII (0.1, 100) },
777  { "Nr", PROP_REAL, { 1, PROP_NO_STR }, PROP_RNGII (0.1, 100) },
778  { "Ikf", PROP_REAL, { 0, PROP_NO_STR }, PROP_POS_RANGE },
779  { "Ikr", PROP_REAL, { 0, PROP_NO_STR }, PROP_POS_RANGE },
780  { "Vaf", PROP_REAL, { 0, PROP_NO_STR }, PROP_POS_RANGE },
781  { "Var", PROP_REAL, { 0, PROP_NO_STR }, PROP_POS_RANGE },
782  { "Ise", PROP_REAL, { 0, PROP_NO_STR }, PROP_POS_RANGE },
783  { "Ne", PROP_REAL, { 1.5, PROP_NO_STR }, PROP_RNGII (0.1, 100) },
784  { "Isc", PROP_REAL, { 0, PROP_NO_STR }, PROP_POS_RANGE },
785  { "Nc", PROP_REAL, { 2, PROP_NO_STR }, PROP_RNGII (0.1, 100) },
786  { "Bf", PROP_REAL, { 100, PROP_NO_STR }, PROP_POS_RANGEX },
787  { "Br", PROP_REAL, { 1, PROP_NO_STR }, PROP_POS_RANGEX },
788  { "Rbm", PROP_REAL, { 0, PROP_NO_STR }, PROP_POS_RANGE },
789  { "Irb", PROP_REAL, { 0, PROP_NO_STR }, PROP_POS_RANGE },
790  { "Cje", PROP_REAL, { 0, PROP_NO_STR }, PROP_POS_RANGE },
791  { "Vje", PROP_REAL, { 0.75, PROP_NO_STR }, PROP_RNGXI (0, 10) },
792  { "Mje", PROP_REAL, { 0.33, PROP_NO_STR }, PROP_RNGII (0, 1) },
793  { "Cjc", PROP_REAL, { 0, PROP_NO_STR }, PROP_POS_RANGE },
794  { "Vjc", PROP_REAL, { 0.75, PROP_NO_STR }, PROP_RNGXI (0, 10) },
795  { "Mjc", PROP_REAL, { 0.33, PROP_NO_STR }, PROP_RNGII (0, 1) },
796  { "Xcjc", PROP_REAL, { 1, PROP_NO_STR }, PROP_RNGII (0, 1) },
797  { "Cjs", PROP_REAL, { 0, PROP_NO_STR }, PROP_POS_RANGE },
798  { "Vjs", PROP_REAL, { 0.75, PROP_NO_STR }, PROP_RNGXI (0, 10) },
799  { "Mjs", PROP_REAL, { 0, PROP_NO_STR }, PROP_RNGII (0, 1) },
800  { "Fc", PROP_REAL, { 0.5, PROP_NO_STR }, PROP_RNGII (0, 1) },
801  { "Vtf", PROP_REAL, { 0, PROP_NO_STR }, PROP_NO_RANGE },
802  { "Tf", PROP_REAL, { 0, PROP_NO_STR }, PROP_POS_RANGE },
803  { "Xtf", PROP_REAL, { 0, PROP_NO_STR }, PROP_POS_RANGE },
804  { "Itf", PROP_REAL, { 0, PROP_NO_STR }, PROP_POS_RANGE },
805  { "Tr", PROP_REAL, { 0, PROP_NO_STR }, PROP_POS_RANGE },
806  PROP_NO_PROP };
807 PROP_OPT [] = {
808  { "Rc", PROP_REAL, { 0, PROP_NO_STR }, PROP_POS_RANGE },
809  { "Re", PROP_REAL, { 0, PROP_NO_STR }, PROP_POS_RANGE },
810  { "Rb", PROP_REAL, { 0, PROP_NO_STR }, PROP_POS_RANGE },
811  { "Kf", PROP_REAL, { 0, PROP_NO_STR }, PROP_POS_RANGE },
812  { "Af", PROP_REAL, { 1, PROP_NO_STR }, PROP_POS_RANGE },
813  { "Ffe", PROP_REAL, { 1, PROP_NO_STR }, PROP_POS_RANGE },
814  { "Kb", PROP_REAL, { 0, PROP_NO_STR }, PROP_POS_RANGE },
815  { "Ab", PROP_REAL, { 1, PROP_NO_STR }, PROP_POS_RANGE },
816  { "Fb", PROP_REAL, { 1, PROP_NO_STR }, PROP_POS_RANGE },
817  { "Temp", PROP_REAL, { 26.85, PROP_NO_STR }, PROP_MIN_VAL (K) },
818  { "Type", PROP_STR, { PROP_NO_VAL, "npn" }, PROP_RNG_BJT },
819  { "Ptf", PROP_REAL, { 0, PROP_NO_STR }, PROP_RNGII (-180, +180) },
820  { "Xtb", PROP_REAL, { 0, PROP_NO_STR }, PROP_NO_RANGE },
821  { "Xti", PROP_REAL, { 3, PROP_NO_STR }, PROP_POS_RANGE },
822  { "Eg", PROP_REAL, { EgSi, PROP_NO_STR }, PROP_POS_RANGE },
823  { "Tnom", PROP_REAL, { 26.85, PROP_NO_STR }, PROP_MIN_VAL (K) },
824  { "Area", PROP_REAL, { 1, PROP_NO_STR }, PROP_POS_RANGEX },
825  PROP_NO_PROP };
826 struct define_t bjt::cirdef =
void setProperty(const char *, char *)
Definition: object.cpp:104
nr_double_t It
Definition: bjt.h:60
nr_double_t gbcn
Definition: bjt.h:61
std::complex< nr_double_t > nr_complex_t
Definition: complex.h:31
nr_double_t getOperatingPoint(const char *)
Definition: circuit.cpp:525
#define PROP_POS_RANGE
Definition: netdefs.h:129
void clearY(void)
Definition: circuit.cpp:740
matrix ytos(matrix y, qucs::vector z0)
Admittance matrix to scattering parameters.
Definition: matrix.cpp:1133
nr_double_t Ubx
Definition: bjt.h:55
#define NODE_2
Definition: circuit.h:35
matrix real(matrix a)
Real part matrix.
Definition: matrix.cpp:568
void restartDC(void)
Definition: bjt.cpp:357
#define T0
standard temperature
Definition: constants.h:61
#define PROP_RNGII(f, t)
Definition: netdefs.h:138
#define kelvin(x)
Definition: constants.h:108
void calcSP(nr_double_t)
Definition: bjt.cpp:48
nr_double_t Uce
Definition: bjt.h:55
#define PROP_DEF
Definition: netdefs.h:189
void disableCapacitor(circuit *base, circuit *cap)
Definition: device.cpp:103
void fillState(int, state_type_t)
Definition: states.cpp:132
nr_double_t pnConductance(nr_double_t Upn, nr_double_t Iss, nr_double_t Ute)
Definition: device.cpp:181
circuit * splitResistor(circuit *base, circuit *res, const char *c, const char *n, int internal)
Definition: device.cpp:56
nr_double_t getPropertyDouble(const char *)
Definition: object.cpp:176
nr_complex_t pow(const nr_complex_t z, const nr_double_t d)
Compute power function with real exponent.
Definition: complex.cpp:238
#define NODE_S
Definition: bjt.cpp:38
#define cexState
Definition: bjt.cpp:363
PROP_NONLINEAR
Definition: bjt.cpp:827
int deviceEnabled(circuit *c)
Definition: device.cpp:112
#define PROP_REAL
Definition: netdefs.h:174
void setStates(int n)
Definition: states.h:52
t
Definition: parse_vcd.y:290
int getMode(void)
Definition: integrator.h:55
void initDC(void)
Definition: bjt.cpp:279
void calcTR(nr_double_t)
Definition: bjt.cpp:711
qucs::matrix calcMatrixY(nr_double_t)
Definition: bjt.cpp:53
#define PROP_NO_PROP
Definition: netdefs.h:122
nr_double_t Qb
Definition: bjt.h:60
#define QoverkB
Elementary charge over Boltzmann constant ( )
Definition: constants.h:70
#define K
Absolute 0 in centigrade.
Definition: constants.h:59
#define PROP_NO_RANGE
Definition: netdefs.h:126
Definition: bjt.cpp:826
#define PROP_NO_STR
Definition: netdefs.h:125
nr_double_t getScaledProperty(const char *)
Definition: object.cpp:185
void allocMatrixS(void)
Definition: circuit.cpp:251
void loadOperatingPoints(void)
Definition: bjt.cpp:568
nr_double_t If
Definition: bjt.h:60
static const nr_double_t z0
Definition: circuit.h:320
nr_double_t Ir
Definition: bjt.h:60
void initSP(void)
placehoder for S-Parameter initialisation function
Definition: bjt.cpp:643
circuit * splitCapacitor(circuit *base, circuit *cap, const char *c, node *n1, node *n2)
Definition: device.cpp:88
bool doTR
Definition: bjt.h:63
nr_double_t pnCapacitance(nr_double_t Uj, nr_double_t Cj, nr_double_t Vj, nr_double_t Mj, nr_double_t Fc)
Definition: device.cpp:187
void setScaledProperty(const char *, nr_double_t)
Definition: object.cpp:133
virtual void initDC(void)
Definition: circuit.h:113
void clearI(void)
Definition: circuit.cpp:730
void excessPhase(int, nr_double_t &, nr_double_t &)
Definition: bjt.cpp:742
i
Definition: parse_mdl.y:516
void initModel(void)
Definition: bjt.cpp:165
nr_complex_t sqr(const nr_complex_t z)
Square of complex number.
Definition: complex.cpp:673
nr_double_t dQbedUbc
Definition: bjt.h:60
virtual void initNoiseAC(void)
Definition: circuit.h:118
virtual void initAC(void)
Definition: circuit.h:120
nr_complex_t sqrt(const nr_complex_t z)
Compute principal value of square root.
Definition: complex.cpp:271
#define qcsState
Definition: bjt.cpp:692
void transientCapacitance(int, int, int, nr_double_t, nr_double_t, nr_double_t)
Definition: circuit.cpp:759
nr_double_t pnCurrent_T(nr_double_t T1, nr_double_t T2, nr_double_t Is, nr_double_t Eg, nr_double_t N=1, nr_double_t Xti=0)
Definition: device.cpp:384
void calcOperatingPoints(void)
Definition: bjt.cpp:575
#define NODE_E
Definition: bjt.cpp:37
nr_double_t pnCapacitance_T(nr_double_t T1, nr_double_t T2, nr_double_t M, nr_double_t VR, nr_double_t Cj)
Definition: device.cpp:406
nr_double_t Rbb
Definition: bjt.h:61
#define kBoverQ
Boltzmann constant over Elementary charge ( )
Definition: constants.h:68
#define PROP_COMPONENT
Definition: netdefs.h:116
nr_double_t dQbdUbc
Definition: bjt.h:60
virtual void initSP(void)
placehoder for S-Parameter initialisation function
Definition: circuit.h:111
eqn::constant * c1
#define kB
Boltzmann constant ( )
Definition: constants.h:64
eqn::constant * c2
nr_double_t gbei
Definition: bjt.h:61
#define qbcState
Definition: bjt.cpp:690
PROP_REQ[]
Definition: bjt.cpp:774
#define NODE_B
Definition: bjt.cpp:35
void setMatrixY(matrix)
Definition: circuit.cpp:685
nr_double_t Ubc
Definition: bjt.h:55
void disableResistor(circuit *base, circuit *res, int internal)
Definition: device.cpp:77
void pnJunctionBIP(nr_double_t Upn, nr_double_t Iss, nr_double_t Ute, nr_double_t &I, nr_double_t &g)
Definition: device.cpp:158
#define M_PI
Archimedes' constant ( )
Definition: consts.h:47
state_type_t getState(int, int n=0)
Definition: states.cpp:99
void setI(int, nr_complex_t)
Definition: circuit.cpp:397
virtual void initTR(void)
Definition: circuit.h:122
nr_double_t pnPotential_T(nr_double_t T1, nr_double_t T2, nr_double_t Vj, nr_double_t Eg0=Eg0Si)
Definition: device.cpp:394
nr_double_t gif
Definition: bjt.h:61
#define rad(x)
Convert degree to radian.
Definition: constants.h:118
nr_double_t gben
Definition: bjt.h:61
nr_double_t Qbe
Definition: bjt.h:62
void setMatrixS(matrix)
Definition: circuit.cpp:643
type
Definition: parse_vcd.y:164
matrix getMatrixS(void)
Definition: circuit.cpp:654
nr_double_t pnCharge(nr_double_t Uj, nr_double_t Cj, nr_double_t Vj, nr_double_t Mj, nr_double_t Fc)
Definition: device.cpp:199
void setY(int, int, nr_complex_t)
Definition: circuit.cpp:452
#define PROP_MIN_VAL(k)
Definition: netdefs.h:133
void processCbcx(void)
Definition: bjt.cpp:652
void saveOperatingPoints(void)
Definition: bjt.cpp:553
qucs::circuit * cbcx
Definition: bjt.h:59
#define MIN(x, y)
Minimum of x and y.
Definition: constants.h:132
void calcNoiseAC(nr_double_t)
Definition: bjt.cpp:684
matrix cytocs(matrix cy, matrix s)
Admittance noise correlation matrix to S-parameter noise correlation matrix.
Definition: matrix.cpp:1404
void allocMatrixMNA(void)
Definition: circuit.cpp:267
void transientCapacitanceC(int, int, int, int, nr_double_t, nr_double_t)
Definition: circuit.cpp:819
#define NODE_C
Definition: bjt.cpp:36
nr_double_t UbcPrev
Definition: bjt.h:55
qucs::circuit * rc
Definition: bjt.h:57
nr_double_t gitf
Definition: bjt.h:61
nr_double_t gitr
Definition: bjt.h:61
#define PROP_POS_RANGEX
Definition: netdefs.h:131
virtual void initNoiseSP(void)
Definition: circuit.h:116
#define PROP_STR
Definition: netdefs.h:175
#define A(a)
Definition: eqndefined.cpp:72
nr_double_t getV(int, nr_double_t)
Definition: circuit.cpp:941
y
Definition: parse_mdl.y:499
qucs::circuit * re
Definition: bjt.h:56
#define NODE_1
Definition: circuit.h:34
nr_double_t Qbcx
Definition: bjt.h:62
void setMatrixN(matrix)
Definition: circuit.cpp:664
qucs::circuit * rb
Definition: bjt.h:58
nr_complex_t tan(const nr_complex_t z)
Compute complex tangent.
Definition: complex.cpp:75
nr_complex_t exp(const nr_complex_t z)
Compute complex exponential.
Definition: complex.cpp:205
qucs::matrix calcMatrixCy(nr_double_t)
Definition: bjt.cpp:132
#define LOG_ERROR
Definition: logging.h:28
nr_double_t Ucs
Definition: bjt.h:55
char * getName(void)
Definition: object.cpp:84
void calcNoiseSP(nr_double_t)
Definition: bjt.cpp:128
node * getNode(int)
Definition: circuit.cpp:307
nr_complex_t polar(const nr_double_t mag, const nr_double_t ang)
Construct a complex number using polar notation.
Definition: complex.cpp:551
void calcAC(nr_double_t)
Definition: bjt.cpp:680
void setOperatingPoint(const char *, nr_double_t)
Definition: circuit.cpp:533
#define PROP_NO_VAL
Definition: netdefs.h:124
void initAC(void)
Definition: bjt.cpp:671
PROP_OPT[]
Definition: bjt.cpp:807
nr_double_t gbci
Definition: bjt.h:61
nr_double_t Qcs
Definition: bjt.h:62
#define qbeState
Definition: bjt.cpp:688
nr_double_t pnCriticalVoltage(nr_double_t Iss, nr_double_t Ute)
Definition: device.cpp:255
#define PROP_RNGXI(f, t)
Definition: netdefs.h:139
void initTR(void)
Definition: bjt.cpp:698
char * getPropertyString(const char *)
Definition: object.cpp:159
void setState(int, state_type_t, int n=0)
Definition: states.cpp:109
virtual void calcDC(void)
Definition: circuit.h:114
void logprint(int level, const char *format,...)
Definition: logging.c:37
nr_complex_t log(const nr_complex_t z)
Compute principal value of natural logarithm of z.
Definition: complex.cpp:215
nr_double_t Ube
Definition: bjt.h:55
nr_double_t dQbdUbe
Definition: bjt.h:60
nr_double_t gir
Definition: bjt.h:61
nr_double_t Qbci
Definition: bjt.h:62
void calcDC(void)
Definition: bjt.cpp:365
nr_double_t UbePrev
Definition: bjt.h:55
#define cubic(x)
Definition: constants.h:106
#define EgSi
Energy gap at 300K in eV of Silicon.
Definition: constants.h:87
nr_double_t pnCurrent(nr_double_t Upn, nr_double_t Iss, nr_double_t Ute)
Definition: device.cpp:175
#define PROP_RNG_BJT
Definition: netdefs.h:159
#define qbxState
Definition: bjt.cpp:695
#define MODE_INIT
Definition: integrator.h:31
#define PROP_NO_SUBSTRATE
Definition: netdefs.h:118
nr_double_t * getDelta(void)
Definition: circuit.h:209
nr_double_t Ibe
Definition: bjt.h:61
virtual void calcTR(nr_double_t)
Definition: circuit.h:123
#define MAX(x, y)
Maximum of x and y.
Definition: constants.h:127
nr_double_t pnVoltage(nr_double_t Ud, nr_double_t Uold, nr_double_t Ut, nr_double_t Ucrit)
Definition: device.cpp:121