Qucs-core  0.0.18
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
device.h
Go to the documentation of this file.
1 /*
2  * device.h - device class definitions
3  *
4  * Copyright (C) 2004, 2005, 2006 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 #ifndef __DEVICE_H__
26 #define __DEVICE_H__
27 
28 namespace qucs {
29 
30 class circuit;
31 class node;
32 class net;
33 
34 namespace device {
35 
36  // creates external resistor circuit
37  circuit *
39  circuit * base, // calling circuit (this)
40  circuit * res, // additional resistor circuit (can be NULL)
41  const char * c, // name of the additional circuit
42  const char * n, // name of the inserted (internal) node
43  int internal); // number of new node (the original external node)
44 
45  // removes external resistor circuit
46  void
48  circuit * base, // calling circuit (this)
49  circuit * res, // additional resistor circuit
50  int internal); // number of new node (the original external node)
51 
52  // creates external capacitor circuit
53  circuit *
55  circuit * base, // calling circuit (this)
56  circuit * cap, // additional capacitor circuit (can be NULL)
57  const char * c, // name of the additional circuit
58  node * n1, // first node of new capacitor
59  node * n2); // second node of new capacitor
60 
61  // removes external capacitor circuit
62  void
64  circuit * base, // calling circuit (this)
65  circuit * cap); // additional capacitor circuit
66 
67  // checks whether circuit is enabled
68  int
70  circuit * c); // circuit to be checked
71 
72  // computes current and its derivative for a MOS pn-junction
73  void
75  nr_double_t Upn, // pn-voltage
76  nr_double_t Iss, // saturation current
77  nr_double_t Ute, // temperature voltage
78  nr_double_t& I, // result current
79  nr_double_t& g); // result derivative
80 
81  // computes current and its derivative for a bipolar pn-junction
82  void
84  nr_double_t Upn, // pn-voltage
85  nr_double_t Iss, // saturation current
86  nr_double_t Ute, // temperature voltage
87  nr_double_t& I, // result current
88  nr_double_t& g); // result derivative
89 
90  // limits the forward pn-voltage
91  nr_double_t
92  pnVoltage (
93  nr_double_t Ud, // current pn-voltage
94  nr_double_t Uold, // previous pn-voltage
95  nr_double_t Ut, // temperature voltage
96  nr_double_t Ucrit); // critical voltage
97 
98  // computes the exponential pn-junction current
99  nr_double_t
100  pnCurrent (
101  nr_double_t Upn, // pn-voltage
102  nr_double_t Iss, // saturation current
103  nr_double_t Ute); // temperature voltage
104 
105  // computes the exponential pn-junction current's derivative
106  nr_double_t
107  pnConductance (
108  nr_double_t Upn, // pn-voltage
109  nr_double_t Iss, // saturation current
110  nr_double_t Ute); // temperature voltage
111 
112  // computes pn-junction depletion capacitance
113  nr_double_t
114  pnCapacitance (
115  nr_double_t Uj, // pn-voltage
116  nr_double_t Cj, // zero-bias capacitance
117  nr_double_t Vj, // built-in potential
118  nr_double_t Mj, // grading coefficient
119  nr_double_t Fc); // forward-bias coefficient
120 
121  // computes pn-junction depletion charge
122  nr_double_t
123  pnCharge (
124  nr_double_t Uj, // pn-voltage
125  nr_double_t Cj, // zero-bias capacitance
126  nr_double_t Vj, // built-in potential
127  nr_double_t Mj, // grading coefficient
128  nr_double_t Fc); // forward-bias coefficient
129 
130  // computes pn-junction depletion capacitance
131  nr_double_t
132  pnCapacitance (
133  nr_double_t Uj, // pn-voltage
134  nr_double_t Cj, // zero-bias capacitance
135  nr_double_t Vj, // built-in potential
136  nr_double_t Mj); // grading coefficient
137 
138  // computes pn-junction depletion charge
139  nr_double_t
140  pnCharge (
141  nr_double_t Uj, // pn-voltage
142  nr_double_t Cj, // zero-bias capacitance
143  nr_double_t Vj, // built-in potential
144  nr_double_t Mj); // grading coefficient
145 
146  // compute critical voltage of pn-junction
147  nr_double_t
149  nr_double_t Iss, // saturation current
150  nr_double_t Ute); // temperature voltage
151 
152  // limits the forward fet-voltage
153  nr_double_t
154  fetVoltage (
155  nr_double_t Ufet, // current fet voltage
156  nr_double_t Uold, // previous fet voltage
157  nr_double_t Uth); // threshold voltage
158 
159  // limits the drain-source voltage
160  nr_double_t
161  fetVoltageDS (
162  nr_double_t Ufet, // current fet voltage
163  nr_double_t Uold); // previous fet voltage
164 
165  // calculates the overlap capacitance for mosfet (meyer model)
166  void
168  nr_double_t Ugs, // gate-source voltage
169  nr_double_t Ugd, // gate-drain voltage
170  nr_double_t Uth, // threshold voltage
171  nr_double_t Udsat, // drain-source saturation voltage
172  nr_double_t Phi, // built-in potential
173  nr_double_t Cox, // oxide capacitance
174  nr_double_t& Cgs, // resulting gate-source capacitance
175  nr_double_t& Cgd, // resulting gate-drain capacitance
176  nr_double_t& Cgb); // resulting gate-bulk capacitance
177 
178  // computes temperature dependency of energy bandgap
179  nr_double_t
180  Egap (
181  nr_double_t T, // temperature
182  nr_double_t Eg0 = Eg0Si); // bandgap at 0K
183 
184  // computes temperature dependency of intrinsic density
185  nr_double_t
187  nr_double_t T, // temperature
188  nr_double_t Eg0 = Eg0Si); // bandgap at 0K
189 
190  // calculates temperature dependence for saturation current
191  nr_double_t
192  pnCurrent_T (
193  nr_double_t T1, // reference temperature
194  nr_double_t T2, // temperature
195  nr_double_t Is, // saturation current
196  nr_double_t Eg, // bandgap at 300K
197  nr_double_t N = 1, // emission coefficient
198  nr_double_t Xti = 0); // temperature coefficient
199 
200  // calculates temperature dependence for junction potential
201  nr_double_t
202  pnPotential_T (
203  nr_double_t T1, // reference temperature
204  nr_double_t T2, // temperature
205  nr_double_t Vj, // built-in potential
206  nr_double_t Eg0 = Eg0Si); // bandgap at 0K
207 
208  // calculates temperature dependence for junction capacitance
209  nr_double_t
211  nr_double_t T1, // reference temperature
212  nr_double_t T2, // temperature
213  nr_double_t M, // grading coefficient
214  nr_double_t VR, // built-in potential ratio
215  nr_double_t Cj); // zero-bias capacitance
216 
217  // calculates temperature dependence for junction capacitance
218  nr_double_t
220  nr_double_t T1, // reference temperature
221  nr_double_t T2, // temperature
222  nr_double_t M, // grading coefficient
223  nr_double_t VR); // built-in potential ratio: Vj(T2) / Vj(T1)
224 
225 } // namespace device
226 
227 } // namespace qucs
228 
229 #endif /* __DEVICE_H__ */
#define N(n)
Definition: equation.cpp:58
void disableCapacitor(circuit *base, circuit *cap)
Definition: device.cpp:103
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
int deviceEnabled(circuit *c)
Definition: device.cpp:112
#define Eg0Si
Energy gap at 0K in eV of Silicon.
Definition: constants.h:97
void pnJunctionMOS(nr_double_t Upn, nr_double_t Iss, nr_double_t Ute, nr_double_t &I, nr_double_t &g)
Definition: device.cpp:144
n
Definition: parse_citi.y:147
circuit * splitCapacitor(circuit *base, circuit *cap, const char *c, node *n1, node *n2)
Definition: device.cpp:88
void fetCapacitanceMeyer(nr_double_t Ugs, nr_double_t Ugd, nr_double_t Uth, nr_double_t Udsat, nr_double_t Phi, nr_double_t Cox, nr_double_t &Cgs, nr_double_t &Cgd, nr_double_t &Cgb)
Definition: device.cpp:333
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
n2
Definition: parse_zvr.y:187
nr_double_t Egap(nr_double_t T, nr_double_t Eg0=Eg0Si)
Definition: device.cpp:367
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
nr_double_t fetVoltage(nr_double_t Ufet, nr_double_t Uold, nr_double_t Uth)
Definition: device.cpp:263
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
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
nr_double_t pnCapacitance_F(nr_double_t T1, nr_double_t T2, nr_double_t M, nr_double_t VR)
Definition: device.cpp:413
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 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
nr_double_t intrinsicDensity(nr_double_t T, nr_double_t Eg0=Eg0Si)
Definition: device.cpp:374
n1
Definition: parse_zvr.y:179
nr_double_t fetVoltageDS(nr_double_t Ufet, nr_double_t Uold)
Definition: device.cpp:312
node
nr_double_t pnCriticalVoltage(nr_double_t Iss, nr_double_t Ute)
Definition: device.cpp:255
#define M(con)
Definition: evaluate.cpp:64
nr_double_t pnCurrent(nr_double_t Upn, nr_double_t Iss, nr_double_t Ute)
Definition: device.cpp:175
nr_double_t pnVoltage(nr_double_t Ud, nr_double_t Uold, nr_double_t Ut, nr_double_t Ucrit)
Definition: device.cpp:121