My Project  0.0.16
QUCS Mapping
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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: device.h 1825 2011-03-11 20:42:14Z ela $
22  *
23  */
24 
25 #ifndef __DEVICE_H__
26 #define __DEVICE_H__
27 
28 class circuit;
29 class node;
30 class net;
31 
32 namespace device {
33 
34  // creates external resistor circuit
35  circuit *
37  circuit * base, // calling circuit (this)
38  circuit * res, // additional resistor circuit (can be NULL)
39  const char * c, // name of the additional circuit
40  const char * n, // name of the inserted (internal) node
41  int internal); // number of new node (the original external node)
42 
43  // removes external resistor circuit
44  void
46  circuit * base, // calling circuit (this)
47  circuit * res, // additional resistor circuit
48  int internal); // number of new node (the original external node)
49 
50  // creates external capacitor circuit
51  circuit *
53  circuit * base, // calling circuit (this)
54  circuit * cap, // additional capacitor circuit (can be NULL)
55  const char * c, // name of the additional circuit
56  node * n1, // first node of new capacitor
57  node * n2); // second node of new capacitor
58 
59  // removes external capacitor circuit
60  void
62  circuit * base, // calling circuit (this)
63  circuit * cap); // additional capacitor circuit
64 
65  // checks whether circuit is enabled
66  int
68  circuit * c); // circuit to be checked
69 
70  // computes current and its derivative for a MOS pn-junction
71  void
73  nr_double_t Upn, // pn-voltage
74  nr_double_t Iss, // saturation current
75  nr_double_t Ute, // temperature voltage
76  nr_double_t& I, // result current
77  nr_double_t& g); // result derivative
78 
79  // computes current and its derivative for a bipolar pn-junction
80  void
82  nr_double_t Upn, // pn-voltage
83  nr_double_t Iss, // saturation current
84  nr_double_t Ute, // temperature voltage
85  nr_double_t& I, // result current
86  nr_double_t& g); // result derivative
87 
88  // limits the forward pn-voltage
89  nr_double_t
90  pnVoltage (
91  nr_double_t Ud, // current pn-voltage
92  nr_double_t Uold, // previous pn-voltage
93  nr_double_t Ut, // temperature voltage
94  nr_double_t Ucrit); // critical voltage
95 
96  // computes the exponential pn-junction current
97  nr_double_t
98  pnCurrent (
99  nr_double_t Upn, // pn-voltage
100  nr_double_t Iss, // saturation current
101  nr_double_t Ute); // temperature voltage
102 
103  // computes the exponential pn-junction current's derivative
104  nr_double_t
105  pnConductance (
106  nr_double_t Upn, // pn-voltage
107  nr_double_t Iss, // saturation current
108  nr_double_t Ute); // temperature voltage
109 
110  // computes pn-junction depletion capacitance
111  nr_double_t
112  pnCapacitance (
113  nr_double_t Uj, // pn-voltage
114  nr_double_t Cj, // zero-bias capacitance
115  nr_double_t Vj, // built-in potential
116  nr_double_t Mj, // grading coefficient
117  nr_double_t Fc); // forward-bias coefficient
118 
119  // computes pn-junction depletion charge
120  nr_double_t
121  pnCharge (
122  nr_double_t Uj, // pn-voltage
123  nr_double_t Cj, // zero-bias capacitance
124  nr_double_t Vj, // built-in potential
125  nr_double_t Mj, // grading coefficient
126  nr_double_t Fc); // forward-bias coefficient
127 
128  // computes pn-junction depletion capacitance
129  nr_double_t
130  pnCapacitance (
131  nr_double_t Uj, // pn-voltage
132  nr_double_t Cj, // zero-bias capacitance
133  nr_double_t Vj, // built-in potential
134  nr_double_t Mj); // grading coefficient
135 
136  // computes pn-junction depletion charge
137  nr_double_t
138  pnCharge (
139  nr_double_t Uj, // pn-voltage
140  nr_double_t Cj, // zero-bias capacitance
141  nr_double_t Vj, // built-in potential
142  nr_double_t Mj); // grading coefficient
143 
144  // compute critical voltage of pn-junction
145  nr_double_t
147  nr_double_t Iss, // saturation current
148  nr_double_t Ute); // temperature voltage
149 
150  // limits the forward fet-voltage
151  nr_double_t
152  fetVoltage (
153  nr_double_t Ufet, // current fet voltage
154  nr_double_t Uold, // previous fet voltage
155  nr_double_t Uth); // threshold voltage
156 
157  // limits the drain-source voltage
158  nr_double_t
159  fetVoltageDS (
160  nr_double_t Ufet, // current fet voltage
161  nr_double_t Uold); // previous fet voltage
162 
163  // calculates the overlap capacitance for mosfet (meyer model)
164  void
166  nr_double_t Ugs, // gate-source voltage
167  nr_double_t Ugd, // gate-drain voltage
168  nr_double_t Uth, // threshold voltage
169  nr_double_t Udsat, // drain-source saturation voltage
170  nr_double_t Phi, // built-in potential
171  nr_double_t Cox, // oxide capacitance
172  nr_double_t& Cgs, // resulting gate-source capacitance
173  nr_double_t& Cgd, // resulting gate-drain capacitance
174  nr_double_t& Cgb); // resulting gate-bulk capacitance
175 
176  // computes temperature dependency of energy bandgap
177  nr_double_t
178  Egap (
179  nr_double_t T, // temperature
180  nr_double_t Eg0 = Eg0Si); // bandgap at 0K
181 
182  // computes temperature dependency of intrinsic density
183  nr_double_t
185  nr_double_t T, // temperature
186  nr_double_t Eg0 = Eg0Si); // bandgap at 0K
187 
188  // calculates temperature dependence for saturation current
189  nr_double_t
190  pnCurrent_T (
191  nr_double_t T1, // reference temperature
192  nr_double_t T2, // temperature
193  nr_double_t Is, // saturation current
194  nr_double_t Eg, // bandgap at 300K
195  nr_double_t N = 1, // emission coefficient
196  nr_double_t Xti = 0); // temperature coefficient
197 
198  // calculates temperature dependence for junction potential
199  nr_double_t
200  pnPotential_T (
201  nr_double_t T1, // reference temperature
202  nr_double_t T2, // temperature
203  nr_double_t Vj, // built-in potential
204  nr_double_t Eg0 = Eg0Si); // bandgap at 0K
205 
206  // calculates temperature dependence for junction capacitance
207  nr_double_t
209  nr_double_t T1, // reference temperature
210  nr_double_t T2, // temperature
211  nr_double_t M, // grading coefficient
212  nr_double_t VR, // built-in potential ratio
213  nr_double_t Cj); // zero-bias capacitance
214 
215  // calculates temperature dependence for junction capacitance
216  nr_double_t
218  nr_double_t T1, // reference temperature
219  nr_double_t T2, // temperature
220  nr_double_t M, // grading coefficient
221  nr_double_t VR); // built-in potential ratio: Vj(T2) / Vj(T1)
222 
223 } // namespace
224 
225 #endif /* __DEVICE_H__ */