Qucs-core  0.0.18
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
diode.cpp
Go to the documentation of this file.
1 /*
2  * diode.cpp - diode class implementation
3  *
4  * Copyright (C) 2004, 2005, 2006, 2007, 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 "devstates.h"
32 #include "diode.h"
33 
34 #define NODE_C 0 /* cathode node */
35 #define NODE_A 1 /* anode node */
36 
37 #define StateVars 1 // state variables
38 
39 // state variable indices
40 #define _UdPrev 0
41 
42 // state variable shortcuts
43 #define UdPrev deviceVar (_UdPrev)
44 
45 using namespace qucs;
46 using namespace qucs::device;
47 
48 // Constructor for the diode.
49 diode::diode () : circuit (2) {
50  rs = NULL;
51  type = CIR_DIODE;
52 }
53 
54 // Callback for S-parameter analysis.
55 void diode::calcSP (nr_double_t frequency) {
56  nr_double_t gd = getOperatingPoint ("gd");
57  nr_double_t Cd = getOperatingPoint ("Cd");
58  nr_complex_t y = 2 * z0 * nr_complex_t (gd, Cd * 2.0 * M_PI * frequency);
59  setS (NODE_C, NODE_C, 1.0 / (1.0 + y));
60  setS (NODE_A, NODE_A, 1.0 / (1.0 + y));
61  setS (NODE_C, NODE_A, y / (1.0 + y));
62  setS (NODE_A, NODE_C, y / (1.0 + y));
63 }
64 
65 // Callback for S-parameter noise analysis.
66 void diode::calcNoiseSP (nr_double_t frequency) {
67 #if MICHAEL /* shot noise only */
68  nr_double_t Id = getOperatingPoint ("Id");
69  nr_double_t Is = getPropertyDouble ("Is") + getPropertyDouble ("Isr");
70 
71  // adjust shot noise current if necessary
72  if (Id < -Is) Id = -Is;
73 
74  nr_double_t gd = getOperatingPoint ("gd");
75  nr_double_t Cd = getOperatingPoint ("Cd");
76 
77  nr_complex_t y = rect (gd, Cd * 2.0 * M_PI * frequency);
78  nr_complex_t f = 2 * z0 * (Id + 2 * Is) / norm (2 * z0 * y + 1) * QoverkB / T0;
79  setN (NODE_C, NODE_C, +f); setN (NODE_A, NODE_A, +f);
80  setN (NODE_C, NODE_A, -f); setN (NODE_A, NODE_C, -f);
81 #else
82  setMatrixN (cytocs (calcMatrixCy (frequency) * z0, getMatrixS ()));
83 #endif
84 }
85 
86 // Computes noise correlation matrix Cy.
87 matrix diode::calcMatrixCy (nr_double_t frequency) {
88  // fetch computed operating points
89  nr_double_t Id = getOperatingPoint ("Id");
90  nr_double_t Is = getPropertyDouble ("Is") + getPropertyDouble ("Isr");
91 
92  // adjust shot noise current if necessary
93  if (Id < -Is) Id = -Is;
94 
95  nr_double_t Kf = getPropertyDouble ("Kf");
96  nr_double_t Af = getPropertyDouble ("Af");
97  nr_double_t Ffe = getPropertyDouble ("Ffe");
98 
99  // build noise current correlation matrix
100  matrix cy (2);
101  nr_double_t i = 2 * (Id + 2 * Is) * QoverkB / T0 + // shot noise
102  Kf * qucs::pow (fabs (Id), Af) / qucs::pow (frequency, Ffe) / kB / T0; // flicker noise
103  cy.set (NODE_C, NODE_C, +i); cy.set (NODE_A, NODE_A, +i);
104  cy.set (NODE_A, NODE_C, -i); cy.set (NODE_C, NODE_A, -i);
105  return cy;
106 }
107 
108 // Initializes the diode model including temperature and area effects.
109 void diode::initModel (void) {
110  // fetch necessary device properties
111  nr_double_t T = getPropertyDouble ("Temp");
112  nr_double_t Tn = getPropertyDouble ("Tnom");
113  nr_double_t A = getPropertyDouble ("Area");
114 
115  // compute Is temperature and area dependency
116  nr_double_t Is = getPropertyDouble ("Is");
117  nr_double_t N = getPropertyDouble ("N");
118  nr_double_t Xti = getPropertyDouble ("Xti");
119  nr_double_t Eg = getPropertyDouble ("Eg");
120  nr_double_t T1, T2;
121  T2 = kelvin (T);
122  T1 = kelvin (Tn);
123  Is = pnCurrent_T (T1, T2, Is, Eg, N, Xti);
124  setScaledProperty ("Is", Is * A);
125 
126  // compute Isr temperature and area dependency
127  nr_double_t Isr = getPropertyDouble ("Isr");
128  nr_double_t Nr = getPropertyDouble ("Nr");
129  Isr = pnCurrent_T (T1, T2, Isr, Eg, Nr, Xti);
130  setScaledProperty ("Isr", Isr * A);
131 
132  // check unphysical parameters
133  if (Nr < 1.0) {
134  logprint (LOG_ERROR, "WARNING: Unphysical model parameter Nr = %g in "
135  "diode `%s'\n", Nr, getName ());
136  }
137  if (N < 1.0) {
138  logprint (LOG_ERROR, "WARNING: Unphysical model parameter N = %g in "
139  "diode `%s'\n", N, getName ());
140  }
141 
142  // compute Vj temperature dependency
143  nr_double_t Vj = getPropertyDouble ("Vj");
144  nr_double_t VjT;
145  VjT = pnPotential_T (T1,T2, Vj);
146  setScaledProperty ("Vj", VjT);
147 
148  // compute Cj0 temperature and area dependency
149  nr_double_t Cj0 = getPropertyDouble ("Cj0");
150  nr_double_t M = getPropertyDouble ("M");
151  Cj0 = pnCapacitance_T (T1, T2, M, VjT / Vj, Cj0);
152  setScaledProperty ("Cj0", Cj0 * A);
153 
154  // check unphysical parameters
155  if (M > 1.0) {
156  logprint (LOG_ERROR, "WARNING: Unphysical model parameter M = %g in "
157  "Diode `%s'\n", M, getName ());
158  }
159 
160  // compute Bv temperature dependency
161  nr_double_t Bv = getPropertyDouble ("Bv");
162  nr_double_t Tbv = getPropertyDouble ("Tbv");
163  nr_double_t DT = T2 - T1;
164  Bv = Bv - Tbv * DT;
165  setScaledProperty ("Bv", Bv);
166 
167  // compute Tt temperature dependency
168  nr_double_t Tt = getPropertyDouble ("Tt");
169  nr_double_t Ttt1 = getPropertyDouble ("Ttt1");
170  nr_double_t Ttt2 = getPropertyDouble ("Ttt2");
171  Tt = Tt * (1 + Ttt1 * DT + Ttt2 * DT * DT);
172  setScaledProperty ("Tt", Tt);
173 
174  // compute M temperature dependency
175  nr_double_t Tm1 = getPropertyDouble ("Tm1");
176  nr_double_t Tm2 = getPropertyDouble ("Tm2");
177  M = M * (1 + Tm1 * DT + Tm2 * DT * DT);
178  setScaledProperty ("M", M);
179 
180  // compute Rs temperature and area dependency
181  nr_double_t Rs = getPropertyDouble ("Rs");
182  nr_double_t Trs = getPropertyDouble ("Trs");
183  Rs = Rs * (1 + Trs * DT);
184  setScaledProperty ("Rs", Rs / A);
185 }
186 
187 // Prepares DC (i.e. HB) analysis.
188 void diode::prepareDC (void) {
189  // allocate MNA matrices
190  allocMatrixMNA ();
191 
192  // initialize scalability
193  initModel ();
194 
195  // initialize starting values
196  Ud = real (getV (NODE_A) - getV (NODE_C));
197  for (int i = 0; i < deviceStates (); i++) {
198  deviceState (i);
199  UdPrev = Ud;
200  }
201 
202  // get device temperature
203  nr_double_t T = getPropertyDouble ("Temp");
204 
205  // possibly insert series resistance
206  nr_double_t Rs = getScaledProperty ("Rs");
207  if (Rs != 0.0) {
208  // create additional circuit if necessary and reassign nodes
209  rs = splitResistor (this, rs, "Rs", "anode", NODE_A);
210  rs->setProperty ("Temp", T);
211  rs->setProperty ("R", Rs);
212  rs->setProperty ("Controlled", getName ());
213  rs->initDC ();
214  }
215  // no series resistance
216  else {
217  disableResistor (this, rs, NODE_A);
218  }
219 
220  // calculate actual breakdown voltage
221  Bv = getScaledProperty ("Bv");
222  if (Bv != 0) {
223  nr_double_t Ibv, Is, tol, Ut, Xbv, Xibv;
224  Ibv = getPropertyDouble ("Ibv");
225  Is = getScaledProperty ("Is");
226  Ut = kelvin (T) * kBoverQ;
227  // adjust very small breakdown currents
228  if (Ibv < Is * Bv / Ut) {
229  Ibv = Is * Bv / Ut;
230  Xbv = Bv;
231  logprint (LOG_ERROR, "WARNING: Increased breakdown current to %g to "
232  "match the saturation current %g\n", Ibv, Is);
233  }
234  // fit reverse and forward regions
235  else {
236  int good = 0;
237  tol = 1e-3 * Ibv;
238  Xbv = Bv - Ut * qucs::log (1 + Ibv / Is);
239  for (int i = 0; i < 25 ; i++) {
240  Xbv = Bv - Ut * qucs::log (Ibv / Is + 1 - Xbv / Ut);
241  Xibv = Is * (qucs::exp ((Bv - Xbv) / Ut) - 1 + Xbv / Ut);
242  if (fabs (Xibv - Ibv) < tol) {
243  Bv = Xbv;
244  good = 1;
245  break;
246  }
247  }
248  if (!good) {
249  logprint (LOG_ERROR, "WARNING: Unable to fit reverse and forward "
250  "diode regions using Bv=%g and Ibv=%g\n", Bv, Ibv);
251  }
252  }
253  }
254 }
255 
256 // Callback for initializing the DC analysis.
257 void diode::initDC (void) {
258  deviceStates (StateVars, 1);
259  doHB = false;
260  prepareDC ();
261 }
262 
263 // Callback for restarting the DC analysis.
264 void diode::restartDC (void) {
265  // apply starting value to previous iteration value
266  UdPrev = real (getV (NODE_A) - getV (NODE_C));
267 }
268 
269 // Callback for DC analysis.
270 void diode::calcDC (void) {
271  // get device properties
272  nr_double_t Is = getScaledProperty ("Is");
273  nr_double_t N = getPropertyDouble ("N");
274  nr_double_t Isr = getScaledProperty ("Isr");
275  nr_double_t Nr = getPropertyDouble ("Nr");
276  nr_double_t Ikf = getPropertyDouble ("Ikf");
277  nr_double_t T = getPropertyDouble ("Temp");
278 
279  nr_double_t Ut, Ieq, Ucrit, gtiny;
280 
281  T = kelvin (T);
282  Ut = T * kBoverQ;
283  Ud = real (getV (NODE_A) - getV (NODE_C));
284 
285  // critical voltage necessary for bad start values
286  Ucrit = pnCriticalVoltage (Is, N * Ut);
287  if (Bv != 0 && Ud < MIN (0, -Bv + 10 * N * Ut)) {
288  nr_double_t V = -(Ud + Bv);
289  V = pnVoltage (V, -(UdPrev + Bv), Ut * N, Ucrit);
290  Ud = -(V + Bv);
291  }
292  else {
293  Ud = pnVoltage (Ud, UdPrev, Ut * N, Ucrit);
294  }
295  UdPrev = Ud;
296 
297  // tiny derivative for little junction voltage
298  gtiny = (Ud < - 10 * Ut * N && Bv != 0) ? (Is + Isr) : 0;
299 
300  if (Ud >= -3 * N * Ut) { // forward region
301  gd = pnConductance (Ud, Is, Ut * N) + pnConductance (Ud, Isr, Ut * Nr);
302  Id = pnCurrent (Ud, Is, Ut * N) + pnCurrent (Ud, Isr, Ut * Nr);
303  }
304  else if (Bv == 0 || Ud >= -Bv) { // reverse region
305  nr_double_t a = 3 * N * Ut / (Ud * M_E);
306  a = cubic (a);
307  Id = -Is * (1 + a);
308  gd = +Is * 3 * a / Ud;
309  }
310  else { // middle region
311  nr_double_t a = qucs::exp (-(Bv + Ud) / N / Ut);
312  Id = -Is * a;
313  gd = +Is * a / Ut / N;
314  }
315 
316  // knee current calculations
317  if (Ikf != 0.0) {
318  nr_double_t a = Ikf / (Ikf + Id);
319  gd *= 0.5 * (2 - Id * a / Ikf) * qucs::sqrt (a);
320  Id *= qucs::sqrt (a);
321  }
322 
323  Id += gtiny * Ud;
324  gd += gtiny;
325 
326  // HB simulation
327  if (doHB) {
328  Ieq = Id;
329  setGV (NODE_C, -gd * Ud);
330  setGV (NODE_A, +gd * Ud);
331  }
332  // DC and transient simulation
333  else {
334  Ieq = Id - Ud * gd;
335  }
336 
337  // fill in I-Vector
338  setI (NODE_C, +Ieq);
339  setI (NODE_A, -Ieq);
340 
341  // fill in G-Matrix
342  setY (NODE_C, NODE_C, +gd); setY (NODE_A, NODE_A, +gd);
343  setY (NODE_C, NODE_A, -gd); setY (NODE_A, NODE_C, -gd);
344 }
345 
346 // Saves operating points (voltages).
348  nr_double_t Vd = real (getV (NODE_A) - getV (NODE_C));
349  setOperatingPoint ("Vd", Vd);
350 }
351 
352 // Loads operating points (voltages).
354  Ud = getOperatingPoint ("Vd");
355 }
356 
357 // Calculates and saves operating points.
359 
360  // load operating points
362 
363  // get necessary properties
364  nr_double_t M = getScaledProperty ("M");
365  nr_double_t Cj0 = getScaledProperty ("Cj0");
366  nr_double_t Vj = getScaledProperty ("Vj");
367  nr_double_t Fc = getPropertyDouble ("Fc");
368  nr_double_t Cp = getPropertyDouble ("Cp");
369  nr_double_t Tt = getScaledProperty ("Tt");
370 
371  // calculate capacitances and charges
372  nr_double_t Cd;
373  Cd = pnCapacitance (Ud, Cj0, Vj, M, Fc) + Tt * gd + Cp;
374  Qd = pnCharge (Ud, Cj0, Vj, M, Fc) + Tt * Id + Cp * Ud;
375 
376  // save operating points
377  setOperatingPoint ("gd", gd);
378  setOperatingPoint ("Id", Id);
379  setOperatingPoint ("Cd", Cd);
380 }
381 
382 // Callback for initializing the AC analysis.
383 void diode::initAC (void) {
384  allocMatrixMNA ();
385 }
386 
387 // Callback for the AC analysis.
388 void diode::calcAC (nr_double_t frequency) {
389  nr_double_t gd = getOperatingPoint ("gd");
390  nr_double_t Cd = getOperatingPoint ("Cd");
391  nr_complex_t y = nr_complex_t (gd, Cd * 2.0 * M_PI * frequency);
392  setY (NODE_C, NODE_C, +y); setY (NODE_A, NODE_A, +y);
393  setY (NODE_C, NODE_A, -y); setY (NODE_A, NODE_C, -y);
394 }
395 
396 // Callback for the AC noise analysis.
397 void diode::calcNoiseAC (nr_double_t frequency) {
398  setMatrixN (calcMatrixCy (frequency));
399 }
400 
401 #define qState 0 // charge state
402 #define cState 1 // current state
403 
404 // Callback for initializing the TR analysis.
405 void diode::initTR (void) {
406  setStates (2);
407  initDC ();
408 }
409 
410 // Callback for the TR analysis.
411 void diode::calcTR (nr_double_t) {
412  calcDC ();
415 
416  nr_double_t Cd = getOperatingPoint ("Cd");
417 
419 }
420 
421 // Callback for initializing the HB analysis.
422 void diode::initHB (int frequencies) {
423  deviceStates (StateVars, frequencies);
424  doHB = true;
425  prepareDC ();
426  allocMatrixHB ();
427 }
428 
429 // Callback for the HB analysis.
430 void diode::calcHB (int frequency) {
431  // set current frequency state
432  deviceState (frequency);
433 
434  // g's (dI/dU) into Y-Matrix and I's into I-Vector
435  calcDC ();
436 
437  // calculate Q and C
440 
441  nr_double_t Cd = getOperatingPoint ("Cd");
442 
443  // fill in Q's in Q-Vector
444  setQ (NODE_C, +Qd);
445  setQ (NODE_A, -Qd);
446 
447  setCV (NODE_C, -Cd * Ud);
448  setCV (NODE_A, +Cd * Ud);
449 
450  // fill in C's (dQ/dU) into QV-Matrix
451  setQV (NODE_C, NODE_C, +Cd); setQV (NODE_A, NODE_A, +Cd);
452  setQV (NODE_C, NODE_A, -Cd); setQV (NODE_A, NODE_C, -Cd);
453 }
454 
455 // properties
456 PROP_REQ [] = {
457  { "Is", PROP_REAL, { 1e-15, PROP_NO_STR }, PROP_POS_RANGE },
458  { "N", PROP_REAL, { 1, PROP_NO_STR }, PROP_RNGII (1e-6, 100) },
459  { "M", PROP_REAL, { 0.5, PROP_NO_STR }, PROP_RNGII (0, 2) },
460  { "Cj0", PROP_REAL, { 10e-15, PROP_NO_STR }, PROP_POS_RANGE },
461  { "Vj", PROP_REAL, { 0.7, PROP_NO_STR }, PROP_RNGXI (0, 10) },
462  PROP_NO_PROP };
463 PROP_OPT [] = {
464  { "Rs", PROP_REAL, { 0, PROP_NO_STR }, PROP_POS_RANGE },
465  { "Isr", PROP_REAL, { 0, PROP_NO_STR }, PROP_POS_RANGE },
466  { "Nr", PROP_REAL, { 2, PROP_NO_STR }, PROP_RNGII (0.1, 100) },
467  { "Bv", PROP_REAL, { 0, PROP_NO_STR }, PROP_POS_RANGE },
468  { "Ibv", PROP_REAL, { 1e-3, PROP_NO_STR }, PROP_POS_RANGE },
469  { "Ikf", PROP_REAL, { 0, PROP_NO_STR }, PROP_POS_RANGE },
470  { "Tt", PROP_REAL, { 0, PROP_NO_STR }, PROP_POS_RANGE },
471  { "Fc", PROP_REAL, { 0.5, PROP_NO_STR }, PROP_RNGIX (0, 1) },
472  { "Cp", PROP_REAL, { 0, PROP_NO_STR }, PROP_POS_RANGE },
473  { "Kf", PROP_REAL, { 0, PROP_NO_STR }, PROP_POS_RANGE },
474  { "Af", PROP_REAL, { 1, PROP_NO_STR }, PROP_POS_RANGE },
475  { "Ffe", PROP_REAL, { 1, PROP_NO_STR }, PROP_POS_RANGE },
476  { "Temp", PROP_REAL, { 26.85, PROP_NO_STR }, PROP_MIN_VAL (K) },
477  { "Xti", PROP_REAL, { 3, PROP_NO_STR }, PROP_POS_RANGE },
478  { "Eg", PROP_REAL, { EgSi, PROP_NO_STR }, PROP_POS_RANGE },
479  { "Tbv", PROP_REAL, { 0, PROP_NO_STR }, PROP_POS_RANGE },
480  { "Trs", PROP_REAL, { 0, PROP_NO_STR }, PROP_NO_RANGE },
481  { "Ttt1", PROP_REAL, { 0, PROP_NO_STR }, PROP_NO_RANGE },
482  { "Ttt2", PROP_REAL, { 0, PROP_NO_STR }, PROP_NO_RANGE },
483  { "Tm1", PROP_REAL, { 0, PROP_NO_STR }, PROP_NO_RANGE },
484  { "Tm2", PROP_REAL, { 0, PROP_NO_STR }, PROP_NO_RANGE },
485  { "Tnom", PROP_REAL, { 26.85, PROP_NO_STR }, PROP_MIN_VAL (K) },
486  { "Area", PROP_REAL, { 1, PROP_NO_STR }, PROP_POS_RANGEX },
487  PROP_NO_PROP };
488 struct define_t diode::cirdef =
void setProperty(const char *, char *)
Definition: object.cpp:104
#define M_E
Euler's constant ( )
Definition: consts.h:71
std::complex< nr_double_t > nr_complex_t
Definition: complex.h:31
qucs::matrix calcMatrixCy(nr_double_t)
Definition: diode.cpp:87
nr_double_t getOperatingPoint(const char *)
Definition: circuit.cpp:525
#define PROP_POS_RANGE
Definition: netdefs.h:129
matrix real(matrix a)
Real part matrix.
Definition: matrix.cpp:568
#define T0
standard temperature
Definition: constants.h:61
#define PROP_RNGII(f, t)
Definition: netdefs.h:138
#define N(n)
Definition: equation.cpp:58
#define kelvin(x)
Definition: constants.h:108
#define PROP_DEF
Definition: netdefs.h:189
void setQ(int, nr_complex_t)
Definition: circuit.cpp:418
nr_double_t pnConductance(nr_double_t Upn, nr_double_t Iss, nr_double_t Ute)
Definition: device.cpp:181
void calcNoiseAC(nr_double_t)
Definition: diode.cpp:397
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 PROP_REAL
Definition: netdefs.h:174
void setStates(int n)
Definition: states.h:52
nr_double_t Id
Definition: diode.h:51
PROP_REQ[]
Definition: diode.cpp:456
#define PROP_NO_PROP
Definition: netdefs.h:122
void prepareDC(void)
Definition: diode.cpp:188
#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
#define PROP_NO_STR
Definition: netdefs.h:125
nr_double_t getScaledProperty(const char *)
Definition: object.cpp:185
static const nr_double_t z0
Definition: circuit.h:320
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
Definition: diode.cpp:488
void calcAC(nr_double_t)
Definition: diode.cpp:388
i
Definition: parse_mdl.y:516
void calcDC(void)
Definition: diode.cpp:270
nr_complex_t sqrt(const nr_complex_t z)
Compute principal value of square root.
Definition: complex.cpp:271
bool doHB
Definition: diode.h:53
void transientCapacitance(int, int, int, nr_double_t, nr_double_t, nr_double_t)
Definition: circuit.cpp:759
void calcNoiseSP(nr_double_t)
Definition: diode.cpp:66
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
double tol
void initTR(void)
Definition: diode.cpp:405
void initDC(void)
Definition: diode.cpp:257
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
#define kBoverQ
Boltzmann constant over Elementary charge ( )
Definition: constants.h:68
#define PROP_COMPONENT
Definition: netdefs.h:116
void setCV(int, nr_complex_t)
Definition: circuit.cpp:511
void allocMatrixHB(void)
Definition: circuit.cpp:227
void saveOperatingPoints(void)
Definition: diode.cpp:347
void calcSP(nr_double_t)
Definition: diode.cpp:55
#define V(con)
Definition: evaluate.cpp:63
#define kB
Boltzmann constant ( )
Definition: constants.h:64
#define qState
Definition: diode.cpp:401
nr_double_t Ud
Definition: diode.h:51
int deviceState(void)
Definition: devstates.cpp:79
void disableResistor(circuit *base, circuit *res, int internal)
Definition: device.cpp:77
#define M_PI
Archimedes' constant ( )
Definition: consts.h:47
void calcOperatingPoints(void)
Definition: diode.cpp:358
void setI(int, nr_complex_t)
Definition: circuit.cpp:397
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
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 restartDC(void)
Definition: diode.cpp:264
void initModel(void)
Definition: diode.cpp:109
void calcTR(nr_double_t)
Definition: diode.cpp:411
#define MIN(x, y)
Minimum of x and y.
Definition: constants.h:132
matrix cytocs(matrix cy, matrix s)
Admittance noise correlation matrix to S-parameter noise correlation matrix.
Definition: matrix.cpp:1404
#define NODE_C
Definition: diode.cpp:34
void allocMatrixMNA(void)
Definition: circuit.cpp:267
#define StateVars
Definition: diode.cpp:37
nr_double_t norm(const nr_complex_t z)
Compute euclidian norm of complex number.
Definition: complex.cpp:283
#define UdPrev
Definition: diode.cpp:43
#define PROP_POS_RANGEX
Definition: netdefs.h:131
#define PROP_RNGIX(f, t)
Definition: netdefs.h:140
#define A(a)
Definition: eqndefined.cpp:72
qucs::circuit * rs
Definition: diode.h:52
virtual void initHB(void)
Definition: circuit.h:124
nr_double_t gd
Definition: diode.h:51
nr_double_t getV(int, nr_double_t)
Definition: circuit.cpp:941
y
Definition: parse_mdl.y:499
nr_double_t Qd
Definition: diode.h:51
void setMatrixN(matrix)
Definition: circuit.cpp:664
nr_complex_t exp(const nr_complex_t z)
Compute complex exponential.
Definition: complex.cpp:205
void setQV(int, int, nr_complex_t)
Definition: circuit.cpp:487
#define LOG_ERROR
Definition: logging.h:28
char * getName(void)
Definition: object.cpp:84
void setS(int, int, nr_complex_t)
Definition: circuit.cpp:587
void setN(int, int, nr_complex_t)
Definition: circuit.cpp:597
void setOperatingPoint(const char *, nr_double_t)
Definition: circuit.cpp:533
void loadOperatingPoints(void)
Definition: diode.cpp:353
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
int deviceStates(void)
Definition: devstates.cpp:68
PROP_OPT[]
Definition: diode.cpp:463
#define M(con)
Definition: evaluate.cpp:64
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
void setGV(int, nr_complex_t)
Definition: circuit.cpp:499
void initAC(void)
Definition: diode.cpp:383
void calcHB(int)
Definition: diode.cpp:430
#define cubic(x)
Definition: constants.h:106
#define EgSi
Energy gap at 300K in eV of Silicon.
Definition: constants.h:87
nr_double_t Bv
Definition: diode.h:51
nr_double_t pnCurrent(nr_double_t Upn, nr_double_t Iss, nr_double_t Ute)
Definition: device.cpp:175
#define NODE_A
Definition: diode.cpp:35
PROP_NONLINEAR
Definition: diode.cpp:489
#define PROP_NO_SUBSTRATE
Definition: netdefs.h:118
nr_double_t pnVoltage(nr_double_t Ud, nr_double_t Uold, nr_double_t Ut, nr_double_t Ucrit)
Definition: device.cpp:121