42 #include "capacitor.h"
44 using namespace device;
56 const char *
c,
const char *
n,
121 nr_double_t Ut, nr_double_t Ucrit) {
123 if (Ud > Ucrit && fabs (Ud - Uold) > 2 * Ut) {
125 arg = (Ud - Uold) / Ut;
127 Ud = Uold + Ut * (2 +
log (arg - 2));
129 Ud = Uold - Ut * (2 +
log (2 - arg));
131 else Ud = Uold < 0 ? Ut *
log (Ud / Ut) : Ucrit;
135 arg = Uold > 0 ? -1 - Uold : 2 * Uold - 1;
136 if (Ud < arg) Ud =
arg;
144 nr_double_t& I, nr_double_t& g) {
150 nr_double_t
e =
exp (
MIN (Upn / Ute, 709));
158 nr_double_t& I, nr_double_t& g) {
159 if (Upn < -3 * Ute) {
160 nr_double_t a = 3 * Ute / (Upn *
M_E);
163 g = +Iss * 3 * a / Upn;
166 nr_double_t
e =
exp (
MIN (Upn / Ute, 709));
175 return Iss * (
exp (
MIN (Upn / Ute, 709)) - 1);
181 return Iss *
exp (
MIN (Upn / Ute, 709)) / Ute;
187 nr_double_t Mj, nr_double_t Fc) {
190 c = Cj *
exp (-Mj *
log (1 - Uj / Vj));
192 c = Cj *
exp (-Mj *
log (1 - Fc)) *
193 (1 + Mj * (Uj - Fc * Vj) / Vj / (1 - Fc));
199 nr_double_t Mj, nr_double_t Fc) {
203 b =
exp ((1 - Mj) *
log (a));
204 q = Cj * Vj / (1 - Mj) * (1 - b);
209 b =
exp ((1 - Mj) *
log (a));
210 a =
exp ((1 + Mj) *
log (a));
211 nr_double_t
c = 1 - Fc * (1 + Mj);
212 nr_double_t d = Fc * Vj;
213 nr_double_t
e = Vj * (1 -
b) / (1 - Mj);
214 q = Cj * (e + (c * (Uj - d) + Mj / 2 / Vj * (
sqr (Uj) -
sqr (d))) / a);
218 nr_double_t f = Fc * Vj;
219 nr_double_t c = Cj * (1 - Fc * (1 + Mj)) * b / a;
220 nr_double_t d = Cj * Mj * b / a / Vj;
221 nr_double_t e = Cj * Vj * (1 - a *
b) / (1 - Mj) - d / 2 * f * f - f *
c;
222 q = e + Uj * (c + Uj * d / 2);
235 c = Cj *
exp (-Mj *
log (1 - Uj / Vj));
237 c = Cj * (1 + Mj * Uj / Vj);
247 q = Cj * Vj / (1 - Mj) * (1 -
exp ((1 - Mj) *
log (1 - Uj / Vj)));
249 q = Cj * Uj * (1 + Mj * Uj / 2 / Vj);
263 nr_double_t Utsthi = fabs (2 * (Uold - Uth)) + 2.0;
264 nr_double_t Utstlo = Utsthi / 2;
265 nr_double_t Utox = Uth + 3.5;
266 nr_double_t DeltaU = Ufet - Uold;
272 if (-DeltaU > Utstlo) {
273 Ufet = Uold - Utstlo;
276 Ufet =
MAX (Ufet, Uth + 2);
279 if (DeltaU >= Utsthi) {
280 Ufet = Uold + Utsthi;
285 Ufet =
MAX (Ufet, Uth - 0.5);
287 Ufet =
MIN (Ufet, Uth + 4);
292 if (-DeltaU > Utsthi) {
293 Ufet = Uold - Utsthi;
296 if (Ufet <= Uth + 0.5) {
297 if (DeltaU > Utstlo) {
298 Ufet = Uold + Utstlo;
314 Ufet =
MIN (Ufet, 3 * Uold + 2);
315 }
else if (Ufet < 3.5) {
316 Ufet =
MAX (Ufet, 2);
320 Ufet =
MIN (Ufet, 4);
322 Ufet =
MAX (Ufet, -0.5);
333 nr_double_t Udsat, nr_double_t Phi,
334 nr_double_t Cox, nr_double_t& Cgs,
335 nr_double_t& Cgd, nr_double_t& Cgb) {
337 nr_double_t Utst = Ugs - Uth;
342 }
else if (Utst <= -Phi / 2) {
343 Cgb = -Utst * Cox / Phi;
346 }
else if (Utst <= 0) {
347 Cgb = -Utst * Cox / Phi;
348 Cgs = Utst * Cox * 4 / 3 / Phi + 2 * Cox / 3;
352 nr_double_t Uds = Ugs - Ugd;
357 nr_double_t Sqr1 =
sqr (Udsat - Uds);
358 nr_double_t Sqr2 =
sqr (2 * Udsat - Uds);
359 Cgs = Cox * (1 - Sqr1 / Sqr2) * 2 / 3;
360 Cgd = Cox * (1 - Udsat * Udsat / Sqr2) * 2 / 3;
367 nr_double_t a = 7.02e-4;
368 nr_double_t
b = 1108;
369 return Eg0 - (a *
sqr (T)) / (T + b);
374 nr_double_t TR = 300.00;
375 nr_double_t E1 =
Egap (TR, Eg0);
376 nr_double_t E2 =
Egap (T, Eg0);
377 nr_double_t NI =
NiSi / 1e6;
378 return NI *
exp (1.5 *
log (T / TR) + (E1 / TR - E2 / T) /
kBoverQ / 2);
384 nr_double_t Eg, nr_double_t
N, nr_double_t Xti) {
388 return Is *
exp (Xti / N *
log (TR) - Eg / N / Vt * (1 - TR));
395 nr_double_t Vt, TR, E1, E2;
400 return TR * Vj - 3 * Vt *
log (TR) - (TR * E1 - E2);
406 nr_double_t VR, nr_double_t Cj) {
414 nr_double_t DT = T2 - T1;
415 return 1 + M * (4
e-4 * DT - VR + 1);