Xyce  6.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
N_DEV_ADMSPSP103VA.C
Go to the documentation of this file.
1 
2 //-----------------------------------------------------------------------------
3 // Copyright Notice
4 //
5 // Copyright 2002 Sandia Corporation. Under the terms
6 // of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S.
7 // Government retains certain rights in this software.
8 //
9 // Xyce(TM) Parallel Electrical Simulator
10 // Copyright (C) 2002-2014 Sandia Corporation
11 //
12 // This program is free software: you can redistribute it and/or modify
13 // it under the terms of the GNU General Public License as published by
14 // the Free Software Foundation, either version 3 of the License, or
15 // (at your option) any later version.
16 //
17 // This program is distributed in the hope that it will be useful,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU General Public License for more details.
21 //
22 // You should have received a copy of the GNU General Public License
23 // along with this program. If not, see <http://www.gnu.org/licenses/>.
24 //-----------------------------------------------------------------------------
25 
26 //-------------------------------------------------------------------------
27 // Filename : $RCSfile: N_DEV_ADMSPSP103VA.C,v $
28 //
29 // Purpose :
30 //
31 // Special Notes : Generated from verilog file psp103.va with ADMS
32 // interface for Xyce 6.1.0
33 // DO NOT EDIT THIS FILE DIRECTLY! It may be overwritten!
34 //
35 // Creator : admsXml-2.3.0
36 //
37 // Creation Date : Mon, 02 Jun 2014 11:34:00
38 //
39 // Revision Information:
40 // ---------------------
41 //
42 // Revision Number: $Revision: 1.51 $
43 //
44 // Revision Date : $Date: 2014/06/02 17:46:47 $
45 //
46 // Current Owner : $Author: tvrusso $
47 //-------------------------------------------------------------------------
48 
49 #include <Xyce_config.h>
50 #include <N_DEV_ADMSPSP103VA.h>
51 
52 
53 #include <N_UTL_Misc.h>
54 
55 #include <N_DEV_Const.h>
56 #include <N_DEV_DeviceOptions.h>
57 #include <N_DEV_DeviceMaster.h>
58 #include <N_DEV_ExternData.h>
59 #include <N_DEV_MatrixLoadData.h>
60 #include <N_DEV_SolverState.h>
61 #include <N_DEV_Message.h>
62 
63 #include <N_LAS_Matrix.h>
64 #include <N_LAS_Vector.h>
65 
66 namespace Xyce {
67 namespace Device {
68 namespace ADMSPSP103VA {
69 
70 
71 void
73 {
74  // Set up each parameter directly, using the up-cased variable name
75  // as the tag.
76 
77  // This kludge is to force us always to have an instance parameter
78  // that the device manager can set to the temperature, even if we have
79  // no "TEMP".
80  p.addPar("XYCEADMSINSTTEMP", 0.0, &ADMSPSP103VA::Instance::admsInstTemp)
81  .setExpressionAccess(NO_DOC)
82  .setUnit(U_DEGK)
83  .setCategory(CAT_TEMP)
84  .setDescription("Internal-use parameter for setting device instance temperature");
85  p.addPar("L", static_cast<double>(10e-6), &ADMSPSP103VA::Instance::L)
86  .setUnit(U_METER)
87  .setDescription("Design length");
88  p.addPar("W", static_cast<double>(10e-6), &ADMSPSP103VA::Instance::W)
89  .setUnit(U_METER)
90  .setDescription("Design width");
91  p.addPar("SA", static_cast<double>(0.0), &ADMSPSP103VA::Instance::SA)
92  .setUnit(U_METER)
93  .setDescription("Distance between OD-edge and poly from one side");
94  p.addPar("SB", static_cast<double>(0.0), &ADMSPSP103VA::Instance::SB)
95  .setUnit(U_METER)
96  .setDescription("Distance between OD-edge and poly from other side");
97  p.addPar("SD", static_cast<double>(0.0), &ADMSPSP103VA::Instance::SD)
98  .setUnit(U_METER)
99  .setDescription("Distance between neighbouring fingers");
100  p.addPar("SCA", static_cast<double>(0.0), &ADMSPSP103VA::Instance::SCA)
101  .setDescription("Integral of the first distribution function for scattered well dopants");
102  p.addPar("SCB", static_cast<double>(0.0), &ADMSPSP103VA::Instance::SCB)
103  .setDescription("Integral of the second distribution function for scattered well dopants");
104  p.addPar("SCC", static_cast<double>(0.0), &ADMSPSP103VA::Instance::SCC)
105  .setDescription("Integral of the third distribution function for scattered well dopants");
106  p.addPar("SC", static_cast<double>(0.0), &ADMSPSP103VA::Instance::SC)
107  .setUnit(U_METER)
108  .setDescription("Distance between OD-edge and nearest well edge");
109  p.addPar("NF", static_cast<double>(1.0), &ADMSPSP103VA::Instance::NF)
110  .setDescription("Number of fingers");
111  p.addPar("NGCON", static_cast<double>(1.0), &ADMSPSP103VA::Instance::NGCON)
112  .setDescription("Number of gate contacts");
113  p.addPar("XGW", static_cast<double>(1.0E-7), &ADMSPSP103VA::Instance::XGW)
114  .setUnit(U_METER)
115  .setDescription("Distance from the gate contact to the channel edge");
116  p.addPar("NRS", static_cast<double>(0.0), &ADMSPSP103VA::Instance::NRS)
117  .setDescription("Number of squares of source diffusion");
118  p.addPar("NRD", static_cast<double>(0.0), &ADMSPSP103VA::Instance::NRD)
119  .setDescription("Number of squares of drain diffusion");
120  p.addPar("JW", static_cast<double>(1E-6), &ADMSPSP103VA::Instance::JW)
121  .setUnit(U_METER)
122  .setDescription("Gate-edge length of source/drain junction");
123  p.addPar("DELVTO", static_cast<double>(0.0), &ADMSPSP103VA::Instance::DELVTO)
124  .setUnit(U_VOLT)
125  .setDescription("Threshold voltage shift parameter");
126  p.addPar("FACTUO", static_cast<double>(1.0), &ADMSPSP103VA::Instance::FACTUO)
127  .setDescription("Zero-field mobility pre-factor");
128  p.addPar("ABSOURCE", static_cast<double>(1E-12), &ADMSPSP103VA::Instance::ABSOURCE)
129  .setDescription("Bottom area of source junction");
130  p.addPar("LSSOURCE", static_cast<double>(1E-6), &ADMSPSP103VA::Instance::LSSOURCE)
131  .setUnit(U_METER)
132  .setDescription("STI-edge length of source junction");
133  p.addPar("LGSOURCE", static_cast<double>(1E-6), &ADMSPSP103VA::Instance::LGSOURCE)
134  .setUnit(U_METER)
135  .setDescription("Gate-edge length of source junction");
136  p.addPar("ABDRAIN", static_cast<double>(1E-12), &ADMSPSP103VA::Instance::ABDRAIN)
137  .setDescription("Bottom area of drain junction");
138  p.addPar("LSDRAIN", static_cast<double>(1E-6), &ADMSPSP103VA::Instance::LSDRAIN)
139  .setUnit(U_METER)
140  .setDescription("STI-edge length of drain junction");
141  p.addPar("LGDRAIN", static_cast<double>(1E-6), &ADMSPSP103VA::Instance::LGDRAIN)
142  .setUnit(U_METER)
143  .setDescription("Gate-edge length of drain junction");
144  p.addPar("AS", static_cast<double>(1E-12), &ADMSPSP103VA::Instance::AS)
145  .setDescription("Bottom area of source junction");
146  p.addPar("PS", static_cast<double>(1E-6), &ADMSPSP103VA::Instance::PS)
147  .setUnit(U_METER)
148  .setDescription("Perimeter of source junction");
149  p.addPar("AD", static_cast<double>(1E-12), &ADMSPSP103VA::Instance::AD)
150  .setDescription("Bottom area of drain junction");
151  p.addPar("PD", static_cast<double>(1E-6), &ADMSPSP103VA::Instance::PD)
152  .setUnit(U_METER)
153  .setDescription("Perimeter of drain junction");
154  p.addPar("MULT", static_cast<double>(1.0), &ADMSPSP103VA::Instance::MULT)
155  .setDescription("Number of devices in parallel");
156 
157 
158 }
159 
161 {
162  // Set up each parameter directly, using the up-cased variable name
163  // as the tag.
164 
165  // This kludge is to force us always to have a model parameter
166  // that the device manager can set to the temperature, even if we have
167  // no "TEMP".
168  p.addPar("XYCEADMSMODTEMP", 0.0, &ADMSPSP103VA::Model::admsModTemp)
169  .setExpressionAccess(NO_DOC)
170  .setUnit(U_DEGK)
171  .setCategory(CAT_TEMP)
172  .setDescription("Internal-use parameter for setting device model temperature");
173  p.addPar("LEVEL", static_cast<double>(103), &ADMSPSP103VA::Model::LEVEL)
174  .setDescription("Model level");
175  p.addPar("TYPE", static_cast<double>(1.0), &ADMSPSP103VA::Model::TYPE)
176  .setDescription("Channel type parameter, +1=NMOS -1=PMOS");
177  p.addPar("TR", static_cast<double>(21.0), &ADMSPSP103VA::Model::TR)
178  .setUnit(U_DEGC)
179 
180  .setDescription("nominal (reference) temperature");
181  p.addPar("SWGEO", static_cast<double>(1.0), &ADMSPSP103VA::Model::SWGEO)
182  .setDescription("Flag for geometrical model, 0=local, 1=global, 2=binning");
183  p.addPar("SWIGATE", static_cast<double>(0.0), &ADMSPSP103VA::Model::SWIGATE)
184  .setDescription("Flag for gate current, 0=turn off IG");
185  p.addPar("SWIMPACT", static_cast<double>(0.0), &ADMSPSP103VA::Model::SWIMPACT)
186  .setDescription("Flag for impact ionization current, 0=turn off II");
187  p.addPar("SWGIDL", static_cast<double>(0.0), &ADMSPSP103VA::Model::SWGIDL)
188  .setDescription("Flag for GIDL current, 0=turn off IGIDL");
189  p.addPar("SWJUNCAP", static_cast<double>(0.0), &ADMSPSP103VA::Model::SWJUNCAP)
190  .setDescription("Flag for juncap, 0=turn off juncap");
191  p.addPar("SWJUNASYM", static_cast<double>(0.0), &ADMSPSP103VA::Model::SWJUNASYM)
192  .setDescription("Flag for asymmetric junctions; 0=symmetric, 1=asymmetric");
193  p.addPar("SWNUD", static_cast<double>(0.0), &ADMSPSP103VA::Model::SWNUD)
194  .setDescription("Flag for NUD-effect; 0=off, 1=on, 2=on+CV-correction");
195  p.addPar("SWDELVTAC", static_cast<double>(0.0), &ADMSPSP103VA::Model::SWDELVTAC)
196  .setDescription("Flag for separate capacitance calculation; 0=off, 1=on");
197  p.addPar("QMC", static_cast<double>(1.0), &ADMSPSP103VA::Model::QMC)
198  .setDescription("Quantum-mechanical correction factor");
199  p.addPar("VFB", static_cast<double>((-1.0)), &ADMSPSP103VA::Model::VFB)
200  .setUnit(U_VOLT)
201 
202  .setDescription("Flat band voltage at TR");
203  p.addPar("STVFB", static_cast<double>(5.0e-4), &ADMSPSP103VA::Model::STVFB)
204  .setUnit(U_VKM1)
205 
206  .setDescription("Temperature dependence of VFB");
207  p.addPar("TOX", static_cast<double>(2.0e-09), &ADMSPSP103VA::Model::TOX)
208  .setUnit(U_METER)
209 
210  .setDescription("Gate oxide thickness");
211  p.addPar("EPSROX", static_cast<double>(3.9), &ADMSPSP103VA::Model::EPSROX)
212  .setDescription("Relative permittivity of gate dielectric");
213  p.addPar("NEFF", static_cast<double>(5.0e+23), &ADMSPSP103VA::Model::NEFF)
214  .setUnit(U_METERM3)
215 
216  .setDescription("Effective substrate doping");
217  p.addPar("FACNEFFAC", static_cast<double>(1.0), &ADMSPSP103VA::Model::FACNEFFAC)
218  .setDescription("Pre-factor for effective substrate doping in separate charge calculation");
219  p.addPar("GFACNUD", static_cast<double>(1.0), &ADMSPSP103VA::Model::GFACNUD)
220  .setDescription("Bodyfactor change due to NUD-effect");
221  p.addPar("VSBNUD", static_cast<double>(0.0), &ADMSPSP103VA::Model::VSBNUD)
222  .setUnit(U_VOLT)
223 
224  .setDescription("Lower Vsb value for NUD-effect");
225  p.addPar("DVSBNUD", static_cast<double>(1.0), &ADMSPSP103VA::Model::DVSBNUD)
226  .setUnit(U_VOLT)
227 
228  .setDescription("Vsb-range for NUD-effect");
229  p.addPar("VNSUB", static_cast<double>(0.0), &ADMSPSP103VA::Model::VNSUB)
230  .setUnit(U_VOLT)
231 
232  .setDescription("Effective doping bias-dependence parameter");
233  p.addPar("NSLP", static_cast<double>(0.05), &ADMSPSP103VA::Model::NSLP)
234  .setUnit(U_VOLT)
235 
236  .setDescription("Effective doping bias-dependence parameter");
237  p.addPar("DNSUB", static_cast<double>(0.0), &ADMSPSP103VA::Model::DNSUB)
238  .setUnit(U_VOLTM1)
239 
240  .setDescription("Effective doping bias-dependence parameter");
241  p.addPar("DPHIB", static_cast<double>(0.0), &ADMSPSP103VA::Model::DPHIB)
242  .setUnit(U_VOLT)
243 
244  .setDescription("Offset parameter for PHIB");
245  p.addPar("DELVTAC", static_cast<double>(0.0), &ADMSPSP103VA::Model::DELVTAC)
246  .setUnit(U_VOLT)
247 
248  .setDescription("Offset parameter for PHIB in separate charge calculation");
249  p.addPar("NP", static_cast<double>(1.0e+26), &ADMSPSP103VA::Model::NP)
250  .setUnit(U_METERM3)
251 
252  .setDescription("Gate poly-silicon doping");
253  p.addPar("CT", static_cast<double>(0.0), &ADMSPSP103VA::Model::CT)
254  .setDescription("Interface states factor");
255  p.addPar("TOXOV", static_cast<double>(2.0e-09), &ADMSPSP103VA::Model::TOXOV)
256  .setUnit(U_METER)
257 
258  .setDescription("Overlap oxide thickness");
259  p.addPar("TOXOVD", static_cast<double>(2.0e-09), &ADMSPSP103VA::Model::TOXOVD)
260  .setUnit(U_METER)
261 
262  .setDescription("Overlap oxide thickness for drain side");
263  p.addPar("NOV", static_cast<double>(5.0e+25), &ADMSPSP103VA::Model::NOV)
264  .setUnit(U_METERM3)
265 
266  .setDescription("Effective doping of overlap region");
267  p.addPar("NOVD", static_cast<double>(5.0e+25), &ADMSPSP103VA::Model::NOVD)
268  .setUnit(U_METERM3)
269 
270  .setDescription("Effective doping of overlap region for drain side");
271  p.addPar("CF", static_cast<double>(0.0), &ADMSPSP103VA::Model::CF)
272  .setDescription("DIBL-parameter");
273  p.addPar("CFB", static_cast<double>(0.0), &ADMSPSP103VA::Model::CFB)
274  .setUnit(U_VOLTM1)
275 
276  .setDescription("Back bias dependence of CF");
277  p.addPar("BETN", static_cast<double>(7e-2), &ADMSPSP103VA::Model::BETN)
278  .setUnit(U_M2VM1SM1)
279 
280  .setDescription("Channel aspect ratio times zero-field mobility");
281  p.addPar("STBET", static_cast<double>(1.0), &ADMSPSP103VA::Model::STBET)
282  .setDescription("Temperature dependence of BETN");
283  p.addPar("MUE", static_cast<double>(0.5), &ADMSPSP103VA::Model::MUE)
284  .setUnit(U_MVM1)
285 
286  .setDescription("Mobility reduction coefficient at TR");
287  p.addPar("STMUE", static_cast<double>(0.0), &ADMSPSP103VA::Model::STMUE)
288  .setDescription("Temperature dependence of MUE");
289  p.addPar("THEMU", static_cast<double>(1.5), &ADMSPSP103VA::Model::THEMU)
290  .setDescription("Mobility reduction exponent at TR");
291  p.addPar("STTHEMU", static_cast<double>(1.5), &ADMSPSP103VA::Model::STTHEMU)
292  .setDescription("Temperature dependence of THEMU");
293  p.addPar("CS", static_cast<double>(0.0), &ADMSPSP103VA::Model::CS)
294  .setDescription("Coulomb scattering parameter at TR");
295  p.addPar("STCS", static_cast<double>(0.0), &ADMSPSP103VA::Model::STCS)
296  .setDescription("Temperature dependence of CS");
297  p.addPar("XCOR", static_cast<double>(0.0), &ADMSPSP103VA::Model::XCOR)
298  .setUnit(U_VOLTM1)
299 
300  .setDescription("Non-universality factor");
301  p.addPar("STXCOR", static_cast<double>(0.0), &ADMSPSP103VA::Model::STXCOR)
302  .setDescription("Temperature dependence of XCOR");
303  p.addPar("FETA", static_cast<double>(1.0), &ADMSPSP103VA::Model::FETA)
304  .setDescription("Effective field parameter");
305  p.addPar("RS", static_cast<double>(30), &ADMSPSP103VA::Model::RS)
306  .setUnit(U_OHM)
307 
308  .setDescription("Series resistance at TR");
309  p.addPar("STRS", static_cast<double>(1.0), &ADMSPSP103VA::Model::STRS)
310  .setDescription("Temperature dependence of RS");
311  p.addPar("RSB", static_cast<double>(0.0), &ADMSPSP103VA::Model::RSB)
312  .setUnit(U_VOLTM1)
313 
314  .setDescription("Back-bias dependence of series resistance");
315  p.addPar("RSG", static_cast<double>(0.0), &ADMSPSP103VA::Model::RSG)
316  .setUnit(U_VOLTM1)
317 
318  .setDescription("Gate-bias dependence of series resistance");
319  p.addPar("THESAT", static_cast<double>(1.0), &ADMSPSP103VA::Model::THESAT)
320  .setUnit(U_VOLTM1)
321 
322  .setDescription("Velocity saturation parameter at TR");
323  p.addPar("STTHESAT", static_cast<double>(1.0), &ADMSPSP103VA::Model::STTHESAT)
324  .setDescription("Temperature dependence of THESAT");
325  p.addPar("THESATB", static_cast<double>(0.0), &ADMSPSP103VA::Model::THESATB)
326  .setUnit(U_VOLTM1)
327 
328  .setDescription("Back-bias dependence of velocity saturation");
329  p.addPar("THESATG", static_cast<double>(0.0), &ADMSPSP103VA::Model::THESATG)
330  .setUnit(U_VOLTM1)
331 
332  .setDescription("Gate-bias dependence of velocity saturation");
333  p.addPar("AX", static_cast<double>(3.0), &ADMSPSP103VA::Model::AX)
334  .setDescription("Linear/saturation transition factor");
335  p.addPar("ALP", static_cast<double>(0.01), &ADMSPSP103VA::Model::ALP)
336  .setDescription("CLM pre-factor");
337  p.addPar("ALP1", static_cast<double>(0.00), &ADMSPSP103VA::Model::ALP1)
338  .setUnit(U_VOLT)
339 
340  .setDescription("CLM enhancement factor above threshold");
341  p.addPar("ALP2", static_cast<double>(0.00), &ADMSPSP103VA::Model::ALP2)
342  .setUnit(U_VOLTM1)
343 
344  .setDescription("CLM enhancement factor below threshold");
345  p.addPar("VP", static_cast<double>(0.05), &ADMSPSP103VA::Model::VP)
346  .setUnit(U_VOLT)
347 
348  .setDescription("CLM logarithm dependence factor");
349  p.addPar("A1", static_cast<double>(1.0), &ADMSPSP103VA::Model::A1)
350  .setDescription("Impact-ionization pre-factor");
351  p.addPar("A2", static_cast<double>(10.0), &ADMSPSP103VA::Model::A2)
352  .setUnit(U_VOLT)
353 
354  .setDescription("Impact-ionization exponent at TR");
355  p.addPar("STA2", static_cast<double>(0.0), &ADMSPSP103VA::Model::STA2)
356  .setUnit(U_VOLT)
357 
358  .setDescription("Temperature dependence of A2");
359  p.addPar("A3", static_cast<double>(1.0), &ADMSPSP103VA::Model::A3)
360  .setDescription("Saturation-voltage dependence of impact-ionization");
361  p.addPar("A4", static_cast<double>(0.0), &ADMSPSP103VA::Model::A4)
362  .setUnit(U_VOLTMH)
363 
364  .setDescription("Back-bias dependence of impact-ionization");
365  p.addPar("GCO", static_cast<double>(0.0), &ADMSPSP103VA::Model::GCO)
366  .setDescription("Gate tunneling energy adjustment");
367  p.addPar("IGINV", static_cast<double>(0.0), &ADMSPSP103VA::Model::IGINV)
368  .setUnit(U_AMP)
369 
370  .setDescription("Gate channel current pre-factor");
371  p.addPar("IGOV", static_cast<double>(0.0), &ADMSPSP103VA::Model::IGOV)
372  .setUnit(U_AMP)
373 
374  .setDescription("Gate overlap current pre-factor");
375  p.addPar("IGOVD", static_cast<double>(0.0), &ADMSPSP103VA::Model::IGOVD)
376  .setUnit(U_AMP)
377 
378  .setDescription("Gate overlap current pre-factor for drain side");
379  p.addPar("STIG", static_cast<double>(2.0), &ADMSPSP103VA::Model::STIG)
380  .setDescription("Temperature dependence of IGINV and IGOV");
381  p.addPar("GC2", static_cast<double>(0.375), &ADMSPSP103VA::Model::GC2)
382  .setDescription("Gate current slope factor");
383  p.addPar("GC3", static_cast<double>(0.063), &ADMSPSP103VA::Model::GC3)
384  .setDescription("Gate current curvature factor");
385  p.addPar("CHIB", static_cast<double>(3.1), &ADMSPSP103VA::Model::CHIB)
386  .setUnit(U_VOLT)
387 
388  .setDescription("Tunneling barrier height");
389  p.addPar("AGIDL", static_cast<double>(0.0), &ADMSPSP103VA::Model::AGIDL)
390  .setUnit(U_AMPVM3)
391 
392  .setDescription("GIDL pre-factor");
393  p.addPar("AGIDLD", static_cast<double>(0.0), &ADMSPSP103VA::Model::AGIDLD)
394  .setUnit(U_AMPVM3)
395 
396  .setDescription("GIDL pre-factor for drain side");
397  p.addPar("BGIDL", static_cast<double>(41.0), &ADMSPSP103VA::Model::BGIDL)
398  .setUnit(U_VOLT)
399 
400  .setDescription("GIDL probability factor at TR");
401  p.addPar("BGIDLD", static_cast<double>(41.0), &ADMSPSP103VA::Model::BGIDLD)
402  .setUnit(U_VOLT)
403 
404  .setDescription("GIDL probability factor at TR for drain side");
405  p.addPar("STBGIDL", static_cast<double>(0.0), &ADMSPSP103VA::Model::STBGIDL)
406  .setUnit(U_VKM1)
407 
408  .setDescription("Temperature dependence of BGIDL");
409  p.addPar("STBGIDLD", static_cast<double>(0.0), &ADMSPSP103VA::Model::STBGIDLD)
410  .setUnit(U_VKM1)
411 
412  .setDescription("Temperature dependence of BGIDL for drain side");
413  p.addPar("CGIDL", static_cast<double>(0.0), &ADMSPSP103VA::Model::CGIDL)
414  .setDescription("Back-bias dependence of GIDL");
415  p.addPar("CGIDLD", static_cast<double>(0.0), &ADMSPSP103VA::Model::CGIDLD)
416  .setDescription("Back-bias dependence of GIDL for drain side");
417  p.addPar("COX", static_cast<double>(1.0e-14), &ADMSPSP103VA::Model::COX)
418  .setUnit(U_FARAD)
419 
420  .setDescription("Oxide capacitance for intrinsic channel");
421  p.addPar("CGOV", static_cast<double>(1.0e-15), &ADMSPSP103VA::Model::CGOV)
422  .setUnit(U_FARAD)
423 
424  .setDescription("Oxide capacitance for gate-drain/source overlap");
425  p.addPar("CGOVD", static_cast<double>(1.0e-15), &ADMSPSP103VA::Model::CGOVD)
426  .setUnit(U_FARAD)
427 
428  .setDescription("Oxide capacitance for gate-drain overlap");
429  p.addPar("CGBOV", static_cast<double>(0.0), &ADMSPSP103VA::Model::CGBOV)
430  .setUnit(U_FARAD)
431 
432  .setDescription("Oxide capacitance for gate-bulk overlap");
433  p.addPar("CFR", static_cast<double>(0.0), &ADMSPSP103VA::Model::CFR)
434  .setUnit(U_FARAD)
435 
436  .setDescription("Outer fringe capacitance");
437  p.addPar("CFRD", static_cast<double>(0.0), &ADMSPSP103VA::Model::CFRD)
438  .setUnit(U_FARAD)
439 
440  .setDescription("Outer fringe capacitance for drain side");
441  p.addPar("FNT", static_cast<double>(1.0), &ADMSPSP103VA::Model::FNT)
442  .setDescription("Thermal noise coefficient");
443  p.addPar("NFA", static_cast<double>(8.0e+22), &ADMSPSP103VA::Model::NFA)
444  .setDescription("First coefficient of flicker noise");
445  p.addPar("NFB", static_cast<double>(3.0e+07), &ADMSPSP103VA::Model::NFB)
446  .setDescription("Second coefficient of flicker noise");
447  p.addPar("NFC", static_cast<double>(0.0), &ADMSPSP103VA::Model::NFC)
448  .setUnit(U_VOLTM1)
449 
450  .setDescription("Third coefficient of flicker noise");
451  p.addPar("EF", static_cast<double>(1.0), &ADMSPSP103VA::Model::EF)
452  .setDescription("Flicker noise frequency exponent");
453  p.addPar("RG", static_cast<double>(0.0), &ADMSPSP103VA::Model::RG)
454  .setUnit(U_OHM)
455 
456  .setDescription("Gate resistance");
457  p.addPar("RSE", static_cast<double>(0.0), &ADMSPSP103VA::Model::RSE)
458  .setUnit(U_OHM)
459 
460  .setDescription("External source resistance");
461  p.addPar("RDE", static_cast<double>(0.0), &ADMSPSP103VA::Model::RDE)
462  .setUnit(U_OHM)
463 
464  .setDescription("External drain resistance");
465  p.addPar("RBULK", static_cast<double>(0.0), &ADMSPSP103VA::Model::RBULK)
466  .setUnit(U_OHM)
467 
468  .setDescription("Bulk resistance between node BP and BI");
469  p.addPar("RWELL", static_cast<double>(0.0), &ADMSPSP103VA::Model::RWELL)
470  .setUnit(U_OHM)
471 
472  .setDescription("Well resistance between node BI and B");
473  p.addPar("RJUNS", static_cast<double>(0.0), &ADMSPSP103VA::Model::RJUNS)
474  .setUnit(U_OHM)
475 
476  .setDescription("Source-side bulk resistance between node BI and BS");
477  p.addPar("RJUND", static_cast<double>(0.0), &ADMSPSP103VA::Model::RJUND)
478  .setUnit(U_OHM)
479 
480  .setDescription("Drain-side bulk resistance between node BI and BD");
481  p.addPar("POVFB", static_cast<double>((-1)), &ADMSPSP103VA::Model::POVFB)
482  .setUnit(U_VOLT)
483 
484  .setDescription("Coefficient for the geometry independent part of VFB");
485  p.addPar("PLVFB", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLVFB)
486  .setUnit(U_VOLT)
487 
488  .setDescription("Coefficient for the length dependence of VFB");
489  p.addPar("PWVFB", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWVFB)
490  .setUnit(U_VOLT)
491 
492  .setDescription("Coefficient for the width dependence of VFB");
493  p.addPar("PLWVFB", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWVFB)
494  .setUnit(U_VOLT)
495 
496  .setDescription("Coefficient for the length times width dependence of VFB");
497  p.addPar("POSTVFB", static_cast<double>(0.0005), &ADMSPSP103VA::Model::POSTVFB)
498  .setUnit(U_VKM1)
499 
500  .setDescription("Coefficient for the geometry independent part of STVFB");
501  p.addPar("PLSTVFB", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLSTVFB)
502  .setUnit(U_VKM1)
503 
504  .setDescription("Coefficient for the length dependence of STVFB");
505  p.addPar("PWSTVFB", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWSTVFB)
506  .setUnit(U_VKM1)
507 
508  .setDescription("Coefficient for the width dependence of STVFB");
509  p.addPar("PLWSTVFB", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWSTVFB)
510  .setUnit(U_VKM1)
511 
512  .setDescription("Coefficient for the length times width dependence of STVFB");
513  p.addPar("POTOX", static_cast<double>(2E-09), &ADMSPSP103VA::Model::POTOX)
514  .setUnit(U_METER)
515 
516  .setDescription("Coefficient for the geometry independent part of TOX");
517  p.addPar("POEPSROX", static_cast<double>(3.9), &ADMSPSP103VA::Model::POEPSROX)
518  .setDescription("Coefficient for the geometry independent part of EPSOX");
519  p.addPar("PONEFF", static_cast<double>(5E+23), &ADMSPSP103VA::Model::PONEFF)
520  .setUnit(U_METERM3)
521 
522  .setDescription("Coefficient for the geometry independent part of NEFF");
523  p.addPar("PLNEFF", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLNEFF)
524  .setUnit(U_METERM3)
525 
526  .setDescription("Coefficient for the length dependence of NEFF");
527  p.addPar("PWNEFF", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWNEFF)
528  .setUnit(U_METERM3)
529 
530  .setDescription("Coefficient for the width dependence of NEFF");
531  p.addPar("PLWNEFF", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWNEFF)
532  .setUnit(U_METERM3)
533 
534  .setDescription("Coefficient for the length times width dependence of NEFF");
535  p.addPar("POFACNEFFAC", static_cast<double>(1.0), &ADMSPSP103VA::Model::POFACNEFFAC)
536  .setDescription("Coefficient for the geometry independent part of FACNEFFAC");
537  p.addPar("PLFACNEFFAC", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLFACNEFFAC)
538  .setDescription("Coefficient for the length dependence of FACNEFFAC");
539  p.addPar("PWFACNEFFAC", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWFACNEFFAC)
540  .setDescription("Coefficient for the width dependence of FACNEFFAC");
541  p.addPar("PLWFACNEFFAC", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWFACNEFFAC)
542  .setDescription("Coefficient for the length times width dependence of FACNEFFAC");
543  p.addPar("POGFACNUD", static_cast<double>(1.0), &ADMSPSP103VA::Model::POGFACNUD)
544  .setDescription("Coefficient for the geometry independent part of GFACNUD");
545  p.addPar("PLGFACNUD", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLGFACNUD)
546  .setDescription("Coefficient for the length dependence of GFACNUD");
547  p.addPar("PWGFACNUD", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWGFACNUD)
548  .setDescription("Coefficient for the width dependence of GFACNUD");
549  p.addPar("PLWGFACNUD", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWGFACNUD)
550  .setDescription("Coefficient for the length times width dependence of GFACNUD");
551  p.addPar("POVSBNUD", static_cast<double>(0.0), &ADMSPSP103VA::Model::POVSBNUD)
552  .setUnit(U_VOLT)
553 
554  .setDescription("Coefficient for the geometry independent part of VSBNUD");
555  p.addPar("PODVSBNUD", static_cast<double>(1.0), &ADMSPSP103VA::Model::PODVSBNUD)
556  .setUnit(U_VOLT)
557 
558  .setDescription("Coefficient for the geometry independent part of DVSBNUD");
559  p.addPar("POVNSUB", static_cast<double>(0), &ADMSPSP103VA::Model::POVNSUB)
560  .setUnit(U_VOLT)
561 
562  .setDescription("Coefficient for the geometry independent part of VNSUB");
563  p.addPar("PONSLP", static_cast<double>(0.05), &ADMSPSP103VA::Model::PONSLP)
564  .setUnit(U_VOLT)
565 
566  .setDescription("Coefficient for the geometry independent part of NSLP");
567  p.addPar("PODNSUB", static_cast<double>(0), &ADMSPSP103VA::Model::PODNSUB)
568  .setDescription("Coefficient for the geometry independent part of DNSUB");
569  p.addPar("PODPHIB", static_cast<double>(0), &ADMSPSP103VA::Model::PODPHIB)
570  .setUnit(U_VOLT)
571 
572  .setDescription("Coefficient for the geometry independent part of DPHIB");
573  p.addPar("PLDPHIB", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLDPHIB)
574  .setUnit(U_VOLT)
575 
576  .setDescription("Coefficient for the length dependence of DPHIB");
577  p.addPar("PWDPHIB", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWDPHIB)
578  .setUnit(U_VOLT)
579 
580  .setDescription("Coefficient for the width dependence of DPHIB");
581  p.addPar("PLWDPHIB", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWDPHIB)
582  .setUnit(U_VOLT)
583 
584  .setDescription("Coefficient for the length times width dependence of DPHIB");
585  p.addPar("PODELVTAC", static_cast<double>(0), &ADMSPSP103VA::Model::PODELVTAC)
586  .setUnit(U_VOLT)
587 
588  .setDescription("Coefficient for the geometry independent part of DELVTAC");
589  p.addPar("PLDELVTAC", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLDELVTAC)
590  .setUnit(U_VOLT)
591 
592  .setDescription("Coefficient for the length dependence of DELVTAC");
593  p.addPar("PWDELVTAC", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWDELVTAC)
594  .setUnit(U_VOLT)
595 
596  .setDescription("Coefficient for the width dependence of DELVTAC");
597  p.addPar("PLWDELVTAC", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWDELVTAC)
598  .setUnit(U_VOLT)
599 
600  .setDescription("Coefficient for the length times width dependence of DELVTAC");
601  p.addPar("PONP", static_cast<double>(1E+26), &ADMSPSP103VA::Model::PONP)
602  .setUnit(U_METERM3)
603 
604  .setDescription("Coefficient for the geometry independent part of NP");
605  p.addPar("PLNP", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLNP)
606  .setUnit(U_METERM3)
607 
608  .setDescription("Coefficient for the length dependence of NP");
609  p.addPar("PWNP", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWNP)
610  .setUnit(U_METERM3)
611 
612  .setDescription("Coefficient for the width dependence of NP");
613  p.addPar("PLWNP", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWNP)
614  .setUnit(U_METERM3)
615 
616  .setDescription("Coefficient for the length times width dependence of NP");
617  p.addPar("POCT", static_cast<double>(0), &ADMSPSP103VA::Model::POCT)
618  .setDescription("Coefficient for the geometry independent part of CT");
619  p.addPar("PLCT", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLCT)
620  .setDescription("Coefficient for the length dependence of CT");
621  p.addPar("PWCT", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWCT)
622  .setDescription("Coefficient for the width dependence of CT");
623  p.addPar("PLWCT", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWCT)
624  .setDescription("Coefficient for the length times width dependence of CT");
625  p.addPar("POTOXOV", static_cast<double>(2E-09), &ADMSPSP103VA::Model::POTOXOV)
626  .setUnit(U_METER)
627 
628  .setDescription("Coefficient for the geometry independent part of TOXOV");
629  p.addPar("POTOXOVD", static_cast<double>(2E-09), &ADMSPSP103VA::Model::POTOXOVD)
630  .setUnit(U_METER)
631 
632  .setDescription("Coefficient for the geometry independent part of TOXOV for drain side");
633  p.addPar("PONOV", static_cast<double>(5E+25), &ADMSPSP103VA::Model::PONOV)
634  .setUnit(U_METERM3)
635 
636  .setDescription("Coefficient for the geometry independent part of NOV");
637  p.addPar("PLNOV", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLNOV)
638  .setUnit(U_METERM3)
639 
640  .setDescription("Coefficient for the length dependence of NOV");
641  p.addPar("PWNOV", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWNOV)
642  .setUnit(U_METERM3)
643 
644  .setDescription("Coefficient for the width dependence of NOV");
645  p.addPar("PLWNOV", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWNOV)
646  .setUnit(U_METERM3)
647 
648  .setDescription("Coefficient for the length times width dependence of NOV");
649  p.addPar("PONOVD", static_cast<double>(5E+25), &ADMSPSP103VA::Model::PONOVD)
650  .setUnit(U_METERM3)
651 
652  .setDescription("Coefficient for the geometry independent part of NOV for drain side");
653  p.addPar("PLNOVD", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLNOVD)
654  .setUnit(U_METERM3)
655 
656  .setDescription("Coefficient for the length dependence of NOV for drain side");
657  p.addPar("PWNOVD", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWNOVD)
658  .setUnit(U_METERM3)
659 
660  .setDescription("Coefficient for the width dependence of NOV for drain side");
661  p.addPar("PLWNOVD", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWNOVD)
662  .setUnit(U_METERM3)
663 
664  .setDescription("Coefficient for the length times width dependence of NOV for drain side");
665  p.addPar("POCF", static_cast<double>(0), &ADMSPSP103VA::Model::POCF)
666  .setDescription("Coefficient for the geometry independent part of CF");
667  p.addPar("PLCF", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLCF)
668  .setDescription("Coefficient for the length dependence of CF");
669  p.addPar("PWCF", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWCF)
670  .setDescription("Coefficient for the width dependence of CF");
671  p.addPar("PLWCF", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWCF)
672  .setDescription("Coefficient for the length times width dependence of CF");
673  p.addPar("POCFB", static_cast<double>(0), &ADMSPSP103VA::Model::POCFB)
674  .setDescription("Coefficient for the geometry independent part of CFB");
675  p.addPar("POBETN", static_cast<double>(0.07), &ADMSPSP103VA::Model::POBETN)
676  .setDescription("Coefficient for the geometry independent part of BETN");
677  p.addPar("PLBETN", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLBETN)
678  .setDescription("Coefficient for the length dependence of BETN");
679  p.addPar("PWBETN", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWBETN)
680  .setDescription("Coefficient for the width dependence of BETN");
681  p.addPar("PLWBETN", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWBETN)
682  .setDescription("Coefficient for the length times width dependence of BETN");
683  p.addPar("POSTBET", static_cast<double>(1), &ADMSPSP103VA::Model::POSTBET)
684  .setDescription("Coefficient for the geometry independent part of STBET");
685  p.addPar("PLSTBET", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLSTBET)
686  .setDescription("Coefficient for the length dependence of STBET");
687  p.addPar("PWSTBET", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWSTBET)
688  .setDescription("Coefficient for the width dependence of STBET");
689  p.addPar("PLWSTBET", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWSTBET)
690  .setDescription("Coefficient for the length times width dependence of STBET");
691  p.addPar("POMUE", static_cast<double>(0.5), &ADMSPSP103VA::Model::POMUE)
692  .setDescription("Coefficient for the geometry independent part of MUE");
693  p.addPar("PLMUE", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLMUE)
694  .setDescription("Coefficient for the length dependence of MUE");
695  p.addPar("PWMUE", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWMUE)
696  .setDescription("Coefficient for the width dependence of MUE");
697  p.addPar("PLWMUE", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWMUE)
698  .setDescription("Coefficient for the length times width dependence of MUE");
699  p.addPar("POSTMUE", static_cast<double>(0), &ADMSPSP103VA::Model::POSTMUE)
700  .setDescription("Coefficient for the geometry independent part of STMUE");
701  p.addPar("POTHEMU", static_cast<double>(1.5), &ADMSPSP103VA::Model::POTHEMU)
702  .setDescription("Coefficient for the geometry independent part of THEMU");
703  p.addPar("POSTTHEMU", static_cast<double>(1.5), &ADMSPSP103VA::Model::POSTTHEMU)
704  .setDescription("Coefficient for the geometry independent part of STTHEMU");
705  p.addPar("POCS", static_cast<double>(0), &ADMSPSP103VA::Model::POCS)
706  .setDescription("Coefficient for the geometry independent part of CS");
707  p.addPar("PLCS", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLCS)
708  .setDescription("Coefficient for the length dependence of CS");
709  p.addPar("PWCS", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWCS)
710  .setDescription("Coefficient for the width dependence of CS");
711  p.addPar("PLWCS", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWCS)
712  .setDescription("Coefficient for the length times width dependence of CS");
713  p.addPar("POSTCS", static_cast<double>(0), &ADMSPSP103VA::Model::POSTCS)
714  .setDescription("Coefficient for the geometry independent part of STCS");
715  p.addPar("POXCOR", static_cast<double>(0), &ADMSPSP103VA::Model::POXCOR)
716  .setDescription("Coefficient for the geometry independent part of XCOR");
717  p.addPar("PLXCOR", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLXCOR)
718  .setDescription("Coefficient for the length dependence of XCOR");
719  p.addPar("PWXCOR", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWXCOR)
720  .setDescription("Coefficient for the width dependence of XCOR");
721  p.addPar("PLWXCOR", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWXCOR)
722  .setDescription("Coefficient for the length times width dependence of XCOR");
723  p.addPar("POSTXCOR", static_cast<double>(0), &ADMSPSP103VA::Model::POSTXCOR)
724  .setDescription("Coefficient for the geometry independent part of STXCOR");
725  p.addPar("POFETA", static_cast<double>(1), &ADMSPSP103VA::Model::POFETA)
726  .setDescription("Coefficient for the geometry independent part of FETA");
727  p.addPar("PORS", static_cast<double>(30), &ADMSPSP103VA::Model::PORS)
728  .setDescription("Coefficient for the geometry independent part of RS");
729  p.addPar("PLRS", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLRS)
730  .setDescription("Coefficient for the length dependence of RS");
731  p.addPar("PWRS", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWRS)
732  .setDescription("Coefficient for the width dependence of RS");
733  p.addPar("PLWRS", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWRS)
734  .setDescription("Coefficient for the length times width dependence of RS");
735  p.addPar("POSTRS", static_cast<double>(1), &ADMSPSP103VA::Model::POSTRS)
736  .setDescription("Coefficient for the geometry independent part of STRS");
737  p.addPar("PORSB", static_cast<double>(0), &ADMSPSP103VA::Model::PORSB)
738  .setDescription("Coefficient for the geometry independent part of RSB");
739  p.addPar("PORSG", static_cast<double>(0), &ADMSPSP103VA::Model::PORSG)
740  .setDescription("Coefficient for the geometry independent part of RSG");
741  p.addPar("POTHESAT", static_cast<double>(1), &ADMSPSP103VA::Model::POTHESAT)
742  .setDescription("Coefficient for the geometry independent part of THESAT");
743  p.addPar("PLTHESAT", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLTHESAT)
744  .setDescription("Coefficient for the length dependence of THESAT");
745  p.addPar("PWTHESAT", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWTHESAT)
746  .setDescription("Coefficient for the width dependence of THESAT");
747  p.addPar("PLWTHESAT", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWTHESAT)
748  .setDescription("Coefficient for the length times width dependence of THESAT");
749  p.addPar("POSTTHESAT", static_cast<double>(1), &ADMSPSP103VA::Model::POSTTHESAT)
750  .setDescription("Coefficient for the geometry independent part of STTHESAT");
751  p.addPar("PLSTTHESAT", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLSTTHESAT)
752  .setDescription("Coefficient for the length dependence of STTHESAT");
753  p.addPar("PWSTTHESAT", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWSTTHESAT)
754  .setDescription("Coefficient for the width dependence of STTHESAT");
755  p.addPar("PLWSTTHESAT", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWSTTHESAT)
756  .setDescription("Coefficient for the length times width dependence of STTHESAT");
757  p.addPar("POTHESATB", static_cast<double>(0), &ADMSPSP103VA::Model::POTHESATB)
758  .setDescription("Coefficient for the geometry independent part of THESATB");
759  p.addPar("PLTHESATB", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLTHESATB)
760  .setDescription("Coefficient for the length dependence of THESATB");
761  p.addPar("PWTHESATB", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWTHESATB)
762  .setDescription("Coefficient for the width dependence of THESATB");
763  p.addPar("PLWTHESATB", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWTHESATB)
764  .setDescription("Coefficient for the length times width dependence of THESATB");
765  p.addPar("POTHESATG", static_cast<double>(0), &ADMSPSP103VA::Model::POTHESATG)
766  .setDescription("Coefficient for the geometry independent part of THESATG");
767  p.addPar("PLTHESATG", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLTHESATG)
768  .setDescription("Coefficient for the length dependence of THESATG");
769  p.addPar("PWTHESATG", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWTHESATG)
770  .setDescription("Coefficient for the width dependence of THESATG");
771  p.addPar("PLWTHESATG", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWTHESATG)
772  .setDescription("Coefficient for the length times width dependence of THESATG");
773  p.addPar("POAX", static_cast<double>(3), &ADMSPSP103VA::Model::POAX)
774  .setDescription("Coefficient for the geometry independent part of AX");
775  p.addPar("PLAX", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLAX)
776  .setDescription("Coefficient for the length dependence of AX");
777  p.addPar("PWAX", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWAX)
778  .setDescription("Coefficient for the width dependence of AX");
779  p.addPar("PLWAX", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWAX)
780  .setDescription("Coefficient for the length times width dependence of AX");
781  p.addPar("POALP", static_cast<double>(0.01), &ADMSPSP103VA::Model::POALP)
782  .setDescription("Coefficient for the geometry independent part of ALP");
783  p.addPar("PLALP", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLALP)
784  .setDescription("Coefficient for the length dependence of ALP");
785  p.addPar("PWALP", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWALP)
786  .setDescription("Coefficient for the width dependence of ALP");
787  p.addPar("PLWALP", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWALP)
788  .setDescription("Coefficient for the length times width dependence of ALP");
789  p.addPar("POALP1", static_cast<double>(0), &ADMSPSP103VA::Model::POALP1)
790  .setUnit(U_VOLT)
791 
792  .setDescription("Coefficient for the geometry independent part of ALP1");
793  p.addPar("PLALP1", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLALP1)
794  .setUnit(U_VOLT)
795 
796  .setDescription("Coefficient for the length dependence of ALP1");
797  p.addPar("PWALP1", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWALP1)
798  .setUnit(U_VOLT)
799 
800  .setDescription("Coefficient for the width dependence of ALP1");
801  p.addPar("PLWALP1", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWALP1)
802  .setUnit(U_VOLT)
803 
804  .setDescription("Coefficient for the length times width dependence of ALP1");
805  p.addPar("POALP2", static_cast<double>(0), &ADMSPSP103VA::Model::POALP2)
806  .setDescription("Coefficient for the geometry independent part of ALP2");
807  p.addPar("PLALP2", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLALP2)
808  .setDescription("Coefficient for the length dependence of ALP2");
809  p.addPar("PWALP2", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWALP2)
810  .setDescription("Coefficient for the width dependence of ALP2");
811  p.addPar("PLWALP2", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWALP2)
812  .setDescription("Coefficient for the length times width dependence of ALP2");
813  p.addPar("POVP", static_cast<double>(0.05), &ADMSPSP103VA::Model::POVP)
814  .setUnit(U_VOLT)
815 
816  .setDescription("Coefficient for the geometry independent part of VP");
817  p.addPar("POA1", static_cast<double>(1), &ADMSPSP103VA::Model::POA1)
818  .setDescription("Coefficient for the geometry independent part of A1");
819  p.addPar("PLA1", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLA1)
820  .setDescription("Coefficient for the length dependence of A1");
821  p.addPar("PWA1", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWA1)
822  .setDescription("Coefficient for the width dependence of A1");
823  p.addPar("PLWA1", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWA1)
824  .setDescription("Coefficient for the length times width dependence of A1");
825  p.addPar("POA2", static_cast<double>(10), &ADMSPSP103VA::Model::POA2)
826  .setUnit(U_VOLT)
827 
828  .setDescription("Coefficient for the geometry independent part of A2");
829  p.addPar("POSTA2", static_cast<double>(0), &ADMSPSP103VA::Model::POSTA2)
830  .setUnit(U_VOLT)
831 
832  .setDescription("Coefficient for the geometry independent part of STA2");
833  p.addPar("POA3", static_cast<double>(1), &ADMSPSP103VA::Model::POA3)
834  .setDescription("Coefficient for the geometry independent part of A3");
835  p.addPar("PLA3", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLA3)
836  .setDescription("Coefficient for the length dependence of A3");
837  p.addPar("PWA3", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWA3)
838  .setDescription("Coefficient for the width dependence of A3");
839  p.addPar("PLWA3", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWA3)
840  .setDescription("Coefficient for the length times width dependence of A3");
841  p.addPar("POA4", static_cast<double>(0), &ADMSPSP103VA::Model::POA4)
842  .setDescription("Coefficient for the geometry independent part of A4");
843  p.addPar("PLA4", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLA4)
844  .setDescription("Coefficient for the length dependence of A4");
845  p.addPar("PWA4", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWA4)
846  .setDescription("Coefficient for the width dependence of A4");
847  p.addPar("PLWA4", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWA4)
848  .setDescription("Coefficient for the length times width dependence of A4");
849  p.addPar("POGCO", static_cast<double>(0), &ADMSPSP103VA::Model::POGCO)
850  .setDescription("Coefficient for the geometry independent part of GCO");
851  p.addPar("POIGINV", static_cast<double>(0), &ADMSPSP103VA::Model::POIGINV)
852  .setUnit(U_AMP)
853 
854  .setDescription("Coefficient for the geometry independent part of IGINV");
855  p.addPar("PLIGINV", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLIGINV)
856  .setUnit(U_AMP)
857 
858  .setDescription("Coefficient for the length dependence of IGINV");
859  p.addPar("PWIGINV", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWIGINV)
860  .setUnit(U_AMP)
861 
862  .setDescription("Coefficient for the width dependence of IGINV");
863  p.addPar("PLWIGINV", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWIGINV)
864  .setUnit(U_AMP)
865 
866  .setDescription("Coefficient for the length times width dependence of IGINV");
867  p.addPar("POIGOV", static_cast<double>(0), &ADMSPSP103VA::Model::POIGOV)
868  .setUnit(U_AMP)
869 
870  .setDescription("Coefficient for the geometry independent part of IGOV");
871  p.addPar("PLIGOV", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLIGOV)
872  .setUnit(U_AMP)
873 
874  .setDescription("Coefficient for the length dependence of IGOV");
875  p.addPar("PWIGOV", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWIGOV)
876  .setUnit(U_AMP)
877 
878  .setDescription("Coefficient for the width dependence of IGOV");
879  p.addPar("PLWIGOV", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWIGOV)
880  .setUnit(U_AMP)
881 
882  .setDescription("Coefficient for the length times width dependence of IGOV");
883  p.addPar("POIGOVD", static_cast<double>(0), &ADMSPSP103VA::Model::POIGOVD)
884  .setUnit(U_AMP)
885 
886  .setDescription("Coefficient for the geometry independent part of IGOV for drain side");
887  p.addPar("PLIGOVD", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLIGOVD)
888  .setUnit(U_AMP)
889 
890  .setDescription("Coefficient for the length dependence of IGOV for drain side");
891  p.addPar("PWIGOVD", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWIGOVD)
892  .setUnit(U_AMP)
893 
894  .setDescription("Coefficient for the width dependence of IGOV for drain side");
895  p.addPar("PLWIGOVD", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWIGOVD)
896  .setUnit(U_AMP)
897 
898  .setDescription("Coefficient for the length times width dependence of IGOV for drain side");
899  p.addPar("POSTIG", static_cast<double>(2), &ADMSPSP103VA::Model::POSTIG)
900  .setDescription("Coefficient for the geometry independent part of STIG");
901  p.addPar("POGC2", static_cast<double>(0.375), &ADMSPSP103VA::Model::POGC2)
902  .setDescription("Coefficient for the geometry independent part of GC2");
903  p.addPar("POGC3", static_cast<double>(0.063), &ADMSPSP103VA::Model::POGC3)
904  .setDescription("Coefficient for the geometry independent part of GC3");
905  p.addPar("POCHIB", static_cast<double>(3.1), &ADMSPSP103VA::Model::POCHIB)
906  .setUnit(U_VOLT)
907 
908  .setDescription("Coefficient for the geometry independent part of CHIB");
909  p.addPar("POAGIDL", static_cast<double>(0), &ADMSPSP103VA::Model::POAGIDL)
910  .setUnit(U_AMPVM3)
911 
912  .setDescription("Coefficient for the geometry independent part of AGIDL");
913  p.addPar("PLAGIDL", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLAGIDL)
914  .setUnit(U_AMPVM3)
915 
916  .setDescription("Coefficient for the length dependence of AGIDL");
917  p.addPar("PWAGIDL", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWAGIDL)
918  .setUnit(U_AMPVM3)
919 
920  .setDescription("Coefficient for the width dependence of AGIDL");
921  p.addPar("PLWAGIDL", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWAGIDL)
922  .setUnit(U_AMPVM3)
923 
924  .setDescription("Coefficient for the length times width dependence of AGIDL");
925  p.addPar("POAGIDLD", static_cast<double>(0), &ADMSPSP103VA::Model::POAGIDLD)
926  .setUnit(U_AMPVM3)
927 
928  .setDescription("Coefficient for the geometry independent part of AGIDL for drain side");
929  p.addPar("PLAGIDLD", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLAGIDLD)
930  .setUnit(U_AMPVM3)
931 
932  .setDescription("Coefficient for the length dependence of AGIDL for drain side");
933  p.addPar("PWAGIDLD", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWAGIDLD)
934  .setUnit(U_AMPVM3)
935 
936  .setDescription("Coefficient for the width dependence of AGIDL for drain side");
937  p.addPar("PLWAGIDLD", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWAGIDLD)
938  .setUnit(U_AMPVM3)
939 
940  .setDescription("Coefficient for the length times width dependence of AGIDL for drain side");
941  p.addPar("POBGIDL", static_cast<double>(41), &ADMSPSP103VA::Model::POBGIDL)
942  .setUnit(U_VOLT)
943 
944  .setDescription("Coefficient for the geometry independent part of BGIDL");
945  p.addPar("POBGIDLD", static_cast<double>(41), &ADMSPSP103VA::Model::POBGIDLD)
946  .setUnit(U_VOLT)
947 
948  .setDescription("Coefficient for the geometry independent part of BGIDL for drain side");
949  p.addPar("POSTBGIDL", static_cast<double>(0), &ADMSPSP103VA::Model::POSTBGIDL)
950  .setUnit(U_VKM1)
951 
952  .setDescription("Coefficient for the geometry independent part of STBGIDL");
953  p.addPar("POSTBGIDLD", static_cast<double>(0), &ADMSPSP103VA::Model::POSTBGIDLD)
954  .setUnit(U_VKM1)
955 
956  .setDescription("Coefficient for the geometry independent part of STBGIDL for drain side");
957  p.addPar("POCGIDL", static_cast<double>(0), &ADMSPSP103VA::Model::POCGIDL)
958  .setDescription("Coefficient for the geometry independent part of CGIDL");
959  p.addPar("POCGIDLD", static_cast<double>(0), &ADMSPSP103VA::Model::POCGIDLD)
960  .setDescription("Coefficient for the geometry independent part of CGIDL for drain side");
961  p.addPar("POCOX", static_cast<double>(1E-14), &ADMSPSP103VA::Model::POCOX)
962  .setUnit(U_FARAD)
963 
964  .setDescription("Coefficient for the geometry independent part of COX");
965  p.addPar("PLCOX", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLCOX)
966  .setUnit(U_FARAD)
967 
968  .setDescription("Coefficient for the length dependence of COX");
969  p.addPar("PWCOX", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWCOX)
970  .setUnit(U_FARAD)
971 
972  .setDescription("Coefficient for the width dependence of COX");
973  p.addPar("PLWCOX", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWCOX)
974  .setUnit(U_FARAD)
975 
976  .setDescription("Coefficient for the length times width dependence of COX");
977  p.addPar("POCGOV", static_cast<double>(1E-15), &ADMSPSP103VA::Model::POCGOV)
978  .setUnit(U_FARAD)
979 
980  .setDescription("Coefficient for the geometry independent part of CGOV");
981  p.addPar("PLCGOV", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLCGOV)
982  .setUnit(U_FARAD)
983 
984  .setDescription("Coefficient for the length dependence of CGOV");
985  p.addPar("PWCGOV", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWCGOV)
986  .setUnit(U_FARAD)
987 
988  .setDescription("Coefficient for the width dependence of CGOV");
989  p.addPar("PLWCGOV", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWCGOV)
990  .setUnit(U_FARAD)
991 
992  .setDescription("Coefficient for the length times width dependence of CGOV");
993  p.addPar("POCGOVD", static_cast<double>(1E-15), &ADMSPSP103VA::Model::POCGOVD)
994  .setUnit(U_FARAD)
995 
996  .setDescription("Coefficient for the geometry independent part of CGOV for drain side");
997  p.addPar("PLCGOVD", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLCGOVD)
998  .setUnit(U_FARAD)
999 
1000  .setDescription("Coefficient for the length dependence of CGOV for drain side");
1001  p.addPar("PWCGOVD", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWCGOVD)
1002  .setUnit(U_FARAD)
1003 
1004  .setDescription("Coefficient for the width dependence of CGOV for drain side");
1005  p.addPar("PLWCGOVD", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWCGOVD)
1006  .setUnit(U_FARAD)
1007 
1008  .setDescription("Coefficient for the length times width dependence of CGOV for drain side");
1009  p.addPar("POCGBOV", static_cast<double>(0), &ADMSPSP103VA::Model::POCGBOV)
1010  .setUnit(U_FARAD)
1011 
1012  .setDescription("Coefficient for the geometry independent part of CGBOV");
1013  p.addPar("PLCGBOV", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLCGBOV)
1014  .setUnit(U_FARAD)
1015 
1016  .setDescription("Coefficient for the length dependence of CGBOV");
1017  p.addPar("PWCGBOV", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWCGBOV)
1018  .setUnit(U_FARAD)
1019 
1020  .setDescription("Coefficient for the width dependence of CGBOV");
1021  p.addPar("PLWCGBOV", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWCGBOV)
1022  .setUnit(U_FARAD)
1023 
1024  .setDescription("Coefficient for the length times width dependence of CGBOV");
1025  p.addPar("POCFR", static_cast<double>(0), &ADMSPSP103VA::Model::POCFR)
1026  .setUnit(U_FARAD)
1027 
1028  .setDescription("Coefficient for the geometry independent part of CFR");
1029  p.addPar("PLCFR", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLCFR)
1030  .setUnit(U_FARAD)
1031 
1032  .setDescription("Coefficient for the length dependence of CFR");
1033  p.addPar("PWCFR", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWCFR)
1034  .setUnit(U_FARAD)
1035 
1036  .setDescription("Coefficient for the width dependence of CFR");
1037  p.addPar("PLWCFR", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWCFR)
1038  .setUnit(U_FARAD)
1039 
1040  .setDescription("Coefficient for the length times width dependence of CFR");
1041  p.addPar("POCFRD", static_cast<double>(0), &ADMSPSP103VA::Model::POCFRD)
1042  .setUnit(U_FARAD)
1043 
1044  .setDescription("Coefficient for the geometry independent part of CFR for drain side");
1045  p.addPar("PLCFRD", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLCFRD)
1046  .setUnit(U_FARAD)
1047 
1048  .setDescription("Coefficient for the length dependence of CFR for drain side");
1049  p.addPar("PWCFRD", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWCFRD)
1050  .setUnit(U_FARAD)
1051 
1052  .setDescription("Coefficient for the width dependence of CFR for drain side");
1053  p.addPar("PLWCFRD", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWCFRD)
1054  .setUnit(U_FARAD)
1055 
1056  .setDescription("Coefficient for the length times width dependence of CFR for drain side");
1057  p.addPar("POFNT", static_cast<double>(1), &ADMSPSP103VA::Model::POFNT)
1058  .setDescription("Coefficient for the geometry independent part of FNT");
1059  p.addPar("PONFA", static_cast<double>(8E+22), &ADMSPSP103VA::Model::PONFA)
1060  .setDescription("Coefficient for the geometry independent part of NFA");
1061  p.addPar("PLNFA", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLNFA)
1062  .setDescription("Coefficient for the length dependence of NFA");
1063  p.addPar("PWNFA", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWNFA)
1064  .setDescription("Coefficient for the width dependence of NFA");
1065  p.addPar("PLWNFA", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWNFA)
1066  .setDescription("Coefficient for the length times width dependence of NFA");
1067  p.addPar("PONFB", static_cast<double>(3E+07), &ADMSPSP103VA::Model::PONFB)
1068  .setDescription("Coefficient for the geometry independent part of NFB");
1069  p.addPar("PLNFB", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLNFB)
1070  .setDescription("Coefficient for the length dependence of NFB");
1071  p.addPar("PWNFB", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWNFB)
1072  .setDescription("Coefficient for the width dependence of NFB");
1073  p.addPar("PLWNFB", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWNFB)
1074  .setDescription("Coefficient for the length times width dependence of NFB");
1075  p.addPar("PONFC", static_cast<double>(0), &ADMSPSP103VA::Model::PONFC)
1076  .setDescription("Coefficient for the geometry independent part of NFC");
1077  p.addPar("PLNFC", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLNFC)
1078  .setDescription("Coefficient for the length dependence of NFC");
1079  p.addPar("PWNFC", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWNFC)
1080  .setDescription("Coefficient for the width dependence of NFC");
1081  p.addPar("PLWNFC", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWNFC)
1082  .setDescription("Coefficient for the length times width dependence of NFC");
1083  p.addPar("POEF", static_cast<double>(1.0), &ADMSPSP103VA::Model::POEF)
1084  .setDescription("Coefficient for the flicker noise frequency exponent");
1085  p.addPar("POKVTHOWE", static_cast<double>(0), &ADMSPSP103VA::Model::POKVTHOWE)
1086  .setDescription("Coefficient for the geometry independent part of KVTHOWE");
1087  p.addPar("PLKVTHOWE", static_cast<double>(0), &ADMSPSP103VA::Model::PLKVTHOWE)
1088  .setDescription("Coefficient for the length dependence part of KVTHOWE");
1089  p.addPar("PWKVTHOWE", static_cast<double>(0), &ADMSPSP103VA::Model::PWKVTHOWE)
1090  .setDescription("Coefficient for the width dependence part of KVTHOWE");
1091  p.addPar("PLWKVTHOWE", static_cast<double>(0), &ADMSPSP103VA::Model::PLWKVTHOWE)
1092  .setDescription("Coefficient for the length times width dependence part of KVTHOWE");
1093  p.addPar("POKUOWE", static_cast<double>(0), &ADMSPSP103VA::Model::POKUOWE)
1094  .setDescription("Coefficient for the geometry independent part of KUOWE");
1095  p.addPar("PLKUOWE", static_cast<double>(0), &ADMSPSP103VA::Model::PLKUOWE)
1096  .setDescription("Coefficient for the length dependence part of KUOWE");
1097  p.addPar("PWKUOWE", static_cast<double>(0), &ADMSPSP103VA::Model::PWKUOWE)
1098  .setDescription("Coefficient for the width dependence part of KUOWE");
1099  p.addPar("PLWKUOWE", static_cast<double>(0), &ADMSPSP103VA::Model::PLWKUOWE)
1100  .setDescription("Coefficient for the length times width dependence part of KUOWE");
1101  p.addPar("LMIN", static_cast<double>(0), &ADMSPSP103VA::Model::LMIN)
1102  .setUnit(U_METER)
1103 
1104  .setDescription("Dummy parameter to label binning set");
1105  p.addPar("LMAX", static_cast<double>(1.0), &ADMSPSP103VA::Model::LMAX)
1106  .setUnit(U_METER)
1107 
1108  .setDescription("Dummy parameter to label binning set");
1109  p.addPar("WMIN", static_cast<double>(0), &ADMSPSP103VA::Model::WMIN)
1110  .setUnit(U_METER)
1111 
1112  .setDescription("Dummy parameter to label binning set");
1113  p.addPar("WMAX", static_cast<double>(1.0), &ADMSPSP103VA::Model::WMAX)
1114  .setUnit(U_METER)
1115 
1116  .setDescription("Dummy parameter to label binning set");
1117  p.addPar("LVARO", static_cast<double>(0.0), &ADMSPSP103VA::Model::LVARO)
1118  .setUnit(U_METER)
1119 
1120  .setDescription("Geom. independent difference between actual and programmed gate length");
1121  p.addPar("LVARL", static_cast<double>(0.0), &ADMSPSP103VA::Model::LVARL)
1122  .setDescription("Length dependence of LVAR");
1123  p.addPar("LVARW", static_cast<double>(0.0), &ADMSPSP103VA::Model::LVARW)
1124  .setDescription("Width dependence of LVAR");
1125  p.addPar("LAP", static_cast<double>(0.0), &ADMSPSP103VA::Model::LAP)
1126  .setUnit(U_METER)
1127 
1128  .setDescription("Effective channel length reduction per side");
1129  p.addPar("WVARO", static_cast<double>(0.0), &ADMSPSP103VA::Model::WVARO)
1130  .setUnit(U_METER)
1131 
1132  .setDescription("Geom. independent difference between actual and programmed field-oxide opening");
1133  p.addPar("WVARL", static_cast<double>(0.0), &ADMSPSP103VA::Model::WVARL)
1134  .setDescription("Length dependence of WVAR");
1135  p.addPar("WVARW", static_cast<double>(0.0), &ADMSPSP103VA::Model::WVARW)
1136  .setDescription("Width dependence of WVAR");
1137  p.addPar("WOT", static_cast<double>(0.0), &ADMSPSP103VA::Model::WOT)
1138  .setUnit(U_METER)
1139 
1140  .setDescription("Effective channel width reduction per side");
1141  p.addPar("DLQ", static_cast<double>(0.0), &ADMSPSP103VA::Model::DLQ)
1142  .setUnit(U_METER)
1143 
1144  .setDescription("Effective channel length reduction for CV");
1145  p.addPar("DWQ", static_cast<double>(0.0), &ADMSPSP103VA::Model::DWQ)
1146  .setUnit(U_METER)
1147 
1148  .setDescription("Effective channel width reduction for CV");
1149  p.addPar("VFBO", static_cast<double>((-1.0)), &ADMSPSP103VA::Model::VFBO)
1150  .setUnit(U_VOLT)
1151 
1152  .setDescription("Geometry-independent flat-band voltage at TR");
1153  p.addPar("VFBL", static_cast<double>(0.0), &ADMSPSP103VA::Model::VFBL)
1154  .setUnit(U_VOLT)
1155 
1156  .setDescription("Length dependence of flat-band voltage");
1157  p.addPar("VFBW", static_cast<double>(0.0), &ADMSPSP103VA::Model::VFBW)
1158  .setUnit(U_VOLT)
1159 
1160  .setDescription("Width dependence of flat-band voltage");
1161  p.addPar("VFBLW", static_cast<double>(0.0), &ADMSPSP103VA::Model::VFBLW)
1162  .setUnit(U_VOLT)
1163 
1164  .setDescription("Area dependence of flat-band voltage");
1165  p.addPar("STVFBO", static_cast<double>(5e-4), &ADMSPSP103VA::Model::STVFBO)
1166  .setUnit(U_VKM1)
1167 
1168  .setDescription("Geometry-independent temperature dependence of VFB");
1169  p.addPar("STVFBL", static_cast<double>(0.0), &ADMSPSP103VA::Model::STVFBL)
1170  .setUnit(U_VKM1)
1171 
1172  .setDescription("Length dependence of temperature dependence of VFB");
1173  p.addPar("STVFBW", static_cast<double>(0.0), &ADMSPSP103VA::Model::STVFBW)
1174  .setUnit(U_VKM1)
1175 
1176  .setDescription("Width dependence of temperature dependence of VFB");
1177  p.addPar("STVFBLW", static_cast<double>(0.0), &ADMSPSP103VA::Model::STVFBLW)
1178  .setUnit(U_VKM1)
1179 
1180  .setDescription("Area dependence of temperature dependence of VFB");
1181  p.addPar("TOXO", static_cast<double>(2e-9), &ADMSPSP103VA::Model::TOXO)
1182  .setUnit(U_METER)
1183 
1184  .setDescription("Gate oxide thickness");
1185  p.addPar("EPSROXO", static_cast<double>(3.9), &ADMSPSP103VA::Model::EPSROXO)
1186  .setDescription("Relative permittivity of gate dielectric");
1187  p.addPar("NSUBO", static_cast<double>(3e23), &ADMSPSP103VA::Model::NSUBO)
1188  .setUnit(U_METERM3)
1189 
1190  .setDescription("Geometry independent substrate doping");
1191  p.addPar("NSUBW", static_cast<double>(0.0), &ADMSPSP103VA::Model::NSUBW)
1192  .setDescription("Width dependence of background doping NSUBO due to segregation");
1193  p.addPar("WSEG", static_cast<double>(1e-8), &ADMSPSP103VA::Model::WSEG)
1194  .setUnit(U_METER)
1195 
1196  .setDescription("Char. length of segregation of background doping NSUBO");
1197  p.addPar("NPCK", static_cast<double>(1e24), &ADMSPSP103VA::Model::NPCK)
1198  .setUnit(U_METERM3)
1199 
1200  .setDescription("Pocket doping level");
1201  p.addPar("NPCKW", static_cast<double>(0.0), &ADMSPSP103VA::Model::NPCKW)
1202  .setDescription("Width dependence of pocket doping NPCK due to segregation");
1203  p.addPar("WSEGP", static_cast<double>(1e-8), &ADMSPSP103VA::Model::WSEGP)
1204  .setUnit(U_METER)
1205 
1206  .setDescription("Char. length of segregation of pocket doping NPCK");
1207  p.addPar("LPCK", static_cast<double>(1e-8), &ADMSPSP103VA::Model::LPCK)
1208  .setUnit(U_METER)
1209 
1210  .setDescription("Char. length of lateral doping profile");
1211  p.addPar("LPCKW", static_cast<double>(0.0), &ADMSPSP103VA::Model::LPCKW)
1212  .setDescription("Width dependence of char. length of lateral doping profile");
1213  p.addPar("FOL1", static_cast<double>(0.0), &ADMSPSP103VA::Model::FOL1)
1214  .setDescription("First length dependence coefficient for short channel body effect");
1215  p.addPar("FOL2", static_cast<double>(0.0), &ADMSPSP103VA::Model::FOL2)
1216  .setDescription("Second length dependence coefficient for short channel body effect");
1217  p.addPar("FACNEFFACO", static_cast<double>(1.0), &ADMSPSP103VA::Model::FACNEFFACO)
1218  .setDescription("Geom. independent pre-factor for effective substrate doping in separate charge calculation");
1219  p.addPar("FACNEFFACL", static_cast<double>(0.0), &ADMSPSP103VA::Model::FACNEFFACL)
1220  .setDescription("Length dependence of FACNEFFAC");
1221  p.addPar("FACNEFFACW", static_cast<double>(0.0), &ADMSPSP103VA::Model::FACNEFFACW)
1222  .setDescription("Width dependence of FACNEFFAC");
1223  p.addPar("FACNEFFACLW", static_cast<double>(0.0), &ADMSPSP103VA::Model::FACNEFFACLW)
1224  .setDescription("Area dependence of FACNEFFAC");
1225  p.addPar("GFACNUDO", static_cast<double>(1.0), &ADMSPSP103VA::Model::GFACNUDO)
1226  .setDescription("Geom. independent bodyfactor change due to NUD-effect");
1227  p.addPar("GFACNUDL", static_cast<double>(0.0), &ADMSPSP103VA::Model::GFACNUDL)
1228  .setDescription("Length dependence of GFACNUD");
1229  p.addPar("GFACNUDLEXP", static_cast<double>(1.0), &ADMSPSP103VA::Model::GFACNUDLEXP)
1230  .setDescription("Exponent for length dependence of GFACNUD");
1231  p.addPar("GFACNUDW", static_cast<double>(0.0), &ADMSPSP103VA::Model::GFACNUDW)
1232  .setDescription("Width dependence of GFACNUD");
1233  p.addPar("GFACNUDLW", static_cast<double>(0.0), &ADMSPSP103VA::Model::GFACNUDLW)
1234  .setDescription("Area dependence of GFACNUD");
1235  p.addPar("VSBNUDO", static_cast<double>(0.0), &ADMSPSP103VA::Model::VSBNUDO)
1236  .setUnit(U_VOLT)
1237 
1238  .setDescription("Lower Vsb value for NUD-effect");
1239  p.addPar("DVSBNUDO", static_cast<double>(1.0), &ADMSPSP103VA::Model::DVSBNUDO)
1240  .setUnit(U_VOLT)
1241 
1242  .setDescription("Vsb range for NUD-effect");
1243  p.addPar("VNSUBO", static_cast<double>(0.0), &ADMSPSP103VA::Model::VNSUBO)
1244  .setUnit(U_VOLT)
1245 
1246  .setDescription("Effective doping bias-dependence parameter");
1247  p.addPar("NSLPO", static_cast<double>(0.05), &ADMSPSP103VA::Model::NSLPO)
1248  .setUnit(U_VOLT)
1249 
1250  .setDescription("Effective doping bias-dependence parameter");
1251  p.addPar("DNSUBO", static_cast<double>(0.0), &ADMSPSP103VA::Model::DNSUBO)
1252  .setUnit(U_VOLTM1)
1253 
1254  .setDescription("Effective doping bias-dependence parameter");
1255  p.addPar("DPHIBO", static_cast<double>(0.0), &ADMSPSP103VA::Model::DPHIBO)
1256  .setUnit(U_VOLT)
1257 
1258  .setDescription("Geometry independent offset of PHIB");
1259  p.addPar("DPHIBL", static_cast<double>(0.0), &ADMSPSP103VA::Model::DPHIBL)
1260  .setUnit(U_VOLT)
1261 
1262  .setDescription("Length dependence offset of PHIB");
1263  p.addPar("DPHIBLEXP", static_cast<double>(1.0), &ADMSPSP103VA::Model::DPHIBLEXP)
1264  .setDescription("Exponent for length dependence of offset of PHIB");
1265  p.addPar("DPHIBW", static_cast<double>(0.0), &ADMSPSP103VA::Model::DPHIBW)
1266  .setUnit(U_VOLT)
1267 
1268  .setDescription("Width dependence of offset of PHIB");
1269  p.addPar("DPHIBLW", static_cast<double>(0.0), &ADMSPSP103VA::Model::DPHIBLW)
1270  .setUnit(U_VOLT)
1271 
1272  .setDescription("Area dependence of offset of PHIB");
1273  p.addPar("DELVTACO", static_cast<double>(0.0), &ADMSPSP103VA::Model::DELVTACO)
1274  .setUnit(U_VOLT)
1275 
1276  .setDescription("Geom. independent offset parameter for PHIB in separate charge calculation");
1277  p.addPar("DELVTACL", static_cast<double>(0.0), &ADMSPSP103VA::Model::DELVTACL)
1278  .setUnit(U_VOLT)
1279 
1280  .setDescription("Length dependence of DELVTAC");
1281  p.addPar("DELVTACLEXP", static_cast<double>(1.0), &ADMSPSP103VA::Model::DELVTACLEXP)
1282  .setDescription("Exponent for length dependence of offset of DELVTAC");
1283  p.addPar("DELVTACW", static_cast<double>(0.0), &ADMSPSP103VA::Model::DELVTACW)
1284  .setUnit(U_VOLT)
1285 
1286  .setDescription("Width dependence of DELVTAC");
1287  p.addPar("DELVTACLW", static_cast<double>(0.0), &ADMSPSP103VA::Model::DELVTACLW)
1288  .setUnit(U_VOLT)
1289 
1290  .setDescription("Area dependence of DELVTAC");
1291  p.addPar("NPO", static_cast<double>(1e26), &ADMSPSP103VA::Model::NPO)
1292  .setUnit(U_METERM3)
1293 
1294  .setDescription("Geometry-independent gate poly-silicon doping");
1295  p.addPar("NPL", static_cast<double>(0.0), &ADMSPSP103VA::Model::NPL)
1296  .setDescription("Length dependence of gate poly-silicon doping");
1297  p.addPar("CTO", static_cast<double>(0.0), &ADMSPSP103VA::Model::CTO)
1298  .setDescription("Geometry-independent interface states factor");
1299  p.addPar("CTL", static_cast<double>(0.0), &ADMSPSP103VA::Model::CTL)
1300  .setDescription("Length dependence of interface states factor");
1301  p.addPar("CTLEXP", static_cast<double>(1.0), &ADMSPSP103VA::Model::CTLEXP)
1302  .setDescription("Exponent for length dependence of interface states factor");
1303  p.addPar("CTW", static_cast<double>(0.0), &ADMSPSP103VA::Model::CTW)
1304  .setDescription("Width dependence of interface states factor");
1305  p.addPar("CTLW", static_cast<double>(0.0), &ADMSPSP103VA::Model::CTLW)
1306  .setDescription("Area dependence of interface states factor");
1307  p.addPar("TOXOVO", static_cast<double>(2e-9), &ADMSPSP103VA::Model::TOXOVO)
1308  .setUnit(U_METER)
1309 
1310  .setDescription("Overlap oxide thickness");
1311  p.addPar("TOXOVDO", static_cast<double>(2e-9), &ADMSPSP103VA::Model::TOXOVDO)
1312  .setUnit(U_METER)
1313 
1314  .setDescription("Overlap oxide thickness for drain side");
1315  p.addPar("LOV", static_cast<double>(0), &ADMSPSP103VA::Model::LOV)
1316  .setUnit(U_METER)
1317 
1318  .setDescription("Overlap length for gate/drain and gate/source overlap capacitance");
1319  p.addPar("LOVD", static_cast<double>(0), &ADMSPSP103VA::Model::LOVD)
1320  .setUnit(U_METER)
1321 
1322  .setDescription("Overlap length for gate/drain overlap capacitance");
1323  p.addPar("NOVO", static_cast<double>(5e25), &ADMSPSP103VA::Model::NOVO)
1324  .setUnit(U_METERM3)
1325 
1326  .setDescription("Effective doping of overlap region");
1327  p.addPar("NOVDO", static_cast<double>(5e25), &ADMSPSP103VA::Model::NOVDO)
1328  .setUnit(U_METERM3)
1329 
1330  .setDescription("Effective doping of overlap region for drain side");
1331  p.addPar("CFL", static_cast<double>(0.0), &ADMSPSP103VA::Model::CFL)
1332  .setDescription("Length dependence of DIBL-parameter");
1333  p.addPar("CFLEXP", static_cast<double>(2.0), &ADMSPSP103VA::Model::CFLEXP)
1334  .setDescription("Exponent for length dependence of CF");
1335  p.addPar("CFW", static_cast<double>(0.0), &ADMSPSP103VA::Model::CFW)
1336  .setDescription("Width dependence of CF");
1337  p.addPar("CFBO", static_cast<double>(0.0), &ADMSPSP103VA::Model::CFBO)
1338  .setUnit(U_VOLTM1)
1339 
1340  .setDescription("Back-bias dependence of CF");
1341  p.addPar("UO", static_cast<double>(5e-2), &ADMSPSP103VA::Model::UO)
1342  .setUnit(U_M2VM1SM1)
1343 
1344  .setDescription("Zero-field mobility at TR");
1345  p.addPar("FBET1", static_cast<double>(0.0), &ADMSPSP103VA::Model::FBET1)
1346  .setDescription("Relative mobility decrease due to first lateral profile");
1347  p.addPar("FBET1W", static_cast<double>(0.0), &ADMSPSP103VA::Model::FBET1W)
1348  .setDescription("Width dependence of relative mobility decrease due to first lateral profile");
1349  p.addPar("LP1", static_cast<double>(1e-8), &ADMSPSP103VA::Model::LP1)
1350  .setUnit(U_METER)
1351 
1352  .setDescription("Mobility-related characteristic length of first lateral profile");
1353  p.addPar("LP1W", static_cast<double>(0.0), &ADMSPSP103VA::Model::LP1W)
1354  .setDescription("Width dependence of mobility-related characteristic length of first lateral profile");
1355  p.addPar("FBET2", static_cast<double>(0.0), &ADMSPSP103VA::Model::FBET2)
1356  .setDescription("Relative mobility decrease due to second lateral profile");
1357  p.addPar("LP2", static_cast<double>(1e-8), &ADMSPSP103VA::Model::LP2)
1358  .setUnit(U_METER)
1359 
1360  .setDescription("Mobility-related characteristic length of second lateral profile");
1361  p.addPar("BETW1", static_cast<double>(0.0), &ADMSPSP103VA::Model::BETW1)
1362  .setDescription("First higher-order width scaling coefficient of BETN");
1363  p.addPar("BETW2", static_cast<double>(0.0), &ADMSPSP103VA::Model::BETW2)
1364  .setDescription("Second higher-order width scaling coefficient of BETN");
1365  p.addPar("WBET", static_cast<double>(1e-9), &ADMSPSP103VA::Model::WBET)
1366  .setUnit(U_METER)
1367 
1368  .setDescription("Characteristic width for width scaling of BETN");
1369  p.addPar("STBETO", static_cast<double>(1.0), &ADMSPSP103VA::Model::STBETO)
1370  .setDescription("Geometry independent temperature dependence of BETN");
1371  p.addPar("STBETL", static_cast<double>(0.0), &ADMSPSP103VA::Model::STBETL)
1372  .setDescription("Length dependence of temperature dependence of BETN");
1373  p.addPar("STBETW", static_cast<double>(0.0), &ADMSPSP103VA::Model::STBETW)
1374  .setDescription("Width dependence of temperature dependence of BETN");
1375  p.addPar("STBETLW", static_cast<double>(0.0), &ADMSPSP103VA::Model::STBETLW)
1376  .setDescription("Area dependence of temperature dependence of BETN");
1377  p.addPar("MUEO", static_cast<double>(0.5), &ADMSPSP103VA::Model::MUEO)
1378  .setUnit(U_MVM1)
1379 
1380  .setDescription("Geometry independent mobility reduction coefficient at TR");
1381  p.addPar("MUEW", static_cast<double>(0.0), &ADMSPSP103VA::Model::MUEW)
1382  .setDescription("Width dependence of mobility reduction coefficient at TR");
1383  p.addPar("STMUEO", static_cast<double>(0.0), &ADMSPSP103VA::Model::STMUEO)
1384  .setDescription("Temperature dependence of MUE");
1385  p.addPar("THEMUO", static_cast<double>(1.5), &ADMSPSP103VA::Model::THEMUO)
1386  .setDescription("Mobility reduction exponent at TR");
1387  p.addPar("STTHEMUO", static_cast<double>(1.5), &ADMSPSP103VA::Model::STTHEMUO)
1388  .setDescription("Temperature dependence of THEMU");
1389  p.addPar("CSO", static_cast<double>(0.0), &ADMSPSP103VA::Model::CSO)
1390  .setDescription("Geometry independent coulomb scattering parameter at TR");
1391  p.addPar("CSL", static_cast<double>(0.0), &ADMSPSP103VA::Model::CSL)
1392  .setDescription("Length dependence of CS");
1393  p.addPar("CSLEXP", static_cast<double>(1.0), &ADMSPSP103VA::Model::CSLEXP)
1394  .setDescription("Exponent for length dependence of CS");
1395  p.addPar("CSW", static_cast<double>(0.0), &ADMSPSP103VA::Model::CSW)
1396  .setDescription("Width dependence of CS");
1397  p.addPar("CSLW", static_cast<double>(0.0), &ADMSPSP103VA::Model::CSLW)
1398  .setDescription("Area dependence of CS");
1399  p.addPar("STCSO", static_cast<double>(0.0), &ADMSPSP103VA::Model::STCSO)
1400  .setDescription("Temperature dependence of CS");
1401  p.addPar("XCORO", static_cast<double>(0.0), &ADMSPSP103VA::Model::XCORO)
1402  .setUnit(U_VOLTM1)
1403 
1404  .setDescription("Geometry independent non-universality parameter");
1405  p.addPar("XCORL", static_cast<double>(0.0), &ADMSPSP103VA::Model::XCORL)
1406  .setDescription("Length dependence of non-universality parameter");
1407  p.addPar("XCORW", static_cast<double>(0.0), &ADMSPSP103VA::Model::XCORW)
1408  .setDescription("Width dependence of non-universality parameter");
1409  p.addPar("XCORLW", static_cast<double>(0.0), &ADMSPSP103VA::Model::XCORLW)
1410  .setDescription("Area dependence of non-universality parameter");
1411  p.addPar("STXCORO", static_cast<double>(0.0), &ADMSPSP103VA::Model::STXCORO)
1412  .setDescription("Temperature dependence of XCOR");
1413  p.addPar("FETAO", static_cast<double>(1.0), &ADMSPSP103VA::Model::FETAO)
1414  .setDescription("Effective field parameter");
1415  p.addPar("RSW1", static_cast<double>(50.0), &ADMSPSP103VA::Model::RSW1)
1416  .setUnit(U_OHM)
1417 
1418  .setDescription("Source/drain series resistance for 1 um wide channel at TR");
1419  p.addPar("RSW2", static_cast<double>(0.0), &ADMSPSP103VA::Model::RSW2)
1420  .setDescription("Higher-order width scaling of RS");
1421  p.addPar("STRSO", static_cast<double>(1.0), &ADMSPSP103VA::Model::STRSO)
1422  .setDescription("Temperature dependence of RS");
1423  p.addPar("RSBO", static_cast<double>(0.0), &ADMSPSP103VA::Model::RSBO)
1424  .setUnit(U_VOLTM1)
1425 
1426  .setDescription("Back-bias dependence of series resistance");
1427  p.addPar("RSGO", static_cast<double>(0.0), &ADMSPSP103VA::Model::RSGO)
1428  .setUnit(U_VOLTM1)
1429 
1430  .setDescription("Gate-bias dependence of series resistance");
1431  p.addPar("THESATO", static_cast<double>(0.0), &ADMSPSP103VA::Model::THESATO)
1432  .setUnit(U_VOLTM1)
1433 
1434  .setDescription("Geometry independent velocity saturation parameter at TR");
1435  p.addPar("THESATL", static_cast<double>(0.05), &ADMSPSP103VA::Model::THESATL)
1436  .setUnit(U_VOLTM1)
1437 
1438  .setDescription("Length dependence of THESAT");
1439  p.addPar("THESATLEXP", static_cast<double>(1.0), &ADMSPSP103VA::Model::THESATLEXP)
1440  .setDescription("Exponent for length dependence of THESAT");
1441  p.addPar("THESATW", static_cast<double>(0.0), &ADMSPSP103VA::Model::THESATW)
1442  .setDescription("Width dependence of velocity saturation parameter");
1443  p.addPar("THESATLW", static_cast<double>(0.0), &ADMSPSP103VA::Model::THESATLW)
1444  .setDescription("Area dependence of velocity saturation parameter");
1445  p.addPar("STTHESATO", static_cast<double>(1.0), &ADMSPSP103VA::Model::STTHESATO)
1446  .setDescription("Geometry independent temperature dependence of THESAT");
1447  p.addPar("STTHESATL", static_cast<double>(0.0), &ADMSPSP103VA::Model::STTHESATL)
1448  .setDescription("Length dependence of temperature dependence of THESAT");
1449  p.addPar("STTHESATW", static_cast<double>(0.0), &ADMSPSP103VA::Model::STTHESATW)
1450  .setDescription("Width dependence of temperature dependence of THESAT");
1451  p.addPar("STTHESATLW", static_cast<double>(0.0), &ADMSPSP103VA::Model::STTHESATLW)
1452  .setDescription("Area dependence of temperature dependence of THESAT");
1453  p.addPar("THESATBO", static_cast<double>(0.0), &ADMSPSP103VA::Model::THESATBO)
1454  .setUnit(U_VOLTM1)
1455 
1456  .setDescription("Back-bias dependence of velocity saturation");
1457  p.addPar("THESATGO", static_cast<double>(0.0), &ADMSPSP103VA::Model::THESATGO)
1458  .setUnit(U_VOLTM1)
1459 
1460  .setDescription("Gate-bias dependence of velocity saturation");
1461  p.addPar("AXO", static_cast<double>(18), &ADMSPSP103VA::Model::AXO)
1462  .setDescription("Geometry independent linear/saturation transition factor");
1463  p.addPar("AXL", static_cast<double>(0.4), &ADMSPSP103VA::Model::AXL)
1464  .setDescription("Length dependence of AX");
1465  p.addPar("ALPL", static_cast<double>(5e-4), &ADMSPSP103VA::Model::ALPL)
1466  .setDescription("Length dependence of ALP");
1467  p.addPar("ALPLEXP", static_cast<double>(1.0), &ADMSPSP103VA::Model::ALPLEXP)
1468  .setDescription("Exponent for length dependence of ALP");
1469  p.addPar("ALPW", static_cast<double>(0.0), &ADMSPSP103VA::Model::ALPW)
1470  .setDescription("Width dependence of ALP");
1471  p.addPar("ALP1L1", static_cast<double>(0.0), &ADMSPSP103VA::Model::ALP1L1)
1472  .setUnit(U_VOLT)
1473 
1474  .setDescription("Length dependence of CLM enhancement factor above threshold");
1475  p.addPar("ALP1LEXP", static_cast<double>(0.5), &ADMSPSP103VA::Model::ALP1LEXP)
1476  .setDescription("Exponent for length dependence of ALP1");
1477  p.addPar("ALP1L2", static_cast<double>(0.0), &ADMSPSP103VA::Model::ALP1L2)
1478  .setDescription("Second order length dependence of ALP1");
1479  p.addPar("ALP1W", static_cast<double>(0.0), &ADMSPSP103VA::Model::ALP1W)
1480  .setDescription("Width dependence of ALP1");
1481  p.addPar("ALP2L1", static_cast<double>(0.0), &ADMSPSP103VA::Model::ALP2L1)
1482  .setUnit(U_VOLTM1)
1483 
1484  .setDescription("Length dependence of CLM enhancement factor below threshold");
1485  p.addPar("ALP2LEXP", static_cast<double>(0.5), &ADMSPSP103VA::Model::ALP2LEXP)
1486  .setDescription("Exponent for length dependence of ALP2");
1487  p.addPar("ALP2L2", static_cast<double>(0.0), &ADMSPSP103VA::Model::ALP2L2)
1488  .setDescription("Second order length dependence of ALP2");
1489  p.addPar("ALP2W", static_cast<double>(0.0), &ADMSPSP103VA::Model::ALP2W)
1490  .setDescription("Width dependence of ALP2");
1491  p.addPar("VPO", static_cast<double>(0.05), &ADMSPSP103VA::Model::VPO)
1492  .setUnit(U_VOLT)
1493 
1494  .setDescription("CLM logarithmic dependence parameter");
1495  p.addPar("A1O", static_cast<double>(1.0), &ADMSPSP103VA::Model::A1O)
1496  .setDescription("Geometry independent impact-ionization pre-factor");
1497  p.addPar("A1L", static_cast<double>(0.0), &ADMSPSP103VA::Model::A1L)
1498  .setDescription("Length dependence of A1");
1499  p.addPar("A1W", static_cast<double>(0.0), &ADMSPSP103VA::Model::A1W)
1500  .setDescription("Width dependence of A1");
1501  p.addPar("A2O", static_cast<double>(10), &ADMSPSP103VA::Model::A2O)
1502  .setUnit(U_VOLT)
1503 
1504  .setDescription("Impact-ionization exponent at TR");
1505  p.addPar("STA2O", static_cast<double>(0.0), &ADMSPSP103VA::Model::STA2O)
1506  .setUnit(U_VOLT)
1507 
1508  .setDescription("Temperature dependence of A2");
1509  p.addPar("A3O", static_cast<double>(1.0), &ADMSPSP103VA::Model::A3O)
1510  .setDescription("Geometry independent saturation-voltage dependence of II");
1511  p.addPar("A3L", static_cast<double>(0.0), &ADMSPSP103VA::Model::A3L)
1512  .setDescription("Length dependence of A3");
1513  p.addPar("A3W", static_cast<double>(0.0), &ADMSPSP103VA::Model::A3W)
1514  .setDescription("Width dependence of A3");
1515  p.addPar("A4O", static_cast<double>(0.0), &ADMSPSP103VA::Model::A4O)
1516  .setUnit(U_VOLTMH)
1517 
1518  .setDescription("Geometry independent back-bias dependence of II");
1519  p.addPar("A4L", static_cast<double>(0.0), &ADMSPSP103VA::Model::A4L)
1520  .setDescription("Length dependence of A4");
1521  p.addPar("A4W", static_cast<double>(0.0), &ADMSPSP103VA::Model::A4W)
1522  .setDescription("Width dependence of A4");
1523  p.addPar("GCOO", static_cast<double>(0.0), &ADMSPSP103VA::Model::GCOO)
1524  .setDescription("Gate tunneling energy adjustment");
1525  p.addPar("IGINVLW", static_cast<double>(0.0), &ADMSPSP103VA::Model::IGINVLW)
1526  .setUnit(U_AMP)
1527 
1528  .setDescription("Gate channel current pre-factor for 1 um**2 channel area");
1529  p.addPar("IGOVW", static_cast<double>(0.0), &ADMSPSP103VA::Model::IGOVW)
1530  .setUnit(U_AMP)
1531 
1532  .setDescription("Gate overlap current pre-factor for 1 um wide channel");
1533  p.addPar("IGOVDW", static_cast<double>(0.0), &ADMSPSP103VA::Model::IGOVDW)
1534  .setUnit(U_AMP)
1535 
1536  .setDescription("Gate overlap current pre-factor for 1 um wide channel for drain side");
1537  p.addPar("STIGO", static_cast<double>(2.0), &ADMSPSP103VA::Model::STIGO)
1538  .setDescription("Temperature dependence of IGINV and IGOV");
1539  p.addPar("GC2O", static_cast<double>(0.375), &ADMSPSP103VA::Model::GC2O)
1540  .setDescription("Gate current slope factor");
1541  p.addPar("GC3O", static_cast<double>(0.063), &ADMSPSP103VA::Model::GC3O)
1542  .setDescription("Gate current curvature factor");
1543  p.addPar("CHIBO", static_cast<double>(3.1), &ADMSPSP103VA::Model::CHIBO)
1544  .setUnit(U_VOLT)
1545 
1546  .setDescription("Tunneling barrier height");
1547  p.addPar("AGIDLW", static_cast<double>(0.0), &ADMSPSP103VA::Model::AGIDLW)
1548  .setUnit(U_AMPVM3)
1549 
1550  .setDescription("Width dependence of GIDL pre-factor");
1551  p.addPar("AGIDLDW", static_cast<double>(0.0), &ADMSPSP103VA::Model::AGIDLDW)
1552  .setUnit(U_AMPVM3)
1553 
1554  .setDescription("Width dependence of GIDL pre-factor for drain side");
1555  p.addPar("BGIDLO", static_cast<double>(41), &ADMSPSP103VA::Model::BGIDLO)
1556  .setUnit(U_VOLT)
1557 
1558  .setDescription("GIDL probability factor at TR");
1559  p.addPar("BGIDLDO", static_cast<double>(41), &ADMSPSP103VA::Model::BGIDLDO)
1560  .setUnit(U_VOLT)
1561 
1562  .setDescription("GIDL probability factor at TR for drain side");
1563  p.addPar("STBGIDLO", static_cast<double>(0.0), &ADMSPSP103VA::Model::STBGIDLO)
1564  .setUnit(U_VKM1)
1565 
1566  .setDescription("Temperature dependence of BGIDL");
1567  p.addPar("STBGIDLDO", static_cast<double>(0.0), &ADMSPSP103VA::Model::STBGIDLDO)
1568  .setUnit(U_VKM1)
1569 
1570  .setDescription("Temperature dependence of BGIDL for drain side");
1571  p.addPar("CGIDLO", static_cast<double>(0.0), &ADMSPSP103VA::Model::CGIDLO)
1572  .setDescription("Back-bias dependence of GIDL");
1573  p.addPar("CGIDLDO", static_cast<double>(0.0), &ADMSPSP103VA::Model::CGIDLDO)
1574  .setDescription("Back-bias dependence of GIDL for drain side");
1575  p.addPar("CGBOVL", static_cast<double>(0.0), &ADMSPSP103VA::Model::CGBOVL)
1576  .setUnit(U_FARAD)
1577 
1578  .setDescription("Oxide capacitance for gate-bulk overlap for 1 um long channel");
1579  p.addPar("CFRW", static_cast<double>(0.0), &ADMSPSP103VA::Model::CFRW)
1580  .setUnit(U_FARAD)
1581 
1582  .setDescription("Outer fringe capacitance for 1 um wide channel");
1583  p.addPar("CFRDW", static_cast<double>(0.0), &ADMSPSP103VA::Model::CFRDW)
1584  .setUnit(U_FARAD)
1585 
1586  .setDescription("Outer fringe capacitance for 1 um wide channel for drain side");
1587  p.addPar("FNTO", static_cast<double>(1.0), &ADMSPSP103VA::Model::FNTO)
1588  .setDescription("Thermal noise coefficient");
1589  p.addPar("NFALW", static_cast<double>(8e22), &ADMSPSP103VA::Model::NFALW)
1590  .setDescription("First coefficient of flicker noise for 1 um**2 channel area");
1591  p.addPar("NFBLW", static_cast<double>(3e7), &ADMSPSP103VA::Model::NFBLW)
1592  .setDescription("Second coefficient of flicker noise for 1 um**2 channel area");
1593  p.addPar("NFCLW", static_cast<double>(0.0), &ADMSPSP103VA::Model::NFCLW)
1594  .setUnit(U_VOLTM1)
1595 
1596  .setDescription("Third coefficient of flicker noise for 1 um**2 channel area");
1597  p.addPar("EFO", static_cast<double>(1.0), &ADMSPSP103VA::Model::EFO)
1598  .setDescription("Flicker noise frequency exponent");
1599  p.addPar("LINTNOI", static_cast<double>(0.0), &ADMSPSP103VA::Model::LINTNOI)
1600  .setUnit(U_METER)
1601 
1602  .setDescription("Length offset for flicker noise");
1603  p.addPar("ALPNOI", static_cast<double>(2.0), &ADMSPSP103VA::Model::ALPNOI)
1604  .setDescription("Exponent for length offset for flicker noise");
1605  p.addPar("KVTHOWEO", static_cast<double>(0), &ADMSPSP103VA::Model::KVTHOWEO)
1606  .setDescription("Geometrical independent threshold shift parameter");
1607  p.addPar("KVTHOWEL", static_cast<double>(0), &ADMSPSP103VA::Model::KVTHOWEL)
1608  .setDescription("Length dependent threshold shift parameter");
1609  p.addPar("KVTHOWEW", static_cast<double>(0), &ADMSPSP103VA::Model::KVTHOWEW)
1610  .setDescription("Width dependent threshold shift parameter");
1611  p.addPar("KVTHOWELW", static_cast<double>(0), &ADMSPSP103VA::Model::KVTHOWELW)
1612  .setDescription("Area dependent threshold shift parameter");
1613  p.addPar("KUOWEO", static_cast<double>(0), &ADMSPSP103VA::Model::KUOWEO)
1614  .setDescription("Geometrical independent mobility degradation factor");
1615  p.addPar("KUOWEL", static_cast<double>(0), &ADMSPSP103VA::Model::KUOWEL)
1616  .setDescription("Length dependent mobility degradation factor");
1617  p.addPar("KUOWEW", static_cast<double>(0), &ADMSPSP103VA::Model::KUOWEW)
1618  .setDescription("Width dependent mobility degradation factor");
1619  p.addPar("KUOWELW", static_cast<double>(0), &ADMSPSP103VA::Model::KUOWELW)
1620  .setDescription("Area dependent mobility degradation factor");
1621  p.addPar("RGO", static_cast<double>(0.0), &ADMSPSP103VA::Model::RGO)
1622  .setUnit(U_OHM)
1623 
1624  .setDescription("Gate resistance");
1625  p.addPar("RINT", static_cast<double>(0.0), &ADMSPSP103VA::Model::RINT)
1626  .setUnit(U_OHMM2)
1627 
1628  .setDescription("Contact resistance between silicide and ploy");
1629  p.addPar("RVPOLY", static_cast<double>(0.0), &ADMSPSP103VA::Model::RVPOLY)
1630  .setUnit(U_OHMM2)
1631 
1632  .setDescription("Vertical poly resistance");
1633  p.addPar("RSHG", static_cast<double>(0.0), &ADMSPSP103VA::Model::RSHG)
1634  .setUnit(U_OSQM1)
1635 
1636  .setDescription("Gate electrode diffusion sheet resistance");
1637  p.addPar("DLSIL", static_cast<double>(0.0), &ADMSPSP103VA::Model::DLSIL)
1638  .setUnit(U_METER)
1639 
1640  .setDescription("Silicide extension over the physical gate length");
1641  p.addPar("RSH", static_cast<double>(0.0), &ADMSPSP103VA::Model::RSH)
1642  .setUnit(U_OSQM1)
1643 
1644  .setDescription("Sheet resistance of source diffusion");
1645  p.addPar("RSHD", static_cast<double>(0.0), &ADMSPSP103VA::Model::RSHD)
1646  .setUnit(U_OSQM1)
1647 
1648  .setDescription("Sheet resistance of drain diffusion");
1649  p.addPar("RBULKO", static_cast<double>(0.0), &ADMSPSP103VA::Model::RBULKO)
1650  .setUnit(U_OHM)
1651 
1652  .setDescription("Bulk resistance between node BP and BI");
1653  p.addPar("RWELLO", static_cast<double>(0.0), &ADMSPSP103VA::Model::RWELLO)
1654  .setUnit(U_OHM)
1655 
1656  .setDescription("Well resistance between node BI and B");
1657  p.addPar("RJUNSO", static_cast<double>(0.0), &ADMSPSP103VA::Model::RJUNSO)
1658  .setUnit(U_OHM)
1659 
1660  .setDescription("Source-side bulk resistance between node BI and BS");
1661  p.addPar("RJUNDO", static_cast<double>(0.0), &ADMSPSP103VA::Model::RJUNDO)
1662  .setUnit(U_OHM)
1663 
1664  .setDescription("Drain-side bulk resistance between node BI and BD");
1665  p.addPar("SAREF", static_cast<double>(1.0e-6), &ADMSPSP103VA::Model::SAREF)
1666  .setUnit(U_METER)
1667 
1668  .setDescription("Reference distance between OD-edge and poly from one side");
1669  p.addPar("SBREF", static_cast<double>(1.0e-6), &ADMSPSP103VA::Model::SBREF)
1670  .setUnit(U_METER)
1671 
1672  .setDescription("Reference distance between OD-edge and poly from other side");
1673  p.addPar("WLOD", static_cast<double>(0), &ADMSPSP103VA::Model::WLOD)
1674  .setUnit(U_METER)
1675 
1676  .setDescription("Width parameter");
1677  p.addPar("KUO", static_cast<double>(0), &ADMSPSP103VA::Model::KUO)
1678  .setUnit(U_METER)
1679 
1680  .setDescription("Mobility degradation/enhancement coefficient");
1681  p.addPar("KVSAT", static_cast<double>(0), &ADMSPSP103VA::Model::KVSAT)
1682  .setUnit(U_METER)
1683 
1684  .setDescription("Saturation velocity degradation/enhancement coefficient");
1685  p.addPar("TKUO", static_cast<double>(0), &ADMSPSP103VA::Model::TKUO)
1686  .setDescription("Temperature dependence of KUO");
1687  p.addPar("LKUO", static_cast<double>(0), &ADMSPSP103VA::Model::LKUO)
1688  .setDescription("Length dependence of KUO");
1689  p.addPar("WKUO", static_cast<double>(0), &ADMSPSP103VA::Model::WKUO)
1690  .setDescription("Width dependence of KUO");
1691  p.addPar("PKUO", static_cast<double>(0), &ADMSPSP103VA::Model::PKUO)
1692  .setDescription("Cross-term dependence of KUO");
1693  p.addPar("LLODKUO", static_cast<double>(0), &ADMSPSP103VA::Model::LLODKUO)
1694  .setDescription("Length parameter for UO stress effect");
1695  p.addPar("WLODKUO", static_cast<double>(0), &ADMSPSP103VA::Model::WLODKUO)
1696  .setDescription("Width parameter for UO stress effect");
1697  p.addPar("KVTHO", static_cast<double>(0), &ADMSPSP103VA::Model::KVTHO)
1698  .setUnit(U_VM)
1699 
1700  .setDescription("Threshold shift parameter");
1701  p.addPar("LKVTHO", static_cast<double>(0), &ADMSPSP103VA::Model::LKVTHO)
1702  .setDescription("Length dependence of KVTHO");
1703  p.addPar("WKVTHO", static_cast<double>(0), &ADMSPSP103VA::Model::WKVTHO)
1704  .setDescription("Width dependence of KVTHO");
1705  p.addPar("PKVTHO", static_cast<double>(0), &ADMSPSP103VA::Model::PKVTHO)
1706  .setDescription("Cross-term dependence of KVTHO");
1707  p.addPar("LLODVTH", static_cast<double>(0), &ADMSPSP103VA::Model::LLODVTH)
1708  .setDescription("Length parameter for VTH-stress effect");
1709  p.addPar("WLODVTH", static_cast<double>(0), &ADMSPSP103VA::Model::WLODVTH)
1710  .setDescription("Width parameter for VTH-stress effect");
1711  p.addPar("STETAO", static_cast<double>(0), &ADMSPSP103VA::Model::STETAO)
1712  .setUnit(U_METER)
1713 
1714  .setDescription("eta0 shift factor related to VTHO change");
1715  p.addPar("LODETAO", static_cast<double>(1.0), &ADMSPSP103VA::Model::LODETAO)
1716  .setDescription("eta0 shift modification factor for stress effect");
1717  p.addPar("SCREF", static_cast<double>(1.0e-6), &ADMSPSP103VA::Model::SCREF)
1718  .setUnit(U_METER)
1719 
1720  .setDescription("Distance between OD-edge and well edge of a reference device");
1721  p.addPar("WEB", static_cast<double>(0), &ADMSPSP103VA::Model::WEB)
1722  .setDescription("Coefficient for SCB");
1723  p.addPar("WEC", static_cast<double>(0), &ADMSPSP103VA::Model::WEC)
1724  .setDescription("Coefficient for SCC");
1725  p.addPar("IMAX", static_cast<double>(1000), &ADMSPSP103VA::Model::IMAX)
1726  .setDescription("Maximum current up to which forward current behaves exponentially");
1727  p.addPar("TRJ", static_cast<double>(21), &ADMSPSP103VA::Model::TRJ)
1728  .setDescription("reference temperature");
1729  p.addPar("CJORBOT", static_cast<double>(1E-3), &ADMSPSP103VA::Model::CJORBOT)
1730  .setDescription("Zero-bias capacitance per unit-of-area of bottom component for source-bulk junction");
1731  p.addPar("CJORSTI", static_cast<double>(1E-9), &ADMSPSP103VA::Model::CJORSTI)
1732  .setDescription("Zero-bias capacitance per unit-of-length of STI-edge component for source-bulk junction");
1733  p.addPar("CJORGAT", static_cast<double>(1E-9), &ADMSPSP103VA::Model::CJORGAT)
1734  .setDescription("Zero-bias capacitance per unit-of-length of gate-edge component for source-bulk junction");
1735  p.addPar("VBIRBOT", static_cast<double>(1), &ADMSPSP103VA::Model::VBIRBOT)
1736  .setDescription("Built-in voltage at the reference temperature of bottom component for source-bulk junction");
1737  p.addPar("VBIRSTI", static_cast<double>(1), &ADMSPSP103VA::Model::VBIRSTI)
1738  .setDescription("Built-in voltage at the reference temperature of STI-edge component for source-bulk junction");
1739  p.addPar("VBIRGAT", static_cast<double>(1), &ADMSPSP103VA::Model::VBIRGAT)
1740  .setDescription("Built-in voltage at the reference temperature of gate-edge component for source-bulk junction");
1741  p.addPar("PBOT", static_cast<double>(0.5), &ADMSPSP103VA::Model::PBOT)
1742  .setDescription("Grading coefficient of bottom component for source-bulk junction");
1743  p.addPar("PSTI", static_cast<double>(0.5), &ADMSPSP103VA::Model::PSTI)
1744  .setDescription("Grading coefficient of STI-edge component for source-bulk junction");
1745  p.addPar("PGAT", static_cast<double>(0.5), &ADMSPSP103VA::Model::PGAT)
1746  .setDescription("Grading coefficient of gate-edge component for source-bulk junction");
1747  p.addPar("PHIGBOT", static_cast<double>(1.16), &ADMSPSP103VA::Model::PHIGBOT)
1748  .setDescription("Zero-temperature bandgap voltage of bottom component for source-bulk junction");
1749  p.addPar("PHIGSTI", static_cast<double>(1.16), &ADMSPSP103VA::Model::PHIGSTI)
1750  .setDescription("Zero-temperature bandgap voltage of STI-edge component for source-bulk junction");
1751  p.addPar("PHIGGAT", static_cast<double>(1.16), &ADMSPSP103VA::Model::PHIGGAT)
1752  .setDescription("Zero-temperature bandgap voltage of gate-edge component for source-bulk junction");
1753  p.addPar("IDSATRBOT", static_cast<double>(1E-12), &ADMSPSP103VA::Model::IDSATRBOT)
1754  .setDescription("Saturation current density at the reference temperature of bottom component for source-bulk junction");
1755  p.addPar("IDSATRSTI", static_cast<double>(1E-18), &ADMSPSP103VA::Model::IDSATRSTI)
1756  .setDescription("Saturation current density at the reference temperature of STI-edge component for source-bulk junction");
1757  p.addPar("IDSATRGAT", static_cast<double>(1E-18), &ADMSPSP103VA::Model::IDSATRGAT)
1758  .setDescription("Saturation current density at the reference temperature of gate-edge component for source-bulk junction");
1759  p.addPar("CSRHBOT", static_cast<double>(1E2), &ADMSPSP103VA::Model::CSRHBOT)
1760  .setDescription("Shockley-Read-Hall prefactor of bottom component for source-bulk junction");
1761  p.addPar("CSRHSTI", static_cast<double>(1E-4), &ADMSPSP103VA::Model::CSRHSTI)
1762  .setDescription("Shockley-Read-Hall prefactor of STI-edge component for source-bulk junction");
1763  p.addPar("CSRHGAT", static_cast<double>(1E-4), &ADMSPSP103VA::Model::CSRHGAT)
1764  .setDescription("Shockley-Read-Hall prefactor of gate-edge component for source-bulk junction");
1765  p.addPar("XJUNSTI", static_cast<double>(100E-9), &ADMSPSP103VA::Model::XJUNSTI)
1766  .setDescription("Junction depth of STI-edge component for source-bulk junction");
1767  p.addPar("XJUNGAT", static_cast<double>(100E-9), &ADMSPSP103VA::Model::XJUNGAT)
1768  .setDescription("Junction depth of gate-edge component for source-bulk junction");
1769  p.addPar("CTATBOT", static_cast<double>(1E2), &ADMSPSP103VA::Model::CTATBOT)
1770  .setDescription("Trap-assisted tunneling prefactor of bottom component for source-bulk junction");
1771  p.addPar("CTATSTI", static_cast<double>(1E-4), &ADMSPSP103VA::Model::CTATSTI)
1772  .setDescription("Trap-assisted tunneling prefactor of STI-edge component for source-bulk junction");
1773  p.addPar("CTATGAT", static_cast<double>(1E-4), &ADMSPSP103VA::Model::CTATGAT)
1774  .setDescription("Trap-assisted tunneling prefactor of gate-edge component for source-bulk junction");
1775  p.addPar("MEFFTATBOT", static_cast<double>(0.25), &ADMSPSP103VA::Model::MEFFTATBOT)
1776  .setDescription("Effective mass (in units of m0) for trap-assisted tunneling of bottom component for source-bulk junction");
1777  p.addPar("MEFFTATSTI", static_cast<double>(0.25), &ADMSPSP103VA::Model::MEFFTATSTI)
1778  .setDescription("Effective mass (in units of m0) for trap-assisted tunneling of STI-edge component for source-bulk junction");
1779  p.addPar("MEFFTATGAT", static_cast<double>(0.25), &ADMSPSP103VA::Model::MEFFTATGAT)
1780  .setDescription("Effective mass (in units of m0) for trap-assisted tunneling of gate-edge component for source-bulk junction");
1781  p.addPar("CBBTBOT", static_cast<double>(1E-12), &ADMSPSP103VA::Model::CBBTBOT)
1782  .setDescription("Band-to-band tunneling prefactor of bottom component for source-bulk junction");
1783  p.addPar("CBBTSTI", static_cast<double>(1E-18), &ADMSPSP103VA::Model::CBBTSTI)
1784  .setDescription("Band-to-band tunneling prefactor of STI-edge component for source-bulk junction");
1785  p.addPar("CBBTGAT", static_cast<double>(1E-18), &ADMSPSP103VA::Model::CBBTGAT)
1786  .setDescription("Band-to-band tunneling prefactor of gate-edge component for source-bulk junction");
1787  p.addPar("FBBTRBOT", static_cast<double>(1E9), &ADMSPSP103VA::Model::FBBTRBOT)
1788  .setDescription("Normalization field at the reference temperature for band-to-band tunneling of bottom component for source-bulk junction");
1789  p.addPar("FBBTRSTI", static_cast<double>(1E9), &ADMSPSP103VA::Model::FBBTRSTI)
1790  .setDescription("Normalization field at the reference temperature for band-to-band tunneling of STI-edge component for source-bulk junction");
1791  p.addPar("FBBTRGAT", static_cast<double>(1E9), &ADMSPSP103VA::Model::FBBTRGAT)
1792  .setDescription("Normalization field at the reference temperature for band-to-band tunneling of gate-edge component for source-bulk junction");
1793  p.addPar("STFBBTBOT", static_cast<double>((-1E-3)), &ADMSPSP103VA::Model::STFBBTBOT)
1794  .setDescription("Temperature scaling parameter for band-to-band tunneling of bottom component for source-bulk junction");
1795  p.addPar("STFBBTSTI", static_cast<double>((-1E-3)), &ADMSPSP103VA::Model::STFBBTSTI)
1796  .setDescription("Temperature scaling parameter for band-to-band tunneling of STI-edge component for source-bulk junction");
1797  p.addPar("STFBBTGAT", static_cast<double>((-1E-3)), &ADMSPSP103VA::Model::STFBBTGAT)
1798  .setDescription("Temperature scaling parameter for band-to-band tunneling of gate-edge component for source-bulk junction");
1799  p.addPar("VBRBOT", static_cast<double>(10), &ADMSPSP103VA::Model::VBRBOT)
1800  .setDescription("Breakdown voltage of bottom component for source-bulk junction");
1801  p.addPar("VBRSTI", static_cast<double>(10), &ADMSPSP103VA::Model::VBRSTI)
1802  .setDescription("Breakdown voltage of STI-edge component for source-bulk junction");
1803  p.addPar("VBRGAT", static_cast<double>(10), &ADMSPSP103VA::Model::VBRGAT)
1804  .setDescription("Breakdown voltage of gate-edge component for source-bulk junction");
1805  p.addPar("PBRBOT", static_cast<double>(4), &ADMSPSP103VA::Model::PBRBOT)
1806  .setDescription("Breakdown onset tuning parameter of bottom component for source-bulk junction");
1807  p.addPar("PBRSTI", static_cast<double>(4), &ADMSPSP103VA::Model::PBRSTI)
1808  .setDescription("Breakdown onset tuning parameter of STI-edge component for source-bulk junction");
1809  p.addPar("PBRGAT", static_cast<double>(4), &ADMSPSP103VA::Model::PBRGAT)
1810  .setDescription("Breakdown onset tuning parameter of gate-edge component for source-bulk junction");
1811  p.addPar("CJORBOTD", static_cast<double>(1E-3), &ADMSPSP103VA::Model::CJORBOTD)
1812  .setDescription("Zero-bias capacitance per unit-of-area of bottom component for drain-bulk junction");
1813  p.addPar("CJORSTID", static_cast<double>(1E-9), &ADMSPSP103VA::Model::CJORSTID)
1814  .setDescription("Zero-bias capacitance per unit-of-length of STI-edge component for drain-bulk junction");
1815  p.addPar("CJORGATD", static_cast<double>(1E-9), &ADMSPSP103VA::Model::CJORGATD)
1816  .setDescription("Zero-bias capacitance per unit-of-length of gate-edge component for drain-bulk junction");
1817  p.addPar("VBIRBOTD", static_cast<double>(1), &ADMSPSP103VA::Model::VBIRBOTD)
1818  .setDescription("Built-in voltage at the reference temperature of bottom component for drain-bulk junction");
1819  p.addPar("VBIRSTID", static_cast<double>(1), &ADMSPSP103VA::Model::VBIRSTID)
1820  .setDescription("Built-in voltage at the reference temperature of STI-edge component for drain-bulk junction");
1821  p.addPar("VBIRGATD", static_cast<double>(1), &ADMSPSP103VA::Model::VBIRGATD)
1822  .setDescription("Built-in voltage at the reference temperature of gate-edge component for drain-bulk junction");
1823  p.addPar("PBOTD", static_cast<double>(0.5), &ADMSPSP103VA::Model::PBOTD)
1824  .setDescription("Grading coefficient of bottom component for drain-bulk junction");
1825  p.addPar("PSTID", static_cast<double>(0.5), &ADMSPSP103VA::Model::PSTID)
1826  .setDescription("Grading coefficient of STI-edge component for drain-bulk junction");
1827  p.addPar("PGATD", static_cast<double>(0.5), &ADMSPSP103VA::Model::PGATD)
1828  .setDescription("Grading coefficient of gate-edge component for drain-bulk junction");
1829  p.addPar("PHIGBOTD", static_cast<double>(1.16), &ADMSPSP103VA::Model::PHIGBOTD)
1830  .setDescription("Zero-temperature bandgap voltage of bottom component for drain-bulk junction");
1831  p.addPar("PHIGSTID", static_cast<double>(1.16), &ADMSPSP103VA::Model::PHIGSTID)
1832  .setDescription("Zero-temperature bandgap voltage of STI-edge component for drain-bulk junction");
1833  p.addPar("PHIGGATD", static_cast<double>(1.16), &ADMSPSP103VA::Model::PHIGGATD)
1834  .setDescription("Zero-temperature bandgap voltage of gate-edge component for drain-bulk junction");
1835  p.addPar("IDSATRBOTD", static_cast<double>(1E-12), &ADMSPSP103VA::Model::IDSATRBOTD)
1836  .setDescription("Saturation current density at the reference temperature of bottom component for drain-bulk junction");
1837  p.addPar("IDSATRSTID", static_cast<double>(1E-18), &ADMSPSP103VA::Model::IDSATRSTID)
1838  .setDescription("Saturation current density at the reference temperature of STI-edge component for drain-bulk junction");
1839  p.addPar("IDSATRGATD", static_cast<double>(1E-18), &ADMSPSP103VA::Model::IDSATRGATD)
1840  .setDescription("Saturation current density at the reference temperature of gate-edge component for drain-bulk junction");
1841  p.addPar("CSRHBOTD", static_cast<double>(1E2), &ADMSPSP103VA::Model::CSRHBOTD)
1842  .setDescription("Shockley-Read-Hall prefactor of bottom component for drain-bulk junction");
1843  p.addPar("CSRHSTID", static_cast<double>(1E-4), &ADMSPSP103VA::Model::CSRHSTID)
1844  .setDescription("Shockley-Read-Hall prefactor of STI-edge component for drain-bulk junction");
1845  p.addPar("CSRHGATD", static_cast<double>(1E-4), &ADMSPSP103VA::Model::CSRHGATD)
1846  .setDescription("Shockley-Read-Hall prefactor of gate-edge component for drain-bulk junction");
1847  p.addPar("XJUNSTID", static_cast<double>(100E-9), &ADMSPSP103VA::Model::XJUNSTID)
1848  .setDescription("Junction depth of STI-edge component for drain-bulk junction");
1849  p.addPar("XJUNGATD", static_cast<double>(100E-9), &ADMSPSP103VA::Model::XJUNGATD)
1850  .setDescription("Junction depth of gate-edge component for drain-bulk junction");
1851  p.addPar("CTATBOTD", static_cast<double>(1E2), &ADMSPSP103VA::Model::CTATBOTD)
1852  .setDescription("Trap-assisted tunneling prefactor of bottom component for drain-bulk junction");
1853  p.addPar("CTATSTID", static_cast<double>(1E-4), &ADMSPSP103VA::Model::CTATSTID)
1854  .setDescription("Trap-assisted tunneling prefactor of STI-edge component for drain-bulk junction");
1855  p.addPar("CTATGATD", static_cast<double>(1E-4), &ADMSPSP103VA::Model::CTATGATD)
1856  .setDescription("Trap-assisted tunneling prefactor of gate-edge component for drain-bulk junction");
1857  p.addPar("MEFFTATBOTD", static_cast<double>(0.25), &ADMSPSP103VA::Model::MEFFTATBOTD)
1858  .setDescription("Effective mass (in units of m0) for trap-assisted tunneling of bottom component for drain-bulk junction");
1859  p.addPar("MEFFTATSTID", static_cast<double>(0.25), &ADMSPSP103VA::Model::MEFFTATSTID)
1860  .setDescription("Effective mass (in units of m0) for trap-assisted tunneling of STI-edge component for drain-bulk junction");
1861  p.addPar("MEFFTATGATD", static_cast<double>(0.25), &ADMSPSP103VA::Model::MEFFTATGATD)
1862  .setDescription("Effective mass (in units of m0) for trap-assisted tunneling of gate-edge component for drain-bulk junction");
1863  p.addPar("CBBTBOTD", static_cast<double>(1E-12), &ADMSPSP103VA::Model::CBBTBOTD)
1864  .setDescription("Band-to-band tunneling prefactor of bottom component for drain-bulk junction");
1865  p.addPar("CBBTSTID", static_cast<double>(1E-18), &ADMSPSP103VA::Model::CBBTSTID)
1866  .setDescription("Band-to-band tunneling prefactor of STI-edge component for drain-bulk junction");
1867  p.addPar("CBBTGATD", static_cast<double>(1E-18), &ADMSPSP103VA::Model::CBBTGATD)
1868  .setDescription("Band-to-band tunneling prefactor of gate-edge component for drain-bulk junction");
1869  p.addPar("FBBTRBOTD", static_cast<double>(1E9), &ADMSPSP103VA::Model::FBBTRBOTD)
1870  .setDescription("Normalization field at the reference temperature for band-to-band tunneling of bottom component for drain-bulk junction");
1871  p.addPar("FBBTRSTID", static_cast<double>(1E9), &ADMSPSP103VA::Model::FBBTRSTID)
1872  .setDescription("Normalization field at the reference temperature for band-to-band tunneling of STI-edge component for drain-bulk junction");
1873  p.addPar("FBBTRGATD", static_cast<double>(1E9), &ADMSPSP103VA::Model::FBBTRGATD)
1874  .setDescription("Normalization field at the reference temperature for band-to-band tunneling of gate-edge component for drain-bulk junction");
1875  p.addPar("STFBBTBOTD", static_cast<double>((-1E-3)), &ADMSPSP103VA::Model::STFBBTBOTD)
1876  .setDescription("Temperature scaling parameter for band-to-band tunneling of bottom component for drain-bulk junction");
1877  p.addPar("STFBBTSTID", static_cast<double>((-1E-3)), &ADMSPSP103VA::Model::STFBBTSTID)
1878  .setDescription("Temperature scaling parameter for band-to-band tunneling of STI-edge component for drain-bulk junction");
1879  p.addPar("STFBBTGATD", static_cast<double>((-1E-3)), &ADMSPSP103VA::Model::STFBBTGATD)
1880  .setDescription("Temperature scaling parameter for band-to-band tunneling of gate-edge component for drain-bulk junction");
1881  p.addPar("VBRBOTD", static_cast<double>(10), &ADMSPSP103VA::Model::VBRBOTD)
1882  .setDescription("Breakdown voltage of bottom component for drain-bulk junction");
1883  p.addPar("VBRSTID", static_cast<double>(10), &ADMSPSP103VA::Model::VBRSTID)
1884  .setDescription("Breakdown voltage of STI-edge component for drain-bulk junction");
1885  p.addPar("VBRGATD", static_cast<double>(10), &ADMSPSP103VA::Model::VBRGATD)
1886  .setDescription("Breakdown voltage of gate-edge component for drain-bulk junction");
1887  p.addPar("PBRBOTD", static_cast<double>(4), &ADMSPSP103VA::Model::PBRBOTD)
1888  .setDescription("Breakdown onset tuning parameter of bottom component for drain-bulk junction");
1889  p.addPar("PBRSTID", static_cast<double>(4), &ADMSPSP103VA::Model::PBRSTID)
1890  .setDescription("Breakdown onset tuning parameter of STI-edge component for drain-bulk junction");
1891  p.addPar("PBRGATD", static_cast<double>(4), &ADMSPSP103VA::Model::PBRGATD)
1892  .setDescription("Breakdown onset tuning parameter of gate-edge component for drain-bulk junction");
1893  p.addPar("SWJUNEXP", static_cast<double>(0.0), &ADMSPSP103VA::Model::SWJUNEXP)
1894  .setDescription("Flag for JUNCAP-express; 0=full model, 1=express model");
1895  p.addPar("VJUNREF", static_cast<double>(2.5), &ADMSPSP103VA::Model::VJUNREF)
1896  .setDescription("Typical maximum source-bulk junction voltage; usually about 2*VSUP");
1897  p.addPar("FJUNQ", static_cast<double>(0.03), &ADMSPSP103VA::Model::FJUNQ)
1898  .setDescription("Fraction below which source-bulk junction capacitance components are considered negligible");
1899  p.addPar("VJUNREFD", static_cast<double>(2.5), &ADMSPSP103VA::Model::VJUNREFD)
1900  .setDescription("Typical maximum drain-bulk junction voltage; usually about 2*VSUP");
1901  p.addPar("FJUNQD", static_cast<double>(0.03), &ADMSPSP103VA::Model::FJUNQD)
1902  .setDescription("Fraction below which drain-bulk junction capacitance components are considered negligible");
1903  p.addPar("DTA", static_cast<double>(0.0), &ADMSPSP103VA::Model::DTA)
1904  .setUnit(U_DEGK)
1905 
1906  .setDescription("Temperature offset w.r.t. ambient temperature");
1907 
1908 }
1909 
1910 //-----------------------------------------------------------------------------
1911 // Function : Instance::processParams
1912 // Purpose :
1913 // Special Notes :
1914 // Scope : public
1915 // Creator : admsXml
1916 // Creation Date :
1917 //-----------------------------------------------------------------------------
1919 {
1920  // Now we need to check that any parameters are within their ranges as
1921  // specified in the verilog:
1922 
1923  // Parameter L : [ 1e-9, (+inf) [
1924  if ( (!((L >=1e-9))) )
1925  {
1926  UserError0(*this) << "ADMSPSP103VA: Parameter L value " << L << " out of range [ 1e-9, (+inf) [";
1927  }
1928 
1929  // Parameter W : [ 1e-9, (+inf) [
1930  if ( (!((W >=1e-9))) )
1931  {
1932  UserError0(*this) << "ADMSPSP103VA: Parameter W value " << W << " out of range [ 1e-9, (+inf) [";
1933  }
1934 
1935  // Parameter SCA : [ 0.0, (+inf) [
1936  if ( (!((SCA >=0.0))) )
1937  {
1938  UserError0(*this) << "ADMSPSP103VA: Parameter SCA value " << SCA << " out of range [ 0.0, (+inf) [";
1939  }
1940 
1941  // Parameter SCB : [ 0.0, (+inf) [
1942  if ( (!((SCB >=0.0))) )
1943  {
1944  UserError0(*this) << "ADMSPSP103VA: Parameter SCB value " << SCB << " out of range [ 0.0, (+inf) [";
1945  }
1946 
1947  // Parameter SCC : [ 0.0, (+inf) [
1948  if ( (!((SCC >=0.0))) )
1949  {
1950  UserError0(*this) << "ADMSPSP103VA: Parameter SCC value " << SCC << " out of range [ 0.0, (+inf) [";
1951  }
1952 
1953  // Parameter NF : [ 1.0, (+inf) [
1954  if ( (!((NF >=1.0))) )
1955  {
1956  UserError0(*this) << "ADMSPSP103VA: Parameter NF value " << NF << " out of range [ 1.0, (+inf) [";
1957  }
1958 
1959  // Parameter NGCON : [ 1.0, 2.0 ]
1960  if ( (!((NGCON >=1.0 && NGCON <=2.0 ))) )
1961  {
1962  UserError0(*this) << "ADMSPSP103VA: Parameter NGCON value " << NGCON << " out of range [ 1.0, 2.0 ]";
1963  }
1964 
1965  // Parameter JW : [ 0, (+inf) [
1966  if ( (!((JW >=0))) )
1967  {
1968  UserError0(*this) << "ADMSPSP103VA: Parameter JW value " << JW << " out of range [ 0, (+inf) [";
1969  }
1970 
1971  // Parameter FACTUO : [ 0.0, (+inf) [
1972  if ( (!((FACTUO >=0.0))) )
1973  {
1974  UserError0(*this) << "ADMSPSP103VA: Parameter FACTUO value " << FACTUO << " out of range [ 0.0, (+inf) [";
1975  }
1976 
1977  // Parameter ABSOURCE : [ 0, (+inf) [
1978  if ( (!((ABSOURCE >=0))) )
1979  {
1980  UserError0(*this) << "ADMSPSP103VA: Parameter ABSOURCE value " << ABSOURCE << " out of range [ 0, (+inf) [";
1981  }
1982 
1983  // Parameter LSSOURCE : [ 0, (+inf) [
1984  if ( (!((LSSOURCE >=0))) )
1985  {
1986  UserError0(*this) << "ADMSPSP103VA: Parameter LSSOURCE value " << LSSOURCE << " out of range [ 0, (+inf) [";
1987  }
1988 
1989  // Parameter LGSOURCE : [ 0, (+inf) [
1990  if ( (!((LGSOURCE >=0))) )
1991  {
1992  UserError0(*this) << "ADMSPSP103VA: Parameter LGSOURCE value " << LGSOURCE << " out of range [ 0, (+inf) [";
1993  }
1994 
1995  // Parameter ABDRAIN : [ 0, (+inf) [
1996  if ( (!((ABDRAIN >=0))) )
1997  {
1998  UserError0(*this) << "ADMSPSP103VA: Parameter ABDRAIN value " << ABDRAIN << " out of range [ 0, (+inf) [";
1999  }
2000 
2001  // Parameter LSDRAIN : [ 0, (+inf) [
2002  if ( (!((LSDRAIN >=0))) )
2003  {
2004  UserError0(*this) << "ADMSPSP103VA: Parameter LSDRAIN value " << LSDRAIN << " out of range [ 0, (+inf) [";
2005  }
2006 
2007  // Parameter LGDRAIN : [ 0, (+inf) [
2008  if ( (!((LGDRAIN >=0))) )
2009  {
2010  UserError0(*this) << "ADMSPSP103VA: Parameter LGDRAIN value " << LGDRAIN << " out of range [ 0, (+inf) [";
2011  }
2012 
2013  // Parameter AS : [ 0, (+inf) [
2014  if ( (!((AS >=0))) )
2015  {
2016  UserError0(*this) << "ADMSPSP103VA: Parameter AS value " << AS << " out of range [ 0, (+inf) [";
2017  }
2018 
2019  // Parameter PS : [ 0, (+inf) [
2020  if ( (!((PS >=0))) )
2021  {
2022  UserError0(*this) << "ADMSPSP103VA: Parameter PS value " << PS << " out of range [ 0, (+inf) [";
2023  }
2024 
2025  // Parameter AD : [ 0, (+inf) [
2026  if ( (!((AD >=0))) )
2027  {
2028  UserError0(*this) << "ADMSPSP103VA: Parameter AD value " << AD << " out of range [ 0, (+inf) [";
2029  }
2030 
2031  // Parameter PD : [ 0, (+inf) [
2032  if ( (!((PD >=0))) )
2033  {
2034  UserError0(*this) << "ADMSPSP103VA: Parameter PD value " << PD << " out of range [ 0, (+inf) [";
2035  }
2036 
2037  // Parameter MULT : [ 0.0, (+inf) [
2038  if ( (!((MULT >=0.0))) )
2039  {
2040  UserError0(*this) << "ADMSPSP103VA: Parameter MULT value " << MULT << " out of range [ 0.0, (+inf) [";
2041  }
2042 
2043 
2044  // this seems a little stupid, but verilog models that use $temperature
2045  // don't also use a defined parameter "Temp", and count on $temperature
2046  // to be the one the simulator wants:
2047 
2049 
2050  // and of course, this routine is where we should put the initial_instance
2051  // stuff
2052  double I5;
2053  double I4;
2054  double I3;
2055  double I2;
2056  double I1;
2057  double ijungat;
2058  double ijunsti;
2059  double ijunbot;
2060  double V5;
2061  double V4;
2062  double V3;
2063  double V2;
2064  double V1;
2065  double FRACI;
2066  double FRACNB;
2067  double FRACNA;
2068  double qjungat;
2069  double qjunsti;
2070  double qjunbot;
2071  double fbreakdown;
2072  double Fmaxr;
2073  double ibbt;
2074  double gammamax;
2075  double erfctimesexpmtat;
2076  double xerfc;
2077  double mtat;
2078  double ltat;
2079  double ktat;
2080  double wtat;
2081  double wgamma;
2082  double umaxpoweronepointfive;
2083  double sqrtumax;
2084  double umax;
2085  double umaxbeforelimiting;
2086  double twoatatoverthreebtat;
2087  double btat;
2088  double itat;
2089  double asrh;
2090  double wdep;
2091  double wsrh;
2092  double dwsrh;
2093  double wsrhstep;
2094  double vbi_minus_vjsrh;
2095  double isrh;
2096  double id;
2097  double tmp;
2098  double vav;
2099  double vbbt;
2100  double vjsrh;
2101  double vjlim;
2102  double two_psistar;
2103  double zinv;
2104  double z;
2105  double vj;
2106  double idmult;
2107  double h5;
2108  double h4;
2109  double h3;
2110  double h2d;
2111  double h2;
2112  double h1;
2113  double erfcpos;
2114  double terfc;
2115  double ysq;
2116  double pmax;
2117  double vbigat2r;
2118  double vbisti2r;
2119  double vbibot2r;
2120  double pgat2;
2121  double psti2;
2122  double pbot2;
2123  double vbigat2;
2124  double vbisti2;
2125  double vbibot2;
2126  double vmaxgat;
2127  double vmaxsti;
2128  double vmaxbot;
2129  double alphaje;
2130  double zfrac;
2131  double tt2;
2132  double tt1;
2133  double tt0;
2134  double I5_cor;
2135  double I4_cor;
2136  double I3_cor;
2137  double I2_cor;
2138  double I1_cor;
2139  double mcor_rev;
2140  double m0_rev;
2141  double jww;
2142  double jwcorr;
2143  double LGD_i;
2144  double LSD_i;
2145  double ABD_i;
2146  double LGS_i;
2147  double LSS_i;
2148  double ABS_i;
2149  double NEFFAC_i;
2150  double Sfl_prefac;
2151  double Cox_over_q;
2152  double nt;
2153  double tempM;
2154  double tf_ig;
2155  double tf_thesat;
2156  double tf_ther;
2157  double tf_xcor;
2158  double tf_cs;
2159  double tf_mue;
2160  double tf_bet;
2161  double CoxovPrime_d;
2162  double CoxovPrime;
2163  double phix2;
2164  double dphibq;
2165  double qb0;
2166  double np;
2167  double arg2max;
2168  double tox_sq;
2169  double CoxPrime;
2170  double EPSOX;
2171  double DELVTO_i;
2172  double FACTUO_i;
2173  double EF_i;
2174  double NFC_i;
2175  double NFB_i;
2176  double NFA_i;
2177  double FNT_i;
2178  double STBGIDLD_i;
2179  double STBGIDL_i;
2180  double STIG_i;
2181  double GCO_i;
2182  double STA2_i;
2183  double VP_i;
2184  double STTHESAT_i;
2185  double STRS_i;
2186  double RS_i;
2187  double FETA_i;
2188  double STXCOR_i;
2189  double STCS_i;
2190  double STTHEMU_i;
2191  double STMUE_i;
2192  double STBET_i;
2193  double BETN_i;
2194  double NOVD_i;
2195  double NOV_i;
2196  double TOXOVD_i;
2197  double TOXOV_i;
2198  double CT_i;
2199  double NP_i;
2200  double DELVTAC_i;
2201  double DPHIB_i;
2202  double DVSBNUD_i;
2203  double VSBNUD_i;
2204  double FACNEFFAC_i;
2205  double NEFF_i;
2206  double EPSROX_i;
2207  double TOX_i;
2208  double STVFB_i;
2209  double temp00;
2210  double Kstressvth0;
2211  double rhobetaref;
2212  double rhobeta;
2213  double Kstressu0;
2214  double tempw;
2215  double templ;
2216  double Wx;
2217  double Lx;
2218  double Invsbref;
2219  double Invsaref;
2220  double Invsb;
2221  double Invsa;
2222  double loop;
2223  double tmpb;
2224  double tmpa;
2225  double iiiLWcv;
2226  double iLcv;
2227  double iiLWcv;
2228  double iiWcv;
2229  double iiLcv;
2230  double iiiLEWEcv;
2231  double iLEcv;
2232  double iiLEWEcv;
2233  double iiWEcv;
2234  double iiLEcv;
2235  double iiiLEWE;
2236  double iiLEWE;
2237  double iiWE;
2238  double iiLE;
2239  double iLEWE;
2240  double KUOWE;
2241  double KVTHOWE;
2242  double Lred;
2243  double Lnoi;
2244  double temp0;
2245  double tmpx;
2246  double GWE;
2247  double GPE;
2248  double LP1e;
2249  double FBET1e;
2250  double NSUB;
2251  double BB;
2252  double AA;
2253  double LPCKe;
2254  double NPCKe;
2255  double NSUB0e;
2256  double RJUND_p;
2257  double RJUNS_p;
2258  double RBULK_p;
2259  double RWELL_p;
2260  double RDE_p;
2261  double RSE_p;
2262  double RG_p;
2263  double EF_p;
2264  double NFC_p;
2265  double NFB_p;
2266  double NFA_p;
2267  double FNT_p;
2268  double CFRD_p;
2269  double CFR_p;
2270  double CGBOV_p;
2271  double CGOVD_p;
2272  double CGOV_p;
2273  double COX_p;
2274  double CGIDLD_p;
2275  double CGIDL_p;
2276  double STBGIDLD_p;
2277  double STBGIDL_p;
2278  double BGIDLD_p;
2279  double BGIDL_p;
2280  double AGIDLD_p;
2281  double AGIDL_p;
2282  double CHIB_p;
2283  double GC3_p;
2284  double GC2_p;
2285  double STIG_p;
2286  double IGOVD_p;
2287  double IGOV_p;
2288  double IGINV_p;
2289  double GCO_p;
2290  double A4_p;
2291  double A3_p;
2292  double STA2_p;
2293  double A2_p;
2294  double A1_p;
2295  double VP_p;
2296  double ALP2_p;
2297  double ALP1_p;
2298  double ALP_p;
2299  double AX_p;
2300  double THESATG_p;
2301  double THESATB_p;
2302  double STTHESAT_p;
2303  double THESAT_p;
2304  double RSG_p;
2305  double RSB_p;
2306  double STRS_p;
2307  double RS_p;
2308  double FETA_p;
2309  double STXCOR_p;
2310  double XCOR_p;
2311  double STCS_p;
2312  double CS_p;
2313  double STTHEMU_p;
2314  double THEMU_p;
2315  double STMUE_p;
2316  double MUE_p;
2317  double STBET_p;
2318  double BETN_p;
2319  double CFB_p;
2320  double CF_p;
2321  double NOVD_p;
2322  double NOV_p;
2323  double TOXOVD_p;
2324  double TOXOV_p;
2325  double CT_p;
2326  double NP_p;
2327  double DELVTAC_p;
2328  double DPHIB_p;
2329  double DNSUB_p;
2330  double NSLP_p;
2331  double VNSUB_p;
2332  double DVSBNUD_p;
2333  double VSBNUD_p;
2334  double GFACNUD_p;
2335  double FACNEFFAC_p;
2336  double NEFF_p;
2337  double EPSROX_p;
2338  double TOX_p;
2339  double STVFB_p;
2340  double VFB_p;
2341  double XGWE;
2342  double W_f;
2343  double L_slif;
2344  double L_f;
2345  double iWE;
2346  double iLE;
2347  double Wcv;
2348  double Lcv;
2349  double WEcv;
2350  double LEcv;
2351  double delWOD;
2352  double delLPS;
2353  double iW;
2354  double iL;
2355  double WEN;
2356  double LEN;
2357  double NGCON_i;
2358  double SCC_i;
2359  double SCB_i;
2360  double SCA_i;
2361  double JW_i;
2362  double PD_i;
2363  double AD_i;
2364  double PS_i;
2365  double AS_i;
2366  double XGW_i;
2367  double SC_i;
2368  double SD_i;
2369  double SB_i;
2370  double SA_i;
2371  double W_i;
2372  double L_i;
2373  double WE;
2374  double LE;
2375  double invNF;
2376  double NF_i;
2377  //Begin block initial_instance
2378  {
2379  NF_i = 1.0;
2380  invNF = 1.0;
2381  LE = 0.0;
2382  WE = 0.0;
2383  L_i = L;
2384  W_i = W;
2385  SA_i = SA;
2386  SB_i = SB;
2387  SD_i = SD;
2388  SC_i = SC;
2389  XGW_i = XGW;
2390  ABSOURCE_i = ABSOURCE;
2391  LSSOURCE_i = LSSOURCE;
2392  LGSOURCE_i = LGSOURCE;
2393  ABDRAIN_i = ABDRAIN;
2394  LSDRAIN_i = LSDRAIN;
2395  LGDRAIN_i = LGDRAIN;
2396  AS_i = AS;
2397  PS_i = PS;
2398  AD_i = AD;
2399  PD_i = PD;
2400  JW_i = JW;
2401  if ((((model_.SWGEO_i)==1)||((model_.SWGEO_i)==2)))
2402  {
2403  NF_i = ((NF>1.0)?NF:1.0);
2404  NF_i = floor((NF_i+0.5));
2405  invNF = (1.0/NF_i);
2406  L_i = ((L_i>1e-9)?L_i:1e-9);
2407  W_i = (((W_i*invNF)>1e-9)?(W_i*invNF):1e-9);
2408  SCA_i = ((SCA>0.0)?SCA:0.0);
2409  SCB_i = ((SCB>0.0)?SCB:0.0);
2410  SCC_i = ((SCC>0.0)?SCC:0.0);
2411  NGCON_i = ((NGCON<1.5)?1.0:2.0);
2412  LEN = 1e-6;
2413  WEN = 1e-6;
2414  iL = (LEN/L_i);
2415  iW = (WEN/W_i);
2416  if (((model_.SWGEO_i)==2))
2417  {
2418  delLPS = ((model_.LVARO)*(1.0+((model_.LVARL)*iL)));
2419  delWOD = ((model_.WVARO)*(1.0+((model_.WVARW)*iW)));
2420  }
2421  else
2422  {
2423  delLPS = (((model_.LVARO)*(1.0+((model_.LVARL)*iL)))*(1.0+((model_.LVARW)*iW)));
2424  delWOD = (((model_.WVARO)*(1.0+((model_.WVARL)*iL)))*(1.0+((model_.WVARW)*iW)));
2425  }
2426  LE = ((((L_i+delLPS)-(2.0*(model_.LAP)))>1e-9)?((L_i+delLPS)-(2.0*(model_.LAP))):1e-9);
2427  WE = ((((W_i+delWOD)-(2.0*(model_.WOT)))>1e-9)?((W_i+delWOD)-(2.0*(model_.WOT))):1e-9);
2428  LEcv = (((((L_i+delLPS)-(2.0*(model_.LAP)))+(model_.DLQ))>1e-9)?(((L_i+delLPS)-(2.0*(model_.LAP)))+(model_.DLQ)):1e-9);
2429  WEcv = (((((W_i+delWOD)-(2.0*(model_.WOT)))+(model_.DWQ))>1e-9)?(((W_i+delWOD)-(2.0*(model_.WOT)))+(model_.DWQ)):1e-9);
2430  Lcv = ((((L_i+delLPS)+(model_.DLQ))>1e-9)?((L_i+delLPS)+(model_.DLQ)):1e-9);
2431  Wcv = ((((W_i+delWOD)+(model_.DWQ))>1e-9)?((W_i+delWOD)+(model_.DWQ)):1e-9);
2432  iLE = (LEN/LE);
2433  iWE = (WEN/WE);
2434  L_f = (((L_i+delLPS)>1e-9)?(L_i+delLPS):1e-9);
2435  L_slif = (((L_f+(model_.DLSIL))>1e-9)?(L_f+(model_.DLSIL)):1e-9);
2436  W_f = (((W_i+delWOD)>1e-9)?(W_i+delWOD):1e-9);
2437  XGWE = (((XGW_i-(0.5*delWOD))>1e-9)?(XGW_i-(0.5*delWOD)):1e-9);
2438  }
2439  if (((model_.SWGEO_i)==0))
2440  {
2441  VFB_p = (model_.VFB);
2442  STVFB_p = (model_.STVFB);
2443  TOX_p = (model_.TOX);
2444  EPSROX_p = (model_.EPSROX);
2445  NEFF_p = (model_.NEFF);
2446  FACNEFFAC_p = (model_.FACNEFFAC);
2447  GFACNUD_p = (model_.GFACNUD);
2448  VSBNUD_p = (model_.VSBNUD);
2449  DVSBNUD_p = (model_.DVSBNUD);
2450  VNSUB_p = (model_.VNSUB);
2451  NSLP_p = (model_.NSLP);
2452  DNSUB_p = (model_.DNSUB);
2453  DPHIB_p = (model_.DPHIB);
2454  DELVTAC_p = (model_.DELVTAC);
2455  NP_p = (model_.NP);
2456  CT_p = (model_.CT);
2457  TOXOV_p = (model_.TOXOV);
2458  TOXOVD_p = (model_.TOXOVD);
2459  NOV_p = (model_.NOV);
2460  NOVD_p = (model_.NOVD);
2461  CF_p = (model_.CF);
2462  CFB_p = (model_.CFB);
2463  BETN_p = (model_.BETN);
2464  STBET_p = (model_.STBET);
2465  MUE_p = (model_.MUE);
2466  STMUE_p = (model_.STMUE);
2467  THEMU_p = (model_.THEMU);
2468  STTHEMU_p = (model_.STTHEMU);
2469  CS_p = (model_.CS);
2470  STCS_p = (model_.STCS);
2471  XCOR_p = (model_.XCOR);
2472  STXCOR_p = (model_.STXCOR);
2473  FETA_p = (model_.FETA);
2474  RS_p = (model_.RS);
2475  STRS_p = (model_.STRS);
2476  RSB_p = (model_.RSB);
2477  RSG_p = (model_.RSG);
2478  THESAT_p = (model_.THESAT);
2479  STTHESAT_p = (model_.STTHESAT);
2480  THESATB_p = (model_.THESATB);
2481  THESATG_p = (model_.THESATG);
2482  AX_p = (model_.AX);
2483  ALP_p = (model_.ALP);
2484  ALP1_p = (model_.ALP1);
2485  ALP2_p = (model_.ALP2);
2486  VP_p = (model_.VP);
2487  A1_p = (model_.A1);
2488  A2_p = (model_.A2);
2489  STA2_p = (model_.STA2);
2490  A3_p = (model_.A3);
2491  A4_p = (model_.A4);
2492  GCO_p = (model_.GCO);
2493  IGINV_p = (model_.IGINV);
2494  IGOV_p = (model_.IGOV);
2495  IGOVD_p = (model_.IGOVD);
2496  STIG_p = (model_.STIG);
2497  GC2_p = (model_.GC2);
2498  GC3_p = (model_.GC3);
2499  CHIB_p = (model_.CHIB);
2500  AGIDL_p = (model_.AGIDL);
2501  AGIDLD_p = (model_.AGIDLD);
2502  BGIDL_p = (model_.BGIDL);
2503  BGIDLD_p = (model_.BGIDLD);
2504  STBGIDL_p = (model_.STBGIDL);
2505  STBGIDLD_p = (model_.STBGIDLD);
2506  CGIDL_p = (model_.CGIDL);
2507  CGIDLD_p = (model_.CGIDLD);
2508  COX_p = (model_.COX);
2509  CGOV_p = (model_.CGOV);
2510  CGOVD_p = (model_.CGOVD);
2511  CGBOV_p = (model_.CGBOV);
2512  CFR_p = (model_.CFR);
2513  CFRD_p = (model_.CFRD);
2514  FNT_p = (model_.FNT);
2515  NFA_p = (model_.NFA);
2516  NFB_p = (model_.NFB);
2517  NFC_p = (model_.NFC);
2518  EF_p = (model_.EF);
2519  RG_p = (model_.RG);
2520  RSE_p = (model_.RSE);
2521  RDE_p = (model_.RDE);
2522  RWELL_p = (model_.RWELL);
2523  RBULK_p = (model_.RBULK);
2524  RJUNS_p = (model_.RJUNS);
2525  RJUND_p = (model_.RJUND);
2526  }
2527  if (((model_.SWGEO_i)==1))
2528  {
2529  VFB_p = ((((model_.VFBO)+((model_.VFBL)*iLE))+((model_.VFBW)*iWE))+(((model_.VFBLW)*iLE)*iWE));
2530  STVFB_p = ((((model_.STVFBO)+((model_.STVFBL)*iLE))+((model_.STVFBW)*iWE))+(((model_.STVFBLW)*iLE)*iWE));
2531  TOX_p = (model_.TOXO);
2532  EPSROX_p = (model_.EPSROXO);
2533  NSUB0e = ((model_.NSUBO_i)*(((1.0+(((model_.NSUBW)*iWE)*log((1.0+(WE/(model_.WSEG_i))))))>1.0E-03)?(1.0+(((model_.NSUBW)*iWE)*log((1.0+(WE/(model_.WSEG_i)))))):1.0E-03));
2534  NPCKe = ((model_.NPCK_i)*(((1.0+(((model_.NPCKW)*iWE)*log((1.0+(WE/(model_.WSEGP_i))))))>1.0E-03)?(1.0+(((model_.NPCKW)*iWE)*log((1.0+(WE/(model_.WSEGP_i)))))):1.0E-03));
2535  LPCKe = ((model_.LPCK_i)*(((1.0+(((model_.LPCKW)*iWE)*log((1.0+(WE/(model_.WSEGP_i))))))>1.0E-03)?(1.0+(((model_.LPCKW)*iWE)*log((1.0+(WE/(model_.WSEGP_i)))))):1.0E-03));
2536  if ((LE>(2*LPCKe)))
2537  {
2538  AA = 7.5e10;
2539  BB = (sqrt((NSUB0e+(0.5*NPCKe)))-sqrt(NSUB0e));
2540  NSUB = (sqrt(NSUB0e)+(AA*log((1+(((2*LPCKe)/LE)*(exp((BB/AA))-1))))));
2541  NSUB = (NSUB*NSUB);
2542  }
2543  else
2544  {
2545  if ((LE>=LPCKe))
2546  {
2547  NSUB = (NSUB0e+((NPCKe*LPCKe)/LE));
2548  }
2549  else
2550  {
2551  NSUB = (NSUB0e+(NPCKe*(2-(LE/LPCKe))));
2552  }
2553  }
2554  NEFF_p = (NSUB*((1-((model_.FOL1)*iLE))-(((model_.FOL2)*iLE)*iLE)));
2555  FACNEFFAC_p = ((((model_.FACNEFFACO)+((model_.FACNEFFACL)*iLE))+((model_.FACNEFFACW)*iWE))+(((model_.FACNEFFACLW)*iLE)*iWE));
2556  GFACNUD_p = ((((model_.GFACNUDO)+((model_.GFACNUDL)*pow(iLE,(model_.GFACNUDLEXP))))+((model_.GFACNUDW)*iWE))+(((model_.GFACNUDLW)*iLE)*iWE));
2557  VSBNUD_p = (model_.VSBNUDO);
2558  DVSBNUD_p = (model_.DVSBNUDO);
2559  VNSUB_p = (model_.VNSUBO);
2560  NSLP_p = (model_.NSLPO);
2561  DNSUB_p = (model_.DNSUBO);
2562  DPHIB_p = ((((model_.DPHIBO)+((model_.DPHIBL)*pow(iLE,(model_.DPHIBLEXP))))+((model_.DPHIBW)*iWE))+(((model_.DPHIBLW)*iLE)*iWE));
2563  DELVTAC_p = ((((model_.DELVTACO)+((model_.DELVTACL)*pow(iLE,(model_.DELVTACLEXP))))+((model_.DELVTACW)*iWE))+(((model_.DELVTACLW)*iLE)*iWE));
2564  NP_p = ((model_.NPO)*((1e-6>(1.0+((model_.NPL)*iLE)))?1e-6:(1.0+((model_.NPL)*iLE))));
2565  CT_p = ((((model_.CTO)+((model_.CTL)*pow(iLE,(model_.CTLEXP))))*(1.0+((model_.CTW)*iWE)))*(1.0+(((model_.CTLW)*iLE)*iWE)));
2566  TOXOV_p = (model_.TOXOVO);
2567  TOXOVD_p = (model_.TOXOVDO);
2568  NOV_p = (model_.NOVO);
2569  NOVD_p = (model_.NOVDO);
2570  CF_p = (((model_.CFL)*pow(iLE,(model_.CFLEXP)))*(1.0+((model_.CFW)*iWE)));
2571  CFB_p = (model_.CFBO);
2572  FBET1e = ((model_.FBET1)*(1.0+((model_.FBET1W)*iWE)));
2573  LP1e = ((model_.LP1_i)*(((1.0+((model_.LP1W)*iWE))>1.0E-03)?(1.0+((model_.LP1W)*iWE)):1.0E-03));
2574  GPE = ((1.0+(((FBET1e*LP1e)/LE)*(1.0-exp(((-LE)/LP1e)))))+((((model_.FBET2)*(model_.LP2_i))/LE)*(1.0-exp(((-LE)/(model_.LP2_i))))));
2575  GPE = ((GPE>1e-15)?GPE:1e-15);
2576  GWE = ((1.0+((model_.BETW1)*iWE))+(((model_.BETW2)*iWE)*log((1.0+(WE/(model_.WBET_i))))));
2577  BETN_p = ((((model_.UO)*WE)/(GPE*LE))*GWE);
2578  STBET_p = ((((model_.STBETO)+((model_.STBETL)*iLE))+((model_.STBETW)*iWE))+(((model_.STBETLW)*iLE)*iWE));
2579  MUE_p = ((model_.MUEO)*(1.0+((model_.MUEW)*iWE)));
2580  STMUE_p = (model_.STMUEO);
2581  THEMU_p = (model_.THEMUO);
2582  STTHEMU_p = (model_.STTHEMUO);
2583  CS_p = ((((model_.CSO)+((model_.CSL)*pow(iLE,(model_.CSLEXP))))*(1.0+((model_.CSW)*iWE)))*(1.0+(((model_.CSLW)*iLE)*iWE)));
2584  STCS_p = (model_.STCSO);
2585  XCOR_p = ((((model_.XCORO)*(1.0+((model_.XCORL)*iLE)))*(1.0+((model_.XCORW)*iWE)))*(1.0+(((model_.XCORLW)*iLE)*iWE)));
2586  STXCOR_p = (model_.STXCORO);
2587  FETA_p = (model_.FETAO);
2588  RS_p = (((model_.RSW1)*iWE)*(1.0+((model_.RSW2)*iWE)));
2589  STRS_p = (model_.STRSO);
2590  RSB_p = (model_.RSBO);
2591  RSG_p = (model_.RSGO);
2592  THESAT_p = ((((model_.THESATO)+((((model_.THESATL)*GWE)/GPE)*pow(iLE,(model_.THESATLEXP))))*(1.0+((model_.THESATW)*iWE)))*(1.0+(((model_.THESATLW)*iLE)*iWE)));
2593  STTHESAT_p = ((((model_.STTHESATO)+((model_.STTHESATL)*iLE))+((model_.STTHESATW)*iWE))+(((model_.STTHESATLW)*iLE)*iWE));
2594  THESATB_p = (model_.THESATBO);
2595  THESATG_p = (model_.THESATGO);
2596  AX_p = ((model_.AXO)/(1.0+((model_.AXL_i)*iLE)));
2597  ALP_p = (((model_.ALPL)*pow(iLE,(model_.ALPLEXP)))*(1.0+((model_.ALPW)*iWE)));
2598  tmpx = pow(iLE,(model_.ALP1LEXP));
2599  ALP1_p = ((((model_.ALP1L1)*tmpx)*(1.0+((model_.ALP1W)*iWE)))/(1.0+(((model_.ALP1L2_i)*iLE)*tmpx)));
2600  tmpx = pow(iLE,(model_.ALP2LEXP));
2601  ALP2_p = ((((model_.ALP2L1)*tmpx)*(1.0+((model_.ALP2W)*iWE)))/(1.0+(((model_.ALP2L2_i)*iLE)*tmpx)));
2602  VP_p = (model_.VPO);
2603  A1_p = (((model_.A1O)*(1.0+((model_.A1L)*iLE)))*(1.0+((model_.A1W)*iWE)));
2604  A2_p = (model_.A2O);
2605  STA2_p = (model_.STA2O);
2606  A3_p = (((model_.A3O)*(1.0+((model_.A3L)*iLE)))*(1.0+((model_.A3W)*iWE)));
2607  A4_p = (((model_.A4O)*(1.0+((model_.A4L)*iLE)))*(1.0+((model_.A4W)*iWE)));
2608  GCO_p = (model_.GCOO);
2609  IGINV_p = ((model_.IGINVLW)/(iWE*iLE));
2610  IGOV_p = (((model_.IGOVW)*(model_.LOV_i))/(LEN*iWE));
2611  IGOVD_p = (((model_.IGOVDW)*(model_.LOVD_i))/(LEN*iWE));
2612  STIG_p = (model_.STIGO);
2613  GC2_p = (model_.GC2O);
2614  GC3_p = (model_.GC3O);
2615  CHIB_p = (model_.CHIBO);
2616  AGIDL_p = (((model_.AGIDLW)*(model_.LOV_i))/(LEN*iWE));
2617  AGIDLD_p = (((model_.AGIDLDW)*(model_.LOVD_i))/(LEN*iWE));
2618  BGIDL_p = (model_.BGIDLO);
2619  BGIDLD_p = (model_.BGIDLDO);
2620  STBGIDL_p = (model_.STBGIDLO);
2621  STBGIDLD_p = (model_.STBGIDLDO);
2622  CGIDL_p = (model_.CGIDLO);
2623  CGIDLD_p = (model_.CGIDLDO);
2624  COX_p = ((((8.8541878176E-12*(model_.EPSROXO_i))*WEcv)*LEcv)/(model_.TOXO_i));
2625  CGOV_p = ((((8.8541878176E-12*(model_.EPSROXO_i))*WEcv)*(model_.LOV_i))/(model_.TOXOVO_i));
2626  CGOVD_p = ((((8.8541878176E-12*(model_.EPSROXO_i))*WEcv)*(model_.LOVD_i))/(model_.TOXOVDO_i));
2627  CGBOV_p = (((model_.CGBOVL)*Lcv)/LEN);
2628  CFR_p = (((model_.CFRW)*Wcv)/WEN);
2629  CFRD_p = (((model_.CFRDW)*Wcv)/WEN);
2630  temp0 = (1.0-(((2.0*(model_.LINTNOI))*iLE)/LEN));
2631  Lnoi = ((temp0>1.0e-3)?temp0:1.0e-3);
2632  Lred = (1.0/pow(Lnoi,(model_.ALPNOI)));
2633  FNT_p = (model_.FNTO);
2634  NFA_p = (((Lred*iWE)*iLE)*(model_.NFALW));
2635  NFB_p = (((Lred*iWE)*iLE)*(model_.NFBLW));
2636  NFC_p = (((Lred*iWE)*iLE)*(model_.NFCLW));
2637  EF_p = (model_.EFO);
2638  KVTHOWE = ((((model_.KVTHOWEO)+((model_.KVTHOWEL)*iLE))+((model_.KVTHOWEW)*iWE))+(((model_.KVTHOWELW)*iLE)*iWE));
2639  KUOWE = ((((model_.KUOWEO)+((model_.KUOWEL)*iLE))+((model_.KUOWEW)*iWE))+(((model_.KUOWELW)*iLE)*iWE));
2640  }
2641  if (((model_.SWGEO_i)==2))
2642  {
2643  iLEWE = (iLE*iWE);
2644  iiLE = (LE/LEN);
2645  iiWE = (WE/WEN);
2646  iiLEWE = (iiLE*iiWE);
2647  iiiLEWE = (iiWE/iiLE);
2648  iiLEcv = (LEcv/LEN);
2649  iiWEcv = (WEcv/WEN);
2650  iiLEWEcv = (iiLEcv*iiWEcv);
2651  iLEcv = (LEN/LEcv);
2652  iiiLEWEcv = (iiWEcv/iiLEcv);
2653  iiLcv = (Lcv/LEN);
2654  iiWcv = (Wcv/WEN);
2655  iiLWcv = (iiLcv*iiWcv);
2656  iLcv = (LEN/Lcv);
2657  iiiLWcv = (iiWcv/iiLcv);
2658  VFB_p = ((((model_.POVFB)+(iLE*(model_.PLVFB)))+(iWE*(model_.PWVFB)))+(iLEWE*(model_.PLWVFB)));
2659  STVFB_p = ((((model_.POSTVFB)+(iLE*(model_.PLSTVFB)))+(iWE*(model_.PWSTVFB)))+(iLEWE*(model_.PLWSTVFB)));
2660  TOX_p = (model_.POTOX);
2661  EPSROX_p = (model_.POEPSROX);
2662  NEFF_p = ((((model_.PONEFF)+(iLE*(model_.PLNEFF)))+(iWE*(model_.PWNEFF)))+(iLEWE*(model_.PLWNEFF)));
2663  FACNEFFAC_p = ((((model_.POFACNEFFAC)+(iLE*(model_.PLFACNEFFAC)))+(iWE*(model_.PWFACNEFFAC)))+(iLEWE*(model_.PLWFACNEFFAC)));
2664  GFACNUD_p = ((((model_.POGFACNUD)+((model_.PLGFACNUD)*iLE))+((model_.PWGFACNUD)*iWE))+(((model_.PLWGFACNUD)*iLE)*iWE));
2665  VSBNUD_p = (model_.POVSBNUD);
2666  DVSBNUD_p = (model_.PODVSBNUD);
2667  VNSUB_p = (model_.POVNSUB);
2668  NSLP_p = (model_.PONSLP);
2669  DNSUB_p = (model_.PODNSUB);
2670  DPHIB_p = ((((model_.PODPHIB)+(iLE*(model_.PLDPHIB)))+(iWE*(model_.PWDPHIB)))+(iLEWE*(model_.PLWDPHIB)));
2671  DELVTAC_p = ((((model_.PODELVTAC)+(iLE*(model_.PLDELVTAC)))+(iWE*(model_.PWDELVTAC)))+(iLEWE*(model_.PLWDELVTAC)));
2672  NP_p = ((((model_.PONP)+(iLE*(model_.PLNP)))+(iWE*(model_.PWNP)))+(iLEWE*(model_.PLWNP)));
2673  CT_p = ((((model_.POCT)+(iLE*(model_.PLCT)))+(iWE*(model_.PWCT)))+(iLEWE*(model_.PLWCT)));
2674  TOXOV_p = (model_.POTOXOV);
2675  TOXOVD_p = (model_.POTOXOVD);
2676  NOV_p = ((((model_.PONOV)+(iLE*(model_.PLNOV)))+(iWE*(model_.PWNOV)))+(iLEWE*(model_.PLWNOV)));
2677  NOVD_p = ((((model_.PONOVD)+(iLE*(model_.PLNOVD)))+(iWE*(model_.PWNOVD)))+(iLEWE*(model_.PLWNOVD)));
2678  CF_p = ((((model_.POCF)+(iLE*(model_.PLCF)))+(iWE*(model_.PWCF)))+(iLEWE*(model_.PLWCF)));
2679  CFB_p = (model_.POCFB);
2680  BETN_p = ((iiWE*iLE)*((((model_.POBETN)+(iLE*(model_.PLBETN)))+(iWE*(model_.PWBETN)))+(iLEWE*(model_.PLWBETN))));
2681  STBET_p = ((((model_.POSTBET)+(iLE*(model_.PLSTBET)))+(iWE*(model_.PWSTBET)))+(iLEWE*(model_.PLWSTBET)));
2682  MUE_p = ((((model_.POMUE)+(iLE*(model_.PLMUE)))+(iWE*(model_.PWMUE)))+(iLEWE*(model_.PLWMUE)));
2683  STMUE_p = (model_.POSTMUE);
2684  THEMU_p = (model_.POTHEMU);
2685  STTHEMU_p = (model_.POSTTHEMU);
2686  CS_p = ((((model_.POCS)+(iLE*(model_.PLCS)))+(iWE*(model_.PWCS)))+(iLEWE*(model_.PLWCS)));
2687  STCS_p = (model_.POSTCS);
2688  XCOR_p = ((((model_.POXCOR)+(iLE*(model_.PLXCOR)))+(iWE*(model_.PWXCOR)))+(iLEWE*(model_.PLWXCOR)));
2689  STXCOR_p = (model_.POSTXCOR);
2690  FETA_p = (model_.POFETA);
2691  RS_p = ((((model_.PORS)+(iLE*(model_.PLRS)))+(iWE*(model_.PWRS)))+(iLEWE*(model_.PLWRS)));
2692  STRS_p = (model_.POSTRS);
2693  RSB_p = (model_.PORSB);
2694  RSG_p = (model_.PORSG);
2695  THESAT_p = ((((model_.POTHESAT)+(iLE*(model_.PLTHESAT)))+(iWE*(model_.PWTHESAT)))+(iLEWE*(model_.PLWTHESAT)));
2696  STTHESAT_p = ((((model_.POSTTHESAT)+(iLE*(model_.PLSTTHESAT)))+(iWE*(model_.PWSTTHESAT)))+(iLEWE*(model_.PLWSTTHESAT)));
2697  THESATB_p = ((((model_.POTHESATB)+(iLE*(model_.PLTHESATB)))+(iWE*(model_.PWTHESATB)))+(iLEWE*(model_.PLWTHESATB)));
2698  THESATG_p = ((((model_.POTHESATG)+(iLE*(model_.PLTHESATG)))+(iWE*(model_.PWTHESATG)))+(iLEWE*(model_.PLWTHESATG)));
2699  AX_p = ((((model_.POAX)+(iLE*(model_.PLAX)))+(iWE*(model_.PWAX)))+(iLEWE*(model_.PLWAX)));
2700  ALP_p = ((((model_.POALP)+(iLE*(model_.PLALP)))+(iWE*(model_.PWALP)))+(iLEWE*(model_.PLWALP)));
2701  ALP1_p = ((((model_.POALP1)+(iLE*(model_.PLALP1)))+(iWE*(model_.PWALP1)))+(iLEWE*(model_.PLWALP1)));
2702  ALP2_p = ((((model_.POALP2)+(iLE*(model_.PLALP2)))+(iWE*(model_.PWALP2)))+(iLEWE*(model_.PLWALP2)));
2703  VP_p = (model_.POVP);
2704  A1_p = ((((model_.POA1)+(iLE*(model_.PLA1)))+(iWE*(model_.PWA1)))+(iLEWE*(model_.PLWA1)));
2705  A2_p = (model_.POA2);
2706  STA2_p = (model_.POSTA2);
2707  A3_p = ((((model_.POA3)+(iLE*(model_.PLA3)))+(iWE*(model_.PWA3)))+(iLEWE*(model_.PLWA3)));
2708  A4_p = ((((model_.POA4)+(iLE*(model_.PLA4)))+(iWE*(model_.PWA4)))+(iLEWE*(model_.PLWA4)));
2709  GCO_p = (model_.POGCO);
2710  IGINV_p = ((((model_.POIGINV)+(iiLE*(model_.PLIGINV)))+(iiWE*(model_.PWIGINV)))+(iiLEWE*(model_.PLWIGINV)));
2711  IGOV_p = ((((model_.POIGOV)+(iLE*(model_.PLIGOV)))+(iiWE*(model_.PWIGOV)))+(iiiLEWE*(model_.PLWIGOV)));
2712  IGOVD_p = ((((model_.POIGOVD)+(iLE*(model_.PLIGOVD)))+(iiWE*(model_.PWIGOVD)))+(iiiLEWE*(model_.PLWIGOVD)));
2713  STIG_p = (model_.POSTIG);
2714  GC2_p = (model_.POGC2);
2715  GC3_p = (model_.POGC3);
2716  CHIB_p = (model_.POCHIB);
2717  AGIDL_p = ((((model_.POAGIDL)+(iLE*(model_.PLAGIDL)))+(iiWE*(model_.PWAGIDL)))+(iiiLEWE*(model_.PLWAGIDL)));
2718  AGIDLD_p = ((((model_.POAGIDLD)+(iLE*(model_.PLAGIDLD)))+(iiWE*(model_.PWAGIDLD)))+(iiiLEWE*(model_.PLWAGIDLD)));
2719  BGIDL_p = (model_.POBGIDL);
2720  BGIDLD_p = (model_.POBGIDLD);
2721  STBGIDL_p = (model_.POSTBGIDL);
2722  STBGIDLD_p = (model_.POSTBGIDLD);
2723  CGIDL_p = (model_.POCGIDL);
2724  CGIDLD_p = (model_.POCGIDLD);
2725  COX_p = ((((model_.POCOX)+(iiLEcv*(model_.PLCOX)))+(iiWEcv*(model_.PWCOX)))+(iiLEWEcv*(model_.PLWCOX)));
2726  CGOV_p = ((((model_.POCGOV)+(iLEcv*(model_.PLCGOV)))+(iiWEcv*(model_.PWCGOV)))+(iiiLEWEcv*(model_.PLWCGOV)));
2727  CGOVD_p = ((((model_.POCGOVD)+(iLEcv*(model_.PLCGOVD)))+(iiWEcv*(model_.PWCGOVD)))+(iiiLEWEcv*(model_.PLWCGOVD)));
2728  CGBOV_p = ((((model_.POCGBOV)+(iiLcv*(model_.PLCGBOV)))+(iiWcv*(model_.PWCGBOV)))+(iiLWcv*(model_.PLWCGBOV)));
2729  CFR_p = ((((model_.POCFR)+(iLcv*(model_.PLCFR)))+(iiWcv*(model_.PWCFR)))+(iiiLWcv*(model_.PLWCFR)));
2730  CFRD_p = ((((model_.POCFRD)+(iLcv*(model_.PLCFRD)))+(iiWcv*(model_.PWCFRD)))+(iiiLWcv*(model_.PLWCFRD)));
2731  FNT_p = (model_.POFNT);
2732  NFA_p = ((((model_.PONFA)+(iLE*(model_.PLNFA)))+(iWE*(model_.PWNFA)))+(iLEWE*(model_.PLWNFA)));
2733  NFB_p = ((((model_.PONFB)+(iLE*(model_.PLNFB)))+(iWE*(model_.PWNFB)))+(iLEWE*(model_.PLWNFB)));
2734  NFC_p = ((((model_.PONFC)+(iLE*(model_.PLNFC)))+(iWE*(model_.PWNFC)))+(iLEWE*(model_.PLWNFC)));
2735  EF_p = (model_.POEF);
2736  KVTHOWE = ((((model_.POKVTHOWE)+(iLE*(model_.PLKVTHOWE)))+(iWE*(model_.PWKVTHOWE)))+(iLEWE*(model_.PLWKVTHOWE)));
2737  KUOWE = ((((model_.POKUOWE)+(iLE*(model_.PLKUOWE)))+(iWE*(model_.PWKUOWE)))+(iLEWE*(model_.PLWKUOWE)));
2738  }
2739  if ((((model_.SWGEO_i)==1)||((model_.SWGEO_i)==2)))
2740  {
2741  RG_p = (((((model_.RSHG_i)*(((3.3333333333333333e-01*W_f)/NGCON_i)+XGWE))/(NGCON_i*L_slif))+(((model_.RINT_i)+(model_.RVPOLY_i))/(W_f*L_f)))+(NF_i*(model_.RGO)));
2742  if (((model_.SWJUNASYM)==0))
2743  {
2744  (model_.RSHD_i) = (model_.RSH_i);
2745  }
2746  RSE_p = (NRS*(model_.RSH_i));
2747  RDE_p = (NRD*(model_.RSHD_i));
2748  RWELL_p = (NF_i*(model_.RWELLO));
2749  RBULK_p = (NF_i*(model_.RBULKO));
2750  RJUNS_p = (NF_i*(model_.RJUNSO));
2751  RJUND_p = (NF_i*(model_.RJUNDO));
2752  tmpa = 0.0;
2753  tmpb = 0.0;
2754  loop = 0.0;
2755  if ((((SA_i>0.0)&&(SB_i>0.0))&&((NF_i==1.0)||((NF_i>1.0)&&(SD_i>0.0)))))
2756  {
2757  while ((loop<(NF_i-0.5)))
2758  {
2759  tmpa = (tmpa+(1.0/((SA_i+(0.5*L_i))+(loop*(SD_i+L_i)))));
2760  tmpb = (tmpb+(1.0/((SB_i+(0.5*L_i))+(loop*(SD_i+L_i)))));
2761  loop = (loop+1.0);
2762  }
2763  Invsa = (tmpa*invNF);
2764  Invsb = (tmpb*invNF);
2765  Invsaref = (1.0/((model_.SAREF_i)+(0.5*L_i)));
2766  Invsbref = (1.0/((model_.SBREF_i)+(0.5*L_i)));
2767  Lx = (((L_i+delLPS)>1e-9)?(L_i+delLPS):1e-9);
2768  Wx = ((((W_i+delWOD)+(model_.WLOD))>1e-9)?((W_i+delWOD)+(model_.WLOD)):1e-9);
2769  templ = (1.0/pow(Lx,(model_.LLODKUO_i)));
2770  tempw = (1.0/pow(Wx,(model_.WLODKUO_i)));
2771  Kstressu0 = ((((1.0+((model_.LKUO)*templ))+((model_.WKUO)*tempw))+(((model_.PKUO)*templ)*tempw))*(1.0+((model_.TKUO)*((model_.rT)-1.0))));
2772  rhobeta = (((model_.KUO)*(Invsa+Invsb))/Kstressu0);
2773  rhobetaref = (((model_.KUO)*(Invsaref+Invsbref))/Kstressu0);
2774  templ = (1.0/pow(Lx,(model_.LLODVTH_i)));
2775  tempw = (1.0/pow(Wx,(model_.WLODVTH_i)));
2776  Kstressvth0 = (((1.0+((model_.LKVTHO)*templ))+((model_.WKVTHO)*tempw))+(((model_.PKVTHO)*templ)*tempw));
2777  temp0 = (((Invsa+Invsb)-Invsaref)-Invsbref);
2778  BETN_p = ((BETN_p*(1.0+rhobeta))/(1.0+rhobetaref));
2779  THESAT_p = (((THESAT_p*(1.0+rhobeta))*(1.0+((model_.KVSAT_i)*rhobetaref)))/((1.0+rhobetaref)*(1.0+((model_.KVSAT_i)*rhobeta))));
2780  VFB_p = (VFB_p+(((model_.KVTHO)*temp0)/Kstressvth0));
2781  CF_p = (CF_p+(((model_.STETAO)*temp0)/pow(Kstressvth0,(model_.LODETAO_i))));
2782  }
2783  if (((((SCA_i>0.0)||(SCB_i>0.0))||(SCC_i>0.0))||(SC_i>0.0)))
2784  {
2785  if ((((SCA_i==0.0)&&(SCB_i==0.0))&&(SCC_i==0.0)))
2786  {
2787  temp0 = (SC_i+W_i);
2788  temp00 = (1.0/(model_.SCREF_i));
2789  SCA_i = (((model_.SCREF_i)*(model_.SCREF_i))/(SC_i*temp0));
2790  SCB_i = (((((0.1*SC_i)+(0.01*(model_.SCREF_i)))*exp((((-10.0)*SC_i)*temp00)))-(((0.1*temp0)+(0.01*(model_.SCREF_i)))*exp((((-10.0)*temp0)*temp00))))/W_i);
2791  SCC_i = (((((0.05*SC_i)+(0.0025*(model_.SCREF_i)))*exp((((-20.0)*SC_i)*temp00)))-(((0.05*temp0)+(0.0025*(model_.SCREF_i)))*exp((((-20.0)*temp0)*temp00))))/W_i);
2792  }
2793  temp0 = ((SCA_i+((model_.WEB_i)*SCB_i))+((model_.WEC_i)*SCC_i));
2794  VFB_p = (VFB_p+(KVTHOWE*temp0));
2795  BETN_p = (BETN_p*(1.0+(KUOWE*temp0)));
2796  }
2797  }
2798  VFB_i = VFB_p;
2799  STVFB_i = STVFB_p;
2800  TOX_i = ((TOX_p>1e-10)?TOX_p:1e-10);
2801  EPSROX_i = ((EPSROX_p>1.0)?EPSROX_p:1.0);
2802  NEFF_i = ((NEFF_p>1e20)?((NEFF_p<1e26)?NEFF_p:1e26):1e20);
2803  FACNEFFAC_i = ((FACNEFFAC_p>0.0)?FACNEFFAC_p:0.0);
2804  GFACNUD_i = ((GFACNUD_p>0.01)?GFACNUD_p:0.01);
2805  VSBNUD_i = ((VSBNUD_p>0.0)?VSBNUD_p:0.0);
2806  DVSBNUD_i = ((DVSBNUD_p>0.1)?DVSBNUD_p:0.1);
2807  VNSUB_i = VNSUB_p;
2808  NSLP_i = ((NSLP_p>1e-3)?NSLP_p:1e-3);
2809  DNSUB_i = ((DNSUB_p>0.0)?((DNSUB_p<1.0)?DNSUB_p:1.0):0.0);
2810  DPHIB_i = DPHIB_p;
2811  DELVTAC_i = DELVTAC_p;
2812  NP_i = ((NP_p>0.0)?NP_p:0.0);
2813  CT_i = ((CT_p>0.0)?CT_p:0.0);
2814  TOXOV_i = ((TOXOV_p>1e-10)?TOXOV_p:1e-10);
2815  TOXOVD_i = ((TOXOVD_p>1e-10)?TOXOVD_p:1e-10);
2816  NOV_i = ((NOV_p>1e20)?((NOV_p<1e27)?NOV_p:1e27):1e20);
2817  NOVD_i = ((NOVD_p>1e20)?((NOVD_p<1e27)?NOVD_p:1e27):1e20);
2818  CF_i = ((CF_p>0.0)?CF_p:0.0);
2819  CFB_i = ((CFB_p>0.0)?((CFB_p<1.0)?CFB_p:1.0):0.0);
2820  BETN_i = ((BETN_p>0.0)?BETN_p:0.0);
2821  STBET_i = STBET_p;
2822  MUE_i = ((MUE_p>0.0)?MUE_p:0.0);
2823  STMUE_i = STMUE_p;
2824  THEMU_i = ((THEMU_p>0.0)?THEMU_p:0.0);
2825  STTHEMU_i = STTHEMU_p;
2826  CS_i = ((CS_p>0.0)?CS_p:0.0);
2827  STCS_i = STCS_p;
2828  XCOR_i = ((XCOR_p>0.0)?XCOR_p:0.0);
2829  STXCOR_i = STXCOR_p;
2830  FETA_i = ((FETA_p>0.0)?FETA_p:0.0);
2831  RS_i = ((RS_p>0.0)?RS_p:0.0);
2832  STRS_i = STRS_p;
2833  RSB_i = ((RSB_p>(-0.5))?((RSB_p<1.0)?RSB_p:1.0):(-0.5));
2834  RSG_i = ((RSG_p>(-0.5))?RSG_p:(-0.5));
2835  THESAT_i = ((THESAT_p>0.0)?THESAT_p:0.0);
2836  STTHESAT_i = STTHESAT_p;
2837  THESATB_i = ((THESATB_p>(-0.5))?((THESATB_p<1.0)?THESATB_p:1.0):(-0.5));
2838  THESATG_i = ((THESATG_p>(-0.5))?THESATG_p:(-0.5));
2839  AX_i = ((AX_p>2.0)?AX_p:2.0);
2840  ALP_i = ((ALP_p>0.0)?ALP_p:0.0);
2841  ALP1_i = ((ALP1_p>0.0)?ALP1_p:0.0);
2842  ALP2_i = ((ALP2_p>0.0)?ALP2_p:0.0);
2843  VP_i = ((VP_p>1.0e-10)?VP_p:1.0e-10);
2844  A1_i = ((A1_p>0.0)?A1_p:0.0);
2845  A2_i = ((A2_p>0.0)?A2_p:0.0);
2846  STA2_i = STA2_p;
2847  A3_i = ((A3_p>0.0)?A3_p:0.0);
2848  A4_i = ((A4_p>0.0)?A4_p:0.0);
2849  GCO_i = ((GCO_p>(-10.0))?((GCO_p<10.0)?GCO_p:10.0):(-10.0));
2850  IGINV_i = ((IGINV_p>0.0)?IGINV_p:0.0);
2851  IGOV_i = ((IGOV_p>0.0)?IGOV_p:0.0);
2852  IGOVD_i = ((IGOVD_p>0.0)?IGOVD_p:0.0);
2853  STIG_i = STIG_p;
2854  GC2_i = ((GC2_p>0.0)?((GC2_p<10.0)?GC2_p:10.0):0.0);
2855  GC3_i = ((GC3_p>(-10.0))?((GC3_p<10.0)?GC3_p:10.0):(-10.0));
2856  CHIB_i = ((CHIB_p>1.0)?CHIB_p:1.0);
2857  AGIDL_i = ((AGIDL_p>0.0)?AGIDL_p:0.0);
2858  AGIDLD_i = ((AGIDLD_p>0.0)?AGIDLD_p:0.0);
2859  BGIDL_i = ((BGIDL_p>0.0)?BGIDL_p:0.0);
2860  BGIDLD_i = ((BGIDLD_p>0.0)?BGIDLD_p:0.0);
2861  STBGIDL_i = STBGIDL_p;
2862  STBGIDLD_i = STBGIDLD_p;
2863  CGIDL_i = CGIDL_p;
2864  CGIDLD_i = CGIDLD_p;
2865  COX_i = ((COX_p>0.0)?COX_p:0.0);
2866  CGOV_i = ((CGOV_p>0.0)?CGOV_p:0.0);
2867  CGOVD_i = ((CGOVD_p>0.0)?CGOVD_p:0.0);
2868  CGBOV_i = ((CGBOV_p>0.0)?CGBOV_p:0.0);
2869  CFR_i = ((CFR_p>0.0)?CFR_p:0.0);
2870  CFRD_i = ((CFRD_p>0.0)?CFRD_p:0.0);
2871  FNT_i = ((FNT_p>0.0)?FNT_p:0.0);
2872  NFA_i = ((NFA_p>0.0)?NFA_p:0.0);
2873  NFB_i = ((NFB_p>0.0)?NFB_p:0.0);
2874  NFC_i = ((NFC_p>0.0)?NFC_p:0.0);
2875  EF_i = ((EF_p>0.0)?EF_p:0.0);
2876  RG_i = ((RG_p>0.0)?RG_p:0.0);
2877  RSE_i = ((RSE_p>0.0)?RSE_p:0.0);
2878  RDE_i = ((RDE_p>0.0)?RDE_p:0.0);
2879  RBULK_i = ((RBULK_p>0.0)?RBULK_p:0.0);
2880  RJUNS_i = ((RJUNS_p>0.0)?RJUNS_p:0.0);
2881  RJUND_i = ((RJUND_p>0.0)?RJUND_p:0.0);
2882  RWELL_i = ((RWELL_p>0.0)?RWELL_p:0.0);
2883  MULT_i = (((MULT*NF_i)>0.0)?(MULT*NF_i):0.0);
2884  FACTUO_i = ((FACTUO>0.0)?FACTUO:0.0);
2885  DELVTO_i = DELVTO;
2886  if (((model_.SWJUNASYM_i)==0))
2887  {
2888  TOXOVD_i = TOXOV_i;
2889  NOVD_i = NOV_i;
2890  AGIDLD_i = AGIDL_i;
2891  BGIDLD_i = BGIDL_i;
2892  STBGIDLD_i = STBGIDL_i;
2893  CGIDLD_i = CGIDL_i;
2894  IGOVD_i = IGOV_i;
2895  CGOVD_i = CGOV_i;
2896  CFRD_i = CFR_i;
2897  }
2898  EPSOX = (8.8541878176E-12*EPSROX_i);
2899  phit1 = ((model_.phit)*(1.0+(CT_i*(model_.rTn))));
2900  inv_phit1 = (1.0/phit1);
2901  VFB_i = ((VFB_i+(STVFB_i*(model_.dT)))+DELVTO_i);
2902  phib_dc = (((model_.Eg)+DPHIB_i)+((2.0*(model_.phit))*log(((NEFF_i*pow((model_.phibFac),(-0.75)))*4.0e-26))));
2903  phib_dc = ((phib_dc>5.0E-2)?phib_dc:5.0E-2);
2904  CoxPrime = (EPSOX/TOX_i);
2905  tox_sq = (TOX_i*TOX_i);
2906  G_0_dc = (sqrt(((((2.0*1.6021918E-19)*NEFF_i)*(model_.EPSSI))*(model_.inv_phit)))/CoxPrime);
2907  kp = 0.0;
2908  if ((NP_i>0.0))
2909  {
2910  arg2max = (8.0e7/tox_sq);
2911  np = ((NP_i>arg2max)?NP_i:arg2max);
2912  np = ((5.0e24>np)?5.0e24:np);
2913  kp = ((((2.0*CoxPrime)*CoxPrime)*(model_.phit))/((1.6021918E-19*np)*(model_.EPSSI)));
2914  }
2915  qlim2 = ((100.0*(model_.phit))*(model_.phit));
2916  qq = 0.0;
2917  if (((model_.QMC_i)>0.0))
2918  {
2919  qq = (((0.4*5.951993)*(model_.QMC_i))*pow(CoxPrime,6.6666666666666667e-01));
2920  if (((model_.CHNL_TYPE)==(-1)))
2921  {
2922  qq = ((7.448711/5.951993)*qq);
2923  }
2924  qb0 = sqrt(((((model_.phit)*G_0_dc)*G_0_dc)*phib_dc));
2925  dphibq = ((0.75*qq)*pow(qb0,6.6666666666666667e-01));
2926  phib_dc = (phib_dc+dphibq);
2927  G_0_dc = (G_0_dc*(1.0+(((2.0*6.6666666666666667e-01)*dphibq)/qb0)));
2928  }
2929  sqrt_phib_dc = sqrt(phib_dc);
2930  phix_dc = (0.95*phib_dc);
2931  aphi_dc = ((0.0025*phib_dc)*phib_dc);
2932  bphi_dc = aphi_dc;
2933  phix2 = (0.5*sqrt(bphi_dc));
2934  phix1_dc = (0.5*(((phix_dc-phix2))-sqrt(((((phix_dc-phix2))*((phix_dc-phix2)))+aphi_dc))));
2935  us1 = (sqrt((VSBNUD_i+phib_dc))-sqrt_phib_dc);
2936  us21 = ((sqrt(((VSBNUD_i+DVSBNUD_i)+phib_dc))-sqrt_phib_dc)-us1);
2937  CoxovPrime = (EPSOX/TOXOV_i);
2938  CoxovPrime_d = (EPSOX/TOXOVD_i);
2939  GOV_s = (sqrt(((((2.0*1.6021918E-19)*NOV_i)*(model_.EPSSI))*(model_.inv_phit)))/CoxovPrime);
2940  GOV_d = (sqrt(((((2.0*1.6021918E-19)*NOVD_i)*(model_.EPSSI))*(model_.inv_phit)))/CoxovPrime_d);
2941  GOV2_s = (GOV_s*GOV_s);
2942  GOV2_d = (GOV_d*GOV_d);
2943  xi_ov_s = (1.0+(GOV_s*7.0710678118654746e-01));
2944  xi_ov_d = (1.0+(GOV_d*7.0710678118654746e-01));
2945  inv_xi_ov_s = (1.0/xi_ov_s);
2946  inv_xi_ov_d = (1.0/xi_ov_d);
2947  x_mrg_ov_s = (1.0e-5*xi_ov_s);
2948  x_mrg_ov_d = (1.0e-5*xi_ov_d);
2949  tf_bet = pow((model_.rTn),STBET_i);
2950  BETN_i = (BETN_i*tf_bet);
2951  BET_i = ((FACTUO_i*BETN_i)*CoxPrime);
2952  THEMU_i = (THEMU_i*pow((model_.rTn),STTHEMU_i));
2953  tf_mue = pow((model_.rTn),STMUE_i);
2954  MUE_i = (MUE_i*tf_mue);
2955  tf_cs = pow((model_.rTn),STCS_i);
2956  CS_i = (CS_i*tf_cs);
2957  tf_xcor = pow((model_.rTn),STXCOR_i);
2958  XCOR_i = (XCOR_i*tf_xcor);
2959  E_eff0 = ((1.0e-8*CoxPrime)/(model_.EPSSI));
2960  eta_mu = (0.5*FETA_i);
2961  eta_mu1 = 0.5;
2962  if (((model_.CHNL_TYPE)==(-1)))
2963  {
2964  eta_mu = (3.3333333333333333e-01*FETA_i);
2965  eta_mu1 = 3.3333333333333333e-01;
2966  }
2967  tf_ther = pow((model_.rTn),STRS_i);
2968  RS_i = (RS_i*tf_ther);
2969  THER_i = ((2*BET_i)*RS_i);
2970  tf_thesat = pow((model_.rTn),STTHESAT_i);
2971  THESAT_i = (THESAT_i*tf_thesat);
2972  Vdsat_lim = (3.912023005*phit1);
2973  inv_AX = (1.0/AX_i);
2974  inv_VP = (1.0/VP_i);
2975  A2_i = (A2_i*pow((model_.rT),STA2_i));
2976  tf_ig = pow((model_.rT),STIG_i);
2977  IGINV_i = (IGINV_i*tf_ig);
2978  IGOV_i = (IGOV_i*tf_ig);
2979  IGOVD_i = (IGOVD_i*tf_ig);
2980  inv_CHIB = (1.0/CHIB_i);
2981  tempM = (((4.0*3.3333333333333333e-01)*sqrt((((2*1.6021918E-19)*9.1093826E-31)*CHIB_i)))/1.05457168E-34);
2982  BCH = (tempM*TOX_i);
2983  BOV = (tempM*TOXOV_i);
2984  BOV_d = (tempM*TOXOVD_i);
2985  GCQ = 0;
2986  if ((GC3_i<0))
2987  {
2988  GCQ = (((-0.495)*GC2_i)/GC3_i);
2989  }
2990  alpha_b = (0.5*(phib_dc+(model_.Eg)));
2991  Dch = (GCO_i*phit1);
2992  Dov = (GCO_i*(model_.phit));
2993  AGIDL_i = ((AGIDL_i*4e-18)/(TOXOV_i*TOXOV_i));
2994  AGIDLD_i = ((AGIDLD_i*4e-18)/(TOXOVD_i*TOXOVD_i));
2995  tempM = (((1.0+(STBGIDL_i*(model_.dT)))>0)?(1.0+(STBGIDL_i*(model_.dT))):0);
2996  BGIDL_i = (((BGIDL_i*tempM)*TOXOV_i)*5e8);
2997  tempM = (((1.0+(STBGIDLD_i*(model_.dT)))>0)?(1.0+(STBGIDLD_i*(model_.dT))):0);
2998  BGIDLD_i = (((BGIDLD_i*tempM)*TOXOVD_i)*5e8);
2999  nt = (((FNT_i*4)*1.3806505E-23)*(model_.TKD));
3000  Cox_over_q = (CoxPrime/1.6021918E-19);
3001  Sfl_prefac = ((((model_.phit)*(model_.phit))*BET_i)/Cox_over_q);
3002  x1 = 1.25;
3003  inv_xg1_s = (1.0/(x1+(GOV_s*7.324648775608221e-1)));
3004  inv_xg1_d = (1.0/(x1+(GOV_d*7.324648775608221e-1)));
3005  NEFFAC_i = (FACNEFFAC_i*NEFF_i);
3006  NEFFAC_i = ((NEFFAC_i>1e20)?((NEFFAC_i<1e26)?NEFFAC_i:1e26):1e20);
3007  phib_ac = ((((model_.Eg)+DPHIB_i)+DELVTAC_i)+((2.0*(model_.phit))*log(((NEFFAC_i*pow((model_.phibFac),(-0.75)))*4.0e-26))));
3008  phib_ac = ((phib_ac>5.0E-2)?phib_ac:5.0E-2);
3009  G_0_ac = (sqrt(((((2.0*1.6021918E-19)*NEFFAC_i)*(model_.EPSSI))*(model_.inv_phit)))/CoxPrime);
3010  if (((model_.QMC_i)>0.0))
3011  {
3012  qb0 = sqrt(((((model_.phit)*G_0_ac)*G_0_ac)*phib_ac));
3013  dphibq = ((0.75*qq)*pow(qb0,6.6666666666666667e-01));
3014  phib_ac = (phib_ac+dphibq);
3015  G_0_ac = (G_0_ac*(1.0+(((2.0*6.6666666666666667e-01)*dphibq)/qb0)));
3016  }
3017  sqrt_phib_ac = sqrt(phib_ac);
3018  phix_ac = (0.95*phib_ac);
3019  aphi_ac = ((0.0025*phib_ac)*phib_ac);
3020  bphi_ac = aphi_ac;
3021  phix2 = (0.5*sqrt(bphi_ac));
3022  phix1_ac = (0.5*(((phix_ac-phix2))-sqrt(((((phix_ac-phix2))*((phix_ac-phix2)))+aphi_ac))));
3023  if ((RG_i>0.0))
3024  {
3025  ggate = (1.0/RG_i);
3026  }
3027  else
3028  {
3029  ggate = 0.0;
3030  }
3031  if ((RSE_i>0.0))
3032  {
3033  gsource = (1.0/RSE_i);
3034  }
3035  else
3036  {
3037  gsource = 0.0;
3038  }
3039  if ((RDE_i>0.0))
3040  {
3041  gdrain = (1.0/RDE_i);
3042  }
3043  else
3044  {
3045  gdrain = 0.0;
3046  }
3047  if ((RBULK_i>0.0))
3048  {
3049  gbulk = (1.0/RBULK_i);
3050  }
3051  else
3052  {
3053  gbulk = 0.0;
3054  }
3055  if ((RJUNS_i>0.0))
3056  {
3057  gjuns = (1.0/RJUNS_i);
3058  }
3059  else
3060  {
3061  gjuns = 0.0;
3062  }
3063  if ((RJUND_i>0.0))
3064  {
3065  gjund = (1.0/RJUND_i);
3066  }
3067  else
3068  {
3069  gjund = 0.0;
3070  }
3071  if ((RWELL_i>0.0))
3072  {
3073  gwell = (1.0/RWELL_i);
3074  }
3075  else
3076  {
3077  gwell = 0.0;
3078  }
3079  ABS_i = 0.0;
3080  LSS_i = 0.0;
3081  LGS_i = 0.0;
3082  ABD_i = 0.0;
3083  LSD_i = 0.0;
3084  LGD_i = 0.0;
3085  jwcorr = 0.0;
3086  jww = WE;
3087  if (((model_.SWGEO_i)==0))
3088  {
3089  jww = ((JW_i>0)?JW_i:0);
3090  }
3091  if (((model_.SWJUNCAP_i)==3))
3092  {
3093  jwcorr = 1.0;
3094  }
3095  ABS_i = (ABSOURCE_i*invNF);
3096  LSS_i = (LSSOURCE_i*invNF);
3097  LGS_i = (LGSOURCE_i*invNF);
3098  ABD_i = (ABDRAIN_i*invNF);
3099  LSD_i = (LSDRAIN_i*invNF);
3100  LGD_i = (LGDRAIN_i*invNF);
3101  if ((((model_.SWJUNCAP_i)==2)||((model_.SWJUNCAP_i)==3)))
3102  {
3103  ABS_i = (AS_i*invNF);
3104  LSS_i = ((PS_i*invNF)-(jwcorr*jww));
3105  LGS_i = jww;
3106  ABD_i = (AD_i*invNF);
3107  LSD_i = ((PD_i*invNF)-(jwcorr*jww));
3108  LGD_i = jww;
3109  }
3110  if (((((model_.SWJUNCAP_i)==1)||((model_.SWJUNCAP_i)==2))||((model_.SWJUNCAP_i)==3)))
3111  {
3112  ABSOURCE_i = ((ABS_i>0)?ABS_i:0);
3113  LSSOURCE_i = ((LSS_i>0)?LSS_i:0);
3114  LGSOURCE_i = ((LGS_i>0)?LGS_i:0);
3115  ABDRAIN_i = ((ABD_i>0)?ABD_i:0);
3116  LSDRAIN_i = ((LSD_i>0)?LSD_i:0);
3117  LGDRAIN_i = ((LGD_i>0)?LGD_i:0);
3118  }
3119  else
3120  {
3121  ABSOURCE_i = 0.0;
3122  LSSOURCE_i = 0.0;
3123  LGSOURCE_i = 0.0;
3124  ABDRAIN_i = 0.0;
3125  LSDRAIN_i = 0.0;
3126  LGDRAIN_i = 0.0;
3127  }
3128  vbimin_s = 0.0;
3129  vbimin_d = 0.0;
3130  vfmin_s = 0.0;
3131  vfmin_d = 0.0;
3132  vch_s = 0.0;
3133  vch_d = 0.0;
3134  vbbtlim_s = 0.0;
3135  vbbtlim_d = 0.0;
3136  VMAX_s = 0.0;
3137  VMAX_d = 0.0;
3138  exp_VMAX_over_phitd_s = 0.0;
3139  exp_VMAX_over_phitd_d = 0.0;
3140  vj = 0.0;
3141  idmult = 0.0;
3142  vjsrh = 0.0;
3143  zinv = 0.0;
3144  wdep = 0.0;
3145  wsrh = 0.0;
3146  asrh = 0.0;
3147  vav = 0.0;
3148  vbi_minus_vjsrh = 0.0;
3149  ISATFOR1_s = 0.0;
3150  ISATFOR1_d = 0.0;
3151  MFOR1_s = 1.0;
3152  MFOR1_d = 1.0;
3153  ISATFOR2_s = 0.0;
3154  ISATFOR2_d = 0.0;
3155  MFOR2_s = 1.0;
3156  MFOR2_d = 1.0;
3157  ISATREV_s = 0.0;
3158  ISATREV_d = 0.0;
3159  MREV_s = 1.0;
3160  MREV_d = 1.0;
3161  m0flag_s = 0.0;
3162  m0flag_d = 0.0;
3163  xhighf1_s = 0.0;
3164  xhighf1_d = 0.0;
3165  expxhf1_s = 0.0;
3166  expxhf1_d = 0.0;
3167  xhighf2_s = 0.0;
3168  xhighf2_d = 0.0;
3169  expxhf2_s = 0.0;
3170  expxhf2_d = 0.0;
3171  xhighr_s = 0.0;
3172  xhighr_d = 0.0;
3173  expxhr_s = 0.0;
3174  expxhr_d = 0.0;
3175  zflagbot_s = 1.0;
3176  zflagbot_d = 1.0;
3177  zflagsti_s = 1.0;
3178  zflagsti_d = 1.0;
3179  zflaggat_s = 1.0;
3180  zflaggat_d = 1.0;
3181  m0_rev = 0.0;
3182  mcor_rev = 0.0;
3183  I1_cor = 0.0;
3184  I2_cor = 0.0;
3185  I3_cor = 0.0;
3186  I4_cor = 0.0;
3187  I5_cor = 0.0;
3188  tt0 = 0.0;
3189  tt1 = 0.0;
3190  tt2 = 0.0;
3191  zfrac = 0.0;
3192  alphaje = 0.0;
3193  tmpv = 0.0;
3194  vjv = 0.0;
3195  ijun_s = 0.0;
3196  ijunbot_s = 0.0;
3197  ijunsti_s = 0.0;
3198  ijungat_s = 0.0;
3199  qjun_s = 0.0;
3200  qjunbot_s = 0.0;
3201  qjunsti_s = 0.0;
3202  qjungat_s = 0.0;
3203  ijun_d = 0.0;
3204  ijunbot_d = 0.0;
3205  ijunsti_d = 0.0;
3206  ijungat_d = 0.0;
3207  qjun_d = 0.0;
3208  qjunbot_d = 0.0;
3209  qjunsti_d = 0.0;
3210  qjungat_d = 0.0;
3211  if (((model_.SWJUNCAP_i)>0))
3212  {
3219  (model_.PBOT_i) = (model_.PBOTS_i);
3220  (model_.PSTI_i) = (model_.PSTIS_i);
3221  (model_.PGAT_i) = (model_.PGATS_i);
3255  (model_.FJUNQ_i) = (model_.FJUNQS_i);
3262  (model_.ftdbot) = (model_.ftdbot_s);
3263  (model_.ftdsti) = (model_.ftdsti_s);
3264  (model_.ftdgat) = (model_.ftdgat_s);
3268  (model_.ubibot) = (model_.ubibot_s);
3269  (model_.ubisti) = (model_.ubisti_s);
3270  (model_.ubigat) = (model_.ubigat_s);
3271  (model_.vbibot) = (model_.vbibot_s);
3272  (model_.vbisti) = (model_.vbisti_s);
3273  (model_.vbigat) = (model_.vbigat_s);
3283  (model_.cjobot) = (model_.cjobot_s);
3284  (model_.cjosti) = (model_.cjosti_s);
3285  (model_.cjogat) = (model_.cjogat_s);
3325  if ((((model_.idsatbot)*ABSOURCE_i)>0))
3326  {
3327  vmaxbot = ((model_.phitd)*log((((model_.IMAX_i)/((model_.idsatbot)*ABSOURCE_i))+1)));
3328  }
3329  else
3330  {
3331  vmaxbot = 1E8;
3332  }
3333  if ((((model_.idsatsti)*LSSOURCE_i)>0))
3334  {
3335  vmaxsti = ((model_.phitd)*log((((model_.IMAX_i)/((model_.idsatsti)*LSSOURCE_i))+1)));
3336  }
3337  else
3338  {
3339  vmaxsti = 1E8;
3340  }
3341  if ((((model_.idsatgat)*LGSOURCE_i)>0))
3342  {
3343  vmaxgat = ((model_.phitd)*log((((model_.IMAX_i)/((model_.idsatgat)*LGSOURCE_i))+1)));
3344  }
3345  else
3346  {
3347  vmaxgat = 1E8;
3348  }
3349  VMAX_s = std::min(std::min(vmaxbot,vmaxsti),vmaxgat);
3350  if ((fabs((VMAX_s*(model_.phitdinv)))<2.3025850929940458e+02))
3351  {
3353  }
3354  else
3355  {
3356  if (((VMAX_s*(model_.phitdinv))<(-2.3025850929940458e+02)))
3357  {
3358  exp_VMAX_over_phitd_s = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-(VMAX_s*(model_.phitdinv)))*(1.0+(0.5*(((-2.3025850929940458e+02)-(VMAX_s*(model_.phitdinv)))*(1.0+(((-2.3025850929940458e+02)-(VMAX_s*(model_.phitdinv)))*3.3333333333333333e-01))))))));
3359  }
3360  else
3361  {
3362  exp_VMAX_over_phitd_s = (1.0e100*(1.0+(((VMAX_s*(model_.phitdinv))-2.3025850929940458e+02)*(1.0+(0.5*(((VMAX_s*(model_.phitdinv))-2.3025850929940458e+02)*(1.0+(((VMAX_s*(model_.phitdinv))-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
3363  }
3364  }
3365  vbibot2 = (model_.vbibot);
3366  vbisti2 = (model_.vbisti);
3367  vbigat2 = (model_.vbigat);
3368  pbot2 = (model_.PBOT_i);
3369  psti2 = (model_.PSTI_i);
3370  pgat2 = (model_.PGAT_i);
3371  vbibot2r = (model_.VBIRBOT_i);
3372  vbisti2r = (model_.VBIRSTI_i);
3373  vbigat2r = (model_.VBIRGAT_i);
3374  if ((ABSOURCE_i==0))
3375  {
3376  vbibot2 = ((model_.vbisti)+(model_.vbigat));
3377  pbot2 = (0.9*std::min((model_.PSTI_i),(model_.PGAT_i)));
3378  vbibot2r = ((model_.VBIRSTI_i)+(model_.VBIRGAT_i));
3379  }
3380  if ((LSSOURCE_i==0))
3381  {
3382  vbisti2 = ((model_.vbibot)+(model_.vbigat));
3383  psti2 = (0.9*std::min((model_.PBOT_i),(model_.PGAT_i)));
3384  vbisti2r = ((model_.VBIRBOT_i)+(model_.VBIRGAT_i));
3385  }
3386  if ((LGSOURCE_i==0))
3387  {
3388  vbigat2 = ((model_.vbibot)+(model_.vbisti));
3389  pgat2 = (0.9*std::min((model_.PBOT_i),(model_.PSTI_i)));
3390  vbigat2r = ((model_.VBIRBOT_i)+(model_.VBIRSTI_i));
3391  }
3392  vbimin_s = std::min(std::min(vbibot2,vbisti2),vbigat2);
3393  vch_s = (vbimin_s*0.1);
3394  pmax = std::max(std::max(pbot2,psti2),pgat2);
3395  vfmin_s = (vbimin_s*(1-pow(2,((-1.0)/pmax))));
3396  vbbtlim_s = (std::min(std::min(vbibot2r,vbisti2r),vbigat2r)-0.050);
3403  (model_.PBOT_i) = (model_.PBOTD_i);
3404  (model_.PSTI_i) = (model_.PSTID_i);
3405  (model_.PGAT_i) = (model_.PGATD_i);
3439  (model_.FJUNQ_i) = (model_.FJUNQD_i);
3446  (model_.ftdbot) = (model_.ftdbot_d);
3447  (model_.ftdsti) = (model_.ftdsti_d);
3448  (model_.ftdgat) = (model_.ftdgat_d);
3452  (model_.ubibot) = (model_.ubibot_d);
3453  (model_.ubisti) = (model_.ubisti_d);
3454  (model_.ubigat) = (model_.ubigat_d);
3455  (model_.vbibot) = (model_.vbibot_d);
3456  (model_.vbisti) = (model_.vbisti_d);
3457  (model_.vbigat) = (model_.vbigat_d);
3467  (model_.cjobot) = (model_.cjobot_d);
3468  (model_.cjosti) = (model_.cjosti_d);
3469  (model_.cjogat) = (model_.cjogat_d);
3509  if ((((model_.idsatbot)*ABDRAIN_i)>0))
3510  {
3511  vmaxbot = ((model_.phitd)*log((((model_.IMAX_i)/((model_.idsatbot)*ABDRAIN_i))+1)));
3512  }
3513  else
3514  {
3515  vmaxbot = 1E8;
3516  }
3517  if ((((model_.idsatsti)*LSDRAIN_i)>0))
3518  {
3519  vmaxsti = ((model_.phitd)*log((((model_.IMAX_i)/((model_.idsatsti)*LSDRAIN_i))+1)));
3520  }
3521  else
3522  {
3523  vmaxsti = 1E8;
3524  }
3525  if ((((model_.idsatgat)*LGDRAIN_i)>0))
3526  {
3527  vmaxgat = ((model_.phitd)*log((((model_.IMAX_i)/((model_.idsatgat)*LGDRAIN_i))+1)));
3528  }
3529  else
3530  {
3531  vmaxgat = 1E8;
3532  }
3533  VMAX_d = std::min(std::min(vmaxbot,vmaxsti),vmaxgat);
3534  if ((fabs((VMAX_d*(model_.phitdinv)))<2.3025850929940458e+02))
3535  {
3537  }
3538  else
3539  {
3540  if (((VMAX_d*(model_.phitdinv))<(-2.3025850929940458e+02)))
3541  {
3542  exp_VMAX_over_phitd_d = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-(VMAX_d*(model_.phitdinv)))*(1.0+(0.5*(((-2.3025850929940458e+02)-(VMAX_d*(model_.phitdinv)))*(1.0+(((-2.3025850929940458e+02)-(VMAX_d*(model_.phitdinv)))*3.3333333333333333e-01))))))));
3543  }
3544  else
3545  {
3546  exp_VMAX_over_phitd_d = (1.0e100*(1.0+(((VMAX_d*(model_.phitdinv))-2.3025850929940458e+02)*(1.0+(0.5*(((VMAX_d*(model_.phitdinv))-2.3025850929940458e+02)*(1.0+(((VMAX_d*(model_.phitdinv))-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
3547  }
3548  }
3549  vbibot2 = (model_.vbibot);
3550  vbisti2 = (model_.vbisti);
3551  vbigat2 = (model_.vbigat);
3552  pbot2 = (model_.PBOT_i);
3553  psti2 = (model_.PSTI_i);
3554  pgat2 = (model_.PGAT_i);
3555  vbibot2r = (model_.VBIRBOT_i);
3556  vbisti2r = (model_.VBIRSTI_i);
3557  vbigat2r = (model_.VBIRGAT_i);
3558  if ((ABDRAIN_i==0))
3559  {
3560  vbibot2 = ((model_.vbisti)+(model_.vbigat));
3561  pbot2 = (0.9*std::min((model_.PSTI_i),(model_.PGAT_i)));
3562  vbibot2r = ((model_.VBIRSTI_i)+(model_.VBIRGAT_i));
3563  }
3564  if ((LSDRAIN_i==0))
3565  {
3566  vbisti2 = ((model_.vbibot)+(model_.vbigat));
3567  psti2 = (0.9*std::min((model_.PBOT_i),(model_.PGAT_i)));
3568  vbisti2r = ((model_.VBIRBOT_i)+(model_.VBIRGAT_i));
3569  }
3570  if ((LGDRAIN_i==0))
3571  {
3572  vbigat2 = ((model_.vbibot)+(model_.vbisti));
3573  pgat2 = (0.9*std::min((model_.PBOT_i),(model_.PSTI_i)));
3574  vbigat2r = ((model_.VBIRBOT_i)+(model_.VBIRSTI_i));
3575  }
3576  vbimin_d = std::min(std::min(vbibot2,vbisti2),vbigat2);
3577  vch_d = (vbimin_d*0.1);
3578  pmax = std::max(std::max(pbot2,psti2),pgat2);
3579  vfmin_d = (vbimin_d*(1-pow(2,((-1.0)/pmax))));
3580  vbbtlim_d = (std::min(std::min(vbibot2r,vbisti2r),vbigat2r)-0.050);
3581  if (((model_.SWJUNEXP_i)==1))
3582  //Begin block JUNCAPexpressInit
3583  {
3584  //Block-local variables for block JUNCAPexpressInit
3585  double ysq;
3586  double terfc;
3587  double erfcpos;
3588  //End of Block-local variables
3589  //Block-local variables for block JUNCAPexpressInit
3590  double h1;
3591  double h2;
3592  double h2d;
3593  double h3;
3594  double h4;
3595  double h5;
3596  //End of Block-local variables
3597  //Block-local variables for block JUNCAPexpressInit
3598  double idmult;
3599  double vj;
3600  double z;
3601  double zinv;
3602  double two_psistar;
3603  double vjlim;
3604  double vjsrh;
3605  double vbbt;
3606  double vav;
3607  //End of Block-local variables
3608  //Block-local variables for block JUNCAPexpressInit
3609  double tmp;
3610  double id;
3611  //End of Block-local variables
3612  //Block-local variables for block JUNCAPexpressInit
3613  double isrh;
3614  double vbi_minus_vjsrh;
3615  double wsrhstep;
3616  double dwsrh;
3617  double wsrh;
3618  double wdep;
3619  double asrh;
3620  //End of Block-local variables
3621  //Block-local variables for block JUNCAPexpressInit
3622  double itat;
3623  double btat;
3624  double twoatatoverthreebtat;
3625  double umaxbeforelimiting;
3626  double umax;
3627  double sqrtumax;
3628  double umaxpoweronepointfive;
3629  //End of Block-local variables
3630  //Block-local variables for block JUNCAPexpressInit
3631  double wgamma;
3632  double wtat;
3633  double ktat;
3634  double ltat;
3635  double mtat;
3636  double xerfc;
3637  double erfctimesexpmtat;
3638  double gammamax;
3639  //End of Block-local variables
3640  //Block-local variables for block JUNCAPexpressInit
3641  double ibbt;
3642  double Fmaxr;
3643  //End of Block-local variables
3644  //Block-local variables for block JUNCAPexpressInit
3645  double fbreakdown;
3646  //End of Block-local variables
3647  //Block-local variables for block JUNCAPexpressInit
3648  double ijunbot;
3649  double ijunsti;
3650  double ijungat;
3651  double qjunbot;
3652  double qjunsti;
3653  double qjungat;
3654  //End of Block-local variables
3655  ysq = 0.0;
3656  terfc = 0.0;
3657  erfcpos = 0.0;
3658  h1 = 0.0;
3659  h2 = 0.0;
3660  h2d = 0.0;
3661  h3 = 0.0;
3662  h4 = 0.0;
3663  h5 = 0.0;
3664  idmult = 0.0;
3665  vj = 0.0;
3666  z = 0.0;
3667  zinv = 0.0;
3668  two_psistar = 0.0;
3669  vjlim = 0.0;
3670  vjsrh = 0.0;
3671  vbbt = 0.0;
3672  vav = 0.0;
3673  tmp = 0.0;
3674  id = 0.0;
3675  isrh = 0.0;
3676  vbi_minus_vjsrh = 0.0;
3677  wsrhstep = 0.0;
3678  dwsrh = 0.0;
3679  wsrh = 0.0;
3680  wdep = 0.0;
3681  asrh = 0.0;
3682  itat = 0.0;
3683  btat = 0.0;
3684  twoatatoverthreebtat = 0.0;
3685  umaxbeforelimiting = 0.0;
3686  umax = 0.0;
3687  sqrtumax = 0.0;
3688  umaxpoweronepointfive = 0.0;
3689  wgamma = 0.0;
3690  wtat = 0.0;
3691  ktat = 0.0;
3692  ltat = 0.0;
3693  mtat = 0.0;
3694  xerfc = 0.0;
3695  erfctimesexpmtat = 0.0;
3696  gammamax = 0.0;
3697  ibbt = 0.0;
3698  Fmaxr = 0.0;
3699  fbreakdown = 0.0;
3700  qjunbot = 0.0;
3701  qjunsti = 0.0;
3702  qjungat = 0.0;
3709  (model_.PBOT_i) = (model_.PBOTS_i);
3710  (model_.PSTI_i) = (model_.PSTIS_i);
3711  (model_.PGAT_i) = (model_.PGATS_i);
3745  (model_.FJUNQ_i) = (model_.FJUNQS_i);
3752  (model_.ftdbot) = (model_.ftdbot_s);
3753  (model_.ftdsti) = (model_.ftdsti_s);
3754  (model_.ftdgat) = (model_.ftdgat_s);
3758  (model_.ubibot) = (model_.ubibot_s);
3759  (model_.ubisti) = (model_.ubisti_s);
3760  (model_.ubigat) = (model_.ubigat_s);
3761  (model_.vbibot) = (model_.vbibot_s);
3762  (model_.vbisti) = (model_.vbisti_s);
3763  (model_.vbigat) = (model_.vbigat_s);
3773  (model_.cjobot) = (model_.cjobot_s);
3774  (model_.cjosti) = (model_.cjosti_s);
3775  (model_.cjogat) = (model_.cjogat_s);
3815  FRACNA = 0.4;
3816  FRACNB = 0.65;
3817  FRACI = 0.8;
3818  V1 = ((-FRACNA)*(model_.VJUNREF_i));
3819  V2 = ((-FRACNB)*(model_.VJUNREF_i));
3820  V3 = ((-FRACI)*(model_.VJUNREF_i));
3821  V4 = 0.1;
3822  V5 = 0.2;
3823  vbbt = 0.0;
3824  two_psistar = 0.0;
3825  if ((!(((ABSOURCE_i==0)&&(LSSOURCE_i==0))&&(LGSOURCE_i==0))))
3826  {
3827  h1 = ((4.0*vch_s)*vch_s);
3828  h2 = (vch_s/vfmin_s);
3829  h2d = (V1+(vch_s*h2));
3830  h3 = (vfmin_s+h2d);
3831  h4 = (vfmin_s-h2d);
3832  h5 = sqrt(((h4*h4)+h1));
3833  vj = (2.0*((V1*vfmin_s)/(h3+h5)));
3834  if ((V1<VMAX_s))
3835  {
3836  if ((fabs((0.5*(V1*(model_.phitdinv))))<2.3025850929940458e+02))
3837  {
3838  zinv = exp((0.5*(V1*(model_.phitdinv))));
3839  }
3840  else
3841  {
3842  if (((0.5*(V1*(model_.phitdinv)))<(-2.3025850929940458e+02)))
3843  {
3844  zinv = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-(0.5*(V1*(model_.phitdinv))))*(1.0+(0.5*(((-2.3025850929940458e+02)-(0.5*(V1*(model_.phitdinv))))*(1.0+(((-2.3025850929940458e+02)-(0.5*(V1*(model_.phitdinv))))*3.3333333333333333e-01))))))));
3845  }
3846  else
3847  {
3848  zinv = (1.0e100*(1.0+(((0.5*(V1*(model_.phitdinv)))-2.3025850929940458e+02)*(1.0+(0.5*(((0.5*(V1*(model_.phitdinv)))-2.3025850929940458e+02)*(1.0+(((0.5*(V1*(model_.phitdinv)))-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
3849  }
3850  }
3851  idmult = (zinv*zinv);
3852  }
3853  else
3854  {
3855  idmult = ((1+((V1-VMAX_s)*(model_.phitdinv)))*exp_VMAX_over_phitd_s);
3856  zinv = sqrt(idmult);
3857  }
3858  idmult = (idmult-1.0);
3859  z = (1/zinv);
3860  if ((V1>0))
3861  {
3862  two_psistar = (2.0*((model_.phitd)*log(((2.0+z)+sqrt(((z+1.0)*(z+3.0)))))));
3863  }
3864  else
3865  {
3866  two_psistar = ((-V1)+(2.0*((model_.phitd)*log((((2*zinv)+1)+sqrt(((1+zinv)*(1+(3*zinv)))))))));
3867  }
3868  vjlim = (vbimin_s-two_psistar);
3869  vjsrh = (0.5*((V1+vjlim)-sqrt((((V1-vjlim)*(V1-vjlim))+((4*(model_.phitd))*(model_.phitd))))));
3870  vbbt = (0.5*((V1+vbbtlim_s)-sqrt((((V1-vbbtlim_s)*(V1-vbbtlim_s))+((4*(model_.phitr))*(model_.phitr))))));
3871  vav = (0.5*((V1)-sqrt((((V1)*(V1))+((4*1E-6)*1E-6)))));
3872  }
3873  if ((ABSOURCE_i==0))
3874  {
3875  ijunbot = 0;
3876  qjunbot = 0;
3877  }
3878  else
3879  {
3880  if (((model_.one_minus_PBOT)==0.5))
3881  {
3882  tmp = sqrt((1-(vj*(model_.vbiinvbot))));
3883  }
3884  else
3885  {
3886  tmp = pow((1-(vj*(model_.vbiinvbot))),(model_.one_minus_PBOT));
3887  }
3888  qjunbot = (((model_.qprefbot)*(1-tmp))+((model_.qpref2bot)*(V1-vj)));
3889  id = ((model_.idsatbot)*idmult);
3890  if ((((model_.CSRHBOT_i)==0)&&((model_.CTATBOT_i)==0)))
3891  {
3892  isrh = 0;
3893  }
3894  else
3895  {
3896  vbi_minus_vjsrh = ((model_.vbibot)-vjsrh);
3897  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
3898  if (((model_.PBOT_i)==0.5))
3899  {
3900  dwsrh = 0;
3901  }
3902  else
3903  {
3904  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PBOT_i))));
3905  }
3906  wsrh = (wsrhstep+dwsrh);
3907  if (((model_.PBOT_i)==0.5))
3908  {
3909  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRBOTinv)));
3910  }
3911  else
3912  {
3913  tmp = pow((vbi_minus_vjsrh*(model_.VBIRBOTinv)),(model_.PBOT_i));
3914  }
3915  wdep = ((model_.wdepnulrbot)*tmp);
3916  asrh = ((model_.ftdbot)*((zinv-1)*wdep));
3917  isrh = ((model_.CSRHBOT_i)*(asrh*wsrh));
3918  }
3919  if (((model_.CTATBOT_i)==0))
3920  {
3921  itat = 0;
3922  }
3923  else
3924  {
3925  btat = ((model_.btatpartbot)*((wdep*(model_.one_minus_PBOT))/vbi_minus_vjsrh));
3926  twoatatoverthreebtat = ((0.666666666666667*(model_.atatbot))/btat);
3927  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
3928  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
3929  sqrtumax = sqrt(fabs(umax));
3930  umaxpoweronepointfive = (umax*sqrtumax);
3931  if ((((-(model_.PBOT_i))*(model_.one_over_one_minus_PBOT))==(-1)))
3932  {
3933  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
3934  }
3935  else
3936  {
3937  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PBOT_i))*(model_.one_over_one_minus_PBOT)));
3938  }
3939  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
3940  ktat = sqrt((0.375*(btat/sqrtumax)));
3941  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
3942  mtat = (((((model_.atatbot)*twoatatoverthreebtat)*sqrtumax)-((model_.atatbot)*umax))+(0.5*(btat*umaxpoweronepointfive)));
3943  xerfc = ((ltat-1)*ktat);
3944  ysq = (xerfc*xerfc);
3945  if ((xerfc>0))
3946  {
3947  terfc = (1/(1+((model_.perfc)*xerfc)));
3948  }
3949  else
3950  {
3951  terfc = (1/(1-((model_.perfc)*xerfc)));
3952  }
3953  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
3954  {
3955  tmp = exp(((-ysq)+mtat));
3956  }
3957  else
3958  {
3959  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
3960  }
3961  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
3962  if ((xerfc>0))
3963  {
3964  erfctimesexpmtat = erfcpos;
3965  }
3966  else
3967  {
3968  if ((mtat>(-2.3025850929940458e+02)))
3969  {
3970  tmp = exp(mtat);
3971  }
3972  else
3973  {
3974  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
3975  }
3976  erfctimesexpmtat = ((2*tmp)-erfcpos);
3977  }
3978  gammamax = ((1.77245385090551603*0.5)*(((model_.atatbot)*erfctimesexpmtat)/ktat));
3979  itat = ((model_.CTATBOT_i)*((asrh*gammamax)*wtat));
3980  }
3981  if (((model_.CBBTBOT_i)==0))
3982  {
3983  ibbt = 0;
3984  }
3985  else
3986  {
3987  if (((model_.PBOT_i)==0.5))
3988  {
3989  tmp = sqrt((((model_.VBIRBOT_i)-vbbt)*(model_.VBIRBOTinv)));
3990  }
3991  else
3992  {
3993  tmp = pow((((model_.VBIRBOT_i)-vbbt)*(model_.VBIRBOTinv)),(model_.PBOT_i));
3994  }
3995  Fmaxr = ((model_.one_over_one_minus_PBOT)*((((model_.VBIRBOT_i)-vbbt)*(model_.wdepnulrinvbot))/tmp));
3996  if ((fabs(((-(model_.fbbtbot))/Fmaxr))<2.3025850929940458e+02))
3997  {
3998  tmp = exp(((-(model_.fbbtbot))/Fmaxr));
3999  }
4000  else
4001  {
4002  if ((((-(model_.fbbtbot))/Fmaxr)<(-2.3025850929940458e+02)))
4003  {
4004  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*3.3333333333333333e-01))))))));
4005  }
4006  else
4007  {
4008  tmp = (1.0e100*(1.0+((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
4009  }
4010  }
4011  ibbt = ((model_.CBBTBOT_i)*(((V1*Fmaxr)*Fmaxr)*tmp));
4012  }
4013  if (((model_.VBRBOT_i)>1000))
4014  {
4015  fbreakdown = 1;
4016  }
4017  else
4018  {
4019  if ((vav>((-0.999)*(model_.VBRBOT_i))))
4020  {
4021  if (((model_.PBRBOT_i)==4))
4022  {
4023  tmp = (((fabs((vav*(model_.VBRinvbot)))*fabs((vav*(model_.VBRinvbot))))*fabs((vav*(model_.VBRinvbot))))*fabs((vav*(model_.VBRinvbot))));
4024  }
4025  else
4026  {
4027  tmp = pow(fabs((vav*(model_.VBRinvbot))),(model_.PBRBOT_i));
4028  }
4029  fbreakdown = (1/(1-tmp));
4030  }
4031  else
4032  {
4033  fbreakdown = ((model_.fstopbot)+((vav+(0.999*(model_.VBRBOT_i)))*(model_.slopebot)));
4034  }
4035  }
4036  ijunbot = ((((id+isrh)+itat)+ibbt)*fbreakdown);
4037  }
4038  if ((LSSOURCE_i==0))
4039  {
4040  ijunsti = 0;
4041  qjunsti = 0;
4042  }
4043  else
4044  {
4045  if (((model_.one_minus_PSTI)==0.5))
4046  {
4047  tmp = sqrt((1-(vj*(model_.vbiinvsti))));
4048  }
4049  else
4050  {
4051  tmp = pow((1-(vj*(model_.vbiinvsti))),(model_.one_minus_PSTI));
4052  }
4053  qjunsti = (((model_.qprefsti)*(1-tmp))+((model_.qpref2sti)*(V1-vj)));
4054  id = ((model_.idsatsti)*idmult);
4055  if ((((model_.CSRHSTI_i)==0)&&((model_.CTATSTI_i)==0)))
4056  {
4057  isrh = 0;
4058  }
4059  else
4060  {
4061  vbi_minus_vjsrh = ((model_.vbisti)-vjsrh);
4062  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
4063  if (((model_.PSTI_i)==0.5))
4064  {
4065  dwsrh = 0;
4066  }
4067  else
4068  {
4069  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PSTI_i))));
4070  }
4071  wsrh = (wsrhstep+dwsrh);
4072  if (((model_.PSTI_i)==0.5))
4073  {
4074  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRSTIinv)));
4075  }
4076  else
4077  {
4078  tmp = pow((vbi_minus_vjsrh*(model_.VBIRSTIinv)),(model_.PSTI_i));
4079  }
4080  wdep = ((model_.wdepnulrsti)*tmp);
4081  asrh = ((model_.ftdsti)*((zinv-1)*wdep));
4082  isrh = ((model_.CSRHSTI_i)*(asrh*wsrh));
4083  }
4084  if (((model_.CTATSTI_i)==0))
4085  {
4086  itat = 0;
4087  }
4088  else
4089  {
4090  btat = ((model_.btatpartsti)*((wdep*(model_.one_minus_PSTI))/vbi_minus_vjsrh));
4091  twoatatoverthreebtat = ((0.666666666666667*(model_.atatsti))/btat);
4092  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
4093  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
4094  sqrtumax = sqrt(fabs(umax));
4095  umaxpoweronepointfive = (umax*sqrtumax);
4096  if ((((-(model_.PSTI_i))*(model_.one_over_one_minus_PSTI))==(-1)))
4097  {
4098  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
4099  }
4100  else
4101  {
4102  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PSTI_i))*(model_.one_over_one_minus_PSTI)));
4103  }
4104  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
4105  ktat = sqrt((0.375*(btat/sqrtumax)));
4106  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
4107  mtat = (((((model_.atatsti)*twoatatoverthreebtat)*sqrtumax)-((model_.atatsti)*umax))+(0.5*(btat*umaxpoweronepointfive)));
4108  xerfc = ((ltat-1)*ktat);
4109  ysq = (xerfc*xerfc);
4110  if ((xerfc>0))
4111  {
4112  terfc = (1/(1+((model_.perfc)*xerfc)));
4113  }
4114  else
4115  {
4116  terfc = (1/(1-((model_.perfc)*xerfc)));
4117  }
4118  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
4119  {
4120  tmp = exp(((-ysq)+mtat));
4121  }
4122  else
4123  {
4124  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
4125  }
4126  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
4127  if ((xerfc>0))
4128  {
4129  erfctimesexpmtat = erfcpos;
4130  }
4131  else
4132  {
4133  if ((mtat>(-2.3025850929940458e+02)))
4134  {
4135  tmp = exp(mtat);
4136  }
4137  else
4138  {
4139  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
4140  }
4141  erfctimesexpmtat = ((2*tmp)-erfcpos);
4142  }
4143  gammamax = ((1.77245385090551603*0.5)*(((model_.atatsti)*erfctimesexpmtat)/ktat));
4144  itat = ((model_.CTATSTI_i)*((asrh*gammamax)*wtat));
4145  }
4146  if (((model_.CBBTSTI_i)==0))
4147  {
4148  ibbt = 0;
4149  }
4150  else
4151  {
4152  if (((model_.PSTI_i)==0.5))
4153  {
4154  tmp = sqrt((((model_.VBIRSTI_i)-vbbt)*(model_.VBIRSTIinv)));
4155  }
4156  else
4157  {
4158  tmp = pow((((model_.VBIRSTI_i)-vbbt)*(model_.VBIRSTIinv)),(model_.PSTI_i));
4159  }
4160  Fmaxr = ((model_.one_over_one_minus_PSTI)*((((model_.VBIRSTI_i)-vbbt)*(model_.wdepnulrinvsti))/tmp));
4161  if ((fabs(((-(model_.fbbtsti))/Fmaxr))<2.3025850929940458e+02))
4162  {
4163  tmp = exp(((-(model_.fbbtsti))/Fmaxr));
4164  }
4165  else
4166  {
4167  if ((((-(model_.fbbtsti))/Fmaxr)<(-2.3025850929940458e+02)))
4168  {
4169  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*3.3333333333333333e-01))))))));
4170  }
4171  else
4172  {
4173  tmp = (1.0e100*(1.0+((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
4174  }
4175  }
4176  ibbt = ((model_.CBBTSTI_i)*(((V1*Fmaxr)*Fmaxr)*tmp));
4177  }
4178  if (((model_.VBRSTI_i)>1000))
4179  {
4180  fbreakdown = 1;
4181  }
4182  else
4183  {
4184  if ((vav>((-0.999)*(model_.VBRSTI_i))))
4185  {
4186  if (((model_.PBRSTI_i)==4))
4187  {
4188  tmp = (((fabs((vav*(model_.VBRinvsti)))*fabs((vav*(model_.VBRinvsti))))*fabs((vav*(model_.VBRinvsti))))*fabs((vav*(model_.VBRinvsti))));
4189  }
4190  else
4191  {
4192  tmp = pow(fabs((vav*(model_.VBRinvsti))),(model_.PBRSTI_i));
4193  }
4194  fbreakdown = (1/(1-tmp));
4195  }
4196  else
4197  {
4198  fbreakdown = ((model_.fstopsti)+((vav+(0.999*(model_.VBRSTI_i)))*(model_.slopesti)));
4199  }
4200  }
4201  ijunsti = ((((id+isrh)+itat)+ibbt)*fbreakdown);
4202  }
4203  if ((LGSOURCE_i==0))
4204  {
4205  ijungat = 0;
4206  qjungat = 0;
4207  }
4208  else
4209  {
4210  if (((model_.one_minus_PGAT)==0.5))
4211  {
4212  tmp = sqrt((1-(vj*(model_.vbiinvgat))));
4213  }
4214  else
4215  {
4216  tmp = pow((1-(vj*(model_.vbiinvgat))),(model_.one_minus_PGAT));
4217  }
4218  qjungat = (((model_.qprefgat)*(1-tmp))+((model_.qpref2gat)*(V1-vj)));
4219  id = ((model_.idsatgat)*idmult);
4220  if ((((model_.CSRHGAT_i)==0)&&((model_.CTATGAT_i)==0)))
4221  {
4222  isrh = 0;
4223  }
4224  else
4225  {
4226  vbi_minus_vjsrh = ((model_.vbigat)-vjsrh);
4227  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
4228  if (((model_.PGAT_i)==0.5))
4229  {
4230  dwsrh = 0;
4231  }
4232  else
4233  {
4234  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PGAT_i))));
4235  }
4236  wsrh = (wsrhstep+dwsrh);
4237  if (((model_.PGAT_i)==0.5))
4238  {
4239  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRGATinv)));
4240  }
4241  else
4242  {
4243  tmp = pow((vbi_minus_vjsrh*(model_.VBIRGATinv)),(model_.PGAT_i));
4244  }
4245  wdep = ((model_.wdepnulrgat)*tmp);
4246  asrh = ((model_.ftdgat)*((zinv-1)*wdep));
4247  isrh = ((model_.CSRHGAT_i)*(asrh*wsrh));
4248  }
4249  if (((model_.CTATGAT_i)==0))
4250  {
4251  itat = 0;
4252  }
4253  else
4254  {
4255  btat = ((model_.btatpartgat)*((wdep*(model_.one_minus_PGAT))/vbi_minus_vjsrh));
4256  twoatatoverthreebtat = ((0.666666666666667*(model_.atatgat))/btat);
4257  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
4258  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
4259  sqrtumax = sqrt(fabs(umax));
4260  umaxpoweronepointfive = (umax*sqrtumax);
4261  if ((((-(model_.PGAT_i))*(model_.one_over_one_minus_PGAT))==(-1)))
4262  {
4263  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
4264  }
4265  else
4266  {
4267  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PGAT_i))*(model_.one_over_one_minus_PGAT)));
4268  }
4269  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
4270  ktat = sqrt((0.375*(btat/sqrtumax)));
4271  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
4272  mtat = (((((model_.atatgat)*twoatatoverthreebtat)*sqrtumax)-((model_.atatgat)*umax))+(0.5*(btat*umaxpoweronepointfive)));
4273  xerfc = ((ltat-1)*ktat);
4274  ysq = (xerfc*xerfc);
4275  if ((xerfc>0))
4276  {
4277  terfc = (1/(1+((model_.perfc)*xerfc)));
4278  }
4279  else
4280  {
4281  terfc = (1/(1-((model_.perfc)*xerfc)));
4282  }
4283  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
4284  {
4285  tmp = exp(((-ysq)+mtat));
4286  }
4287  else
4288  {
4289  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
4290  }
4291  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
4292  if ((xerfc>0))
4293  {
4294  erfctimesexpmtat = erfcpos;
4295  }
4296  else
4297  {
4298  if ((mtat>(-2.3025850929940458e+02)))
4299  {
4300  tmp = exp(mtat);
4301  }
4302  else
4303  {
4304  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
4305  }
4306  erfctimesexpmtat = ((2*tmp)-erfcpos);
4307  }
4308  gammamax = ((1.77245385090551603*0.5)*(((model_.atatgat)*erfctimesexpmtat)/ktat));
4309  itat = ((model_.CTATGAT_i)*((asrh*gammamax)*wtat));
4310  }
4311  if (((model_.CBBTGAT_i)==0))
4312  {
4313  ibbt = 0;
4314  }
4315  else
4316  {
4317  if (((model_.PGAT_i)==0.5))
4318  {
4319  tmp = sqrt((((model_.VBIRGAT_i)-vbbt)*(model_.VBIRGATinv)));
4320  }
4321  else
4322  {
4323  tmp = pow((((model_.VBIRGAT_i)-vbbt)*(model_.VBIRGATinv)),(model_.PGAT_i));
4324  }
4325  Fmaxr = ((model_.one_over_one_minus_PGAT)*((((model_.VBIRGAT_i)-vbbt)*(model_.wdepnulrinvgat))/tmp));
4326  if ((fabs(((-(model_.fbbtgat))/Fmaxr))<2.3025850929940458e+02))
4327  {
4328  tmp = exp(((-(model_.fbbtgat))/Fmaxr));
4329  }
4330  else
4331  {
4332  if ((((-(model_.fbbtgat))/Fmaxr)<(-2.3025850929940458e+02)))
4333  {
4334  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*3.3333333333333333e-01))))))));
4335  }
4336  else
4337  {
4338  tmp = (1.0e100*(1.0+((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
4339  }
4340  }
4341  ibbt = ((model_.CBBTGAT_i)*(((V1*Fmaxr)*Fmaxr)*tmp));
4342  }
4343  if (((model_.VBRGAT_i)>1000))
4344  {
4345  fbreakdown = 1;
4346  }
4347  else
4348  {
4349  if ((vav>((-0.999)*(model_.VBRGAT_i))))
4350  {
4351  if (((model_.PBRGAT_i)==4))
4352  {
4353  tmp = (((fabs((vav*(model_.VBRinvgat)))*fabs((vav*(model_.VBRinvgat))))*fabs((vav*(model_.VBRinvgat))))*fabs((vav*(model_.VBRinvgat))));
4354  }
4355  else
4356  {
4357  tmp = pow(fabs((vav*(model_.VBRinvgat))),(model_.PBRGAT_i));
4358  }
4359  fbreakdown = (1/(1-tmp));
4360  }
4361  else
4362  {
4363  fbreakdown = ((model_.fstopgat)+((vav+(0.999*(model_.VBRGAT_i)))*(model_.slopegat)));
4364  }
4365  }
4366  ijungat = ((((id+isrh)+itat)+ibbt)*fbreakdown);
4367  }
4368  I1 = (((ABSOURCE_i*ijunbot)+(LSSOURCE_i*ijunsti))+(LGSOURCE_i*ijungat));
4369  vbbt = 0.0;
4370  two_psistar = 0.0;
4371  if ((!(((ABSOURCE_i==0)&&(LSSOURCE_i==0))&&(LGSOURCE_i==0))))
4372  {
4373  h1 = ((4.0*vch_s)*vch_s);
4374  h2 = (vch_s/vfmin_s);
4375  h2d = (V2+(vch_s*h2));
4376  h3 = (vfmin_s+h2d);
4377  h4 = (vfmin_s-h2d);
4378  h5 = sqrt(((h4*h4)+h1));
4379  vj = (2.0*((V2*vfmin_s)/(h3+h5)));
4380  if ((V2<VMAX_s))
4381  {
4382  if ((fabs((0.5*(V2*(model_.phitdinv))))<2.3025850929940458e+02))
4383  {
4384  zinv = exp((0.5*(V2*(model_.phitdinv))));
4385  }
4386  else
4387  {
4388  if (((0.5*(V2*(model_.phitdinv)))<(-2.3025850929940458e+02)))
4389  {
4390  zinv = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-(0.5*(V2*(model_.phitdinv))))*(1.0+(0.5*(((-2.3025850929940458e+02)-(0.5*(V2*(model_.phitdinv))))*(1.0+(((-2.3025850929940458e+02)-(0.5*(V2*(model_.phitdinv))))*3.3333333333333333e-01))))))));
4391  }
4392  else
4393  {
4394  zinv = (1.0e100*(1.0+(((0.5*(V2*(model_.phitdinv)))-2.3025850929940458e+02)*(1.0+(0.5*(((0.5*(V2*(model_.phitdinv)))-2.3025850929940458e+02)*(1.0+(((0.5*(V2*(model_.phitdinv)))-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
4395  }
4396  }
4397  idmult = (zinv*zinv);
4398  }
4399  else
4400  {
4401  idmult = ((1+((V2-VMAX_s)*(model_.phitdinv)))*exp_VMAX_over_phitd_s);
4402  zinv = sqrt(idmult);
4403  }
4404  idmult = (idmult-1.0);
4405  z = (1/zinv);
4406  if ((V2>0))
4407  {
4408  two_psistar = (2.0*((model_.phitd)*log(((2.0+z)+sqrt(((z+1.0)*(z+3.0)))))));
4409  }
4410  else
4411  {
4412  two_psistar = ((-V2)+(2.0*((model_.phitd)*log((((2*zinv)+1)+sqrt(((1+zinv)*(1+(3*zinv)))))))));
4413  }
4414  vjlim = (vbimin_s-two_psistar);
4415  vjsrh = (0.5*((V2+vjlim)-sqrt((((V2-vjlim)*(V2-vjlim))+((4*(model_.phitd))*(model_.phitd))))));
4416  vbbt = (0.5*((V2+vbbtlim_s)-sqrt((((V2-vbbtlim_s)*(V2-vbbtlim_s))+((4*(model_.phitr))*(model_.phitr))))));
4417  vav = (0.5*((V2)-sqrt((((V2)*(V2))+((4*1E-6)*1E-6)))));
4418  }
4419  if ((ABSOURCE_i==0))
4420  {
4421  ijunbot = 0;
4422  qjunbot = 0;
4423  }
4424  else
4425  {
4426  if (((model_.one_minus_PBOT)==0.5))
4427  {
4428  tmp = sqrt((1-(vj*(model_.vbiinvbot))));
4429  }
4430  else
4431  {
4432  tmp = pow((1-(vj*(model_.vbiinvbot))),(model_.one_minus_PBOT));
4433  }
4434  qjunbot = (((model_.qprefbot)*(1-tmp))+((model_.qpref2bot)*(V2-vj)));
4435  id = ((model_.idsatbot)*idmult);
4436  if ((((model_.CSRHBOT_i)==0)&&((model_.CTATBOT_i)==0)))
4437  {
4438  isrh = 0;
4439  }
4440  else
4441  {
4442  vbi_minus_vjsrh = ((model_.vbibot)-vjsrh);
4443  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
4444  if (((model_.PBOT_i)==0.5))
4445  {
4446  dwsrh = 0;
4447  }
4448  else
4449  {
4450  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PBOT_i))));
4451  }
4452  wsrh = (wsrhstep+dwsrh);
4453  if (((model_.PBOT_i)==0.5))
4454  {
4455  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRBOTinv)));
4456  }
4457  else
4458  {
4459  tmp = pow((vbi_minus_vjsrh*(model_.VBIRBOTinv)),(model_.PBOT_i));
4460  }
4461  wdep = ((model_.wdepnulrbot)*tmp);
4462  asrh = ((model_.ftdbot)*((zinv-1)*wdep));
4463  isrh = ((model_.CSRHBOT_i)*(asrh*wsrh));
4464  }
4465  if (((model_.CTATBOT_i)==0))
4466  {
4467  itat = 0;
4468  }
4469  else
4470  {
4471  btat = ((model_.btatpartbot)*((wdep*(model_.one_minus_PBOT))/vbi_minus_vjsrh));
4472  twoatatoverthreebtat = ((0.666666666666667*(model_.atatbot))/btat);
4473  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
4474  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
4475  sqrtumax = sqrt(fabs(umax));
4476  umaxpoweronepointfive = (umax*sqrtumax);
4477  if ((((-(model_.PBOT_i))*(model_.one_over_one_minus_PBOT))==(-1)))
4478  {
4479  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
4480  }
4481  else
4482  {
4483  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PBOT_i))*(model_.one_over_one_minus_PBOT)));
4484  }
4485  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
4486  ktat = sqrt((0.375*(btat/sqrtumax)));
4487  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
4488  mtat = (((((model_.atatbot)*twoatatoverthreebtat)*sqrtumax)-((model_.atatbot)*umax))+(0.5*(btat*umaxpoweronepointfive)));
4489  xerfc = ((ltat-1)*ktat);
4490  ysq = (xerfc*xerfc);
4491  if ((xerfc>0))
4492  {
4493  terfc = (1/(1+((model_.perfc)*xerfc)));
4494  }
4495  else
4496  {
4497  terfc = (1/(1-((model_.perfc)*xerfc)));
4498  }
4499  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
4500  {
4501  tmp = exp(((-ysq)+mtat));
4502  }
4503  else
4504  {
4505  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
4506  }
4507  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
4508  if ((xerfc>0))
4509  {
4510  erfctimesexpmtat = erfcpos;
4511  }
4512  else
4513  {
4514  if ((mtat>(-2.3025850929940458e+02)))
4515  {
4516  tmp = exp(mtat);
4517  }
4518  else
4519  {
4520  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
4521  }
4522  erfctimesexpmtat = ((2*tmp)-erfcpos);
4523  }
4524  gammamax = ((1.77245385090551603*0.5)*(((model_.atatbot)*erfctimesexpmtat)/ktat));
4525  itat = ((model_.CTATBOT_i)*((asrh*gammamax)*wtat));
4526  }
4527  if (((model_.CBBTBOT_i)==0))
4528  {
4529  ibbt = 0;
4530  }
4531  else
4532  {
4533  if (((model_.PBOT_i)==0.5))
4534  {
4535  tmp = sqrt((((model_.VBIRBOT_i)-vbbt)*(model_.VBIRBOTinv)));
4536  }
4537  else
4538  {
4539  tmp = pow((((model_.VBIRBOT_i)-vbbt)*(model_.VBIRBOTinv)),(model_.PBOT_i));
4540  }
4541  Fmaxr = ((model_.one_over_one_minus_PBOT)*((((model_.VBIRBOT_i)-vbbt)*(model_.wdepnulrinvbot))/tmp));
4542  if ((fabs(((-(model_.fbbtbot))/Fmaxr))<2.3025850929940458e+02))
4543  {
4544  tmp = exp(((-(model_.fbbtbot))/Fmaxr));
4545  }
4546  else
4547  {
4548  if ((((-(model_.fbbtbot))/Fmaxr)<(-2.3025850929940458e+02)))
4549  {
4550  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*3.3333333333333333e-01))))))));
4551  }
4552  else
4553  {
4554  tmp = (1.0e100*(1.0+((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
4555  }
4556  }
4557  ibbt = ((model_.CBBTBOT_i)*(((V2*Fmaxr)*Fmaxr)*tmp));
4558  }
4559  if (((model_.VBRBOT_i)>1000))
4560  {
4561  fbreakdown = 1;
4562  }
4563  else
4564  {
4565  if ((vav>((-0.999)*(model_.VBRBOT_i))))
4566  {
4567  if (((model_.PBRBOT_i)==4))
4568  {
4569  tmp = (((fabs((vav*(model_.VBRinvbot)))*fabs((vav*(model_.VBRinvbot))))*fabs((vav*(model_.VBRinvbot))))*fabs((vav*(model_.VBRinvbot))));
4570  }
4571  else
4572  {
4573  tmp = pow(fabs((vav*(model_.VBRinvbot))),(model_.PBRBOT_i));
4574  }
4575  fbreakdown = (1/(1-tmp));
4576  }
4577  else
4578  {
4579  fbreakdown = ((model_.fstopbot)+((vav+(0.999*(model_.VBRBOT_i)))*(model_.slopebot)));
4580  }
4581  }
4582  ijunbot = ((((id+isrh)+itat)+ibbt)*fbreakdown);
4583  }
4584  if ((LSSOURCE_i==0))
4585  {
4586  ijunsti = 0;
4587  qjunsti = 0;
4588  }
4589  else
4590  {
4591  if (((model_.one_minus_PSTI)==0.5))
4592  {
4593  tmp = sqrt((1-(vj*(model_.vbiinvsti))));
4594  }
4595  else
4596  {
4597  tmp = pow((1-(vj*(model_.vbiinvsti))),(model_.one_minus_PSTI));
4598  }
4599  qjunsti = (((model_.qprefsti)*(1-tmp))+((model_.qpref2sti)*(V2-vj)));
4600  id = ((model_.idsatsti)*idmult);
4601  if ((((model_.CSRHSTI_i)==0)&&((model_.CTATSTI_i)==0)))
4602  {
4603  isrh = 0;
4604  }
4605  else
4606  {
4607  vbi_minus_vjsrh = ((model_.vbisti)-vjsrh);
4608  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
4609  if (((model_.PSTI_i)==0.5))
4610  {
4611  dwsrh = 0;
4612  }
4613  else
4614  {
4615  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PSTI_i))));
4616  }
4617  wsrh = (wsrhstep+dwsrh);
4618  if (((model_.PSTI_i)==0.5))
4619  {
4620  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRSTIinv)));
4621  }
4622  else
4623  {
4624  tmp = pow((vbi_minus_vjsrh*(model_.VBIRSTIinv)),(model_.PSTI_i));
4625  }
4626  wdep = ((model_.wdepnulrsti)*tmp);
4627  asrh = ((model_.ftdsti)*((zinv-1)*wdep));
4628  isrh = ((model_.CSRHSTI_i)*(asrh*wsrh));
4629  }
4630  if (((model_.CTATSTI_i)==0))
4631  {
4632  itat = 0;
4633  }
4634  else
4635  {
4636  btat = ((model_.btatpartsti)*((wdep*(model_.one_minus_PSTI))/vbi_minus_vjsrh));
4637  twoatatoverthreebtat = ((0.666666666666667*(model_.atatsti))/btat);
4638  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
4639  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
4640  sqrtumax = sqrt(fabs(umax));
4641  umaxpoweronepointfive = (umax*sqrtumax);
4642  if ((((-(model_.PSTI_i))*(model_.one_over_one_minus_PSTI))==(-1)))
4643  {
4644  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
4645  }
4646  else
4647  {
4648  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PSTI_i))*(model_.one_over_one_minus_PSTI)));
4649  }
4650  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
4651  ktat = sqrt((0.375*(btat/sqrtumax)));
4652  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
4653  mtat = (((((model_.atatsti)*twoatatoverthreebtat)*sqrtumax)-((model_.atatsti)*umax))+(0.5*(btat*umaxpoweronepointfive)));
4654  xerfc = ((ltat-1)*ktat);
4655  ysq = (xerfc*xerfc);
4656  if ((xerfc>0))
4657  {
4658  terfc = (1/(1+((model_.perfc)*xerfc)));
4659  }
4660  else
4661  {
4662  terfc = (1/(1-((model_.perfc)*xerfc)));
4663  }
4664  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
4665  {
4666  tmp = exp(((-ysq)+mtat));
4667  }
4668  else
4669  {
4670  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
4671  }
4672  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
4673  if ((xerfc>0))
4674  {
4675  erfctimesexpmtat = erfcpos;
4676  }
4677  else
4678  {
4679  if ((mtat>(-2.3025850929940458e+02)))
4680  {
4681  tmp = exp(mtat);
4682  }
4683  else
4684  {
4685  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
4686  }
4687  erfctimesexpmtat = ((2*tmp)-erfcpos);
4688  }
4689  gammamax = ((1.77245385090551603*0.5)*(((model_.atatsti)*erfctimesexpmtat)/ktat));
4690  itat = ((model_.CTATSTI_i)*((asrh*gammamax)*wtat));
4691  }
4692  if (((model_.CBBTSTI_i)==0))
4693  {
4694  ibbt = 0;
4695  }
4696  else
4697  {
4698  if (((model_.PSTI_i)==0.5))
4699  {
4700  tmp = sqrt((((model_.VBIRSTI_i)-vbbt)*(model_.VBIRSTIinv)));
4701  }
4702  else
4703  {
4704  tmp = pow((((model_.VBIRSTI_i)-vbbt)*(model_.VBIRSTIinv)),(model_.PSTI_i));
4705  }
4706  Fmaxr = ((model_.one_over_one_minus_PSTI)*((((model_.VBIRSTI_i)-vbbt)*(model_.wdepnulrinvsti))/tmp));
4707  if ((fabs(((-(model_.fbbtsti))/Fmaxr))<2.3025850929940458e+02))
4708  {
4709  tmp = exp(((-(model_.fbbtsti))/Fmaxr));
4710  }
4711  else
4712  {
4713  if ((((-(model_.fbbtsti))/Fmaxr)<(-2.3025850929940458e+02)))
4714  {
4715  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*3.3333333333333333e-01))))))));
4716  }
4717  else
4718  {
4719  tmp = (1.0e100*(1.0+((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
4720  }
4721  }
4722  ibbt = ((model_.CBBTSTI_i)*(((V2*Fmaxr)*Fmaxr)*tmp));
4723  }
4724  if (((model_.VBRSTI_i)>1000))
4725  {
4726  fbreakdown = 1;
4727  }
4728  else
4729  {
4730  if ((vav>((-0.999)*(model_.VBRSTI_i))))
4731  {
4732  if (((model_.PBRSTI_i)==4))
4733  {
4734  tmp = (((fabs((vav*(model_.VBRinvsti)))*fabs((vav*(model_.VBRinvsti))))*fabs((vav*(model_.VBRinvsti))))*fabs((vav*(model_.VBRinvsti))));
4735  }
4736  else
4737  {
4738  tmp = pow(fabs((vav*(model_.VBRinvsti))),(model_.PBRSTI_i));
4739  }
4740  fbreakdown = (1/(1-tmp));
4741  }
4742  else
4743  {
4744  fbreakdown = ((model_.fstopsti)+((vav+(0.999*(model_.VBRSTI_i)))*(model_.slopesti)));
4745  }
4746  }
4747  ijunsti = ((((id+isrh)+itat)+ibbt)*fbreakdown);
4748  }
4749  if ((LGSOURCE_i==0))
4750  {
4751  ijungat = 0;
4752  qjungat = 0;
4753  }
4754  else
4755  {
4756  if (((model_.one_minus_PGAT)==0.5))
4757  {
4758  tmp = sqrt((1-(vj*(model_.vbiinvgat))));
4759  }
4760  else
4761  {
4762  tmp = pow((1-(vj*(model_.vbiinvgat))),(model_.one_minus_PGAT));
4763  }
4764  qjungat = (((model_.qprefgat)*(1-tmp))+((model_.qpref2gat)*(V2-vj)));
4765  id = ((model_.idsatgat)*idmult);
4766  if ((((model_.CSRHGAT_i)==0)&&((model_.CTATGAT_i)==0)))
4767  {
4768  isrh = 0;
4769  }
4770  else
4771  {
4772  vbi_minus_vjsrh = ((model_.vbigat)-vjsrh);
4773  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
4774  if (((model_.PGAT_i)==0.5))
4775  {
4776  dwsrh = 0;
4777  }
4778  else
4779  {
4780  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PGAT_i))));
4781  }
4782  wsrh = (wsrhstep+dwsrh);
4783  if (((model_.PGAT_i)==0.5))
4784  {
4785  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRGATinv)));
4786  }
4787  else
4788  {
4789  tmp = pow((vbi_minus_vjsrh*(model_.VBIRGATinv)),(model_.PGAT_i));
4790  }
4791  wdep = ((model_.wdepnulrgat)*tmp);
4792  asrh = ((model_.ftdgat)*((zinv-1)*wdep));
4793  isrh = ((model_.CSRHGAT_i)*(asrh*wsrh));
4794  }
4795  if (((model_.CTATGAT_i)==0))
4796  {
4797  itat = 0;
4798  }
4799  else
4800  {
4801  btat = ((model_.btatpartgat)*((wdep*(model_.one_minus_PGAT))/vbi_minus_vjsrh));
4802  twoatatoverthreebtat = ((0.666666666666667*(model_.atatgat))/btat);
4803  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
4804  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
4805  sqrtumax = sqrt(fabs(umax));
4806  umaxpoweronepointfive = (umax*sqrtumax);
4807  if ((((-(model_.PGAT_i))*(model_.one_over_one_minus_PGAT))==(-1)))
4808  {
4809  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
4810  }
4811  else
4812  {
4813  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PGAT_i))*(model_.one_over_one_minus_PGAT)));
4814  }
4815  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
4816  ktat = sqrt((0.375*(btat/sqrtumax)));
4817  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
4818  mtat = (((((model_.atatgat)*twoatatoverthreebtat)*sqrtumax)-((model_.atatgat)*umax))+(0.5*(btat*umaxpoweronepointfive)));
4819  xerfc = ((ltat-1)*ktat);
4820  ysq = (xerfc*xerfc);
4821  if ((xerfc>0))
4822  {
4823  terfc = (1/(1+((model_.perfc)*xerfc)));
4824  }
4825  else
4826  {
4827  terfc = (1/(1-((model_.perfc)*xerfc)));
4828  }
4829  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
4830  {
4831  tmp = exp(((-ysq)+mtat));
4832  }
4833  else
4834  {
4835  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
4836  }
4837  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
4838  if ((xerfc>0))
4839  {
4840  erfctimesexpmtat = erfcpos;
4841  }
4842  else
4843  {
4844  if ((mtat>(-2.3025850929940458e+02)))
4845  {
4846  tmp = exp(mtat);
4847  }
4848  else
4849  {
4850  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
4851  }
4852  erfctimesexpmtat = ((2*tmp)-erfcpos);
4853  }
4854  gammamax = ((1.77245385090551603*0.5)*(((model_.atatgat)*erfctimesexpmtat)/ktat));
4855  itat = ((model_.CTATGAT_i)*((asrh*gammamax)*wtat));
4856  }
4857  if (((model_.CBBTGAT_i)==0))
4858  {
4859  ibbt = 0;
4860  }
4861  else
4862  {
4863  if (((model_.PGAT_i)==0.5))
4864  {
4865  tmp = sqrt((((model_.VBIRGAT_i)-vbbt)*(model_.VBIRGATinv)));
4866  }
4867  else
4868  {
4869  tmp = pow((((model_.VBIRGAT_i)-vbbt)*(model_.VBIRGATinv)),(model_.PGAT_i));
4870  }
4871  Fmaxr = ((model_.one_over_one_minus_PGAT)*((((model_.VBIRGAT_i)-vbbt)*(model_.wdepnulrinvgat))/tmp));
4872  if ((fabs(((-(model_.fbbtgat))/Fmaxr))<2.3025850929940458e+02))
4873  {
4874  tmp = exp(((-(model_.fbbtgat))/Fmaxr));
4875  }
4876  else
4877  {
4878  if ((((-(model_.fbbtgat))/Fmaxr)<(-2.3025850929940458e+02)))
4879  {
4880  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*3.3333333333333333e-01))))))));
4881  }
4882  else
4883  {
4884  tmp = (1.0e100*(1.0+((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
4885  }
4886  }
4887  ibbt = ((model_.CBBTGAT_i)*(((V2*Fmaxr)*Fmaxr)*tmp));
4888  }
4889  if (((model_.VBRGAT_i)>1000))
4890  {
4891  fbreakdown = 1;
4892  }
4893  else
4894  {
4895  if ((vav>((-0.999)*(model_.VBRGAT_i))))
4896  {
4897  if (((model_.PBRGAT_i)==4))
4898  {
4899  tmp = (((fabs((vav*(model_.VBRinvgat)))*fabs((vav*(model_.VBRinvgat))))*fabs((vav*(model_.VBRinvgat))))*fabs((vav*(model_.VBRinvgat))));
4900  }
4901  else
4902  {
4903  tmp = pow(fabs((vav*(model_.VBRinvgat))),(model_.PBRGAT_i));
4904  }
4905  fbreakdown = (1/(1-tmp));
4906  }
4907  else
4908  {
4909  fbreakdown = ((model_.fstopgat)+((vav+(0.999*(model_.VBRGAT_i)))*(model_.slopegat)));
4910  }
4911  }
4912  ijungat = ((((id+isrh)+itat)+ibbt)*fbreakdown);
4913  }
4914  I2 = (((ABSOURCE_i*ijunbot)+(LSSOURCE_i*ijunsti))+(LGSOURCE_i*ijungat));
4915  vbbt = 0.0;
4916  two_psistar = 0.0;
4917  if ((!(((ABSOURCE_i==0)&&(LSSOURCE_i==0))&&(LGSOURCE_i==0))))
4918  {
4919  h1 = ((4.0*vch_s)*vch_s);
4920  h2 = (vch_s/vfmin_s);
4921  h2d = (V3+(vch_s*h2));
4922  h3 = (vfmin_s+h2d);
4923  h4 = (vfmin_s-h2d);
4924  h5 = sqrt(((h4*h4)+h1));
4925  vj = (2.0*((V3*vfmin_s)/(h3+h5)));
4926  if ((V3<VMAX_s))
4927  {
4928  if ((fabs((0.5*(V3*(model_.phitdinv))))<2.3025850929940458e+02))
4929  {
4930  zinv = exp((0.5*(V3*(model_.phitdinv))));
4931  }
4932  else
4933  {
4934  if (((0.5*(V3*(model_.phitdinv)))<(-2.3025850929940458e+02)))
4935  {
4936  zinv = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-(0.5*(V3*(model_.phitdinv))))*(1.0+(0.5*(((-2.3025850929940458e+02)-(0.5*(V3*(model_.phitdinv))))*(1.0+(((-2.3025850929940458e+02)-(0.5*(V3*(model_.phitdinv))))*3.3333333333333333e-01))))))));
4937  }
4938  else
4939  {
4940  zinv = (1.0e100*(1.0+(((0.5*(V3*(model_.phitdinv)))-2.3025850929940458e+02)*(1.0+(0.5*(((0.5*(V3*(model_.phitdinv)))-2.3025850929940458e+02)*(1.0+(((0.5*(V3*(model_.phitdinv)))-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
4941  }
4942  }
4943  idmult = (zinv*zinv);
4944  }
4945  else
4946  {
4947  idmult = ((1+((V3-VMAX_s)*(model_.phitdinv)))*exp_VMAX_over_phitd_s);
4948  zinv = sqrt(idmult);
4949  }
4950  idmult = (idmult-1.0);
4951  z = (1/zinv);
4952  if ((V3>0))
4953  {
4954  two_psistar = (2.0*((model_.phitd)*log(((2.0+z)+sqrt(((z+1.0)*(z+3.0)))))));
4955  }
4956  else
4957  {
4958  two_psistar = ((-V3)+(2.0*((model_.phitd)*log((((2*zinv)+1)+sqrt(((1+zinv)*(1+(3*zinv)))))))));
4959  }
4960  vjlim = (vbimin_s-two_psistar);
4961  vjsrh = (0.5*((V3+vjlim)-sqrt((((V3-vjlim)*(V3-vjlim))+((4*(model_.phitd))*(model_.phitd))))));
4962  vbbt = (0.5*((V3+vbbtlim_s)-sqrt((((V3-vbbtlim_s)*(V3-vbbtlim_s))+((4*(model_.phitr))*(model_.phitr))))));
4963  vav = (0.5*((V3)-sqrt((((V3)*(V3))+((4*1E-6)*1E-6)))));
4964  }
4965  if ((ABSOURCE_i==0))
4966  {
4967  ijunbot = 0;
4968  qjunbot = 0;
4969  }
4970  else
4971  {
4972  if (((model_.one_minus_PBOT)==0.5))
4973  {
4974  tmp = sqrt((1-(vj*(model_.vbiinvbot))));
4975  }
4976  else
4977  {
4978  tmp = pow((1-(vj*(model_.vbiinvbot))),(model_.one_minus_PBOT));
4979  }
4980  qjunbot = (((model_.qprefbot)*(1-tmp))+((model_.qpref2bot)*(V3-vj)));
4981  id = ((model_.idsatbot)*idmult);
4982  if ((((model_.CSRHBOT_i)==0)&&((model_.CTATBOT_i)==0)))
4983  {
4984  isrh = 0;
4985  }
4986  else
4987  {
4988  vbi_minus_vjsrh = ((model_.vbibot)-vjsrh);
4989  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
4990  if (((model_.PBOT_i)==0.5))
4991  {
4992  dwsrh = 0;
4993  }
4994  else
4995  {
4996  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PBOT_i))));
4997  }
4998  wsrh = (wsrhstep+dwsrh);
4999  if (((model_.PBOT_i)==0.5))
5000  {
5001  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRBOTinv)));
5002  }
5003  else
5004  {
5005  tmp = pow((vbi_minus_vjsrh*(model_.VBIRBOTinv)),(model_.PBOT_i));
5006  }
5007  wdep = ((model_.wdepnulrbot)*tmp);
5008  asrh = ((model_.ftdbot)*((zinv-1)*wdep));
5009  isrh = ((model_.CSRHBOT_i)*(asrh*wsrh));
5010  }
5011  if (((model_.CTATBOT_i)==0))
5012  {
5013  itat = 0;
5014  }
5015  else
5016  {
5017  btat = ((model_.btatpartbot)*((wdep*(model_.one_minus_PBOT))/vbi_minus_vjsrh));
5018  twoatatoverthreebtat = ((0.666666666666667*(model_.atatbot))/btat);
5019  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
5020  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
5021  sqrtumax = sqrt(fabs(umax));
5022  umaxpoweronepointfive = (umax*sqrtumax);
5023  if ((((-(model_.PBOT_i))*(model_.one_over_one_minus_PBOT))==(-1)))
5024  {
5025  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
5026  }
5027  else
5028  {
5029  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PBOT_i))*(model_.one_over_one_minus_PBOT)));
5030  }
5031  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
5032  ktat = sqrt((0.375*(btat/sqrtumax)));
5033  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
5034  mtat = (((((model_.atatbot)*twoatatoverthreebtat)*sqrtumax)-((model_.atatbot)*umax))+(0.5*(btat*umaxpoweronepointfive)));
5035  xerfc = ((ltat-1)*ktat);
5036  ysq = (xerfc*xerfc);
5037  if ((xerfc>0))
5038  {
5039  terfc = (1/(1+((model_.perfc)*xerfc)));
5040  }
5041  else
5042  {
5043  terfc = (1/(1-((model_.perfc)*xerfc)));
5044  }
5045  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
5046  {
5047  tmp = exp(((-ysq)+mtat));
5048  }
5049  else
5050  {
5051  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
5052  }
5053  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
5054  if ((xerfc>0))
5055  {
5056  erfctimesexpmtat = erfcpos;
5057  }
5058  else
5059  {
5060  if ((mtat>(-2.3025850929940458e+02)))
5061  {
5062  tmp = exp(mtat);
5063  }
5064  else
5065  {
5066  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
5067  }
5068  erfctimesexpmtat = ((2*tmp)-erfcpos);
5069  }
5070  gammamax = ((1.77245385090551603*0.5)*(((model_.atatbot)*erfctimesexpmtat)/ktat));
5071  itat = ((model_.CTATBOT_i)*((asrh*gammamax)*wtat));
5072  }
5073  if (((model_.CBBTBOT_i)==0))
5074  {
5075  ibbt = 0;
5076  }
5077  else
5078  {
5079  if (((model_.PBOT_i)==0.5))
5080  {
5081  tmp = sqrt((((model_.VBIRBOT_i)-vbbt)*(model_.VBIRBOTinv)));
5082  }
5083  else
5084  {
5085  tmp = pow((((model_.VBIRBOT_i)-vbbt)*(model_.VBIRBOTinv)),(model_.PBOT_i));
5086  }
5087  Fmaxr = ((model_.one_over_one_minus_PBOT)*((((model_.VBIRBOT_i)-vbbt)*(model_.wdepnulrinvbot))/tmp));
5088  if ((fabs(((-(model_.fbbtbot))/Fmaxr))<2.3025850929940458e+02))
5089  {
5090  tmp = exp(((-(model_.fbbtbot))/Fmaxr));
5091  }
5092  else
5093  {
5094  if ((((-(model_.fbbtbot))/Fmaxr)<(-2.3025850929940458e+02)))
5095  {
5096  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*3.3333333333333333e-01))))))));
5097  }
5098  else
5099  {
5100  tmp = (1.0e100*(1.0+((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
5101  }
5102  }
5103  ibbt = ((model_.CBBTBOT_i)*(((V3*Fmaxr)*Fmaxr)*tmp));
5104  }
5105  if (((model_.VBRBOT_i)>1000))
5106  {
5107  fbreakdown = 1;
5108  }
5109  else
5110  {
5111  if ((vav>((-0.999)*(model_.VBRBOT_i))))
5112  {
5113  if (((model_.PBRBOT_i)==4))
5114  {
5115  tmp = (((fabs((vav*(model_.VBRinvbot)))*fabs((vav*(model_.VBRinvbot))))*fabs((vav*(model_.VBRinvbot))))*fabs((vav*(model_.VBRinvbot))));
5116  }
5117  else
5118  {
5119  tmp = pow(fabs((vav*(model_.VBRinvbot))),(model_.PBRBOT_i));
5120  }
5121  fbreakdown = (1/(1-tmp));
5122  }
5123  else
5124  {
5125  fbreakdown = ((model_.fstopbot)+((vav+(0.999*(model_.VBRBOT_i)))*(model_.slopebot)));
5126  }
5127  }
5128  ijunbot = ((((id+isrh)+itat)+ibbt)*fbreakdown);
5129  }
5130  if ((LSSOURCE_i==0))
5131  {
5132  ijunsti = 0;
5133  qjunsti = 0;
5134  }
5135  else
5136  {
5137  if (((model_.one_minus_PSTI)==0.5))
5138  {
5139  tmp = sqrt((1-(vj*(model_.vbiinvsti))));
5140  }
5141  else
5142  {
5143  tmp = pow((1-(vj*(model_.vbiinvsti))),(model_.one_minus_PSTI));
5144  }
5145  qjunsti = (((model_.qprefsti)*(1-tmp))+((model_.qpref2sti)*(V3-vj)));
5146  id = ((model_.idsatsti)*idmult);
5147  if ((((model_.CSRHSTI_i)==0)&&((model_.CTATSTI_i)==0)))
5148  {
5149  isrh = 0;
5150  }
5151  else
5152  {
5153  vbi_minus_vjsrh = ((model_.vbisti)-vjsrh);
5154  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
5155  if (((model_.PSTI_i)==0.5))
5156  {
5157  dwsrh = 0;
5158  }
5159  else
5160  {
5161  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PSTI_i))));
5162  }
5163  wsrh = (wsrhstep+dwsrh);
5164  if (((model_.PSTI_i)==0.5))
5165  {
5166  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRSTIinv)));
5167  }
5168  else
5169  {
5170  tmp = pow((vbi_minus_vjsrh*(model_.VBIRSTIinv)),(model_.PSTI_i));
5171  }
5172  wdep = ((model_.wdepnulrsti)*tmp);
5173  asrh = ((model_.ftdsti)*((zinv-1)*wdep));
5174  isrh = ((model_.CSRHSTI_i)*(asrh*wsrh));
5175  }
5176  if (((model_.CTATSTI_i)==0))
5177  {
5178  itat = 0;
5179  }
5180  else
5181  {
5182  btat = ((model_.btatpartsti)*((wdep*(model_.one_minus_PSTI))/vbi_minus_vjsrh));
5183  twoatatoverthreebtat = ((0.666666666666667*(model_.atatsti))/btat);
5184  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
5185  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
5186  sqrtumax = sqrt(fabs(umax));
5187  umaxpoweronepointfive = (umax*sqrtumax);
5188  if ((((-(model_.PSTI_i))*(model_.one_over_one_minus_PSTI))==(-1)))
5189  {
5190  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
5191  }
5192  else
5193  {
5194  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PSTI_i))*(model_.one_over_one_minus_PSTI)));
5195  }
5196  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
5197  ktat = sqrt((0.375*(btat/sqrtumax)));
5198  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
5199  mtat = (((((model_.atatsti)*twoatatoverthreebtat)*sqrtumax)-((model_.atatsti)*umax))+(0.5*(btat*umaxpoweronepointfive)));
5200  xerfc = ((ltat-1)*ktat);
5201  ysq = (xerfc*xerfc);
5202  if ((xerfc>0))
5203  {
5204  terfc = (1/(1+((model_.perfc)*xerfc)));
5205  }
5206  else
5207  {
5208  terfc = (1/(1-((model_.perfc)*xerfc)));
5209  }
5210  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
5211  {
5212  tmp = exp(((-ysq)+mtat));
5213  }
5214  else
5215  {
5216  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
5217  }
5218  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
5219  if ((xerfc>0))
5220  {
5221  erfctimesexpmtat = erfcpos;
5222  }
5223  else
5224  {
5225  if ((mtat>(-2.3025850929940458e+02)))
5226  {
5227  tmp = exp(mtat);
5228  }
5229  else
5230  {
5231  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
5232  }
5233  erfctimesexpmtat = ((2*tmp)-erfcpos);
5234  }
5235  gammamax = ((1.77245385090551603*0.5)*(((model_.atatsti)*erfctimesexpmtat)/ktat));
5236  itat = ((model_.CTATSTI_i)*((asrh*gammamax)*wtat));
5237  }
5238  if (((model_.CBBTSTI_i)==0))
5239  {
5240  ibbt = 0;
5241  }
5242  else
5243  {
5244  if (((model_.PSTI_i)==0.5))
5245  {
5246  tmp = sqrt((((model_.VBIRSTI_i)-vbbt)*(model_.VBIRSTIinv)));
5247  }
5248  else
5249  {
5250  tmp = pow((((model_.VBIRSTI_i)-vbbt)*(model_.VBIRSTIinv)),(model_.PSTI_i));
5251  }
5252  Fmaxr = ((model_.one_over_one_minus_PSTI)*((((model_.VBIRSTI_i)-vbbt)*(model_.wdepnulrinvsti))/tmp));
5253  if ((fabs(((-(model_.fbbtsti))/Fmaxr))<2.3025850929940458e+02))
5254  {
5255  tmp = exp(((-(model_.fbbtsti))/Fmaxr));
5256  }
5257  else
5258  {
5259  if ((((-(model_.fbbtsti))/Fmaxr)<(-2.3025850929940458e+02)))
5260  {
5261  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*3.3333333333333333e-01))))))));
5262  }
5263  else
5264  {
5265  tmp = (1.0e100*(1.0+((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
5266  }
5267  }
5268  ibbt = ((model_.CBBTSTI_i)*(((V3*Fmaxr)*Fmaxr)*tmp));
5269  }
5270  if (((model_.VBRSTI_i)>1000))
5271  {
5272  fbreakdown = 1;
5273  }
5274  else
5275  {
5276  if ((vav>((-0.999)*(model_.VBRSTI_i))))
5277  {
5278  if (((model_.PBRSTI_i)==4))
5279  {
5280  tmp = (((fabs((vav*(model_.VBRinvsti)))*fabs((vav*(model_.VBRinvsti))))*fabs((vav*(model_.VBRinvsti))))*fabs((vav*(model_.VBRinvsti))));
5281  }
5282  else
5283  {
5284  tmp = pow(fabs((vav*(model_.VBRinvsti))),(model_.PBRSTI_i));
5285  }
5286  fbreakdown = (1/(1-tmp));
5287  }
5288  else
5289  {
5290  fbreakdown = ((model_.fstopsti)+((vav+(0.999*(model_.VBRSTI_i)))*(model_.slopesti)));
5291  }
5292  }
5293  ijunsti = ((((id+isrh)+itat)+ibbt)*fbreakdown);
5294  }
5295  if ((LGSOURCE_i==0))
5296  {
5297  ijungat = 0;
5298  qjungat = 0;
5299  }
5300  else
5301  {
5302  if (((model_.one_minus_PGAT)==0.5))
5303  {
5304  tmp = sqrt((1-(vj*(model_.vbiinvgat))));
5305  }
5306  else
5307  {
5308  tmp = pow((1-(vj*(model_.vbiinvgat))),(model_.one_minus_PGAT));
5309  }
5310  qjungat = (((model_.qprefgat)*(1-tmp))+((model_.qpref2gat)*(V3-vj)));
5311  id = ((model_.idsatgat)*idmult);
5312  if ((((model_.CSRHGAT_i)==0)&&((model_.CTATGAT_i)==0)))
5313  {
5314  isrh = 0;
5315  }
5316  else
5317  {
5318  vbi_minus_vjsrh = ((model_.vbigat)-vjsrh);
5319  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
5320  if (((model_.PGAT_i)==0.5))
5321  {
5322  dwsrh = 0;
5323  }
5324  else
5325  {
5326  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PGAT_i))));
5327  }
5328  wsrh = (wsrhstep+dwsrh);
5329  if (((model_.PGAT_i)==0.5))
5330  {
5331  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRGATinv)));
5332  }
5333  else
5334  {
5335  tmp = pow((vbi_minus_vjsrh*(model_.VBIRGATinv)),(model_.PGAT_i));
5336  }
5337  wdep = ((model_.wdepnulrgat)*tmp);
5338  asrh = ((model_.ftdgat)*((zinv-1)*wdep));
5339  isrh = ((model_.CSRHGAT_i)*(asrh*wsrh));
5340  }
5341  if (((model_.CTATGAT_i)==0))
5342  {
5343  itat = 0;
5344  }
5345  else
5346  {
5347  btat = ((model_.btatpartgat)*((wdep*(model_.one_minus_PGAT))/vbi_minus_vjsrh));
5348  twoatatoverthreebtat = ((0.666666666666667*(model_.atatgat))/btat);
5349  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
5350  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
5351  sqrtumax = sqrt(fabs(umax));
5352  umaxpoweronepointfive = (umax*sqrtumax);
5353  if ((((-(model_.PGAT_i))*(model_.one_over_one_minus_PGAT))==(-1)))
5354  {
5355  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
5356  }
5357  else
5358  {
5359  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PGAT_i))*(model_.one_over_one_minus_PGAT)));
5360  }
5361  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
5362  ktat = sqrt((0.375*(btat/sqrtumax)));
5363  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
5364  mtat = (((((model_.atatgat)*twoatatoverthreebtat)*sqrtumax)-((model_.atatgat)*umax))+(0.5*(btat*umaxpoweronepointfive)));
5365  xerfc = ((ltat-1)*ktat);
5366  ysq = (xerfc*xerfc);
5367  if ((xerfc>0))
5368  {
5369  terfc = (1/(1+((model_.perfc)*xerfc)));
5370  }
5371  else
5372  {
5373  terfc = (1/(1-((model_.perfc)*xerfc)));
5374  }
5375  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
5376  {
5377  tmp = exp(((-ysq)+mtat));
5378  }
5379  else
5380  {
5381  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
5382  }
5383  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
5384  if ((xerfc>0))
5385  {
5386  erfctimesexpmtat = erfcpos;
5387  }
5388  else
5389  {
5390  if ((mtat>(-2.3025850929940458e+02)))
5391  {
5392  tmp = exp(mtat);
5393  }
5394  else
5395  {
5396  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
5397  }
5398  erfctimesexpmtat = ((2*tmp)-erfcpos);
5399  }
5400  gammamax = ((1.77245385090551603*0.5)*(((model_.atatgat)*erfctimesexpmtat)/ktat));
5401  itat = ((model_.CTATGAT_i)*((asrh*gammamax)*wtat));
5402  }
5403  if (((model_.CBBTGAT_i)==0))
5404  {
5405  ibbt = 0;
5406  }
5407  else
5408  {
5409  if (((model_.PGAT_i)==0.5))
5410  {
5411  tmp = sqrt((((model_.VBIRGAT_i)-vbbt)*(model_.VBIRGATinv)));
5412  }
5413  else
5414  {
5415  tmp = pow((((model_.VBIRGAT_i)-vbbt)*(model_.VBIRGATinv)),(model_.PGAT_i));
5416  }
5417  Fmaxr = ((model_.one_over_one_minus_PGAT)*((((model_.VBIRGAT_i)-vbbt)*(model_.wdepnulrinvgat))/tmp));
5418  if ((fabs(((-(model_.fbbtgat))/Fmaxr))<2.3025850929940458e+02))
5419  {
5420  tmp = exp(((-(model_.fbbtgat))/Fmaxr));
5421  }
5422  else
5423  {
5424  if ((((-(model_.fbbtgat))/Fmaxr)<(-2.3025850929940458e+02)))
5425  {
5426  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*3.3333333333333333e-01))))))));
5427  }
5428  else
5429  {
5430  tmp = (1.0e100*(1.0+((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
5431  }
5432  }
5433  ibbt = ((model_.CBBTGAT_i)*(((V3*Fmaxr)*Fmaxr)*tmp));
5434  }
5435  if (((model_.VBRGAT_i)>1000))
5436  {
5437  fbreakdown = 1;
5438  }
5439  else
5440  {
5441  if ((vav>((-0.999)*(model_.VBRGAT_i))))
5442  {
5443  if (((model_.PBRGAT_i)==4))
5444  {
5445  tmp = (((fabs((vav*(model_.VBRinvgat)))*fabs((vav*(model_.VBRinvgat))))*fabs((vav*(model_.VBRinvgat))))*fabs((vav*(model_.VBRinvgat))));
5446  }
5447  else
5448  {
5449  tmp = pow(fabs((vav*(model_.VBRinvgat))),(model_.PBRGAT_i));
5450  }
5451  fbreakdown = (1/(1-tmp));
5452  }
5453  else
5454  {
5455  fbreakdown = ((model_.fstopgat)+((vav+(0.999*(model_.VBRGAT_i)))*(model_.slopegat)));
5456  }
5457  }
5458  ijungat = ((((id+isrh)+itat)+ibbt)*fbreakdown);
5459  }
5460  I3 = (((ABSOURCE_i*ijunbot)+(LSSOURCE_i*ijunsti))+(LGSOURCE_i*ijungat));
5461  vbbt = 0.0;
5462  two_psistar = 0.0;
5463  if ((!(((ABSOURCE_i==0)&&(LSSOURCE_i==0))&&(LGSOURCE_i==0))))
5464  {
5465  h1 = ((4.0*vch_s)*vch_s);
5466  h2 = (vch_s/vfmin_s);
5467  h2d = (V4+(vch_s*h2));
5468  h3 = (vfmin_s+h2d);
5469  h4 = (vfmin_s-h2d);
5470  h5 = sqrt(((h4*h4)+h1));
5471  vj = (2.0*((V4*vfmin_s)/(h3+h5)));
5472  if ((V4<VMAX_s))
5473  {
5474  if ((fabs((0.5*(V4*(model_.phitdinv))))<2.3025850929940458e+02))
5475  {
5476  zinv = exp((0.5*(V4*(model_.phitdinv))));
5477  }
5478  else
5479  {
5480  if (((0.5*(V4*(model_.phitdinv)))<(-2.3025850929940458e+02)))
5481  {
5482  zinv = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-(0.5*(V4*(model_.phitdinv))))*(1.0+(0.5*(((-2.3025850929940458e+02)-(0.5*(V4*(model_.phitdinv))))*(1.0+(((-2.3025850929940458e+02)-(0.5*(V4*(model_.phitdinv))))*3.3333333333333333e-01))))))));
5483  }
5484  else
5485  {
5486  zinv = (1.0e100*(1.0+(((0.5*(V4*(model_.phitdinv)))-2.3025850929940458e+02)*(1.0+(0.5*(((0.5*(V4*(model_.phitdinv)))-2.3025850929940458e+02)*(1.0+(((0.5*(V4*(model_.phitdinv)))-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
5487  }
5488  }
5489  idmult = (zinv*zinv);
5490  }
5491  else
5492  {
5493  idmult = ((1+((V4-VMAX_s)*(model_.phitdinv)))*exp_VMAX_over_phitd_s);
5494  zinv = sqrt(idmult);
5495  }
5496  idmult = (idmult-1.0);
5497  z = (1/zinv);
5498  if ((V4>0))
5499  {
5500  two_psistar = (2.0*((model_.phitd)*log(((2.0+z)+sqrt(((z+1.0)*(z+3.0)))))));
5501  }
5502  else
5503  {
5504  two_psistar = ((-V4)+(2.0*((model_.phitd)*log((((2*zinv)+1)+sqrt(((1+zinv)*(1+(3*zinv)))))))));
5505  }
5506  vjlim = (vbimin_s-two_psistar);
5507  vjsrh = (0.5*((V4+vjlim)-sqrt((((V4-vjlim)*(V4-vjlim))+((4*(model_.phitd))*(model_.phitd))))));
5508  vbbt = (0.5*((V4+vbbtlim_s)-sqrt((((V4-vbbtlim_s)*(V4-vbbtlim_s))+((4*(model_.phitr))*(model_.phitr))))));
5509  vav = (0.5*((V4)-sqrt((((V4)*(V4))+((4*1E-6)*1E-6)))));
5510  }
5511  if ((ABSOURCE_i==0))
5512  {
5513  ijunbot = 0;
5514  qjunbot = 0;
5515  }
5516  else
5517  {
5518  if (((model_.one_minus_PBOT)==0.5))
5519  {
5520  tmp = sqrt((1-(vj*(model_.vbiinvbot))));
5521  }
5522  else
5523  {
5524  tmp = pow((1-(vj*(model_.vbiinvbot))),(model_.one_minus_PBOT));
5525  }
5526  qjunbot = (((model_.qprefbot)*(1-tmp))+((model_.qpref2bot)*(V4-vj)));
5527  id = ((model_.idsatbot)*idmult);
5528  if ((((model_.CSRHBOT_i)==0)&&((model_.CTATBOT_i)==0)))
5529  {
5530  isrh = 0;
5531  }
5532  else
5533  {
5534  vbi_minus_vjsrh = ((model_.vbibot)-vjsrh);
5535  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
5536  if (((model_.PBOT_i)==0.5))
5537  {
5538  dwsrh = 0;
5539  }
5540  else
5541  {
5542  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PBOT_i))));
5543  }
5544  wsrh = (wsrhstep+dwsrh);
5545  if (((model_.PBOT_i)==0.5))
5546  {
5547  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRBOTinv)));
5548  }
5549  else
5550  {
5551  tmp = pow((vbi_minus_vjsrh*(model_.VBIRBOTinv)),(model_.PBOT_i));
5552  }
5553  wdep = ((model_.wdepnulrbot)*tmp);
5554  asrh = ((model_.ftdbot)*((zinv-1)*wdep));
5555  isrh = ((model_.CSRHBOT_i)*(asrh*wsrh));
5556  }
5557  if (((model_.CTATBOT_i)==0))
5558  {
5559  itat = 0;
5560  }
5561  else
5562  {
5563  btat = ((model_.btatpartbot)*((wdep*(model_.one_minus_PBOT))/vbi_minus_vjsrh));
5564  twoatatoverthreebtat = ((0.666666666666667*(model_.atatbot))/btat);
5565  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
5566  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
5567  sqrtumax = sqrt(fabs(umax));
5568  umaxpoweronepointfive = (umax*sqrtumax);
5569  if ((((-(model_.PBOT_i))*(model_.one_over_one_minus_PBOT))==(-1)))
5570  {
5571  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
5572  }
5573  else
5574  {
5575  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PBOT_i))*(model_.one_over_one_minus_PBOT)));
5576  }
5577  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
5578  ktat = sqrt((0.375*(btat/sqrtumax)));
5579  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
5580  mtat = (((((model_.atatbot)*twoatatoverthreebtat)*sqrtumax)-((model_.atatbot)*umax))+(0.5*(btat*umaxpoweronepointfive)));
5581  xerfc = ((ltat-1)*ktat);
5582  ysq = (xerfc*xerfc);
5583  if ((xerfc>0))
5584  {
5585  terfc = (1/(1+((model_.perfc)*xerfc)));
5586  }
5587  else
5588  {
5589  terfc = (1/(1-((model_.perfc)*xerfc)));
5590  }
5591  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
5592  {
5593  tmp = exp(((-ysq)+mtat));
5594  }
5595  else
5596  {
5597  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
5598  }
5599  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
5600  if ((xerfc>0))
5601  {
5602  erfctimesexpmtat = erfcpos;
5603  }
5604  else
5605  {
5606  if ((mtat>(-2.3025850929940458e+02)))
5607  {
5608  tmp = exp(mtat);
5609  }
5610  else
5611  {
5612  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
5613  }
5614  erfctimesexpmtat = ((2*tmp)-erfcpos);
5615  }
5616  gammamax = ((1.77245385090551603*0.5)*(((model_.atatbot)*erfctimesexpmtat)/ktat));
5617  itat = ((model_.CTATBOT_i)*((asrh*gammamax)*wtat));
5618  }
5619  if (((model_.CBBTBOT_i)==0))
5620  {
5621  ibbt = 0;
5622  }
5623  else
5624  {
5625  if (((model_.PBOT_i)==0.5))
5626  {
5627  tmp = sqrt((((model_.VBIRBOT_i)-vbbt)*(model_.VBIRBOTinv)));
5628  }
5629  else
5630  {
5631  tmp = pow((((model_.VBIRBOT_i)-vbbt)*(model_.VBIRBOTinv)),(model_.PBOT_i));
5632  }
5633  Fmaxr = ((model_.one_over_one_minus_PBOT)*((((model_.VBIRBOT_i)-vbbt)*(model_.wdepnulrinvbot))/tmp));
5634  if ((fabs(((-(model_.fbbtbot))/Fmaxr))<2.3025850929940458e+02))
5635  {
5636  tmp = exp(((-(model_.fbbtbot))/Fmaxr));
5637  }
5638  else
5639  {
5640  if ((((-(model_.fbbtbot))/Fmaxr)<(-2.3025850929940458e+02)))
5641  {
5642  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*3.3333333333333333e-01))))))));
5643  }
5644  else
5645  {
5646  tmp = (1.0e100*(1.0+((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
5647  }
5648  }
5649  ibbt = ((model_.CBBTBOT_i)*(((V4*Fmaxr)*Fmaxr)*tmp));
5650  }
5651  if (((model_.VBRBOT_i)>1000))
5652  {
5653  fbreakdown = 1;
5654  }
5655  else
5656  {
5657  if ((vav>((-0.999)*(model_.VBRBOT_i))))
5658  {
5659  if (((model_.PBRBOT_i)==4))
5660  {
5661  tmp = (((fabs((vav*(model_.VBRinvbot)))*fabs((vav*(model_.VBRinvbot))))*fabs((vav*(model_.VBRinvbot))))*fabs((vav*(model_.VBRinvbot))));
5662  }
5663  else
5664  {
5665  tmp = pow(fabs((vav*(model_.VBRinvbot))),(model_.PBRBOT_i));
5666  }
5667  fbreakdown = (1/(1-tmp));
5668  }
5669  else
5670  {
5671  fbreakdown = ((model_.fstopbot)+((vav+(0.999*(model_.VBRBOT_i)))*(model_.slopebot)));
5672  }
5673  }
5674  ijunbot = ((((id+isrh)+itat)+ibbt)*fbreakdown);
5675  }
5676  if ((LSSOURCE_i==0))
5677  {
5678  ijunsti = 0;
5679  qjunsti = 0;
5680  }
5681  else
5682  {
5683  if (((model_.one_minus_PSTI)==0.5))
5684  {
5685  tmp = sqrt((1-(vj*(model_.vbiinvsti))));
5686  }
5687  else
5688  {
5689  tmp = pow((1-(vj*(model_.vbiinvsti))),(model_.one_minus_PSTI));
5690  }
5691  qjunsti = (((model_.qprefsti)*(1-tmp))+((model_.qpref2sti)*(V4-vj)));
5692  id = ((model_.idsatsti)*idmult);
5693  if ((((model_.CSRHSTI_i)==0)&&((model_.CTATSTI_i)==0)))
5694  {
5695  isrh = 0;
5696  }
5697  else
5698  {
5699  vbi_minus_vjsrh = ((model_.vbisti)-vjsrh);
5700  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
5701  if (((model_.PSTI_i)==0.5))
5702  {
5703  dwsrh = 0;
5704  }
5705  else
5706  {
5707  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PSTI_i))));
5708  }
5709  wsrh = (wsrhstep+dwsrh);
5710  if (((model_.PSTI_i)==0.5))
5711  {
5712  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRSTIinv)));
5713  }
5714  else
5715  {
5716  tmp = pow((vbi_minus_vjsrh*(model_.VBIRSTIinv)),(model_.PSTI_i));
5717  }
5718  wdep = ((model_.wdepnulrsti)*tmp);
5719  asrh = ((model_.ftdsti)*((zinv-1)*wdep));
5720  isrh = ((model_.CSRHSTI_i)*(asrh*wsrh));
5721  }
5722  if (((model_.CTATSTI_i)==0))
5723  {
5724  itat = 0;
5725  }
5726  else
5727  {
5728  btat = ((model_.btatpartsti)*((wdep*(model_.one_minus_PSTI))/vbi_minus_vjsrh));
5729  twoatatoverthreebtat = ((0.666666666666667*(model_.atatsti))/btat);
5730  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
5731  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
5732  sqrtumax = sqrt(fabs(umax));
5733  umaxpoweronepointfive = (umax*sqrtumax);
5734  if ((((-(model_.PSTI_i))*(model_.one_over_one_minus_PSTI))==(-1)))
5735  {
5736  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
5737  }
5738  else
5739  {
5740  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PSTI_i))*(model_.one_over_one_minus_PSTI)));
5741  }
5742  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
5743  ktat = sqrt((0.375*(btat/sqrtumax)));
5744  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
5745  mtat = (((((model_.atatsti)*twoatatoverthreebtat)*sqrtumax)-((model_.atatsti)*umax))+(0.5*(btat*umaxpoweronepointfive)));
5746  xerfc = ((ltat-1)*ktat);
5747  ysq = (xerfc*xerfc);
5748  if ((xerfc>0))
5749  {
5750  terfc = (1/(1+((model_.perfc)*xerfc)));
5751  }
5752  else
5753  {
5754  terfc = (1/(1-((model_.perfc)*xerfc)));
5755  }
5756  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
5757  {
5758  tmp = exp(((-ysq)+mtat));
5759  }
5760  else
5761  {
5762  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
5763  }
5764  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
5765  if ((xerfc>0))
5766  {
5767  erfctimesexpmtat = erfcpos;
5768  }
5769  else
5770  {
5771  if ((mtat>(-2.3025850929940458e+02)))
5772  {
5773  tmp = exp(mtat);
5774  }
5775  else
5776  {
5777  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
5778  }
5779  erfctimesexpmtat = ((2*tmp)-erfcpos);
5780  }
5781  gammamax = ((1.77245385090551603*0.5)*(((model_.atatsti)*erfctimesexpmtat)/ktat));
5782  itat = ((model_.CTATSTI_i)*((asrh*gammamax)*wtat));
5783  }
5784  if (((model_.CBBTSTI_i)==0))
5785  {
5786  ibbt = 0;
5787  }
5788  else
5789  {
5790  if (((model_.PSTI_i)==0.5))
5791  {
5792  tmp = sqrt((((model_.VBIRSTI_i)-vbbt)*(model_.VBIRSTIinv)));
5793  }
5794  else
5795  {
5796  tmp = pow((((model_.VBIRSTI_i)-vbbt)*(model_.VBIRSTIinv)),(model_.PSTI_i));
5797  }
5798  Fmaxr = ((model_.one_over_one_minus_PSTI)*((((model_.VBIRSTI_i)-vbbt)*(model_.wdepnulrinvsti))/tmp));
5799  if ((fabs(((-(model_.fbbtsti))/Fmaxr))<2.3025850929940458e+02))
5800  {
5801  tmp = exp(((-(model_.fbbtsti))/Fmaxr));
5802  }
5803  else
5804  {
5805  if ((((-(model_.fbbtsti))/Fmaxr)<(-2.3025850929940458e+02)))
5806  {
5807  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*3.3333333333333333e-01))))))));
5808  }
5809  else
5810  {
5811  tmp = (1.0e100*(1.0+((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
5812  }
5813  }
5814  ibbt = ((model_.CBBTSTI_i)*(((V4*Fmaxr)*Fmaxr)*tmp));
5815  }
5816  if (((model_.VBRSTI_i)>1000))
5817  {
5818  fbreakdown = 1;
5819  }
5820  else
5821  {
5822  if ((vav>((-0.999)*(model_.VBRSTI_i))))
5823  {
5824  if (((model_.PBRSTI_i)==4))
5825  {
5826  tmp = (((fabs((vav*(model_.VBRinvsti)))*fabs((vav*(model_.VBRinvsti))))*fabs((vav*(model_.VBRinvsti))))*fabs((vav*(model_.VBRinvsti))));
5827  }
5828  else
5829  {
5830  tmp = pow(fabs((vav*(model_.VBRinvsti))),(model_.PBRSTI_i));
5831  }
5832  fbreakdown = (1/(1-tmp));
5833  }
5834  else
5835  {
5836  fbreakdown = ((model_.fstopsti)+((vav+(0.999*(model_.VBRSTI_i)))*(model_.slopesti)));
5837  }
5838  }
5839  ijunsti = ((((id+isrh)+itat)+ibbt)*fbreakdown);
5840  }
5841  if ((LGSOURCE_i==0))
5842  {
5843  ijungat = 0;
5844  qjungat = 0;
5845  }
5846  else
5847  {
5848  if (((model_.one_minus_PGAT)==0.5))
5849  {
5850  tmp = sqrt((1-(vj*(model_.vbiinvgat))));
5851  }
5852  else
5853  {
5854  tmp = pow((1-(vj*(model_.vbiinvgat))),(model_.one_minus_PGAT));
5855  }
5856  qjungat = (((model_.qprefgat)*(1-tmp))+((model_.qpref2gat)*(V4-vj)));
5857  id = ((model_.idsatgat)*idmult);
5858  if ((((model_.CSRHGAT_i)==0)&&((model_.CTATGAT_i)==0)))
5859  {
5860  isrh = 0;
5861  }
5862  else
5863  {
5864  vbi_minus_vjsrh = ((model_.vbigat)-vjsrh);
5865  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
5866  if (((model_.PGAT_i)==0.5))
5867  {
5868  dwsrh = 0;
5869  }
5870  else
5871  {
5872  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PGAT_i))));
5873  }
5874  wsrh = (wsrhstep+dwsrh);
5875  if (((model_.PGAT_i)==0.5))
5876  {
5877  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRGATinv)));
5878  }
5879  else
5880  {
5881  tmp = pow((vbi_minus_vjsrh*(model_.VBIRGATinv)),(model_.PGAT_i));
5882  }
5883  wdep = ((model_.wdepnulrgat)*tmp);
5884  asrh = ((model_.ftdgat)*((zinv-1)*wdep));
5885  isrh = ((model_.CSRHGAT_i)*(asrh*wsrh));
5886  }
5887  if (((model_.CTATGAT_i)==0))
5888  {
5889  itat = 0;
5890  }
5891  else
5892  {
5893  btat = ((model_.btatpartgat)*((wdep*(model_.one_minus_PGAT))/vbi_minus_vjsrh));
5894  twoatatoverthreebtat = ((0.666666666666667*(model_.atatgat))/btat);
5895  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
5896  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
5897  sqrtumax = sqrt(fabs(umax));
5898  umaxpoweronepointfive = (umax*sqrtumax);
5899  if ((((-(model_.PGAT_i))*(model_.one_over_one_minus_PGAT))==(-1)))
5900  {
5901  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
5902  }
5903  else
5904  {
5905  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PGAT_i))*(model_.one_over_one_minus_PGAT)));
5906  }
5907  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
5908  ktat = sqrt((0.375*(btat/sqrtumax)));
5909  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
5910  mtat = (((((model_.atatgat)*twoatatoverthreebtat)*sqrtumax)-((model_.atatgat)*umax))+(0.5*(btat*umaxpoweronepointfive)));
5911  xerfc = ((ltat-1)*ktat);
5912  ysq = (xerfc*xerfc);
5913  if ((xerfc>0))
5914  {
5915  terfc = (1/(1+((model_.perfc)*xerfc)));
5916  }
5917  else
5918  {
5919  terfc = (1/(1-((model_.perfc)*xerfc)));
5920  }
5921  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
5922  {
5923  tmp = exp(((-ysq)+mtat));
5924  }
5925  else
5926  {
5927  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
5928  }
5929  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
5930  if ((xerfc>0))
5931  {
5932  erfctimesexpmtat = erfcpos;
5933  }
5934  else
5935  {
5936  if ((mtat>(-2.3025850929940458e+02)))
5937  {
5938  tmp = exp(mtat);
5939  }
5940  else
5941  {
5942  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
5943  }
5944  erfctimesexpmtat = ((2*tmp)-erfcpos);
5945  }
5946  gammamax = ((1.77245385090551603*0.5)*(((model_.atatgat)*erfctimesexpmtat)/ktat));
5947  itat = ((model_.CTATGAT_i)*((asrh*gammamax)*wtat));
5948  }
5949  if (((model_.CBBTGAT_i)==0))
5950  {
5951  ibbt = 0;
5952  }
5953  else
5954  {
5955  if (((model_.PGAT_i)==0.5))
5956  {
5957  tmp = sqrt((((model_.VBIRGAT_i)-vbbt)*(model_.VBIRGATinv)));
5958  }
5959  else
5960  {
5961  tmp = pow((((model_.VBIRGAT_i)-vbbt)*(model_.VBIRGATinv)),(model_.PGAT_i));
5962  }
5963  Fmaxr = ((model_.one_over_one_minus_PGAT)*((((model_.VBIRGAT_i)-vbbt)*(model_.wdepnulrinvgat))/tmp));
5964  if ((fabs(((-(model_.fbbtgat))/Fmaxr))<2.3025850929940458e+02))
5965  {
5966  tmp = exp(((-(model_.fbbtgat))/Fmaxr));
5967  }
5968  else
5969  {
5970  if ((((-(model_.fbbtgat))/Fmaxr)<(-2.3025850929940458e+02)))
5971  {
5972  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*3.3333333333333333e-01))))))));
5973  }
5974  else
5975  {
5976  tmp = (1.0e100*(1.0+((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
5977  }
5978  }
5979  ibbt = ((model_.CBBTGAT_i)*(((V4*Fmaxr)*Fmaxr)*tmp));
5980  }
5981  if (((model_.VBRGAT_i)>1000))
5982  {
5983  fbreakdown = 1;
5984  }
5985  else
5986  {
5987  if ((vav>((-0.999)*(model_.VBRGAT_i))))
5988  {
5989  if (((model_.PBRGAT_i)==4))
5990  {
5991  tmp = (((fabs((vav*(model_.VBRinvgat)))*fabs((vav*(model_.VBRinvgat))))*fabs((vav*(model_.VBRinvgat))))*fabs((vav*(model_.VBRinvgat))));
5992  }
5993  else
5994  {
5995  tmp = pow(fabs((vav*(model_.VBRinvgat))),(model_.PBRGAT_i));
5996  }
5997  fbreakdown = (1/(1-tmp));
5998  }
5999  else
6000  {
6001  fbreakdown = ((model_.fstopgat)+((vav+(0.999*(model_.VBRGAT_i)))*(model_.slopegat)));
6002  }
6003  }
6004  ijungat = ((((id+isrh)+itat)+ibbt)*fbreakdown);
6005  }
6006  I4 = (((ABSOURCE_i*ijunbot)+(LSSOURCE_i*ijunsti))+(LGSOURCE_i*ijungat));
6007  vbbt = 0.0;
6008  two_psistar = 0.0;
6009  if ((!(((ABSOURCE_i==0)&&(LSSOURCE_i==0))&&(LGSOURCE_i==0))))
6010  {
6011  h1 = ((4.0*vch_s)*vch_s);
6012  h2 = (vch_s/vfmin_s);
6013  h2d = (V5+(vch_s*h2));
6014  h3 = (vfmin_s+h2d);
6015  h4 = (vfmin_s-h2d);
6016  h5 = sqrt(((h4*h4)+h1));
6017  vj = (2.0*((V5*vfmin_s)/(h3+h5)));
6018  if ((V5<VMAX_s))
6019  {
6020  if ((fabs((0.5*(V5*(model_.phitdinv))))<2.3025850929940458e+02))
6021  {
6022  zinv = exp((0.5*(V5*(model_.phitdinv))));
6023  }
6024  else
6025  {
6026  if (((0.5*(V5*(model_.phitdinv)))<(-2.3025850929940458e+02)))
6027  {
6028  zinv = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-(0.5*(V5*(model_.phitdinv))))*(1.0+(0.5*(((-2.3025850929940458e+02)-(0.5*(V5*(model_.phitdinv))))*(1.0+(((-2.3025850929940458e+02)-(0.5*(V5*(model_.phitdinv))))*3.3333333333333333e-01))))))));
6029  }
6030  else
6031  {
6032  zinv = (1.0e100*(1.0+(((0.5*(V5*(model_.phitdinv)))-2.3025850929940458e+02)*(1.0+(0.5*(((0.5*(V5*(model_.phitdinv)))-2.3025850929940458e+02)*(1.0+(((0.5*(V5*(model_.phitdinv)))-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
6033  }
6034  }
6035  idmult = (zinv*zinv);
6036  }
6037  else
6038  {
6039  idmult = ((1+((V5-VMAX_s)*(model_.phitdinv)))*exp_VMAX_over_phitd_s);
6040  zinv = sqrt(idmult);
6041  }
6042  idmult = (idmult-1.0);
6043  z = (1/zinv);
6044  if ((V5>0))
6045  {
6046  two_psistar = (2.0*((model_.phitd)*log(((2.0+z)+sqrt(((z+1.0)*(z+3.0)))))));
6047  }
6048  else
6049  {
6050  two_psistar = ((-V5)+(2.0*((model_.phitd)*log((((2*zinv)+1)+sqrt(((1+zinv)*(1+(3*zinv)))))))));
6051  }
6052  vjlim = (vbimin_s-two_psistar);
6053  vjsrh = (0.5*((V5+vjlim)-sqrt((((V5-vjlim)*(V5-vjlim))+((4*(model_.phitd))*(model_.phitd))))));
6054  vbbt = (0.5*((V5+vbbtlim_s)-sqrt((((V5-vbbtlim_s)*(V5-vbbtlim_s))+((4*(model_.phitr))*(model_.phitr))))));
6055  vav = (0.5*((V5)-sqrt((((V5)*(V5))+((4*1E-6)*1E-6)))));
6056  }
6057  if ((ABSOURCE_i==0))
6058  {
6059  ijunbot = 0;
6060  qjunbot = 0;
6061  }
6062  else
6063  {
6064  if (((model_.one_minus_PBOT)==0.5))
6065  {
6066  tmp = sqrt((1-(vj*(model_.vbiinvbot))));
6067  }
6068  else
6069  {
6070  tmp = pow((1-(vj*(model_.vbiinvbot))),(model_.one_minus_PBOT));
6071  }
6072  qjunbot = (((model_.qprefbot)*(1-tmp))+((model_.qpref2bot)*(V5-vj)));
6073  id = ((model_.idsatbot)*idmult);
6074  if ((((model_.CSRHBOT_i)==0)&&((model_.CTATBOT_i)==0)))
6075  {
6076  isrh = 0;
6077  }
6078  else
6079  {
6080  vbi_minus_vjsrh = ((model_.vbibot)-vjsrh);
6081  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
6082  if (((model_.PBOT_i)==0.5))
6083  {
6084  dwsrh = 0;
6085  }
6086  else
6087  {
6088  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PBOT_i))));
6089  }
6090  wsrh = (wsrhstep+dwsrh);
6091  if (((model_.PBOT_i)==0.5))
6092  {
6093  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRBOTinv)));
6094  }
6095  else
6096  {
6097  tmp = pow((vbi_minus_vjsrh*(model_.VBIRBOTinv)),(model_.PBOT_i));
6098  }
6099  wdep = ((model_.wdepnulrbot)*tmp);
6100  asrh = ((model_.ftdbot)*((zinv-1)*wdep));
6101  isrh = ((model_.CSRHBOT_i)*(asrh*wsrh));
6102  }
6103  if (((model_.CTATBOT_i)==0))
6104  {
6105  itat = 0;
6106  }
6107  else
6108  {
6109  btat = ((model_.btatpartbot)*((wdep*(model_.one_minus_PBOT))/vbi_minus_vjsrh));
6110  twoatatoverthreebtat = ((0.666666666666667*(model_.atatbot))/btat);
6111  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
6112  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
6113  sqrtumax = sqrt(fabs(umax));
6114  umaxpoweronepointfive = (umax*sqrtumax);
6115  if ((((-(model_.PBOT_i))*(model_.one_over_one_minus_PBOT))==(-1)))
6116  {
6117  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
6118  }
6119  else
6120  {
6121  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PBOT_i))*(model_.one_over_one_minus_PBOT)));
6122  }
6123  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
6124  ktat = sqrt((0.375*(btat/sqrtumax)));
6125  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
6126  mtat = (((((model_.atatbot)*twoatatoverthreebtat)*sqrtumax)-((model_.atatbot)*umax))+(0.5*(btat*umaxpoweronepointfive)));
6127  xerfc = ((ltat-1)*ktat);
6128  ysq = (xerfc*xerfc);
6129  if ((xerfc>0))
6130  {
6131  terfc = (1/(1+((model_.perfc)*xerfc)));
6132  }
6133  else
6134  {
6135  terfc = (1/(1-((model_.perfc)*xerfc)));
6136  }
6137  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
6138  {
6139  tmp = exp(((-ysq)+mtat));
6140  }
6141  else
6142  {
6143  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
6144  }
6145  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
6146  if ((xerfc>0))
6147  {
6148  erfctimesexpmtat = erfcpos;
6149  }
6150  else
6151  {
6152  if ((mtat>(-2.3025850929940458e+02)))
6153  {
6154  tmp = exp(mtat);
6155  }
6156  else
6157  {
6158  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
6159  }
6160  erfctimesexpmtat = ((2*tmp)-erfcpos);
6161  }
6162  gammamax = ((1.77245385090551603*0.5)*(((model_.atatbot)*erfctimesexpmtat)/ktat));
6163  itat = ((model_.CTATBOT_i)*((asrh*gammamax)*wtat));
6164  }
6165  if (((model_.CBBTBOT_i)==0))
6166  {
6167  ibbt = 0;
6168  }
6169  else
6170  {
6171  if (((model_.PBOT_i)==0.5))
6172  {
6173  tmp = sqrt((((model_.VBIRBOT_i)-vbbt)*(model_.VBIRBOTinv)));
6174  }
6175  else
6176  {
6177  tmp = pow((((model_.VBIRBOT_i)-vbbt)*(model_.VBIRBOTinv)),(model_.PBOT_i));
6178  }
6179  Fmaxr = ((model_.one_over_one_minus_PBOT)*((((model_.VBIRBOT_i)-vbbt)*(model_.wdepnulrinvbot))/tmp));
6180  if ((fabs(((-(model_.fbbtbot))/Fmaxr))<2.3025850929940458e+02))
6181  {
6182  tmp = exp(((-(model_.fbbtbot))/Fmaxr));
6183  }
6184  else
6185  {
6186  if ((((-(model_.fbbtbot))/Fmaxr)<(-2.3025850929940458e+02)))
6187  {
6188  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*3.3333333333333333e-01))))))));
6189  }
6190  else
6191  {
6192  tmp = (1.0e100*(1.0+((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
6193  }
6194  }
6195  ibbt = ((model_.CBBTBOT_i)*(((V5*Fmaxr)*Fmaxr)*tmp));
6196  }
6197  if (((model_.VBRBOT_i)>1000))
6198  {
6199  fbreakdown = 1;
6200  }
6201  else
6202  {
6203  if ((vav>((-0.999)*(model_.VBRBOT_i))))
6204  {
6205  if (((model_.PBRBOT_i)==4))
6206  {
6207  tmp = (((fabs((vav*(model_.VBRinvbot)))*fabs((vav*(model_.VBRinvbot))))*fabs((vav*(model_.VBRinvbot))))*fabs((vav*(model_.VBRinvbot))));
6208  }
6209  else
6210  {
6211  tmp = pow(fabs((vav*(model_.VBRinvbot))),(model_.PBRBOT_i));
6212  }
6213  fbreakdown = (1/(1-tmp));
6214  }
6215  else
6216  {
6217  fbreakdown = ((model_.fstopbot)+((vav+(0.999*(model_.VBRBOT_i)))*(model_.slopebot)));
6218  }
6219  }
6220  ijunbot = ((((id+isrh)+itat)+ibbt)*fbreakdown);
6221  }
6222  if ((LSSOURCE_i==0))
6223  {
6224  ijunsti = 0;
6225  qjunsti = 0;
6226  }
6227  else
6228  {
6229  if (((model_.one_minus_PSTI)==0.5))
6230  {
6231  tmp = sqrt((1-(vj*(model_.vbiinvsti))));
6232  }
6233  else
6234  {
6235  tmp = pow((1-(vj*(model_.vbiinvsti))),(model_.one_minus_PSTI));
6236  }
6237  qjunsti = (((model_.qprefsti)*(1-tmp))+((model_.qpref2sti)*(V5-vj)));
6238  id = ((model_.idsatsti)*idmult);
6239  if ((((model_.CSRHSTI_i)==0)&&((model_.CTATSTI_i)==0)))
6240  {
6241  isrh = 0;
6242  }
6243  else
6244  {
6245  vbi_minus_vjsrh = ((model_.vbisti)-vjsrh);
6246  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
6247  if (((model_.PSTI_i)==0.5))
6248  {
6249  dwsrh = 0;
6250  }
6251  else
6252  {
6253  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PSTI_i))));
6254  }
6255  wsrh = (wsrhstep+dwsrh);
6256  if (((model_.PSTI_i)==0.5))
6257  {
6258  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRSTIinv)));
6259  }
6260  else
6261  {
6262  tmp = pow((vbi_minus_vjsrh*(model_.VBIRSTIinv)),(model_.PSTI_i));
6263  }
6264  wdep = ((model_.wdepnulrsti)*tmp);
6265  asrh = ((model_.ftdsti)*((zinv-1)*wdep));
6266  isrh = ((model_.CSRHSTI_i)*(asrh*wsrh));
6267  }
6268  if (((model_.CTATSTI_i)==0))
6269  {
6270  itat = 0;
6271  }
6272  else
6273  {
6274  btat = ((model_.btatpartsti)*((wdep*(model_.one_minus_PSTI))/vbi_minus_vjsrh));
6275  twoatatoverthreebtat = ((0.666666666666667*(model_.atatsti))/btat);
6276  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
6277  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
6278  sqrtumax = sqrt(fabs(umax));
6279  umaxpoweronepointfive = (umax*sqrtumax);
6280  if ((((-(model_.PSTI_i))*(model_.one_over_one_minus_PSTI))==(-1)))
6281  {
6282  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
6283  }
6284  else
6285  {
6286  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PSTI_i))*(model_.one_over_one_minus_PSTI)));
6287  }
6288  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
6289  ktat = sqrt((0.375*(btat/sqrtumax)));
6290  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
6291  mtat = (((((model_.atatsti)*twoatatoverthreebtat)*sqrtumax)-((model_.atatsti)*umax))+(0.5*(btat*umaxpoweronepointfive)));
6292  xerfc = ((ltat-1)*ktat);
6293  ysq = (xerfc*xerfc);
6294  if ((xerfc>0))
6295  {
6296  terfc = (1/(1+((model_.perfc)*xerfc)));
6297  }
6298  else
6299  {
6300  terfc = (1/(1-((model_.perfc)*xerfc)));
6301  }
6302  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
6303  {
6304  tmp = exp(((-ysq)+mtat));
6305  }
6306  else
6307  {
6308  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
6309  }
6310  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
6311  if ((xerfc>0))
6312  {
6313  erfctimesexpmtat = erfcpos;
6314  }
6315  else
6316  {
6317  if ((mtat>(-2.3025850929940458e+02)))
6318  {
6319  tmp = exp(mtat);
6320  }
6321  else
6322  {
6323  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
6324  }
6325  erfctimesexpmtat = ((2*tmp)-erfcpos);
6326  }
6327  gammamax = ((1.77245385090551603*0.5)*(((model_.atatsti)*erfctimesexpmtat)/ktat));
6328  itat = ((model_.CTATSTI_i)*((asrh*gammamax)*wtat));
6329  }
6330  if (((model_.CBBTSTI_i)==0))
6331  {
6332  ibbt = 0;
6333  }
6334  else
6335  {
6336  if (((model_.PSTI_i)==0.5))
6337  {
6338  tmp = sqrt((((model_.VBIRSTI_i)-vbbt)*(model_.VBIRSTIinv)));
6339  }
6340  else
6341  {
6342  tmp = pow((((model_.VBIRSTI_i)-vbbt)*(model_.VBIRSTIinv)),(model_.PSTI_i));
6343  }
6344  Fmaxr = ((model_.one_over_one_minus_PSTI)*((((model_.VBIRSTI_i)-vbbt)*(model_.wdepnulrinvsti))/tmp));
6345  if ((fabs(((-(model_.fbbtsti))/Fmaxr))<2.3025850929940458e+02))
6346  {
6347  tmp = exp(((-(model_.fbbtsti))/Fmaxr));
6348  }
6349  else
6350  {
6351  if ((((-(model_.fbbtsti))/Fmaxr)<(-2.3025850929940458e+02)))
6352  {
6353  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*3.3333333333333333e-01))))))));
6354  }
6355  else
6356  {
6357  tmp = (1.0e100*(1.0+((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
6358  }
6359  }
6360  ibbt = ((model_.CBBTSTI_i)*(((V5*Fmaxr)*Fmaxr)*tmp));
6361  }
6362  if (((model_.VBRSTI_i)>1000))
6363  {
6364  fbreakdown = 1;
6365  }
6366  else
6367  {
6368  if ((vav>((-0.999)*(model_.VBRSTI_i))))
6369  {
6370  if (((model_.PBRSTI_i)==4))
6371  {
6372  tmp = (((fabs((vav*(model_.VBRinvsti)))*fabs((vav*(model_.VBRinvsti))))*fabs((vav*(model_.VBRinvsti))))*fabs((vav*(model_.VBRinvsti))));
6373  }
6374  else
6375  {
6376  tmp = pow(fabs((vav*(model_.VBRinvsti))),(model_.PBRSTI_i));
6377  }
6378  fbreakdown = (1/(1-tmp));
6379  }
6380  else
6381  {
6382  fbreakdown = ((model_.fstopsti)+((vav+(0.999*(model_.VBRSTI_i)))*(model_.slopesti)));
6383  }
6384  }
6385  ijunsti = ((((id+isrh)+itat)+ibbt)*fbreakdown);
6386  }
6387  if ((LGSOURCE_i==0))
6388  {
6389  ijungat = 0;
6390  qjungat = 0;
6391  }
6392  else
6393  {
6394  if (((model_.one_minus_PGAT)==0.5))
6395  {
6396  tmp = sqrt((1-(vj*(model_.vbiinvgat))));
6397  }
6398  else
6399  {
6400  tmp = pow((1-(vj*(model_.vbiinvgat))),(model_.one_minus_PGAT));
6401  }
6402  qjungat = (((model_.qprefgat)*(1-tmp))+((model_.qpref2gat)*(V5-vj)));
6403  id = ((model_.idsatgat)*idmult);
6404  if ((((model_.CSRHGAT_i)==0)&&((model_.CTATGAT_i)==0)))
6405  {
6406  isrh = 0;
6407  }
6408  else
6409  {
6410  vbi_minus_vjsrh = ((model_.vbigat)-vjsrh);
6411  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
6412  if (((model_.PGAT_i)==0.5))
6413  {
6414  dwsrh = 0;
6415  }
6416  else
6417  {
6418  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PGAT_i))));
6419  }
6420  wsrh = (wsrhstep+dwsrh);
6421  if (((model_.PGAT_i)==0.5))
6422  {
6423  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRGATinv)));
6424  }
6425  else
6426  {
6427  tmp = pow((vbi_minus_vjsrh*(model_.VBIRGATinv)),(model_.PGAT_i));
6428  }
6429  wdep = ((model_.wdepnulrgat)*tmp);
6430  asrh = ((model_.ftdgat)*((zinv-1)*wdep));
6431  isrh = ((model_.CSRHGAT_i)*(asrh*wsrh));
6432  }
6433  if (((model_.CTATGAT_i)==0))
6434  {
6435  itat = 0;
6436  }
6437  else
6438  {
6439  btat = ((model_.btatpartgat)*((wdep*(model_.one_minus_PGAT))/vbi_minus_vjsrh));
6440  twoatatoverthreebtat = ((0.666666666666667*(model_.atatgat))/btat);
6441  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
6442  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
6443  sqrtumax = sqrt(fabs(umax));
6444  umaxpoweronepointfive = (umax*sqrtumax);
6445  if ((((-(model_.PGAT_i))*(model_.one_over_one_minus_PGAT))==(-1)))
6446  {
6447  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
6448  }
6449  else
6450  {
6451  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PGAT_i))*(model_.one_over_one_minus_PGAT)));
6452  }
6453  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
6454  ktat = sqrt((0.375*(btat/sqrtumax)));
6455  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
6456  mtat = (((((model_.atatgat)*twoatatoverthreebtat)*sqrtumax)-((model_.atatgat)*umax))+(0.5*(btat*umaxpoweronepointfive)));
6457  xerfc = ((ltat-1)*ktat);
6458  ysq = (xerfc*xerfc);
6459  if ((xerfc>0))
6460  {
6461  terfc = (1/(1+((model_.perfc)*xerfc)));
6462  }
6463  else
6464  {
6465  terfc = (1/(1-((model_.perfc)*xerfc)));
6466  }
6467  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
6468  {
6469  tmp = exp(((-ysq)+mtat));
6470  }
6471  else
6472  {
6473  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
6474  }
6475  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
6476  if ((xerfc>0))
6477  {
6478  erfctimesexpmtat = erfcpos;
6479  }
6480  else
6481  {
6482  if ((mtat>(-2.3025850929940458e+02)))
6483  {
6484  tmp = exp(mtat);
6485  }
6486  else
6487  {
6488  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
6489  }
6490  erfctimesexpmtat = ((2*tmp)-erfcpos);
6491  }
6492  gammamax = ((1.77245385090551603*0.5)*(((model_.atatgat)*erfctimesexpmtat)/ktat));
6493  itat = ((model_.CTATGAT_i)*((asrh*gammamax)*wtat));
6494  }
6495  if (((model_.CBBTGAT_i)==0))
6496  {
6497  ibbt = 0;
6498  }
6499  else
6500  {
6501  if (((model_.PGAT_i)==0.5))
6502  {
6503  tmp = sqrt((((model_.VBIRGAT_i)-vbbt)*(model_.VBIRGATinv)));
6504  }
6505  else
6506  {
6507  tmp = pow((((model_.VBIRGAT_i)-vbbt)*(model_.VBIRGATinv)),(model_.PGAT_i));
6508  }
6509  Fmaxr = ((model_.one_over_one_minus_PGAT)*((((model_.VBIRGAT_i)-vbbt)*(model_.wdepnulrinvgat))/tmp));
6510  if ((fabs(((-(model_.fbbtgat))/Fmaxr))<2.3025850929940458e+02))
6511  {
6512  tmp = exp(((-(model_.fbbtgat))/Fmaxr));
6513  }
6514  else
6515  {
6516  if ((((-(model_.fbbtgat))/Fmaxr)<(-2.3025850929940458e+02)))
6517  {
6518  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*3.3333333333333333e-01))))))));
6519  }
6520  else
6521  {
6522  tmp = (1.0e100*(1.0+((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
6523  }
6524  }
6525  ibbt = ((model_.CBBTGAT_i)*(((V5*Fmaxr)*Fmaxr)*tmp));
6526  }
6527  if (((model_.VBRGAT_i)>1000))
6528  {
6529  fbreakdown = 1;
6530  }
6531  else
6532  {
6533  if ((vav>((-0.999)*(model_.VBRGAT_i))))
6534  {
6535  if (((model_.PBRGAT_i)==4))
6536  {
6537  tmp = (((fabs((vav*(model_.VBRinvgat)))*fabs((vav*(model_.VBRinvgat))))*fabs((vav*(model_.VBRinvgat))))*fabs((vav*(model_.VBRinvgat))));
6538  }
6539  else
6540  {
6541  tmp = pow(fabs((vav*(model_.VBRinvgat))),(model_.PBRGAT_i));
6542  }
6543  fbreakdown = (1/(1-tmp));
6544  }
6545  else
6546  {
6547  fbreakdown = ((model_.fstopgat)+((vav+(0.999*(model_.VBRGAT_i)))*(model_.slopegat)));
6548  }
6549  }
6550  ijungat = ((((id+isrh)+itat)+ibbt)*fbreakdown);
6551  }
6552  I5 = (((ABSOURCE_i*ijunbot)+(LSSOURCE_i*ijunsti))+(LGSOURCE_i*ijungat));
6554  I4_cor = (I4-(ISATFOR1_s*(exp(((V4*(model_.phitdinv))*MFOR1_s))-1.0)));
6555  I5_cor = (I5-(ISATFOR1_s*(exp(((V5*(model_.phitdinv))*MFOR1_s))-1.0)));
6556  if ((!(((ABSOURCE_i==0)&&(LSSOURCE_i==0))&&(LGSOURCE_i==0))))
6557  {
6558  if (((I4>0)&&(I5>0)))
6559  {
6560  if ((((((I4_cor/I4)>0.001)||((I5_cor/I5)>0.001))&&(I4_cor>0))&&(I5_cor>0)))
6561  {
6562  alphaje = (I4_cor/I5_cor);
6563  MFOR2_s = (((model_.phitd)*log(alphaje))/(V4-V5));
6564  ISATFOR2_s = (I4_cor/(exp(((V4*(model_.phitdinv))*MFOR2_s))-1));
6565  }
6566  }
6567  I1_cor = ((I1-(ISATFOR1_s*(exp(((V1*(model_.phitdinv))*MFOR1_s))-1.0)))-(ISATFOR2_s*(exp(((V1*(model_.phitdinv))*MFOR2_s))-1.0)));
6568  I2_cor = ((I2-(ISATFOR1_s*(exp(((V2*(model_.phitdinv))*MFOR1_s))-1.0)))-(ISATFOR2_s*(exp(((V2*(model_.phitdinv))*MFOR2_s))-1.0)));
6569  I3_cor = ((I3-(ISATFOR1_s*(exp(((V3*(model_.phitdinv))*MFOR1_s))-1.0)))-(ISATFOR2_s*(exp(((V3*(model_.phitdinv))*MFOR2_s))-1.0)));
6570  if ((((I1<0)&&(I2<0))&&(I3<0)))
6571  {
6572  if ((((((((I1_cor/I1)>0.001)||((I2_cor/I2)>0.001))||((I3_cor/I3)>0.001))&&(I1_cor<0))&&(I2_cor<0))&&(I3_cor<0)))
6573  {
6574  alphaje = (I1_cor/I2_cor);
6575  m0_rev = (((-(model_.phitd))*log(alphaje))/(V1-V2));
6576  tt0 = (V2/(V2-V1));
6577  tt1 = (((model_.phitd)*(alphaje-1))*(pow(alphaje,tt0)-1));
6578  tt0 = (V1/(V1-V2));
6579  tt2 = (((pow(alphaje,tt0)*(V2-V1))+(alphaje*V1))-V2);
6580  mcor_rev = (tt1/tt2);
6581  MREV_s = (m0_rev+mcor_rev);
6582  if ((fabs(((V3*(model_.phitdinv))*MREV_s))<1e-6))
6583  {
6584  m0flag_s = 1.0;
6585  ISATREV_s = (I3_cor*((1/V3)+((0.5*(model_.phitdinv))*MREV_s)));
6586  MREV_s = (((((-0.5)*I3_cor)*MREV_s)*(model_.phitdinv))/V3);
6587  }
6588  else
6589  {
6590  m0flag_s = 0.0;
6591  ISATREV_s = ((-I3_cor)/(exp((((-V3)*(model_.phitdinv))*MREV_s))-1));
6592  }
6593  }
6594  }
6595  }
6597  if (((ABSOURCE_i*(model_.cjobot))<=zfrac))
6598  {
6599  zflagbot_s = 0.0;
6600  }
6601  if (((LSSOURCE_i*(model_.cjosti))<=zfrac))
6602  {
6603  zflagsti_s = 0.0;
6604  }
6605  if (((LGSOURCE_i*(model_.cjogat))<=zfrac))
6606  {
6607  zflaggat_s = 0.0;
6608  }
6609  if ((!(((ABSOURCE_i==0)&&(LSSOURCE_i==0))&&(LGSOURCE_i==0))))
6610  {
6611  xhighf1_s = log(((0.5*(model_.IMAX_i))/(ISATFOR1_s+1e-21)));
6612  xhighf2_s = log(((0.5*(model_.IMAX_i))/(ISATFOR2_s+1e-21)));
6613  xhighr_s = log(((0.5*(model_.IMAX_i))/(fabs(ISATREV_s)+1e-21)));
6614  }
6615  xhighf1_s = std::min(xhighf1_s,2.3025850929940458e+02);
6616  expxhf1_s = exp(xhighf1_s);
6617  xhighf2_s = std::min(xhighf2_s,2.3025850929940458e+02);
6618  expxhf2_s = exp(xhighf2_s);
6619  xhighr_s = std::min(xhighr_s,2.3025850929940458e+02);
6620  expxhr_s = exp(xhighr_s);
6627  (model_.PBOT_i) = (model_.PBOTD_i);
6628  (model_.PSTI_i) = (model_.PSTID_i);
6629  (model_.PGAT_i) = (model_.PGATD_i);
6663  (model_.FJUNQ_i) = (model_.FJUNQD_i);
6670  (model_.ftdbot) = (model_.ftdbot_d);
6671  (model_.ftdsti) = (model_.ftdsti_d);
6672  (model_.ftdgat) = (model_.ftdgat_d);
6676  (model_.ubibot) = (model_.ubibot_d);
6677  (model_.ubisti) = (model_.ubisti_d);
6678  (model_.ubigat) = (model_.ubigat_d);
6679  (model_.vbibot) = (model_.vbibot_d);
6680  (model_.vbisti) = (model_.vbisti_d);
6681  (model_.vbigat) = (model_.vbigat_d);
6691  (model_.cjobot) = (model_.cjobot_d);
6692  (model_.cjosti) = (model_.cjosti_d);
6693  (model_.cjogat) = (model_.cjogat_d);
6733  FRACNA = 0.4;
6734  FRACNB = 0.65;
6735  FRACI = 0.8;
6736  V1 = ((-FRACNA)*(model_.VJUNREF_i));
6737  V2 = ((-FRACNB)*(model_.VJUNREF_i));
6738  V3 = ((-FRACI)*(model_.VJUNREF_i));
6739  V4 = 0.1;
6740  V5 = 0.2;
6741  vbbt = 0.0;
6742  two_psistar = 0.0;
6743  if ((!(((ABDRAIN_i==0)&&(LSDRAIN_i==0))&&(LGDRAIN_i==0))))
6744  {
6745  h1 = ((4.0*vch_d)*vch_d);
6746  h2 = (vch_d/vfmin_d);
6747  h2d = (V1+(vch_d*h2));
6748  h3 = (vfmin_d+h2d);
6749  h4 = (vfmin_d-h2d);
6750  h5 = sqrt(((h4*h4)+h1));
6751  vj = (2.0*((V1*vfmin_d)/(h3+h5)));
6752  if ((V1<VMAX_d))
6753  {
6754  if ((fabs((0.5*(V1*(model_.phitdinv))))<2.3025850929940458e+02))
6755  {
6756  zinv = exp((0.5*(V1*(model_.phitdinv))));
6757  }
6758  else
6759  {
6760  if (((0.5*(V1*(model_.phitdinv)))<(-2.3025850929940458e+02)))
6761  {
6762  zinv = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-(0.5*(V1*(model_.phitdinv))))*(1.0+(0.5*(((-2.3025850929940458e+02)-(0.5*(V1*(model_.phitdinv))))*(1.0+(((-2.3025850929940458e+02)-(0.5*(V1*(model_.phitdinv))))*3.3333333333333333e-01))))))));
6763  }
6764  else
6765  {
6766  zinv = (1.0e100*(1.0+(((0.5*(V1*(model_.phitdinv)))-2.3025850929940458e+02)*(1.0+(0.5*(((0.5*(V1*(model_.phitdinv)))-2.3025850929940458e+02)*(1.0+(((0.5*(V1*(model_.phitdinv)))-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
6767  }
6768  }
6769  idmult = (zinv*zinv);
6770  }
6771  else
6772  {
6773  idmult = ((1+((V1-VMAX_d)*(model_.phitdinv)))*exp_VMAX_over_phitd_d);
6774  zinv = sqrt(idmult);
6775  }
6776  idmult = (idmult-1.0);
6777  z = (1/zinv);
6778  if ((V1>0))
6779  {
6780  two_psistar = (2.0*((model_.phitd)*log(((2.0+z)+sqrt(((z+1.0)*(z+3.0)))))));
6781  }
6782  else
6783  {
6784  two_psistar = ((-V1)+(2.0*((model_.phitd)*log((((2*zinv)+1)+sqrt(((1+zinv)*(1+(3*zinv)))))))));
6785  }
6786  vjlim = (vbimin_d-two_psistar);
6787  vjsrh = (0.5*((V1+vjlim)-sqrt((((V1-vjlim)*(V1-vjlim))+((4*(model_.phitd))*(model_.phitd))))));
6788  vbbt = (0.5*((V1+vbbtlim_d)-sqrt((((V1-vbbtlim_d)*(V1-vbbtlim_d))+((4*(model_.phitr))*(model_.phitr))))));
6789  vav = (0.5*((V1)-sqrt((((V1)*(V1))+((4*1E-6)*1E-6)))));
6790  }
6791  if ((ABDRAIN_i==0))
6792  {
6793  ijunbot = 0;
6794  qjunbot = 0;
6795  }
6796  else
6797  {
6798  if (((model_.one_minus_PBOT)==0.5))
6799  {
6800  tmp = sqrt((1-(vj*(model_.vbiinvbot))));
6801  }
6802  else
6803  {
6804  tmp = pow((1-(vj*(model_.vbiinvbot))),(model_.one_minus_PBOT));
6805  }
6806  qjunbot = (((model_.qprefbot)*(1-tmp))+((model_.qpref2bot)*(V1-vj)));
6807  id = ((model_.idsatbot)*idmult);
6808  if ((((model_.CSRHBOT_i)==0)&&((model_.CTATBOT_i)==0)))
6809  {
6810  isrh = 0;
6811  }
6812  else
6813  {
6814  vbi_minus_vjsrh = ((model_.vbibot)-vjsrh);
6815  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
6816  if (((model_.PBOT_i)==0.5))
6817  {
6818  dwsrh = 0;
6819  }
6820  else
6821  {
6822  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PBOT_i))));
6823  }
6824  wsrh = (wsrhstep+dwsrh);
6825  if (((model_.PBOT_i)==0.5))
6826  {
6827  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRBOTinv)));
6828  }
6829  else
6830  {
6831  tmp = pow((vbi_minus_vjsrh*(model_.VBIRBOTinv)),(model_.PBOT_i));
6832  }
6833  wdep = ((model_.wdepnulrbot)*tmp);
6834  asrh = ((model_.ftdbot)*((zinv-1)*wdep));
6835  isrh = ((model_.CSRHBOT_i)*(asrh*wsrh));
6836  }
6837  if (((model_.CTATBOT_i)==0))
6838  {
6839  itat = 0;
6840  }
6841  else
6842  {
6843  btat = ((model_.btatpartbot)*((wdep*(model_.one_minus_PBOT))/vbi_minus_vjsrh));
6844  twoatatoverthreebtat = ((0.666666666666667*(model_.atatbot))/btat);
6845  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
6846  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
6847  sqrtumax = sqrt(fabs(umax));
6848  umaxpoweronepointfive = (umax*sqrtumax);
6849  if ((((-(model_.PBOT_i))*(model_.one_over_one_minus_PBOT))==(-1)))
6850  {
6851  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
6852  }
6853  else
6854  {
6855  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PBOT_i))*(model_.one_over_one_minus_PBOT)));
6856  }
6857  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
6858  ktat = sqrt((0.375*(btat/sqrtumax)));
6859  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
6860  mtat = (((((model_.atatbot)*twoatatoverthreebtat)*sqrtumax)-((model_.atatbot)*umax))+(0.5*(btat*umaxpoweronepointfive)));
6861  xerfc = ((ltat-1)*ktat);
6862  ysq = (xerfc*xerfc);
6863  if ((xerfc>0))
6864  {
6865  terfc = (1/(1+((model_.perfc)*xerfc)));
6866  }
6867  else
6868  {
6869  terfc = (1/(1-((model_.perfc)*xerfc)));
6870  }
6871  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
6872  {
6873  tmp = exp(((-ysq)+mtat));
6874  }
6875  else
6876  {
6877  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
6878  }
6879  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
6880  if ((xerfc>0))
6881  {
6882  erfctimesexpmtat = erfcpos;
6883  }
6884  else
6885  {
6886  if ((mtat>(-2.3025850929940458e+02)))
6887  {
6888  tmp = exp(mtat);
6889  }
6890  else
6891  {
6892  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
6893  }
6894  erfctimesexpmtat = ((2*tmp)-erfcpos);
6895  }
6896  gammamax = ((1.77245385090551603*0.5)*(((model_.atatbot)*erfctimesexpmtat)/ktat));
6897  itat = ((model_.CTATBOT_i)*((asrh*gammamax)*wtat));
6898  }
6899  if (((model_.CBBTBOT_i)==0))
6900  {
6901  ibbt = 0;
6902  }
6903  else
6904  {
6905  if (((model_.PBOT_i)==0.5))
6906  {
6907  tmp = sqrt((((model_.VBIRBOT_i)-vbbt)*(model_.VBIRBOTinv)));
6908  }
6909  else
6910  {
6911  tmp = pow((((model_.VBIRBOT_i)-vbbt)*(model_.VBIRBOTinv)),(model_.PBOT_i));
6912  }
6913  Fmaxr = ((model_.one_over_one_minus_PBOT)*((((model_.VBIRBOT_i)-vbbt)*(model_.wdepnulrinvbot))/tmp));
6914  if ((fabs(((-(model_.fbbtbot))/Fmaxr))<2.3025850929940458e+02))
6915  {
6916  tmp = exp(((-(model_.fbbtbot))/Fmaxr));
6917  }
6918  else
6919  {
6920  if ((((-(model_.fbbtbot))/Fmaxr)<(-2.3025850929940458e+02)))
6921  {
6922  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*3.3333333333333333e-01))))))));
6923  }
6924  else
6925  {
6926  tmp = (1.0e100*(1.0+((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
6927  }
6928  }
6929  ibbt = ((model_.CBBTBOT_i)*(((V1*Fmaxr)*Fmaxr)*tmp));
6930  }
6931  if (((model_.VBRBOT_i)>1000))
6932  {
6933  fbreakdown = 1;
6934  }
6935  else
6936  {
6937  if ((vav>((-0.999)*(model_.VBRBOT_i))))
6938  {
6939  if (((model_.PBRBOT_i)==4))
6940  {
6941  tmp = (((fabs((vav*(model_.VBRinvbot)))*fabs((vav*(model_.VBRinvbot))))*fabs((vav*(model_.VBRinvbot))))*fabs((vav*(model_.VBRinvbot))));
6942  }
6943  else
6944  {
6945  tmp = pow(fabs((vav*(model_.VBRinvbot))),(model_.PBRBOT_i));
6946  }
6947  fbreakdown = (1/(1-tmp));
6948  }
6949  else
6950  {
6951  fbreakdown = ((model_.fstopbot)+((vav+(0.999*(model_.VBRBOT_i)))*(model_.slopebot)));
6952  }
6953  }
6954  ijunbot = ((((id+isrh)+itat)+ibbt)*fbreakdown);
6955  }
6956  if ((LSDRAIN_i==0))
6957  {
6958  ijunsti = 0;
6959  qjunsti = 0;
6960  }
6961  else
6962  {
6963  if (((model_.one_minus_PSTI)==0.5))
6964  {
6965  tmp = sqrt((1-(vj*(model_.vbiinvsti))));
6966  }
6967  else
6968  {
6969  tmp = pow((1-(vj*(model_.vbiinvsti))),(model_.one_minus_PSTI));
6970  }
6971  qjunsti = (((model_.qprefsti)*(1-tmp))+((model_.qpref2sti)*(V1-vj)));
6972  id = ((model_.idsatsti)*idmult);
6973  if ((((model_.CSRHSTI_i)==0)&&((model_.CTATSTI_i)==0)))
6974  {
6975  isrh = 0;
6976  }
6977  else
6978  {
6979  vbi_minus_vjsrh = ((model_.vbisti)-vjsrh);
6980  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
6981  if (((model_.PSTI_i)==0.5))
6982  {
6983  dwsrh = 0;
6984  }
6985  else
6986  {
6987  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PSTI_i))));
6988  }
6989  wsrh = (wsrhstep+dwsrh);
6990  if (((model_.PSTI_i)==0.5))
6991  {
6992  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRSTIinv)));
6993  }
6994  else
6995  {
6996  tmp = pow((vbi_minus_vjsrh*(model_.VBIRSTIinv)),(model_.PSTI_i));
6997  }
6998  wdep = ((model_.wdepnulrsti)*tmp);
6999  asrh = ((model_.ftdsti)*((zinv-1)*wdep));
7000  isrh = ((model_.CSRHSTI_i)*(asrh*wsrh));
7001  }
7002  if (((model_.CTATSTI_i)==0))
7003  {
7004  itat = 0;
7005  }
7006  else
7007  {
7008  btat = ((model_.btatpartsti)*((wdep*(model_.one_minus_PSTI))/vbi_minus_vjsrh));
7009  twoatatoverthreebtat = ((0.666666666666667*(model_.atatsti))/btat);
7010  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
7011  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
7012  sqrtumax = sqrt(fabs(umax));
7013  umaxpoweronepointfive = (umax*sqrtumax);
7014  if ((((-(model_.PSTI_i))*(model_.one_over_one_minus_PSTI))==(-1)))
7015  {
7016  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
7017  }
7018  else
7019  {
7020  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PSTI_i))*(model_.one_over_one_minus_PSTI)));
7021  }
7022  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
7023  ktat = sqrt((0.375*(btat/sqrtumax)));
7024  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
7025  mtat = (((((model_.atatsti)*twoatatoverthreebtat)*sqrtumax)-((model_.atatsti)*umax))+(0.5*(btat*umaxpoweronepointfive)));
7026  xerfc = ((ltat-1)*ktat);
7027  ysq = (xerfc*xerfc);
7028  if ((xerfc>0))
7029  {
7030  terfc = (1/(1+((model_.perfc)*xerfc)));
7031  }
7032  else
7033  {
7034  terfc = (1/(1-((model_.perfc)*xerfc)));
7035  }
7036  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
7037  {
7038  tmp = exp(((-ysq)+mtat));
7039  }
7040  else
7041  {
7042  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
7043  }
7044  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
7045  if ((xerfc>0))
7046  {
7047  erfctimesexpmtat = erfcpos;
7048  }
7049  else
7050  {
7051  if ((mtat>(-2.3025850929940458e+02)))
7052  {
7053  tmp = exp(mtat);
7054  }
7055  else
7056  {
7057  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
7058  }
7059  erfctimesexpmtat = ((2*tmp)-erfcpos);
7060  }
7061  gammamax = ((1.77245385090551603*0.5)*(((model_.atatsti)*erfctimesexpmtat)/ktat));
7062  itat = ((model_.CTATSTI_i)*((asrh*gammamax)*wtat));
7063  }
7064  if (((model_.CBBTSTI_i)==0))
7065  {
7066  ibbt = 0;
7067  }
7068  else
7069  {
7070  if (((model_.PSTI_i)==0.5))
7071  {
7072  tmp = sqrt((((model_.VBIRSTI_i)-vbbt)*(model_.VBIRSTIinv)));
7073  }
7074  else
7075  {
7076  tmp = pow((((model_.VBIRSTI_i)-vbbt)*(model_.VBIRSTIinv)),(model_.PSTI_i));
7077  }
7078  Fmaxr = ((model_.one_over_one_minus_PSTI)*((((model_.VBIRSTI_i)-vbbt)*(model_.wdepnulrinvsti))/tmp));
7079  if ((fabs(((-(model_.fbbtsti))/Fmaxr))<2.3025850929940458e+02))
7080  {
7081  tmp = exp(((-(model_.fbbtsti))/Fmaxr));
7082  }
7083  else
7084  {
7085  if ((((-(model_.fbbtsti))/Fmaxr)<(-2.3025850929940458e+02)))
7086  {
7087  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*3.3333333333333333e-01))))))));
7088  }
7089  else
7090  {
7091  tmp = (1.0e100*(1.0+((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
7092  }
7093  }
7094  ibbt = ((model_.CBBTSTI_i)*(((V1*Fmaxr)*Fmaxr)*tmp));
7095  }
7096  if (((model_.VBRSTI_i)>1000))
7097  {
7098  fbreakdown = 1;
7099  }
7100  else
7101  {
7102  if ((vav>((-0.999)*(model_.VBRSTI_i))))
7103  {
7104  if (((model_.PBRSTI_i)==4))
7105  {
7106  tmp = (((fabs((vav*(model_.VBRinvsti)))*fabs((vav*(model_.VBRinvsti))))*fabs((vav*(model_.VBRinvsti))))*fabs((vav*(model_.VBRinvsti))));
7107  }
7108  else
7109  {
7110  tmp = pow(fabs((vav*(model_.VBRinvsti))),(model_.PBRSTI_i));
7111  }
7112  fbreakdown = (1/(1-tmp));
7113  }
7114  else
7115  {
7116  fbreakdown = ((model_.fstopsti)+((vav+(0.999*(model_.VBRSTI_i)))*(model_.slopesti)));
7117  }
7118  }
7119  ijunsti = ((((id+isrh)+itat)+ibbt)*fbreakdown);
7120  }
7121  if ((LGDRAIN_i==0))
7122  {
7123  ijungat = 0;
7124  qjungat = 0;
7125  }
7126  else
7127  {
7128  if (((model_.one_minus_PGAT)==0.5))
7129  {
7130  tmp = sqrt((1-(vj*(model_.vbiinvgat))));
7131  }
7132  else
7133  {
7134  tmp = pow((1-(vj*(model_.vbiinvgat))),(model_.one_minus_PGAT));
7135  }
7136  qjungat = (((model_.qprefgat)*(1-tmp))+((model_.qpref2gat)*(V1-vj)));
7137  id = ((model_.idsatgat)*idmult);
7138  if ((((model_.CSRHGAT_i)==0)&&((model_.CTATGAT_i)==0)))
7139  {
7140  isrh = 0;
7141  }
7142  else
7143  {
7144  vbi_minus_vjsrh = ((model_.vbigat)-vjsrh);
7145  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
7146  if (((model_.PGAT_i)==0.5))
7147  {
7148  dwsrh = 0;
7149  }
7150  else
7151  {
7152  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PGAT_i))));
7153  }
7154  wsrh = (wsrhstep+dwsrh);
7155  if (((model_.PGAT_i)==0.5))
7156  {
7157  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRGATinv)));
7158  }
7159  else
7160  {
7161  tmp = pow((vbi_minus_vjsrh*(model_.VBIRGATinv)),(model_.PGAT_i));
7162  }
7163  wdep = ((model_.wdepnulrgat)*tmp);
7164  asrh = ((model_.ftdgat)*((zinv-1)*wdep));
7165  isrh = ((model_.CSRHGAT_i)*(asrh*wsrh));
7166  }
7167  if (((model_.CTATGAT_i)==0))
7168  {
7169  itat = 0;
7170  }
7171  else
7172  {
7173  btat = ((model_.btatpartgat)*((wdep*(model_.one_minus_PGAT))/vbi_minus_vjsrh));
7174  twoatatoverthreebtat = ((0.666666666666667*(model_.atatgat))/btat);
7175  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
7176  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
7177  sqrtumax = sqrt(fabs(umax));
7178  umaxpoweronepointfive = (umax*sqrtumax);
7179  if ((((-(model_.PGAT_i))*(model_.one_over_one_minus_PGAT))==(-1)))
7180  {
7181  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
7182  }
7183  else
7184  {
7185  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PGAT_i))*(model_.one_over_one_minus_PGAT)));
7186  }
7187  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
7188  ktat = sqrt((0.375*(btat/sqrtumax)));
7189  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
7190  mtat = (((((model_.atatgat)*twoatatoverthreebtat)*sqrtumax)-((model_.atatgat)*umax))+(0.5*(btat*umaxpoweronepointfive)));
7191  xerfc = ((ltat-1)*ktat);
7192  ysq = (xerfc*xerfc);
7193  if ((xerfc>0))
7194  {
7195  terfc = (1/(1+((model_.perfc)*xerfc)));
7196  }
7197  else
7198  {
7199  terfc = (1/(1-((model_.perfc)*xerfc)));
7200  }
7201  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
7202  {
7203  tmp = exp(((-ysq)+mtat));
7204  }
7205  else
7206  {
7207  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
7208  }
7209  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
7210  if ((xerfc>0))
7211  {
7212  erfctimesexpmtat = erfcpos;
7213  }
7214  else
7215  {
7216  if ((mtat>(-2.3025850929940458e+02)))
7217  {
7218  tmp = exp(mtat);
7219  }
7220  else
7221  {
7222  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
7223  }
7224  erfctimesexpmtat = ((2*tmp)-erfcpos);
7225  }
7226  gammamax = ((1.77245385090551603*0.5)*(((model_.atatgat)*erfctimesexpmtat)/ktat));
7227  itat = ((model_.CTATGAT_i)*((asrh*gammamax)*wtat));
7228  }
7229  if (((model_.CBBTGAT_i)==0))
7230  {
7231  ibbt = 0;
7232  }
7233  else
7234  {
7235  if (((model_.PGAT_i)==0.5))
7236  {
7237  tmp = sqrt((((model_.VBIRGAT_i)-vbbt)*(model_.VBIRGATinv)));
7238  }
7239  else
7240  {
7241  tmp = pow((((model_.VBIRGAT_i)-vbbt)*(model_.VBIRGATinv)),(model_.PGAT_i));
7242  }
7243  Fmaxr = ((model_.one_over_one_minus_PGAT)*((((model_.VBIRGAT_i)-vbbt)*(model_.wdepnulrinvgat))/tmp));
7244  if ((fabs(((-(model_.fbbtgat))/Fmaxr))<2.3025850929940458e+02))
7245  {
7246  tmp = exp(((-(model_.fbbtgat))/Fmaxr));
7247  }
7248  else
7249  {
7250  if ((((-(model_.fbbtgat))/Fmaxr)<(-2.3025850929940458e+02)))
7251  {
7252  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*3.3333333333333333e-01))))))));
7253  }
7254  else
7255  {
7256  tmp = (1.0e100*(1.0+((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
7257  }
7258  }
7259  ibbt = ((model_.CBBTGAT_i)*(((V1*Fmaxr)*Fmaxr)*tmp));
7260  }
7261  if (((model_.VBRGAT_i)>1000))
7262  {
7263  fbreakdown = 1;
7264  }
7265  else
7266  {
7267  if ((vav>((-0.999)*(model_.VBRGAT_i))))
7268  {
7269  if (((model_.PBRGAT_i)==4))
7270  {
7271  tmp = (((fabs((vav*(model_.VBRinvgat)))*fabs((vav*(model_.VBRinvgat))))*fabs((vav*(model_.VBRinvgat))))*fabs((vav*(model_.VBRinvgat))));
7272  }
7273  else
7274  {
7275  tmp = pow(fabs((vav*(model_.VBRinvgat))),(model_.PBRGAT_i));
7276  }
7277  fbreakdown = (1/(1-tmp));
7278  }
7279  else
7280  {
7281  fbreakdown = ((model_.fstopgat)+((vav+(0.999*(model_.VBRGAT_i)))*(model_.slopegat)));
7282  }
7283  }
7284  ijungat = ((((id+isrh)+itat)+ibbt)*fbreakdown);
7285  }
7286  I1 = (((ABDRAIN_i*ijunbot)+(LSDRAIN_i*ijunsti))+(LGDRAIN_i*ijungat));
7287  vbbt = 0.0;
7288  two_psistar = 0.0;
7289  if ((!(((ABDRAIN_i==0)&&(LSDRAIN_i==0))&&(LGDRAIN_i==0))))
7290  {
7291  h1 = ((4.0*vch_d)*vch_d);
7292  h2 = (vch_d/vfmin_d);
7293  h2d = (V2+(vch_d*h2));
7294  h3 = (vfmin_d+h2d);
7295  h4 = (vfmin_d-h2d);
7296  h5 = sqrt(((h4*h4)+h1));
7297  vj = (2.0*((V2*vfmin_d)/(h3+h5)));
7298  if ((V2<VMAX_d))
7299  {
7300  if ((fabs((0.5*(V2*(model_.phitdinv))))<2.3025850929940458e+02))
7301  {
7302  zinv = exp((0.5*(V2*(model_.phitdinv))));
7303  }
7304  else
7305  {
7306  if (((0.5*(V2*(model_.phitdinv)))<(-2.3025850929940458e+02)))
7307  {
7308  zinv = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-(0.5*(V2*(model_.phitdinv))))*(1.0+(0.5*(((-2.3025850929940458e+02)-(0.5*(V2*(model_.phitdinv))))*(1.0+(((-2.3025850929940458e+02)-(0.5*(V2*(model_.phitdinv))))*3.3333333333333333e-01))))))));
7309  }
7310  else
7311  {
7312  zinv = (1.0e100*(1.0+(((0.5*(V2*(model_.phitdinv)))-2.3025850929940458e+02)*(1.0+(0.5*(((0.5*(V2*(model_.phitdinv)))-2.3025850929940458e+02)*(1.0+(((0.5*(V2*(model_.phitdinv)))-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
7313  }
7314  }
7315  idmult = (zinv*zinv);
7316  }
7317  else
7318  {
7319  idmult = ((1+((V2-VMAX_d)*(model_.phitdinv)))*exp_VMAX_over_phitd_d);
7320  zinv = sqrt(idmult);
7321  }
7322  idmult = (idmult-1.0);
7323  z = (1/zinv);
7324  if ((V2>0))
7325  {
7326  two_psistar = (2.0*((model_.phitd)*log(((2.0+z)+sqrt(((z+1.0)*(z+3.0)))))));
7327  }
7328  else
7329  {
7330  two_psistar = ((-V2)+(2.0*((model_.phitd)*log((((2*zinv)+1)+sqrt(((1+zinv)*(1+(3*zinv)))))))));
7331  }
7332  vjlim = (vbimin_d-two_psistar);
7333  vjsrh = (0.5*((V2+vjlim)-sqrt((((V2-vjlim)*(V2-vjlim))+((4*(model_.phitd))*(model_.phitd))))));
7334  vbbt = (0.5*((V2+vbbtlim_d)-sqrt((((V2-vbbtlim_d)*(V2-vbbtlim_d))+((4*(model_.phitr))*(model_.phitr))))));
7335  vav = (0.5*((V2)-sqrt((((V2)*(V2))+((4*1E-6)*1E-6)))));
7336  }
7337  if ((ABDRAIN_i==0))
7338  {
7339  ijunbot = 0;
7340  qjunbot = 0;
7341  }
7342  else
7343  {
7344  if (((model_.one_minus_PBOT)==0.5))
7345  {
7346  tmp = sqrt((1-(vj*(model_.vbiinvbot))));
7347  }
7348  else
7349  {
7350  tmp = pow((1-(vj*(model_.vbiinvbot))),(model_.one_minus_PBOT));
7351  }
7352  qjunbot = (((model_.qprefbot)*(1-tmp))+((model_.qpref2bot)*(V2-vj)));
7353  id = ((model_.idsatbot)*idmult);
7354  if ((((model_.CSRHBOT_i)==0)&&((model_.CTATBOT_i)==0)))
7355  {
7356  isrh = 0;
7357  }
7358  else
7359  {
7360  vbi_minus_vjsrh = ((model_.vbibot)-vjsrh);
7361  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
7362  if (((model_.PBOT_i)==0.5))
7363  {
7364  dwsrh = 0;
7365  }
7366  else
7367  {
7368  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PBOT_i))));
7369  }
7370  wsrh = (wsrhstep+dwsrh);
7371  if (((model_.PBOT_i)==0.5))
7372  {
7373  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRBOTinv)));
7374  }
7375  else
7376  {
7377  tmp = pow((vbi_minus_vjsrh*(model_.VBIRBOTinv)),(model_.PBOT_i));
7378  }
7379  wdep = ((model_.wdepnulrbot)*tmp);
7380  asrh = ((model_.ftdbot)*((zinv-1)*wdep));
7381  isrh = ((model_.CSRHBOT_i)*(asrh*wsrh));
7382  }
7383  if (((model_.CTATBOT_i)==0))
7384  {
7385  itat = 0;
7386  }
7387  else
7388  {
7389  btat = ((model_.btatpartbot)*((wdep*(model_.one_minus_PBOT))/vbi_minus_vjsrh));
7390  twoatatoverthreebtat = ((0.666666666666667*(model_.atatbot))/btat);
7391  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
7392  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
7393  sqrtumax = sqrt(fabs(umax));
7394  umaxpoweronepointfive = (umax*sqrtumax);
7395  if ((((-(model_.PBOT_i))*(model_.one_over_one_minus_PBOT))==(-1)))
7396  {
7397  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
7398  }
7399  else
7400  {
7401  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PBOT_i))*(model_.one_over_one_minus_PBOT)));
7402  }
7403  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
7404  ktat = sqrt((0.375*(btat/sqrtumax)));
7405  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
7406  mtat = (((((model_.atatbot)*twoatatoverthreebtat)*sqrtumax)-((model_.atatbot)*umax))+(0.5*(btat*umaxpoweronepointfive)));
7407  xerfc = ((ltat-1)*ktat);
7408  ysq = (xerfc*xerfc);
7409  if ((xerfc>0))
7410  {
7411  terfc = (1/(1+((model_.perfc)*xerfc)));
7412  }
7413  else
7414  {
7415  terfc = (1/(1-((model_.perfc)*xerfc)));
7416  }
7417  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
7418  {
7419  tmp = exp(((-ysq)+mtat));
7420  }
7421  else
7422  {
7423  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
7424  }
7425  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
7426  if ((xerfc>0))
7427  {
7428  erfctimesexpmtat = erfcpos;
7429  }
7430  else
7431  {
7432  if ((mtat>(-2.3025850929940458e+02)))
7433  {
7434  tmp = exp(mtat);
7435  }
7436  else
7437  {
7438  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
7439  }
7440  erfctimesexpmtat = ((2*tmp)-erfcpos);
7441  }
7442  gammamax = ((1.77245385090551603*0.5)*(((model_.atatbot)*erfctimesexpmtat)/ktat));
7443  itat = ((model_.CTATBOT_i)*((asrh*gammamax)*wtat));
7444  }
7445  if (((model_.CBBTBOT_i)==0))
7446  {
7447  ibbt = 0;
7448  }
7449  else
7450  {
7451  if (((model_.PBOT_i)==0.5))
7452  {
7453  tmp = sqrt((((model_.VBIRBOT_i)-vbbt)*(model_.VBIRBOTinv)));
7454  }
7455  else
7456  {
7457  tmp = pow((((model_.VBIRBOT_i)-vbbt)*(model_.VBIRBOTinv)),(model_.PBOT_i));
7458  }
7459  Fmaxr = ((model_.one_over_one_minus_PBOT)*((((model_.VBIRBOT_i)-vbbt)*(model_.wdepnulrinvbot))/tmp));
7460  if ((fabs(((-(model_.fbbtbot))/Fmaxr))<2.3025850929940458e+02))
7461  {
7462  tmp = exp(((-(model_.fbbtbot))/Fmaxr));
7463  }
7464  else
7465  {
7466  if ((((-(model_.fbbtbot))/Fmaxr)<(-2.3025850929940458e+02)))
7467  {
7468  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*3.3333333333333333e-01))))))));
7469  }
7470  else
7471  {
7472  tmp = (1.0e100*(1.0+((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
7473  }
7474  }
7475  ibbt = ((model_.CBBTBOT_i)*(((V2*Fmaxr)*Fmaxr)*tmp));
7476  }
7477  if (((model_.VBRBOT_i)>1000))
7478  {
7479  fbreakdown = 1;
7480  }
7481  else
7482  {
7483  if ((vav>((-0.999)*(model_.VBRBOT_i))))
7484  {
7485  if (((model_.PBRBOT_i)==4))
7486  {
7487  tmp = (((fabs((vav*(model_.VBRinvbot)))*fabs((vav*(model_.VBRinvbot))))*fabs((vav*(model_.VBRinvbot))))*fabs((vav*(model_.VBRinvbot))));
7488  }
7489  else
7490  {
7491  tmp = pow(fabs((vav*(model_.VBRinvbot))),(model_.PBRBOT_i));
7492  }
7493  fbreakdown = (1/(1-tmp));
7494  }
7495  else
7496  {
7497  fbreakdown = ((model_.fstopbot)+((vav+(0.999*(model_.VBRBOT_i)))*(model_.slopebot)));
7498  }
7499  }
7500  ijunbot = ((((id+isrh)+itat)+ibbt)*fbreakdown);
7501  }
7502  if ((LSDRAIN_i==0))
7503  {
7504  ijunsti = 0;
7505  qjunsti = 0;
7506  }
7507  else
7508  {
7509  if (((model_.one_minus_PSTI)==0.5))
7510  {
7511  tmp = sqrt((1-(vj*(model_.vbiinvsti))));
7512  }
7513  else
7514  {
7515  tmp = pow((1-(vj*(model_.vbiinvsti))),(model_.one_minus_PSTI));
7516  }
7517  qjunsti = (((model_.qprefsti)*(1-tmp))+((model_.qpref2sti)*(V2-vj)));
7518  id = ((model_.idsatsti)*idmult);
7519  if ((((model_.CSRHSTI_i)==0)&&((model_.CTATSTI_i)==0)))
7520  {
7521  isrh = 0;
7522  }
7523  else
7524  {
7525  vbi_minus_vjsrh = ((model_.vbisti)-vjsrh);
7526  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
7527  if (((model_.PSTI_i)==0.5))
7528  {
7529  dwsrh = 0;
7530  }
7531  else
7532  {
7533  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PSTI_i))));
7534  }
7535  wsrh = (wsrhstep+dwsrh);
7536  if (((model_.PSTI_i)==0.5))
7537  {
7538  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRSTIinv)));
7539  }
7540  else
7541  {
7542  tmp = pow((vbi_minus_vjsrh*(model_.VBIRSTIinv)),(model_.PSTI_i));
7543  }
7544  wdep = ((model_.wdepnulrsti)*tmp);
7545  asrh = ((model_.ftdsti)*((zinv-1)*wdep));
7546  isrh = ((model_.CSRHSTI_i)*(asrh*wsrh));
7547  }
7548  if (((model_.CTATSTI_i)==0))
7549  {
7550  itat = 0;
7551  }
7552  else
7553  {
7554  btat = ((model_.btatpartsti)*((wdep*(model_.one_minus_PSTI))/vbi_minus_vjsrh));
7555  twoatatoverthreebtat = ((0.666666666666667*(model_.atatsti))/btat);
7556  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
7557  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
7558  sqrtumax = sqrt(fabs(umax));
7559  umaxpoweronepointfive = (umax*sqrtumax);
7560  if ((((-(model_.PSTI_i))*(model_.one_over_one_minus_PSTI))==(-1)))
7561  {
7562  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
7563  }
7564  else
7565  {
7566  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PSTI_i))*(model_.one_over_one_minus_PSTI)));
7567  }
7568  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
7569  ktat = sqrt((0.375*(btat/sqrtumax)));
7570  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
7571  mtat = (((((model_.atatsti)*twoatatoverthreebtat)*sqrtumax)-((model_.atatsti)*umax))+(0.5*(btat*umaxpoweronepointfive)));
7572  xerfc = ((ltat-1)*ktat);
7573  ysq = (xerfc*xerfc);
7574  if ((xerfc>0))
7575  {
7576  terfc = (1/(1+((model_.perfc)*xerfc)));
7577  }
7578  else
7579  {
7580  terfc = (1/(1-((model_.perfc)*xerfc)));
7581  }
7582  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
7583  {
7584  tmp = exp(((-ysq)+mtat));
7585  }
7586  else
7587  {
7588  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
7589  }
7590  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
7591  if ((xerfc>0))
7592  {
7593  erfctimesexpmtat = erfcpos;
7594  }
7595  else
7596  {
7597  if ((mtat>(-2.3025850929940458e+02)))
7598  {
7599  tmp = exp(mtat);
7600  }
7601  else
7602  {
7603  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
7604  }
7605  erfctimesexpmtat = ((2*tmp)-erfcpos);
7606  }
7607  gammamax = ((1.77245385090551603*0.5)*(((model_.atatsti)*erfctimesexpmtat)/ktat));
7608  itat = ((model_.CTATSTI_i)*((asrh*gammamax)*wtat));
7609  }
7610  if (((model_.CBBTSTI_i)==0))
7611  {
7612  ibbt = 0;
7613  }
7614  else
7615  {
7616  if (((model_.PSTI_i)==0.5))
7617  {
7618  tmp = sqrt((((model_.VBIRSTI_i)-vbbt)*(model_.VBIRSTIinv)));
7619  }
7620  else
7621  {
7622  tmp = pow((((model_.VBIRSTI_i)-vbbt)*(model_.VBIRSTIinv)),(model_.PSTI_i));
7623  }
7624  Fmaxr = ((model_.one_over_one_minus_PSTI)*((((model_.VBIRSTI_i)-vbbt)*(model_.wdepnulrinvsti))/tmp));
7625  if ((fabs(((-(model_.fbbtsti))/Fmaxr))<2.3025850929940458e+02))
7626  {
7627  tmp = exp(((-(model_.fbbtsti))/Fmaxr));
7628  }
7629  else
7630  {
7631  if ((((-(model_.fbbtsti))/Fmaxr)<(-2.3025850929940458e+02)))
7632  {
7633  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*3.3333333333333333e-01))))))));
7634  }
7635  else
7636  {
7637  tmp = (1.0e100*(1.0+((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
7638  }
7639  }
7640  ibbt = ((model_.CBBTSTI_i)*(((V2*Fmaxr)*Fmaxr)*tmp));
7641  }
7642  if (((model_.VBRSTI_i)>1000))
7643  {
7644  fbreakdown = 1;
7645  }
7646  else
7647  {
7648  if ((vav>((-0.999)*(model_.VBRSTI_i))))
7649  {
7650  if (((model_.PBRSTI_i)==4))
7651  {
7652  tmp = (((fabs((vav*(model_.VBRinvsti)))*fabs((vav*(model_.VBRinvsti))))*fabs((vav*(model_.VBRinvsti))))*fabs((vav*(model_.VBRinvsti))));
7653  }
7654  else
7655  {
7656  tmp = pow(fabs((vav*(model_.VBRinvsti))),(model_.PBRSTI_i));
7657  }
7658  fbreakdown = (1/(1-tmp));
7659  }
7660  else
7661  {
7662  fbreakdown = ((model_.fstopsti)+((vav+(0.999*(model_.VBRSTI_i)))*(model_.slopesti)));
7663  }
7664  }
7665  ijunsti = ((((id+isrh)+itat)+ibbt)*fbreakdown);
7666  }
7667  if ((LGDRAIN_i==0))
7668  {
7669  ijungat = 0;
7670  qjungat = 0;
7671  }
7672  else
7673  {
7674  if (((model_.one_minus_PGAT)==0.5))
7675  {
7676  tmp = sqrt((1-(vj*(model_.vbiinvgat))));
7677  }
7678  else
7679  {
7680  tmp = pow((1-(vj*(model_.vbiinvgat))),(model_.one_minus_PGAT));
7681  }
7682  qjungat = (((model_.qprefgat)*(1-tmp))+((model_.qpref2gat)*(V2-vj)));
7683  id = ((model_.idsatgat)*idmult);
7684  if ((((model_.CSRHGAT_i)==0)&&((model_.CTATGAT_i)==0)))
7685  {
7686  isrh = 0;
7687  }
7688  else
7689  {
7690  vbi_minus_vjsrh = ((model_.vbigat)-vjsrh);
7691  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
7692  if (((model_.PGAT_i)==0.5))
7693  {
7694  dwsrh = 0;
7695  }
7696  else
7697  {
7698  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PGAT_i))));
7699  }
7700  wsrh = (wsrhstep+dwsrh);
7701  if (((model_.PGAT_i)==0.5))
7702  {
7703  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRGATinv)));
7704  }
7705  else
7706  {
7707  tmp = pow((vbi_minus_vjsrh*(model_.VBIRGATinv)),(model_.PGAT_i));
7708  }
7709  wdep = ((model_.wdepnulrgat)*tmp);
7710  asrh = ((model_.ftdgat)*((zinv-1)*wdep));
7711  isrh = ((model_.CSRHGAT_i)*(asrh*wsrh));
7712  }
7713  if (((model_.CTATGAT_i)==0))
7714  {
7715  itat = 0;
7716  }
7717  else
7718  {
7719  btat = ((model_.btatpartgat)*((wdep*(model_.one_minus_PGAT))/vbi_minus_vjsrh));
7720  twoatatoverthreebtat = ((0.666666666666667*(model_.atatgat))/btat);
7721  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
7722  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
7723  sqrtumax = sqrt(fabs(umax));
7724  umaxpoweronepointfive = (umax*sqrtumax);
7725  if ((((-(model_.PGAT_i))*(model_.one_over_one_minus_PGAT))==(-1)))
7726  {
7727  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
7728  }
7729  else
7730  {
7731  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PGAT_i))*(model_.one_over_one_minus_PGAT)));
7732  }
7733  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
7734  ktat = sqrt((0.375*(btat/sqrtumax)));
7735  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
7736  mtat = (((((model_.atatgat)*twoatatoverthreebtat)*sqrtumax)-((model_.atatgat)*umax))+(0.5*(btat*umaxpoweronepointfive)));
7737  xerfc = ((ltat-1)*ktat);
7738  ysq = (xerfc*xerfc);
7739  if ((xerfc>0))
7740  {
7741  terfc = (1/(1+((model_.perfc)*xerfc)));
7742  }
7743  else
7744  {
7745  terfc = (1/(1-((model_.perfc)*xerfc)));
7746  }
7747  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
7748  {
7749  tmp = exp(((-ysq)+mtat));
7750  }
7751  else
7752  {
7753  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
7754  }
7755  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
7756  if ((xerfc>0))
7757  {
7758  erfctimesexpmtat = erfcpos;
7759  }
7760  else
7761  {
7762  if ((mtat>(-2.3025850929940458e+02)))
7763  {
7764  tmp = exp(mtat);
7765  }
7766  else
7767  {
7768  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
7769  }
7770  erfctimesexpmtat = ((2*tmp)-erfcpos);
7771  }
7772  gammamax = ((1.77245385090551603*0.5)*(((model_.atatgat)*erfctimesexpmtat)/ktat));
7773  itat = ((model_.CTATGAT_i)*((asrh*gammamax)*wtat));
7774  }
7775  if (((model_.CBBTGAT_i)==0))
7776  {
7777  ibbt = 0;
7778  }
7779  else
7780  {
7781  if (((model_.PGAT_i)==0.5))
7782  {
7783  tmp = sqrt((((model_.VBIRGAT_i)-vbbt)*(model_.VBIRGATinv)));
7784  }
7785  else
7786  {
7787  tmp = pow((((model_.VBIRGAT_i)-vbbt)*(model_.VBIRGATinv)),(model_.PGAT_i));
7788  }
7789  Fmaxr = ((model_.one_over_one_minus_PGAT)*((((model_.VBIRGAT_i)-vbbt)*(model_.wdepnulrinvgat))/tmp));
7790  if ((fabs(((-(model_.fbbtgat))/Fmaxr))<2.3025850929940458e+02))
7791  {
7792  tmp = exp(((-(model_.fbbtgat))/Fmaxr));
7793  }
7794  else
7795  {
7796  if ((((-(model_.fbbtgat))/Fmaxr)<(-2.3025850929940458e+02)))
7797  {
7798  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*3.3333333333333333e-01))))))));
7799  }
7800  else
7801  {
7802  tmp = (1.0e100*(1.0+((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
7803  }
7804  }
7805  ibbt = ((model_.CBBTGAT_i)*(((V2*Fmaxr)*Fmaxr)*tmp));
7806  }
7807  if (((model_.VBRGAT_i)>1000))
7808  {
7809  fbreakdown = 1;
7810  }
7811  else
7812  {
7813  if ((vav>((-0.999)*(model_.VBRGAT_i))))
7814  {
7815  if (((model_.PBRGAT_i)==4))
7816  {
7817  tmp = (((fabs((vav*(model_.VBRinvgat)))*fabs((vav*(model_.VBRinvgat))))*fabs((vav*(model_.VBRinvgat))))*fabs((vav*(model_.VBRinvgat))));
7818  }
7819  else
7820  {
7821  tmp = pow(fabs((vav*(model_.VBRinvgat))),(model_.PBRGAT_i));
7822  }
7823  fbreakdown = (1/(1-tmp));
7824  }
7825  else
7826  {
7827  fbreakdown = ((model_.fstopgat)+((vav+(0.999*(model_.VBRGAT_i)))*(model_.slopegat)));
7828  }
7829  }
7830  ijungat = ((((id+isrh)+itat)+ibbt)*fbreakdown);
7831  }
7832  I2 = (((ABDRAIN_i*ijunbot)+(LSDRAIN_i*ijunsti))+(LGDRAIN_i*ijungat));
7833  vbbt = 0.0;
7834  two_psistar = 0.0;
7835  if ((!(((ABDRAIN_i==0)&&(LSDRAIN_i==0))&&(LGDRAIN_i==0))))
7836  {
7837  h1 = ((4.0*vch_d)*vch_d);
7838  h2 = (vch_d/vfmin_d);
7839  h2d = (V3+(vch_d*h2));
7840  h3 = (vfmin_d+h2d);
7841  h4 = (vfmin_d-h2d);
7842  h5 = sqrt(((h4*h4)+h1));
7843  vj = (2.0*((V3*vfmin_d)/(h3+h5)));
7844  if ((V3<VMAX_d))
7845  {
7846  if ((fabs((0.5*(V3*(model_.phitdinv))))<2.3025850929940458e+02))
7847  {
7848  zinv = exp((0.5*(V3*(model_.phitdinv))));
7849  }
7850  else
7851  {
7852  if (((0.5*(V3*(model_.phitdinv)))<(-2.3025850929940458e+02)))
7853  {
7854  zinv = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-(0.5*(V3*(model_.phitdinv))))*(1.0+(0.5*(((-2.3025850929940458e+02)-(0.5*(V3*(model_.phitdinv))))*(1.0+(((-2.3025850929940458e+02)-(0.5*(V3*(model_.phitdinv))))*3.3333333333333333e-01))))))));
7855  }
7856  else
7857  {
7858  zinv = (1.0e100*(1.0+(((0.5*(V3*(model_.phitdinv)))-2.3025850929940458e+02)*(1.0+(0.5*(((0.5*(V3*(model_.phitdinv)))-2.3025850929940458e+02)*(1.0+(((0.5*(V3*(model_.phitdinv)))-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
7859  }
7860  }
7861  idmult = (zinv*zinv);
7862  }
7863  else
7864  {
7865  idmult = ((1+((V3-VMAX_d)*(model_.phitdinv)))*exp_VMAX_over_phitd_d);
7866  zinv = sqrt(idmult);
7867  }
7868  idmult = (idmult-1.0);
7869  z = (1/zinv);
7870  if ((V3>0))
7871  {
7872  two_psistar = (2.0*((model_.phitd)*log(((2.0+z)+sqrt(((z+1.0)*(z+3.0)))))));
7873  }
7874  else
7875  {
7876  two_psistar = ((-V3)+(2.0*((model_.phitd)*log((((2*zinv)+1)+sqrt(((1+zinv)*(1+(3*zinv)))))))));
7877  }
7878  vjlim = (vbimin_d-two_psistar);
7879  vjsrh = (0.5*((V3+vjlim)-sqrt((((V3-vjlim)*(V3-vjlim))+((4*(model_.phitd))*(model_.phitd))))));
7880  vbbt = (0.5*((V3+vbbtlim_d)-sqrt((((V3-vbbtlim_d)*(V3-vbbtlim_d))+((4*(model_.phitr))*(model_.phitr))))));
7881  vav = (0.5*((V3)-sqrt((((V3)*(V3))+((4*1E-6)*1E-6)))));
7882  }
7883  if ((ABDRAIN_i==0))
7884  {
7885  ijunbot = 0;
7886  qjunbot = 0;
7887  }
7888  else
7889  {
7890  if (((model_.one_minus_PBOT)==0.5))
7891  {
7892  tmp = sqrt((1-(vj*(model_.vbiinvbot))));
7893  }
7894  else
7895  {
7896  tmp = pow((1-(vj*(model_.vbiinvbot))),(model_.one_minus_PBOT));
7897  }
7898  qjunbot = (((model_.qprefbot)*(1-tmp))+((model_.qpref2bot)*(V3-vj)));
7899  id = ((model_.idsatbot)*idmult);
7900  if ((((model_.CSRHBOT_i)==0)&&((model_.CTATBOT_i)==0)))
7901  {
7902  isrh = 0;
7903  }
7904  else
7905  {
7906  vbi_minus_vjsrh = ((model_.vbibot)-vjsrh);
7907  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
7908  if (((model_.PBOT_i)==0.5))
7909  {
7910  dwsrh = 0;
7911  }
7912  else
7913  {
7914  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PBOT_i))));
7915  }
7916  wsrh = (wsrhstep+dwsrh);
7917  if (((model_.PBOT_i)==0.5))
7918  {
7919  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRBOTinv)));
7920  }
7921  else
7922  {
7923  tmp = pow((vbi_minus_vjsrh*(model_.VBIRBOTinv)),(model_.PBOT_i));
7924  }
7925  wdep = ((model_.wdepnulrbot)*tmp);
7926  asrh = ((model_.ftdbot)*((zinv-1)*wdep));
7927  isrh = ((model_.CSRHBOT_i)*(asrh*wsrh));
7928  }
7929  if (((model_.CTATBOT_i)==0))
7930  {
7931  itat = 0;
7932  }
7933  else
7934  {
7935  btat = ((model_.btatpartbot)*((wdep*(model_.one_minus_PBOT))/vbi_minus_vjsrh));
7936  twoatatoverthreebtat = ((0.666666666666667*(model_.atatbot))/btat);
7937  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
7938  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
7939  sqrtumax = sqrt(fabs(umax));
7940  umaxpoweronepointfive = (umax*sqrtumax);
7941  if ((((-(model_.PBOT_i))*(model_.one_over_one_minus_PBOT))==(-1)))
7942  {
7943  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
7944  }
7945  else
7946  {
7947  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PBOT_i))*(model_.one_over_one_minus_PBOT)));
7948  }
7949  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
7950  ktat = sqrt((0.375*(btat/sqrtumax)));
7951  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
7952  mtat = (((((model_.atatbot)*twoatatoverthreebtat)*sqrtumax)-((model_.atatbot)*umax))+(0.5*(btat*umaxpoweronepointfive)));
7953  xerfc = ((ltat-1)*ktat);
7954  ysq = (xerfc*xerfc);
7955  if ((xerfc>0))
7956  {
7957  terfc = (1/(1+((model_.perfc)*xerfc)));
7958  }
7959  else
7960  {
7961  terfc = (1/(1-((model_.perfc)*xerfc)));
7962  }
7963  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
7964  {
7965  tmp = exp(((-ysq)+mtat));
7966  }
7967  else
7968  {
7969  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
7970  }
7971  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
7972  if ((xerfc>0))
7973  {
7974  erfctimesexpmtat = erfcpos;
7975  }
7976  else
7977  {
7978  if ((mtat>(-2.3025850929940458e+02)))
7979  {
7980  tmp = exp(mtat);
7981  }
7982  else
7983  {
7984  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
7985  }
7986  erfctimesexpmtat = ((2*tmp)-erfcpos);
7987  }
7988  gammamax = ((1.77245385090551603*0.5)*(((model_.atatbot)*erfctimesexpmtat)/ktat));
7989  itat = ((model_.CTATBOT_i)*((asrh*gammamax)*wtat));
7990  }
7991  if (((model_.CBBTBOT_i)==0))
7992  {
7993  ibbt = 0;
7994  }
7995  else
7996  {
7997  if (((model_.PBOT_i)==0.5))
7998  {
7999  tmp = sqrt((((model_.VBIRBOT_i)-vbbt)*(model_.VBIRBOTinv)));
8000  }
8001  else
8002  {
8003  tmp = pow((((model_.VBIRBOT_i)-vbbt)*(model_.VBIRBOTinv)),(model_.PBOT_i));
8004  }
8005  Fmaxr = ((model_.one_over_one_minus_PBOT)*((((model_.VBIRBOT_i)-vbbt)*(model_.wdepnulrinvbot))/tmp));
8006  if ((fabs(((-(model_.fbbtbot))/Fmaxr))<2.3025850929940458e+02))
8007  {
8008  tmp = exp(((-(model_.fbbtbot))/Fmaxr));
8009  }
8010  else
8011  {
8012  if ((((-(model_.fbbtbot))/Fmaxr)<(-2.3025850929940458e+02)))
8013  {
8014  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*3.3333333333333333e-01))))))));
8015  }
8016  else
8017  {
8018  tmp = (1.0e100*(1.0+((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
8019  }
8020  }
8021  ibbt = ((model_.CBBTBOT_i)*(((V3*Fmaxr)*Fmaxr)*tmp));
8022  }
8023  if (((model_.VBRBOT_i)>1000))
8024  {
8025  fbreakdown = 1;
8026  }
8027  else
8028  {
8029  if ((vav>((-0.999)*(model_.VBRBOT_i))))
8030  {
8031  if (((model_.PBRBOT_i)==4))
8032  {
8033  tmp = (((fabs((vav*(model_.VBRinvbot)))*fabs((vav*(model_.VBRinvbot))))*fabs((vav*(model_.VBRinvbot))))*fabs((vav*(model_.VBRinvbot))));
8034  }
8035  else
8036  {
8037  tmp = pow(fabs((vav*(model_.VBRinvbot))),(model_.PBRBOT_i));
8038  }
8039  fbreakdown = (1/(1-tmp));
8040  }
8041  else
8042  {
8043  fbreakdown = ((model_.fstopbot)+((vav+(0.999*(model_.VBRBOT_i)))*(model_.slopebot)));
8044  }
8045  }
8046  ijunbot = ((((id+isrh)+itat)+ibbt)*fbreakdown);
8047  }
8048  if ((LSDRAIN_i==0))
8049  {
8050  ijunsti = 0;
8051  qjunsti = 0;
8052  }
8053  else
8054  {
8055  if (((model_.one_minus_PSTI)==0.5))
8056  {
8057  tmp = sqrt((1-(vj*(model_.vbiinvsti))));
8058  }
8059  else
8060  {
8061  tmp = pow((1-(vj*(model_.vbiinvsti))),(model_.one_minus_PSTI));
8062  }
8063  qjunsti = (((model_.qprefsti)*(1-tmp))+((model_.qpref2sti)*(V3-vj)));
8064  id = ((model_.idsatsti)*idmult);
8065  if ((((model_.CSRHSTI_i)==0)&&((model_.CTATSTI_i)==0)))
8066  {
8067  isrh = 0;
8068  }
8069  else
8070  {
8071  vbi_minus_vjsrh = ((model_.vbisti)-vjsrh);
8072  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
8073  if (((model_.PSTI_i)==0.5))
8074  {
8075  dwsrh = 0;
8076  }
8077  else
8078  {
8079  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PSTI_i))));
8080  }
8081  wsrh = (wsrhstep+dwsrh);
8082  if (((model_.PSTI_i)==0.5))
8083  {
8084  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRSTIinv)));
8085  }
8086  else
8087  {
8088  tmp = pow((vbi_minus_vjsrh*(model_.VBIRSTIinv)),(model_.PSTI_i));
8089  }
8090  wdep = ((model_.wdepnulrsti)*tmp);
8091  asrh = ((model_.ftdsti)*((zinv-1)*wdep));
8092  isrh = ((model_.CSRHSTI_i)*(asrh*wsrh));
8093  }
8094  if (((model_.CTATSTI_i)==0))
8095  {
8096  itat = 0;
8097  }
8098  else
8099  {
8100  btat = ((model_.btatpartsti)*((wdep*(model_.one_minus_PSTI))/vbi_minus_vjsrh));
8101  twoatatoverthreebtat = ((0.666666666666667*(model_.atatsti))/btat);
8102  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
8103  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
8104  sqrtumax = sqrt(fabs(umax));
8105  umaxpoweronepointfive = (umax*sqrtumax);
8106  if ((((-(model_.PSTI_i))*(model_.one_over_one_minus_PSTI))==(-1)))
8107  {
8108  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
8109  }
8110  else
8111  {
8112  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PSTI_i))*(model_.one_over_one_minus_PSTI)));
8113  }
8114  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
8115  ktat = sqrt((0.375*(btat/sqrtumax)));
8116  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
8117  mtat = (((((model_.atatsti)*twoatatoverthreebtat)*sqrtumax)-((model_.atatsti)*umax))+(0.5*(btat*umaxpoweronepointfive)));
8118  xerfc = ((ltat-1)*ktat);
8119  ysq = (xerfc*xerfc);
8120  if ((xerfc>0))
8121  {
8122  terfc = (1/(1+((model_.perfc)*xerfc)));
8123  }
8124  else
8125  {
8126  terfc = (1/(1-((model_.perfc)*xerfc)));
8127  }
8128  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
8129  {
8130  tmp = exp(((-ysq)+mtat));
8131  }
8132  else
8133  {
8134  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
8135  }
8136  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
8137  if ((xerfc>0))
8138  {
8139  erfctimesexpmtat = erfcpos;
8140  }
8141  else
8142  {
8143  if ((mtat>(-2.3025850929940458e+02)))
8144  {
8145  tmp = exp(mtat);
8146  }
8147  else
8148  {
8149  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
8150  }
8151  erfctimesexpmtat = ((2*tmp)-erfcpos);
8152  }
8153  gammamax = ((1.77245385090551603*0.5)*(((model_.atatsti)*erfctimesexpmtat)/ktat));
8154  itat = ((model_.CTATSTI_i)*((asrh*gammamax)*wtat));
8155  }
8156  if (((model_.CBBTSTI_i)==0))
8157  {
8158  ibbt = 0;
8159  }
8160  else
8161  {
8162  if (((model_.PSTI_i)==0.5))
8163  {
8164  tmp = sqrt((((model_.VBIRSTI_i)-vbbt)*(model_.VBIRSTIinv)));
8165  }
8166  else
8167  {
8168  tmp = pow((((model_.VBIRSTI_i)-vbbt)*(model_.VBIRSTIinv)),(model_.PSTI_i));
8169  }
8170  Fmaxr = ((model_.one_over_one_minus_PSTI)*((((model_.VBIRSTI_i)-vbbt)*(model_.wdepnulrinvsti))/tmp));
8171  if ((fabs(((-(model_.fbbtsti))/Fmaxr))<2.3025850929940458e+02))
8172  {
8173  tmp = exp(((-(model_.fbbtsti))/Fmaxr));
8174  }
8175  else
8176  {
8177  if ((((-(model_.fbbtsti))/Fmaxr)<(-2.3025850929940458e+02)))
8178  {
8179  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*3.3333333333333333e-01))))))));
8180  }
8181  else
8182  {
8183  tmp = (1.0e100*(1.0+((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
8184  }
8185  }
8186  ibbt = ((model_.CBBTSTI_i)*(((V3*Fmaxr)*Fmaxr)*tmp));
8187  }
8188  if (((model_.VBRSTI_i)>1000))
8189  {
8190  fbreakdown = 1;
8191  }
8192  else
8193  {
8194  if ((vav>((-0.999)*(model_.VBRSTI_i))))
8195  {
8196  if (((model_.PBRSTI_i)==4))
8197  {
8198  tmp = (((fabs((vav*(model_.VBRinvsti)))*fabs((vav*(model_.VBRinvsti))))*fabs((vav*(model_.VBRinvsti))))*fabs((vav*(model_.VBRinvsti))));
8199  }
8200  else
8201  {
8202  tmp = pow(fabs((vav*(model_.VBRinvsti))),(model_.PBRSTI_i));
8203  }
8204  fbreakdown = (1/(1-tmp));
8205  }
8206  else
8207  {
8208  fbreakdown = ((model_.fstopsti)+((vav+(0.999*(model_.VBRSTI_i)))*(model_.slopesti)));
8209  }
8210  }
8211  ijunsti = ((((id+isrh)+itat)+ibbt)*fbreakdown);
8212  }
8213  if ((LGDRAIN_i==0))
8214  {
8215  ijungat = 0;
8216  qjungat = 0;
8217  }
8218  else
8219  {
8220  if (((model_.one_minus_PGAT)==0.5))
8221  {
8222  tmp = sqrt((1-(vj*(model_.vbiinvgat))));
8223  }
8224  else
8225  {
8226  tmp = pow((1-(vj*(model_.vbiinvgat))),(model_.one_minus_PGAT));
8227  }
8228  qjungat = (((model_.qprefgat)*(1-tmp))+((model_.qpref2gat)*(V3-vj)));
8229  id = ((model_.idsatgat)*idmult);
8230  if ((((model_.CSRHGAT_i)==0)&&((model_.CTATGAT_i)==0)))
8231  {
8232  isrh = 0;
8233  }
8234  else
8235  {
8236  vbi_minus_vjsrh = ((model_.vbigat)-vjsrh);
8237  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
8238  if (((model_.PGAT_i)==0.5))
8239  {
8240  dwsrh = 0;
8241  }
8242  else
8243  {
8244  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PGAT_i))));
8245  }
8246  wsrh = (wsrhstep+dwsrh);
8247  if (((model_.PGAT_i)==0.5))
8248  {
8249  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRGATinv)));
8250  }
8251  else
8252  {
8253  tmp = pow((vbi_minus_vjsrh*(model_.VBIRGATinv)),(model_.PGAT_i));
8254  }
8255  wdep = ((model_.wdepnulrgat)*tmp);
8256  asrh = ((model_.ftdgat)*((zinv-1)*wdep));
8257  isrh = ((model_.CSRHGAT_i)*(asrh*wsrh));
8258  }
8259  if (((model_.CTATGAT_i)==0))
8260  {
8261  itat = 0;
8262  }
8263  else
8264  {
8265  btat = ((model_.btatpartgat)*((wdep*(model_.one_minus_PGAT))/vbi_minus_vjsrh));
8266  twoatatoverthreebtat = ((0.666666666666667*(model_.atatgat))/btat);
8267  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
8268  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
8269  sqrtumax = sqrt(fabs(umax));
8270  umaxpoweronepointfive = (umax*sqrtumax);
8271  if ((((-(model_.PGAT_i))*(model_.one_over_one_minus_PGAT))==(-1)))
8272  {
8273  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
8274  }
8275  else
8276  {
8277  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PGAT_i))*(model_.one_over_one_minus_PGAT)));
8278  }
8279  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
8280  ktat = sqrt((0.375*(btat/sqrtumax)));
8281  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
8282  mtat = (((((model_.atatgat)*twoatatoverthreebtat)*sqrtumax)-((model_.atatgat)*umax))+(0.5*(btat*umaxpoweronepointfive)));
8283  xerfc = ((ltat-1)*ktat);
8284  ysq = (xerfc*xerfc);
8285  if ((xerfc>0))
8286  {
8287  terfc = (1/(1+((model_.perfc)*xerfc)));
8288  }
8289  else
8290  {
8291  terfc = (1/(1-((model_.perfc)*xerfc)));
8292  }
8293  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
8294  {
8295  tmp = exp(((-ysq)+mtat));
8296  }
8297  else
8298  {
8299  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
8300  }
8301  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
8302  if ((xerfc>0))
8303  {
8304  erfctimesexpmtat = erfcpos;
8305  }
8306  else
8307  {
8308  if ((mtat>(-2.3025850929940458e+02)))
8309  {
8310  tmp = exp(mtat);
8311  }
8312  else
8313  {
8314  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
8315  }
8316  erfctimesexpmtat = ((2*tmp)-erfcpos);
8317  }
8318  gammamax = ((1.77245385090551603*0.5)*(((model_.atatgat)*erfctimesexpmtat)/ktat));
8319  itat = ((model_.CTATGAT_i)*((asrh*gammamax)*wtat));
8320  }
8321  if (((model_.CBBTGAT_i)==0))
8322  {
8323  ibbt = 0;
8324  }
8325  else
8326  {
8327  if (((model_.PGAT_i)==0.5))
8328  {
8329  tmp = sqrt((((model_.VBIRGAT_i)-vbbt)*(model_.VBIRGATinv)));
8330  }
8331  else
8332  {
8333  tmp = pow((((model_.VBIRGAT_i)-vbbt)*(model_.VBIRGATinv)),(model_.PGAT_i));
8334  }
8335  Fmaxr = ((model_.one_over_one_minus_PGAT)*((((model_.VBIRGAT_i)-vbbt)*(model_.wdepnulrinvgat))/tmp));
8336  if ((fabs(((-(model_.fbbtgat))/Fmaxr))<2.3025850929940458e+02))
8337  {
8338  tmp = exp(((-(model_.fbbtgat))/Fmaxr));
8339  }
8340  else
8341  {
8342  if ((((-(model_.fbbtgat))/Fmaxr)<(-2.3025850929940458e+02)))
8343  {
8344  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*3.3333333333333333e-01))))))));
8345  }
8346  else
8347  {
8348  tmp = (1.0e100*(1.0+((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
8349  }
8350  }
8351  ibbt = ((model_.CBBTGAT_i)*(((V3*Fmaxr)*Fmaxr)*tmp));
8352  }
8353  if (((model_.VBRGAT_i)>1000))
8354  {
8355  fbreakdown = 1;
8356  }
8357  else
8358  {
8359  if ((vav>((-0.999)*(model_.VBRGAT_i))))
8360  {
8361  if (((model_.PBRGAT_i)==4))
8362  {
8363  tmp = (((fabs((vav*(model_.VBRinvgat)))*fabs((vav*(model_.VBRinvgat))))*fabs((vav*(model_.VBRinvgat))))*fabs((vav*(model_.VBRinvgat))));
8364  }
8365  else
8366  {
8367  tmp = pow(fabs((vav*(model_.VBRinvgat))),(model_.PBRGAT_i));
8368  }
8369  fbreakdown = (1/(1-tmp));
8370  }
8371  else
8372  {
8373  fbreakdown = ((model_.fstopgat)+((vav+(0.999*(model_.VBRGAT_i)))*(model_.slopegat)));
8374  }
8375  }
8376  ijungat = ((((id+isrh)+itat)+ibbt)*fbreakdown);
8377  }
8378  I3 = (((ABDRAIN_i*ijunbot)+(LSDRAIN_i*ijunsti))+(LGDRAIN_i*ijungat));
8379  vbbt = 0.0;
8380  two_psistar = 0.0;
8381  if ((!(((ABDRAIN_i==0)&&(LSDRAIN_i==0))&&(LGDRAIN_i==0))))
8382  {
8383  h1 = ((4.0*vch_d)*vch_d);
8384  h2 = (vch_d/vfmin_d);
8385  h2d = (V4+(vch_d*h2));
8386  h3 = (vfmin_d+h2d);
8387  h4 = (vfmin_d-h2d);
8388  h5 = sqrt(((h4*h4)+h1));
8389  vj = (2.0*((V4*vfmin_d)/(h3+h5)));
8390  if ((V4<VMAX_d))
8391  {
8392  if ((fabs((0.5*(V4*(model_.phitdinv))))<2.3025850929940458e+02))
8393  {
8394  zinv = exp((0.5*(V4*(model_.phitdinv))));
8395  }
8396  else
8397  {
8398  if (((0.5*(V4*(model_.phitdinv)))<(-2.3025850929940458e+02)))
8399  {
8400  zinv = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-(0.5*(V4*(model_.phitdinv))))*(1.0+(0.5*(((-2.3025850929940458e+02)-(0.5*(V4*(model_.phitdinv))))*(1.0+(((-2.3025850929940458e+02)-(0.5*(V4*(model_.phitdinv))))*3.3333333333333333e-01))))))));
8401  }
8402  else
8403  {
8404  zinv = (1.0e100*(1.0+(((0.5*(V4*(model_.phitdinv)))-2.3025850929940458e+02)*(1.0+(0.5*(((0.5*(V4*(model_.phitdinv)))-2.3025850929940458e+02)*(1.0+(((0.5*(V4*(model_.phitdinv)))-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
8405  }
8406  }
8407  idmult = (zinv*zinv);
8408  }
8409  else
8410  {
8411  idmult = ((1+((V4-VMAX_d)*(model_.phitdinv)))*exp_VMAX_over_phitd_d);
8412  zinv = sqrt(idmult);
8413  }
8414  idmult = (idmult-1.0);
8415  z = (1/zinv);
8416  if ((V4>0))
8417  {
8418  two_psistar = (2.0*((model_.phitd)*log(((2.0+z)+sqrt(((z+1.0)*(z+3.0)))))));
8419  }
8420  else
8421  {
8422  two_psistar = ((-V4)+(2.0*((model_.phitd)*log((((2*zinv)+1)+sqrt(((1+zinv)*(1+(3*zinv)))))))));
8423  }
8424  vjlim = (vbimin_d-two_psistar);
8425  vjsrh = (0.5*((V4+vjlim)-sqrt((((V4-vjlim)*(V4-vjlim))+((4*(model_.phitd))*(model_.phitd))))));
8426  vbbt = (0.5*((V4+vbbtlim_d)-sqrt((((V4-vbbtlim_d)*(V4-vbbtlim_d))+((4*(model_.phitr))*(model_.phitr))))));
8427  vav = (0.5*((V4)-sqrt((((V4)*(V4))+((4*1E-6)*1E-6)))));
8428  }
8429  if ((ABDRAIN_i==0))
8430  {
8431  ijunbot = 0;
8432  qjunbot = 0;
8433  }
8434  else
8435  {
8436  if (((model_.one_minus_PBOT)==0.5))
8437  {
8438  tmp = sqrt((1-(vj*(model_.vbiinvbot))));
8439  }
8440  else
8441  {
8442  tmp = pow((1-(vj*(model_.vbiinvbot))),(model_.one_minus_PBOT));
8443  }
8444  qjunbot = (((model_.qprefbot)*(1-tmp))+((model_.qpref2bot)*(V4-vj)));
8445  id = ((model_.idsatbot)*idmult);
8446  if ((((model_.CSRHBOT_i)==0)&&((model_.CTATBOT_i)==0)))
8447  {
8448  isrh = 0;
8449  }
8450  else
8451  {
8452  vbi_minus_vjsrh = ((model_.vbibot)-vjsrh);
8453  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
8454  if (((model_.PBOT_i)==0.5))
8455  {
8456  dwsrh = 0;
8457  }
8458  else
8459  {
8460  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PBOT_i))));
8461  }
8462  wsrh = (wsrhstep+dwsrh);
8463  if (((model_.PBOT_i)==0.5))
8464  {
8465  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRBOTinv)));
8466  }
8467  else
8468  {
8469  tmp = pow((vbi_minus_vjsrh*(model_.VBIRBOTinv)),(model_.PBOT_i));
8470  }
8471  wdep = ((model_.wdepnulrbot)*tmp);
8472  asrh = ((model_.ftdbot)*((zinv-1)*wdep));
8473  isrh = ((model_.CSRHBOT_i)*(asrh*wsrh));
8474  }
8475  if (((model_.CTATBOT_i)==0))
8476  {
8477  itat = 0;
8478  }
8479  else
8480  {
8481  btat = ((model_.btatpartbot)*((wdep*(model_.one_minus_PBOT))/vbi_minus_vjsrh));
8482  twoatatoverthreebtat = ((0.666666666666667*(model_.atatbot))/btat);
8483  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
8484  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
8485  sqrtumax = sqrt(fabs(umax));
8486  umaxpoweronepointfive = (umax*sqrtumax);
8487  if ((((-(model_.PBOT_i))*(model_.one_over_one_minus_PBOT))==(-1)))
8488  {
8489  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
8490  }
8491  else
8492  {
8493  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PBOT_i))*(model_.one_over_one_minus_PBOT)));
8494  }
8495  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
8496  ktat = sqrt((0.375*(btat/sqrtumax)));
8497  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
8498  mtat = (((((model_.atatbot)*twoatatoverthreebtat)*sqrtumax)-((model_.atatbot)*umax))+(0.5*(btat*umaxpoweronepointfive)));
8499  xerfc = ((ltat-1)*ktat);
8500  ysq = (xerfc*xerfc);
8501  if ((xerfc>0))
8502  {
8503  terfc = (1/(1+((model_.perfc)*xerfc)));
8504  }
8505  else
8506  {
8507  terfc = (1/(1-((model_.perfc)*xerfc)));
8508  }
8509  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
8510  {
8511  tmp = exp(((-ysq)+mtat));
8512  }
8513  else
8514  {
8515  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
8516  }
8517  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
8518  if ((xerfc>0))
8519  {
8520  erfctimesexpmtat = erfcpos;
8521  }
8522  else
8523  {
8524  if ((mtat>(-2.3025850929940458e+02)))
8525  {
8526  tmp = exp(mtat);
8527  }
8528  else
8529  {
8530  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
8531  }
8532  erfctimesexpmtat = ((2*tmp)-erfcpos);
8533  }
8534  gammamax = ((1.77245385090551603*0.5)*(((model_.atatbot)*erfctimesexpmtat)/ktat));
8535  itat = ((model_.CTATBOT_i)*((asrh*gammamax)*wtat));
8536  }
8537  if (((model_.CBBTBOT_i)==0))
8538  {
8539  ibbt = 0;
8540  }
8541  else
8542  {
8543  if (((model_.PBOT_i)==0.5))
8544  {
8545  tmp = sqrt((((model_.VBIRBOT_i)-vbbt)*(model_.VBIRBOTinv)));
8546  }
8547  else
8548  {
8549  tmp = pow((((model_.VBIRBOT_i)-vbbt)*(model_.VBIRBOTinv)),(model_.PBOT_i));
8550  }
8551  Fmaxr = ((model_.one_over_one_minus_PBOT)*((((model_.VBIRBOT_i)-vbbt)*(model_.wdepnulrinvbot))/tmp));
8552  if ((fabs(((-(model_.fbbtbot))/Fmaxr))<2.3025850929940458e+02))
8553  {
8554  tmp = exp(((-(model_.fbbtbot))/Fmaxr));
8555  }
8556  else
8557  {
8558  if ((((-(model_.fbbtbot))/Fmaxr)<(-2.3025850929940458e+02)))
8559  {
8560  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*3.3333333333333333e-01))))))));
8561  }
8562  else
8563  {
8564  tmp = (1.0e100*(1.0+((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
8565  }
8566  }
8567  ibbt = ((model_.CBBTBOT_i)*(((V4*Fmaxr)*Fmaxr)*tmp));
8568  }
8569  if (((model_.VBRBOT_i)>1000))
8570  {
8571  fbreakdown = 1;
8572  }
8573  else
8574  {
8575  if ((vav>((-0.999)*(model_.VBRBOT_i))))
8576  {
8577  if (((model_.PBRBOT_i)==4))
8578  {
8579  tmp = (((fabs((vav*(model_.VBRinvbot)))*fabs((vav*(model_.VBRinvbot))))*fabs((vav*(model_.VBRinvbot))))*fabs((vav*(model_.VBRinvbot))));
8580  }
8581  else
8582  {
8583  tmp = pow(fabs((vav*(model_.VBRinvbot))),(model_.PBRBOT_i));
8584  }
8585  fbreakdown = (1/(1-tmp));
8586  }
8587  else
8588  {
8589  fbreakdown = ((model_.fstopbot)+((vav+(0.999*(model_.VBRBOT_i)))*(model_.slopebot)));
8590  }
8591  }
8592  ijunbot = ((((id+isrh)+itat)+ibbt)*fbreakdown);
8593  }
8594  if ((LSDRAIN_i==0))
8595  {
8596  ijunsti = 0;
8597  qjunsti = 0;
8598  }
8599  else
8600  {
8601  if (((model_.one_minus_PSTI)==0.5))
8602  {
8603  tmp = sqrt((1-(vj*(model_.vbiinvsti))));
8604  }
8605  else
8606  {
8607  tmp = pow((1-(vj*(model_.vbiinvsti))),(model_.one_minus_PSTI));
8608  }
8609  qjunsti = (((model_.qprefsti)*(1-tmp))+((model_.qpref2sti)*(V4-vj)));
8610  id = ((model_.idsatsti)*idmult);
8611  if ((((model_.CSRHSTI_i)==0)&&((model_.CTATSTI_i)==0)))
8612  {
8613  isrh = 0;
8614  }
8615  else
8616  {
8617  vbi_minus_vjsrh = ((model_.vbisti)-vjsrh);
8618  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
8619  if (((model_.PSTI_i)==0.5))
8620  {
8621  dwsrh = 0;
8622  }
8623  else
8624  {
8625  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PSTI_i))));
8626  }
8627  wsrh = (wsrhstep+dwsrh);
8628  if (((model_.PSTI_i)==0.5))
8629  {
8630  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRSTIinv)));
8631  }
8632  else
8633  {
8634  tmp = pow((vbi_minus_vjsrh*(model_.VBIRSTIinv)),(model_.PSTI_i));
8635  }
8636  wdep = ((model_.wdepnulrsti)*tmp);
8637  asrh = ((model_.ftdsti)*((zinv-1)*wdep));
8638  isrh = ((model_.CSRHSTI_i)*(asrh*wsrh));
8639  }
8640  if (((model_.CTATSTI_i)==0))
8641  {
8642  itat = 0;
8643  }
8644  else
8645  {
8646  btat = ((model_.btatpartsti)*((wdep*(model_.one_minus_PSTI))/vbi_minus_vjsrh));
8647  twoatatoverthreebtat = ((0.666666666666667*(model_.atatsti))/btat);
8648  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
8649  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
8650  sqrtumax = sqrt(fabs(umax));
8651  umaxpoweronepointfive = (umax*sqrtumax);
8652  if ((((-(model_.PSTI_i))*(model_.one_over_one_minus_PSTI))==(-1)))
8653  {
8654  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
8655  }
8656  else
8657  {
8658  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PSTI_i))*(model_.one_over_one_minus_PSTI)));
8659  }
8660  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
8661  ktat = sqrt((0.375*(btat/sqrtumax)));
8662  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
8663  mtat = (((((model_.atatsti)*twoatatoverthreebtat)*sqrtumax)-((model_.atatsti)*umax))+(0.5*(btat*umaxpoweronepointfive)));
8664  xerfc = ((ltat-1)*ktat);
8665  ysq = (xerfc*xerfc);
8666  if ((xerfc>0))
8667  {
8668  terfc = (1/(1+((model_.perfc)*xerfc)));
8669  }
8670  else
8671  {
8672  terfc = (1/(1-((model_.perfc)*xerfc)));
8673  }
8674  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
8675  {
8676  tmp = exp(((-ysq)+mtat));
8677  }
8678  else
8679  {
8680  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
8681  }
8682  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
8683  if ((xerfc>0))
8684  {
8685  erfctimesexpmtat = erfcpos;
8686  }
8687  else
8688  {
8689  if ((mtat>(-2.3025850929940458e+02)))
8690  {
8691  tmp = exp(mtat);
8692  }
8693  else
8694  {
8695  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
8696  }
8697  erfctimesexpmtat = ((2*tmp)-erfcpos);
8698  }
8699  gammamax = ((1.77245385090551603*0.5)*(((model_.atatsti)*erfctimesexpmtat)/ktat));
8700  itat = ((model_.CTATSTI_i)*((asrh*gammamax)*wtat));
8701  }
8702  if (((model_.CBBTSTI_i)==0))
8703  {
8704  ibbt = 0;
8705  }
8706  else
8707  {
8708  if (((model_.PSTI_i)==0.5))
8709  {
8710  tmp = sqrt((((model_.VBIRSTI_i)-vbbt)*(model_.VBIRSTIinv)));
8711  }
8712  else
8713  {
8714  tmp = pow((((model_.VBIRSTI_i)-vbbt)*(model_.VBIRSTIinv)),(model_.PSTI_i));
8715  }
8716  Fmaxr = ((model_.one_over_one_minus_PSTI)*((((model_.VBIRSTI_i)-vbbt)*(model_.wdepnulrinvsti))/tmp));
8717  if ((fabs(((-(model_.fbbtsti))/Fmaxr))<2.3025850929940458e+02))
8718  {
8719  tmp = exp(((-(model_.fbbtsti))/Fmaxr));
8720  }
8721  else
8722  {
8723  if ((((-(model_.fbbtsti))/Fmaxr)<(-2.3025850929940458e+02)))
8724  {
8725  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*3.3333333333333333e-01))))))));
8726  }
8727  else
8728  {
8729  tmp = (1.0e100*(1.0+((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
8730  }
8731  }
8732  ibbt = ((model_.CBBTSTI_i)*(((V4*Fmaxr)*Fmaxr)*tmp));
8733  }
8734  if (((model_.VBRSTI_i)>1000))
8735  {
8736  fbreakdown = 1;
8737  }
8738  else
8739  {
8740  if ((vav>((-0.999)*(model_.VBRSTI_i))))
8741  {
8742  if (((model_.PBRSTI_i)==4))
8743  {
8744  tmp = (((fabs((vav*(model_.VBRinvsti)))*fabs((vav*(model_.VBRinvsti))))*fabs((vav*(model_.VBRinvsti))))*fabs((vav*(model_.VBRinvsti))));
8745  }
8746  else
8747  {
8748  tmp = pow(fabs((vav*(model_.VBRinvsti))),(model_.PBRSTI_i));
8749  }
8750  fbreakdown = (1/(1-tmp));
8751  }
8752  else
8753  {
8754  fbreakdown = ((model_.fstopsti)+((vav+(0.999*(model_.VBRSTI_i)))*(model_.slopesti)));
8755  }
8756  }
8757  ijunsti = ((((id+isrh)+itat)+ibbt)*fbreakdown);
8758  }
8759  if ((LGDRAIN_i==0))
8760  {
8761  ijungat = 0;
8762  qjungat = 0;
8763  }
8764  else
8765  {
8766  if (((model_.one_minus_PGAT)==0.5))
8767  {
8768  tmp = sqrt((1-(vj*(model_.vbiinvgat))));
8769  }
8770  else
8771  {
8772  tmp = pow((1-(vj*(model_.vbiinvgat))),(model_.one_minus_PGAT));
8773  }
8774  qjungat = (((model_.qprefgat)*(1-tmp))+((model_.qpref2gat)*(V4-vj)));
8775  id = ((model_.idsatgat)*idmult);
8776  if ((((model_.CSRHGAT_i)==0)&&((model_.CTATGAT_i)==0)))
8777  {
8778  isrh = 0;
8779  }
8780  else
8781  {
8782  vbi_minus_vjsrh = ((model_.vbigat)-vjsrh);
8783  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
8784  if (((model_.PGAT_i)==0.5))
8785  {
8786  dwsrh = 0;
8787  }
8788  else
8789  {
8790  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PGAT_i))));
8791  }
8792  wsrh = (wsrhstep+dwsrh);
8793  if (((model_.PGAT_i)==0.5))
8794  {
8795  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRGATinv)));
8796  }
8797  else
8798  {
8799  tmp = pow((vbi_minus_vjsrh*(model_.VBIRGATinv)),(model_.PGAT_i));
8800  }
8801  wdep = ((model_.wdepnulrgat)*tmp);
8802  asrh = ((model_.ftdgat)*((zinv-1)*wdep));
8803  isrh = ((model_.CSRHGAT_i)*(asrh*wsrh));
8804  }
8805  if (((model_.CTATGAT_i)==0))
8806  {
8807  itat = 0;
8808  }
8809  else
8810  {
8811  btat = ((model_.btatpartgat)*((wdep*(model_.one_minus_PGAT))/vbi_minus_vjsrh));
8812  twoatatoverthreebtat = ((0.666666666666667*(model_.atatgat))/btat);
8813  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
8814  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
8815  sqrtumax = sqrt(fabs(umax));
8816  umaxpoweronepointfive = (umax*sqrtumax);
8817  if ((((-(model_.PGAT_i))*(model_.one_over_one_minus_PGAT))==(-1)))
8818  {
8819  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
8820  }
8821  else
8822  {
8823  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PGAT_i))*(model_.one_over_one_minus_PGAT)));
8824  }
8825  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
8826  ktat = sqrt((0.375*(btat/sqrtumax)));
8827  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
8828  mtat = (((((model_.atatgat)*twoatatoverthreebtat)*sqrtumax)-((model_.atatgat)*umax))+(0.5*(btat*umaxpoweronepointfive)));
8829  xerfc = ((ltat-1)*ktat);
8830  ysq = (xerfc*xerfc);
8831  if ((xerfc>0))
8832  {
8833  terfc = (1/(1+((model_.perfc)*xerfc)));
8834  }
8835  else
8836  {
8837  terfc = (1/(1-((model_.perfc)*xerfc)));
8838  }
8839  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
8840  {
8841  tmp = exp(((-ysq)+mtat));
8842  }
8843  else
8844  {
8845  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
8846  }
8847  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
8848  if ((xerfc>0))
8849  {
8850  erfctimesexpmtat = erfcpos;
8851  }
8852  else
8853  {
8854  if ((mtat>(-2.3025850929940458e+02)))
8855  {
8856  tmp = exp(mtat);
8857  }
8858  else
8859  {
8860  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
8861  }
8862  erfctimesexpmtat = ((2*tmp)-erfcpos);
8863  }
8864  gammamax = ((1.77245385090551603*0.5)*(((model_.atatgat)*erfctimesexpmtat)/ktat));
8865  itat = ((model_.CTATGAT_i)*((asrh*gammamax)*wtat));
8866  }
8867  if (((model_.CBBTGAT_i)==0))
8868  {
8869  ibbt = 0;
8870  }
8871  else
8872  {
8873  if (((model_.PGAT_i)==0.5))
8874  {
8875  tmp = sqrt((((model_.VBIRGAT_i)-vbbt)*(model_.VBIRGATinv)));
8876  }
8877  else
8878  {
8879  tmp = pow((((model_.VBIRGAT_i)-vbbt)*(model_.VBIRGATinv)),(model_.PGAT_i));
8880  }
8881  Fmaxr = ((model_.one_over_one_minus_PGAT)*((((model_.VBIRGAT_i)-vbbt)*(model_.wdepnulrinvgat))/tmp));
8882  if ((fabs(((-(model_.fbbtgat))/Fmaxr))<2.3025850929940458e+02))
8883  {
8884  tmp = exp(((-(model_.fbbtgat))/Fmaxr));
8885  }
8886  else
8887  {
8888  if ((((-(model_.fbbtgat))/Fmaxr)<(-2.3025850929940458e+02)))
8889  {
8890  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*3.3333333333333333e-01))))))));
8891  }
8892  else
8893  {
8894  tmp = (1.0e100*(1.0+((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
8895  }
8896  }
8897  ibbt = ((model_.CBBTGAT_i)*(((V4*Fmaxr)*Fmaxr)*tmp));
8898  }
8899  if (((model_.VBRGAT_i)>1000))
8900  {
8901  fbreakdown = 1;
8902  }
8903  else
8904  {
8905  if ((vav>((-0.999)*(model_.VBRGAT_i))))
8906  {
8907  if (((model_.PBRGAT_i)==4))
8908  {
8909  tmp = (((fabs((vav*(model_.VBRinvgat)))*fabs((vav*(model_.VBRinvgat))))*fabs((vav*(model_.VBRinvgat))))*fabs((vav*(model_.VBRinvgat))));
8910  }
8911  else
8912  {
8913  tmp = pow(fabs((vav*(model_.VBRinvgat))),(model_.PBRGAT_i));
8914  }
8915  fbreakdown = (1/(1-tmp));
8916  }
8917  else
8918  {
8919  fbreakdown = ((model_.fstopgat)+((vav+(0.999*(model_.VBRGAT_i)))*(model_.slopegat)));
8920  }
8921  }
8922  ijungat = ((((id+isrh)+itat)+ibbt)*fbreakdown);
8923  }
8924  I4 = (((ABDRAIN_i*ijunbot)+(LSDRAIN_i*ijunsti))+(LGDRAIN_i*ijungat));
8925  vbbt = 0.0;
8926  two_psistar = 0.0;
8927  if ((!(((ABDRAIN_i==0)&&(LSDRAIN_i==0))&&(LGDRAIN_i==0))))
8928  {
8929  h1 = ((4.0*vch_d)*vch_d);
8930  h2 = (vch_d/vfmin_d);
8931  h2d = (V5+(vch_d*h2));
8932  h3 = (vfmin_d+h2d);
8933  h4 = (vfmin_d-h2d);
8934  h5 = sqrt(((h4*h4)+h1));
8935  vj = (2.0*((V5*vfmin_d)/(h3+h5)));
8936  if ((V5<VMAX_d))
8937  {
8938  if ((fabs((0.5*(V5*(model_.phitdinv))))<2.3025850929940458e+02))
8939  {
8940  zinv = exp((0.5*(V5*(model_.phitdinv))));
8941  }
8942  else
8943  {
8944  if (((0.5*(V5*(model_.phitdinv)))<(-2.3025850929940458e+02)))
8945  {
8946  zinv = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-(0.5*(V5*(model_.phitdinv))))*(1.0+(0.5*(((-2.3025850929940458e+02)-(0.5*(V5*(model_.phitdinv))))*(1.0+(((-2.3025850929940458e+02)-(0.5*(V5*(model_.phitdinv))))*3.3333333333333333e-01))))))));
8947  }
8948  else
8949  {
8950  zinv = (1.0e100*(1.0+(((0.5*(V5*(model_.phitdinv)))-2.3025850929940458e+02)*(1.0+(0.5*(((0.5*(V5*(model_.phitdinv)))-2.3025850929940458e+02)*(1.0+(((0.5*(V5*(model_.phitdinv)))-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
8951  }
8952  }
8953  idmult = (zinv*zinv);
8954  }
8955  else
8956  {
8957  idmult = ((1+((V5-VMAX_d)*(model_.phitdinv)))*exp_VMAX_over_phitd_d);
8958  zinv = sqrt(idmult);
8959  }
8960  idmult = (idmult-1.0);
8961  z = (1/zinv);
8962  if ((V5>0))
8963  {
8964  two_psistar = (2.0*((model_.phitd)*log(((2.0+z)+sqrt(((z+1.0)*(z+3.0)))))));
8965  }
8966  else
8967  {
8968  two_psistar = ((-V5)+(2.0*((model_.phitd)*log((((2*zinv)+1)+sqrt(((1+zinv)*(1+(3*zinv)))))))));
8969  }
8970  vjlim = (vbimin_d-two_psistar);
8971  vjsrh = (0.5*((V5+vjlim)-sqrt((((V5-vjlim)*(V5-vjlim))+((4*(model_.phitd))*(model_.phitd))))));
8972  vbbt = (0.5*((V5+vbbtlim_d)-sqrt((((V5-vbbtlim_d)*(V5-vbbtlim_d))+((4*(model_.phitr))*(model_.phitr))))));
8973  vav = (0.5*((V5)-sqrt((((V5)*(V5))+((4*1E-6)*1E-6)))));
8974  }
8975  if ((ABDRAIN_i==0))
8976  {
8977  ijunbot = 0;
8978  qjunbot = 0;
8979  }
8980  else
8981  {
8982  if (((model_.one_minus_PBOT)==0.5))
8983  {
8984  tmp = sqrt((1-(vj*(model_.vbiinvbot))));
8985  }
8986  else
8987  {
8988  tmp = pow((1-(vj*(model_.vbiinvbot))),(model_.one_minus_PBOT));
8989  }
8990  qjunbot = (((model_.qprefbot)*(1-tmp))+((model_.qpref2bot)*(V5-vj)));
8991  id = ((model_.idsatbot)*idmult);
8992  if ((((model_.CSRHBOT_i)==0)&&((model_.CTATBOT_i)==0)))
8993  {
8994  isrh = 0;
8995  }
8996  else
8997  {
8998  vbi_minus_vjsrh = ((model_.vbibot)-vjsrh);
8999  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
9000  if (((model_.PBOT_i)==0.5))
9001  {
9002  dwsrh = 0;
9003  }
9004  else
9005  {
9006  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PBOT_i))));
9007  }
9008  wsrh = (wsrhstep+dwsrh);
9009  if (((model_.PBOT_i)==0.5))
9010  {
9011  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRBOTinv)));
9012  }
9013  else
9014  {
9015  tmp = pow((vbi_minus_vjsrh*(model_.VBIRBOTinv)),(model_.PBOT_i));
9016  }
9017  wdep = ((model_.wdepnulrbot)*tmp);
9018  asrh = ((model_.ftdbot)*((zinv-1)*wdep));
9019  isrh = ((model_.CSRHBOT_i)*(asrh*wsrh));
9020  }
9021  if (((model_.CTATBOT_i)==0))
9022  {
9023  itat = 0;
9024  }
9025  else
9026  {
9027  btat = ((model_.btatpartbot)*((wdep*(model_.one_minus_PBOT))/vbi_minus_vjsrh));
9028  twoatatoverthreebtat = ((0.666666666666667*(model_.atatbot))/btat);
9029  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
9030  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
9031  sqrtumax = sqrt(fabs(umax));
9032  umaxpoweronepointfive = (umax*sqrtumax);
9033  if ((((-(model_.PBOT_i))*(model_.one_over_one_minus_PBOT))==(-1)))
9034  {
9035  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
9036  }
9037  else
9038  {
9039  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PBOT_i))*(model_.one_over_one_minus_PBOT)));
9040  }
9041  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
9042  ktat = sqrt((0.375*(btat/sqrtumax)));
9043  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
9044  mtat = (((((model_.atatbot)*twoatatoverthreebtat)*sqrtumax)-((model_.atatbot)*umax))+(0.5*(btat*umaxpoweronepointfive)));
9045  xerfc = ((ltat-1)*ktat);
9046  ysq = (xerfc*xerfc);
9047  if ((xerfc>0))
9048  {
9049  terfc = (1/(1+((model_.perfc)*xerfc)));
9050  }
9051  else
9052  {
9053  terfc = (1/(1-((model_.perfc)*xerfc)));
9054  }
9055  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
9056  {
9057  tmp = exp(((-ysq)+mtat));
9058  }
9059  else
9060  {
9061  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
9062  }
9063  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
9064  if ((xerfc>0))
9065  {
9066  erfctimesexpmtat = erfcpos;
9067  }
9068  else
9069  {
9070  if ((mtat>(-2.3025850929940458e+02)))
9071  {
9072  tmp = exp(mtat);
9073  }
9074  else
9075  {
9076  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
9077  }
9078  erfctimesexpmtat = ((2*tmp)-erfcpos);
9079  }
9080  gammamax = ((1.77245385090551603*0.5)*(((model_.atatbot)*erfctimesexpmtat)/ktat));
9081  itat = ((model_.CTATBOT_i)*((asrh*gammamax)*wtat));
9082  }
9083  if (((model_.CBBTBOT_i)==0))
9084  {
9085  ibbt = 0;
9086  }
9087  else
9088  {
9089  if (((model_.PBOT_i)==0.5))
9090  {
9091  tmp = sqrt((((model_.VBIRBOT_i)-vbbt)*(model_.VBIRBOTinv)));
9092  }
9093  else
9094  {
9095  tmp = pow((((model_.VBIRBOT_i)-vbbt)*(model_.VBIRBOTinv)),(model_.PBOT_i));
9096  }
9097  Fmaxr = ((model_.one_over_one_minus_PBOT)*((((model_.VBIRBOT_i)-vbbt)*(model_.wdepnulrinvbot))/tmp));
9098  if ((fabs(((-(model_.fbbtbot))/Fmaxr))<2.3025850929940458e+02))
9099  {
9100  tmp = exp(((-(model_.fbbtbot))/Fmaxr));
9101  }
9102  else
9103  {
9104  if ((((-(model_.fbbtbot))/Fmaxr)<(-2.3025850929940458e+02)))
9105  {
9106  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*3.3333333333333333e-01))))))));
9107  }
9108  else
9109  {
9110  tmp = (1.0e100*(1.0+((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
9111  }
9112  }
9113  ibbt = ((model_.CBBTBOT_i)*(((V5*Fmaxr)*Fmaxr)*tmp));
9114  }
9115  if (((model_.VBRBOT_i)>1000))
9116  {
9117  fbreakdown = 1;
9118  }
9119  else
9120  {
9121  if ((vav>((-0.999)*(model_.VBRBOT_i))))
9122  {
9123  if (((model_.PBRBOT_i)==4))
9124  {
9125  tmp = (((fabs((vav*(model_.VBRinvbot)))*fabs((vav*(model_.VBRinvbot))))*fabs((vav*(model_.VBRinvbot))))*fabs((vav*(model_.VBRinvbot))));
9126  }
9127  else
9128  {
9129  tmp = pow(fabs((vav*(model_.VBRinvbot))),(model_.PBRBOT_i));
9130  }
9131  fbreakdown = (1/(1-tmp));
9132  }
9133  else
9134  {
9135  fbreakdown = ((model_.fstopbot)+((vav+(0.999*(model_.VBRBOT_i)))*(model_.slopebot)));
9136  }
9137  }
9138  ijunbot = ((((id+isrh)+itat)+ibbt)*fbreakdown);
9139  }
9140  if ((LSDRAIN_i==0))
9141  {
9142  ijunsti = 0;
9143  qjunsti = 0;
9144  }
9145  else
9146  {
9147  if (((model_.one_minus_PSTI)==0.5))
9148  {
9149  tmp = sqrt((1-(vj*(model_.vbiinvsti))));
9150  }
9151  else
9152  {
9153  tmp = pow((1-(vj*(model_.vbiinvsti))),(model_.one_minus_PSTI));
9154  }
9155  qjunsti = (((model_.qprefsti)*(1-tmp))+((model_.qpref2sti)*(V5-vj)));
9156  id = ((model_.idsatsti)*idmult);
9157  if ((((model_.CSRHSTI_i)==0)&&((model_.CTATSTI_i)==0)))
9158  {
9159  isrh = 0;
9160  }
9161  else
9162  {
9163  vbi_minus_vjsrh = ((model_.vbisti)-vjsrh);
9164  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
9165  if (((model_.PSTI_i)==0.5))
9166  {
9167  dwsrh = 0;
9168  }
9169  else
9170  {
9171  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PSTI_i))));
9172  }
9173  wsrh = (wsrhstep+dwsrh);
9174  if (((model_.PSTI_i)==0.5))
9175  {
9176  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRSTIinv)));
9177  }
9178  else
9179  {
9180  tmp = pow((vbi_minus_vjsrh*(model_.VBIRSTIinv)),(model_.PSTI_i));
9181  }
9182  wdep = ((model_.wdepnulrsti)*tmp);
9183  asrh = ((model_.ftdsti)*((zinv-1)*wdep));
9184  isrh = ((model_.CSRHSTI_i)*(asrh*wsrh));
9185  }
9186  if (((model_.CTATSTI_i)==0))
9187  {
9188  itat = 0;
9189  }
9190  else
9191  {
9192  btat = ((model_.btatpartsti)*((wdep*(model_.one_minus_PSTI))/vbi_minus_vjsrh));
9193  twoatatoverthreebtat = ((0.666666666666667*(model_.atatsti))/btat);
9194  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
9195  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
9196  sqrtumax = sqrt(fabs(umax));
9197  umaxpoweronepointfive = (umax*sqrtumax);
9198  if ((((-(model_.PSTI_i))*(model_.one_over_one_minus_PSTI))==(-1)))
9199  {
9200  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
9201  }
9202  else
9203  {
9204  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PSTI_i))*(model_.one_over_one_minus_PSTI)));
9205  }
9206  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
9207  ktat = sqrt((0.375*(btat/sqrtumax)));
9208  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
9209  mtat = (((((model_.atatsti)*twoatatoverthreebtat)*sqrtumax)-((model_.atatsti)*umax))+(0.5*(btat*umaxpoweronepointfive)));
9210  xerfc = ((ltat-1)*ktat);
9211  ysq = (xerfc*xerfc);
9212  if ((xerfc>0))
9213  {
9214  terfc = (1/(1+((model_.perfc)*xerfc)));
9215  }
9216  else
9217  {
9218  terfc = (1/(1-((model_.perfc)*xerfc)));
9219  }
9220  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
9221  {
9222  tmp = exp(((-ysq)+mtat));
9223  }
9224  else
9225  {
9226  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
9227  }
9228  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
9229  if ((xerfc>0))
9230  {
9231  erfctimesexpmtat = erfcpos;
9232  }
9233  else
9234  {
9235  if ((mtat>(-2.3025850929940458e+02)))
9236  {
9237  tmp = exp(mtat);
9238  }
9239  else
9240  {
9241  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
9242  }
9243  erfctimesexpmtat = ((2*tmp)-erfcpos);
9244  }
9245  gammamax = ((1.77245385090551603*0.5)*(((model_.atatsti)*erfctimesexpmtat)/ktat));
9246  itat = ((model_.CTATSTI_i)*((asrh*gammamax)*wtat));
9247  }
9248  if (((model_.CBBTSTI_i)==0))
9249  {
9250  ibbt = 0;
9251  }
9252  else
9253  {
9254  if (((model_.PSTI_i)==0.5))
9255  {
9256  tmp = sqrt((((model_.VBIRSTI_i)-vbbt)*(model_.VBIRSTIinv)));
9257  }
9258  else
9259  {
9260  tmp = pow((((model_.VBIRSTI_i)-vbbt)*(model_.VBIRSTIinv)),(model_.PSTI_i));
9261  }
9262  Fmaxr = ((model_.one_over_one_minus_PSTI)*((((model_.VBIRSTI_i)-vbbt)*(model_.wdepnulrinvsti))/tmp));
9263  if ((fabs(((-(model_.fbbtsti))/Fmaxr))<2.3025850929940458e+02))
9264  {
9265  tmp = exp(((-(model_.fbbtsti))/Fmaxr));
9266  }
9267  else
9268  {
9269  if ((((-(model_.fbbtsti))/Fmaxr)<(-2.3025850929940458e+02)))
9270  {
9271  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*3.3333333333333333e-01))))))));
9272  }
9273  else
9274  {
9275  tmp = (1.0e100*(1.0+((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
9276  }
9277  }
9278  ibbt = ((model_.CBBTSTI_i)*(((V5*Fmaxr)*Fmaxr)*tmp));
9279  }
9280  if (((model_.VBRSTI_i)>1000))
9281  {
9282  fbreakdown = 1;
9283  }
9284  else
9285  {
9286  if ((vav>((-0.999)*(model_.VBRSTI_i))))
9287  {
9288  if (((model_.PBRSTI_i)==4))
9289  {
9290  tmp = (((fabs((vav*(model_.VBRinvsti)))*fabs((vav*(model_.VBRinvsti))))*fabs((vav*(model_.VBRinvsti))))*fabs((vav*(model_.VBRinvsti))));
9291  }
9292  else
9293  {
9294  tmp = pow(fabs((vav*(model_.VBRinvsti))),(model_.PBRSTI_i));
9295  }
9296  fbreakdown = (1/(1-tmp));
9297  }
9298  else
9299  {
9300  fbreakdown = ((model_.fstopsti)+((vav+(0.999*(model_.VBRSTI_i)))*(model_.slopesti)));
9301  }
9302  }
9303  ijunsti = ((((id+isrh)+itat)+ibbt)*fbreakdown);
9304  }
9305  if ((LGDRAIN_i==0))
9306  {
9307  ijungat = 0;
9308  qjungat = 0;
9309  }
9310  else
9311  {
9312  if (((model_.one_minus_PGAT)==0.5))
9313  {
9314  tmp = sqrt((1-(vj*(model_.vbiinvgat))));
9315  }
9316  else
9317  {
9318  tmp = pow((1-(vj*(model_.vbiinvgat))),(model_.one_minus_PGAT));
9319  }
9320  qjungat = (((model_.qprefgat)*(1-tmp))+((model_.qpref2gat)*(V5-vj)));
9321  id = ((model_.idsatgat)*idmult);
9322  if ((((model_.CSRHGAT_i)==0)&&((model_.CTATGAT_i)==0)))
9323  {
9324  isrh = 0;
9325  }
9326  else
9327  {
9328  vbi_minus_vjsrh = ((model_.vbigat)-vjsrh);
9329  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
9330  if (((model_.PGAT_i)==0.5))
9331  {
9332  dwsrh = 0;
9333  }
9334  else
9335  {
9336  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PGAT_i))));
9337  }
9338  wsrh = (wsrhstep+dwsrh);
9339  if (((model_.PGAT_i)==0.5))
9340  {
9341  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRGATinv)));
9342  }
9343  else
9344  {
9345  tmp = pow((vbi_minus_vjsrh*(model_.VBIRGATinv)),(model_.PGAT_i));
9346  }
9347  wdep = ((model_.wdepnulrgat)*tmp);
9348  asrh = ((model_.ftdgat)*((zinv-1)*wdep));
9349  isrh = ((model_.CSRHGAT_i)*(asrh*wsrh));
9350  }
9351  if (((model_.CTATGAT_i)==0))
9352  {
9353  itat = 0;
9354  }
9355  else
9356  {
9357  btat = ((model_.btatpartgat)*((wdep*(model_.one_minus_PGAT))/vbi_minus_vjsrh));
9358  twoatatoverthreebtat = ((0.666666666666667*(model_.atatgat))/btat);
9359  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
9360  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
9361  sqrtumax = sqrt(fabs(umax));
9362  umaxpoweronepointfive = (umax*sqrtumax);
9363  if ((((-(model_.PGAT_i))*(model_.one_over_one_minus_PGAT))==(-1)))
9364  {
9365  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
9366  }
9367  else
9368  {
9369  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PGAT_i))*(model_.one_over_one_minus_PGAT)));
9370  }
9371  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
9372  ktat = sqrt((0.375*(btat/sqrtumax)));
9373  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
9374  mtat = (((((model_.atatgat)*twoatatoverthreebtat)*sqrtumax)-((model_.atatgat)*umax))+(0.5*(btat*umaxpoweronepointfive)));
9375  xerfc = ((ltat-1)*ktat);
9376  ysq = (xerfc*xerfc);
9377  if ((xerfc>0))
9378  {
9379  terfc = (1/(1+((model_.perfc)*xerfc)));
9380  }
9381  else
9382  {
9383  terfc = (1/(1-((model_.perfc)*xerfc)));
9384  }
9385  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
9386  {
9387  tmp = exp(((-ysq)+mtat));
9388  }
9389  else
9390  {
9391  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
9392  }
9393  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
9394  if ((xerfc>0))
9395  {
9396  erfctimesexpmtat = erfcpos;
9397  }
9398  else
9399  {
9400  if ((mtat>(-2.3025850929940458e+02)))
9401  {
9402  tmp = exp(mtat);
9403  }
9404  else
9405  {
9406  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
9407  }
9408  erfctimesexpmtat = ((2*tmp)-erfcpos);
9409  }
9410  gammamax = ((1.77245385090551603*0.5)*(((model_.atatgat)*erfctimesexpmtat)/ktat));
9411  itat = ((model_.CTATGAT_i)*((asrh*gammamax)*wtat));
9412  }
9413  if (((model_.CBBTGAT_i)==0))
9414  {
9415  ibbt = 0;
9416  }
9417  else
9418  {
9419  if (((model_.PGAT_i)==0.5))
9420  {
9421  tmp = sqrt((((model_.VBIRGAT_i)-vbbt)*(model_.VBIRGATinv)));
9422  }
9423  else
9424  {
9425  tmp = pow((((model_.VBIRGAT_i)-vbbt)*(model_.VBIRGATinv)),(model_.PGAT_i));
9426  }
9427  Fmaxr = ((model_.one_over_one_minus_PGAT)*((((model_.VBIRGAT_i)-vbbt)*(model_.wdepnulrinvgat))/tmp));
9428  if ((fabs(((-(model_.fbbtgat))/Fmaxr))<2.3025850929940458e+02))
9429  {
9430  tmp = exp(((-(model_.fbbtgat))/Fmaxr));
9431  }
9432  else
9433  {
9434  if ((((-(model_.fbbtgat))/Fmaxr)<(-2.3025850929940458e+02)))
9435  {
9436  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*3.3333333333333333e-01))))))));
9437  }
9438  else
9439  {
9440  tmp = (1.0e100*(1.0+((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
9441  }
9442  }
9443  ibbt = ((model_.CBBTGAT_i)*(((V5*Fmaxr)*Fmaxr)*tmp));
9444  }
9445  if (((model_.VBRGAT_i)>1000))
9446  {
9447  fbreakdown = 1;
9448  }
9449  else
9450  {
9451  if ((vav>((-0.999)*(model_.VBRGAT_i))))
9452  {
9453  if (((model_.PBRGAT_i)==4))
9454  {
9455  tmp = (((fabs((vav*(model_.VBRinvgat)))*fabs((vav*(model_.VBRinvgat))))*fabs((vav*(model_.VBRinvgat))))*fabs((vav*(model_.VBRinvgat))));
9456  }
9457  else
9458  {
9459  tmp = pow(fabs((vav*(model_.VBRinvgat))),(model_.PBRGAT_i));
9460  }
9461  fbreakdown = (1/(1-tmp));
9462  }
9463  else
9464  {
9465  fbreakdown = ((model_.fstopgat)+((vav+(0.999*(model_.VBRGAT_i)))*(model_.slopegat)));
9466  }
9467  }
9468  ijungat = ((((id+isrh)+itat)+ibbt)*fbreakdown);
9469  }
9470  I5 = (((ABDRAIN_i*ijunbot)+(LSDRAIN_i*ijunsti))+(LGDRAIN_i*ijungat));
9472  I4_cor = (I4-(ISATFOR1_d*(exp(((V4*(model_.phitdinv))*MFOR1_d))-1.0)));
9473  I5_cor = (I5-(ISATFOR1_d*(exp(((V5*(model_.phitdinv))*MFOR1_d))-1.0)));
9474  if ((!(((ABDRAIN_i==0)&&(LSDRAIN_i==0))&&(LGDRAIN_i==0))))
9475  {
9476  if (((I4>0)&&(I5>0)))
9477  {
9478  if ((((((I4_cor/I4)>0.001)||((I5_cor/I5)>0.001))&&(I4_cor>0))&&(I5_cor>0)))
9479  {
9480  alphaje = (I4_cor/I5_cor);
9481  MFOR2_d = (((model_.phitd)*log(alphaje))/(V4-V5));
9482  ISATFOR2_d = (I4_cor/(exp(((V4*(model_.phitdinv))*MFOR2_d))-1));
9483  }
9484  }
9485  I1_cor = ((I1-(ISATFOR1_d*(exp(((V1*(model_.phitdinv))*MFOR1_d))-1.0)))-(ISATFOR2_d*(exp(((V1*(model_.phitdinv))*MFOR2_d))-1.0)));
9486  I2_cor = ((I2-(ISATFOR1_d*(exp(((V2*(model_.phitdinv))*MFOR1_d))-1.0)))-(ISATFOR2_d*(exp(((V2*(model_.phitdinv))*MFOR2_d))-1.0)));
9487  I3_cor = ((I3-(ISATFOR1_d*(exp(((V3*(model_.phitdinv))*MFOR1_d))-1.0)))-(ISATFOR2_d*(exp(((V3*(model_.phitdinv))*MFOR2_d))-1.0)));
9488  if ((((I1<0)&&(I2<0))&&(I3<0)))
9489  {
9490  if ((((((((I1_cor/I1)>0.001)||((I2_cor/I2)>0.001))||((I3_cor/I3)>0.001))&&(I1_cor<0))&&(I2_cor<0))&&(I3_cor<0)))
9491  {
9492  alphaje = (I1_cor/I2_cor);
9493  m0_rev = (((-(model_.phitd))*log(alphaje))/(V1-V2));
9494  tt0 = (V2/(V2-V1));
9495  tt1 = (((model_.phitd)*(alphaje-1))*(pow(alphaje,tt0)-1));
9496  tt0 = (V1/(V1-V2));
9497  tt2 = (((pow(alphaje,tt0)*(V2-V1))+(alphaje*V1))-V2);
9498  mcor_rev = (tt1/tt2);
9499  MREV_d = (m0_rev+mcor_rev);
9500  if ((fabs(((V3*(model_.phitdinv))*MREV_d))<1e-6))
9501  {
9502  m0flag_d = 1.0;
9503  ISATREV_d = (I3_cor*((1/V3)+((0.5*(model_.phitdinv))*MREV_d)));
9504  MREV_d = (((((-0.5)*I3_cor)*MREV_d)*(model_.phitdinv))/V3);
9505  }
9506  else
9507  {
9508  m0flag_d = 0.0;
9509  ISATREV_d = ((-I3_cor)/(exp((((-V3)*(model_.phitdinv))*MREV_d))-1));
9510  }
9511  }
9512  }
9513  }
9515  if (((ABDRAIN_i*(model_.cjobot))<=zfrac))
9516  {
9517  zflagbot_d = 0.0;
9518  }
9519  if (((LSDRAIN_i*(model_.cjosti))<=zfrac))
9520  {
9521  zflagsti_d = 0.0;
9522  }
9523  if (((LGDRAIN_i*(model_.cjogat))<=zfrac))
9524  {
9525  zflaggat_d = 0.0;
9526  }
9527  if ((!(((ABDRAIN_i==0)&&(LSDRAIN_i==0))&&(LGDRAIN_i==0))))
9528  {
9529  xhighf1_d = log(((0.5*(model_.IMAX_i))/(ISATFOR1_d+1e-21)));
9530  xhighf2_d = log(((0.5*(model_.IMAX_i))/(ISATFOR2_d+1e-21)));
9531  xhighr_d = log(((0.5*(model_.IMAX_i))/(fabs(ISATREV_d)+1e-21)));
9532  }
9533  xhighf1_d = std::min(xhighf1_d,2.3025850929940458e+02);
9534  expxhf1_d = exp(xhighf1_d);
9535  xhighf2_d = std::min(xhighf2_d,2.3025850929940458e+02);
9536  expxhf2_d = exp(xhighf2_d);
9537  xhighr_d = std::min(xhighr_d,2.3025850929940458e+02);
9538  expxhr_d = exp(xhighr_d);
9539  }
9540  // End block JUNCAPexpressInit
9541  }
9542  }
9543  // End block initial_instance
9544 
9545 
9546  return true;
9547 }
9548 
9549 //-----------------------------------------------------------------------------
9550 // Function : Instance::Instance
9551 // Purpose : "instance block" constructor
9552 // Special Notes :
9553 // Scope : public
9554 // Creator : admsXml
9555 // Creation Date :
9556 //-----------------------------------------------------------------------------
9557 
9559  const Configuration & configuration,
9560  const InstanceBlock & instance_block,
9561  Model & model,
9562  const FactoryBlock & factory_block)
9563  : DeviceInstance(instance_block, configuration.getInstanceParameters(), factory_block),
9564  model_(model),
9565  L(10e-6),
9566  W(10e-6),
9567  SA(0.0),
9568  SB(0.0),
9569  SD(0.0),
9570  SCA(0.0),
9571  SCB(0.0),
9572  SCC(0.0),
9573  SC(0.0),
9574  NF(1.0),
9575  NGCON(1.0),
9576  XGW(1.0E-7),
9577  NRS(0.0),
9578  NRD(0.0),
9579  JW(1E-6),
9580  DELVTO(0.0),
9581  FACTUO(1.0),
9582  ABSOURCE(1E-12),
9583  LSSOURCE(1E-6),
9584  LGSOURCE(1E-6),
9585  ABDRAIN(1E-12),
9586  LSDRAIN(1E-6),
9587  LGDRAIN(1E-6),
9588  AS(1E-12),
9589  PS(1E-6),
9590  AD(1E-12),
9591  PD(1E-6),
9592  MULT(1.0),
9593  VFB_i(0.0),
9594  GFACNUD_i(0.0),
9595  VNSUB_i(0.0),
9596  NSLP_i(0.0),
9597  DNSUB_i(0.0),
9598  CF_i(0.0),
9599  CFB_i(0.0),
9600  MUE_i(0.0),
9601  THEMU_i(0.0),
9602  CS_i(0.0),
9603  XCOR_i(0.0),
9604  THER_i(0.0),
9605  RSB_i(0.0),
9606  RSG_i(0.0),
9607  THESAT_i(0.0),
9608  THESATB_i(0.0),
9609  THESATG_i(0.0),
9610  AX_i(0.0),
9611  ALP_i(0.0),
9612  ALP1_i(0.0),
9613  ALP2_i(0.0),
9614  A1_i(0.0),
9615  A2_i(0.0),
9616  A3_i(0.0),
9617  A4_i(0.0),
9618  IGINV_i(0.0),
9619  IGOV_i(0.0),
9620  IGOVD_i(0.0),
9621  GC2_i(0.0),
9622  GC3_i(0.0),
9623  CHIB_i(0.0),
9624  AGIDL_i(0.0),
9625  BGIDL_i(0.0),
9626  CGIDL_i(0.0),
9627  AGIDLD_i(0.0),
9628  BGIDLD_i(0.0),
9629  CGIDLD_i(0.0),
9630  COX_i(0.0),
9631  CGOV_i(0.0),
9632  CGOVD_i(0.0),
9633  CGBOV_i(0.0),
9634  CFR_i(0.0),
9635  CFRD_i(0.0),
9636  MULT_i(0.0),
9637  BET_i(0.0),
9638  kp(0.0),
9639  qq(0.0),
9640  qlim2(0.0),
9641  E_eff0(0.0),
9642  eta_mu(0.0),
9643  eta_mu1(0.0),
9644  BCH(0.0),
9645  BOV(0.0),
9646  inv_CHIB(0.0),
9647  GCQ(0.0),
9648  Dch(0.0),
9649  Dov(0.0),
9650  x1(0.0),
9651  Vdsat_lim(0.0),
9652  GOV_s(0.0),
9653  GOV_d(0.0),
9654  GOV2_s(0.0),
9655  GOV2_d(0.0),
9656  BOV_d(0.0),
9657  xi_ov_s(0.0),
9658  xi_ov_d(0.0),
9659  inv_xi_ov_s(0.0),
9660  inv_xi_ov_d(0.0),
9661  x_mrg_ov_s(0.0),
9662  x_mrg_ov_d(0.0),
9663  inv_xg1_s(0.0),
9664  inv_xg1_d(0.0),
9665  phit1(0.0),
9666  inv_phit1(0.0),
9667  alpha_b(0.0),
9668  inv_VP(0.0),
9669  inv_AX(0.0),
9670  us1(0.0),
9671  us21(0.0),
9672  phib_dc(0.0),
9673  sqrt_phib_dc(0.0),
9674  G_0_dc(0.0),
9675  aphi_dc(0.0),
9676  bphi_dc(0.0),
9677  phix_dc(0.0),
9678  phix1_dc(0.0),
9679  phib_ac(0.0),
9680  sqrt_phib_ac(0.0),
9681  G_0_ac(0.0),
9682  aphi_ac(0.0),
9683  bphi_ac(0.0),
9684  phix_ac(0.0),
9685  phix1_ac(0.0),
9686  RG_i(0.0),
9687  RSE_i(0.0),
9688  RDE_i(0.0),
9689  RBULK_i(0.0),
9690  RWELL_i(0.0),
9691  RJUNS_i(0.0),
9692  RJUND_i(0.0),
9693  ggate(0.0),
9694  gsource(0.0),
9695  gdrain(0.0),
9696  gbulk(0.0),
9697  gwell(0.0),
9698  gjund(0.0),
9699  gjuns(0.0),
9700  tmpv(0.0),
9701  vjv(0.0),
9702  idmult(0.0),
9703  vj(0.0),
9704  zinv(0.0),
9705  vjsrh(0.0),
9706  vav(0.0),
9707  vbi_minus_vjsrh(0.0),
9708  wsrh(0.0),
9709  wdep(0.0),
9710  asrh(0.0),
9711  ABSOURCE_i(0.0),
9712  LSSOURCE_i(0.0),
9713  LGSOURCE_i(0.0),
9714  zflagbot_s(0.0),
9715  zflagsti_s(0.0),
9716  zflaggat_s(0.0),
9717  VMAX_s(0.0),
9718  exp_VMAX_over_phitd_s(0.0),
9719  vbimin_s(0.0),
9720  vch_s(0.0),
9721  vfmin_s(0.0),
9722  vbbtlim_s(0.0),
9723  ijunbot_s(0.0),
9724  qjunbot_s(0.0),
9725  ijunsti_s(0.0),
9726  qjunsti_s(0.0),
9727  ijungat_s(0.0),
9728  qjungat_s(0.0),
9729  ijun_s(0.0),
9730  qjun_s(0.0),
9731  xhighf1_s(0.0),
9732  expxhf1_s(0.0),
9733  xhighf2_s(0.0),
9734  expxhf2_s(0.0),
9735  xhighr_s(0.0),
9736  expxhr_s(0.0),
9737  m0flag_s(0.0),
9738  ISATFOR1_s(0.0),
9739  MFOR1_s(0.0),
9740  ISATFOR2_s(0.0),
9741  MFOR2_s(0.0),
9742  ISATREV_s(0.0),
9743  MREV_s(0.0),
9744  ABDRAIN_i(0.0),
9745  LSDRAIN_i(0.0),
9746  LGDRAIN_i(0.0),
9747  zflagbot_d(0.0),
9748  zflagsti_d(0.0),
9749  zflaggat_d(0.0),
9750  VMAX_d(0.0),
9751  exp_VMAX_over_phitd_d(0.0),
9752  vbimin_d(0.0),
9753  vch_d(0.0),
9754  vfmin_d(0.0),
9755  vbbtlim_d(0.0),
9756  ijunbot_d(0.0),
9757  qjunbot_d(0.0),
9758  ijunsti_d(0.0),
9759  qjunsti_d(0.0),
9760  ijungat_d(0.0),
9761  qjungat_d(0.0),
9762  ijun_d(0.0),
9763  qjun_d(0.0),
9764  xhighf1_d(0.0),
9765  expxhf1_d(0.0),
9766  xhighf2_d(0.0),
9767  expxhf2_d(0.0),
9768  xhighr_d(0.0),
9769  expxhr_d(0.0),
9770  m0flag_d(0.0),
9771  ISATFOR1_d(0.0),
9772  MFOR1_d(0.0),
9773  ISATFOR2_d(0.0),
9774  MFOR2_d(0.0),
9775  ISATREV_d(0.0),
9776  MREV_d(0.0),
9777  li_D(-1),
9778  li_G(-1),
9779  li_S(-1),
9780  li_B(-1),
9781  li_GP(-1),
9782  li_SI(-1),
9783  li_DI(-1),
9784  li_BI(-1),
9785  li_BP(-1),
9786  li_BS(-1),
9787  li_BD(-1),
9788  f_DI_Equ_SI_Node_Ptr(0),
9789  f_DI_Equ_BP_Node_Ptr(0),
9790  f_BP_Equ_SI_Node_Ptr(0),
9791  f_BP_Equ_BP_Node_Ptr(0),
9792  f_DI_Equ_GP_Node_Ptr(0),
9793  f_BP_Equ_GP_Node_Ptr(0),
9794  f_DI_Equ_DI_Node_Ptr(0),
9795  f_BP_Equ_DI_Node_Ptr(0),
9796  f_SI_Equ_SI_Node_Ptr(0),
9797  f_SI_Equ_BP_Node_Ptr(0),
9798  f_SI_Equ_GP_Node_Ptr(0),
9799  f_SI_Equ_DI_Node_Ptr(0),
9800  f_GP_Equ_SI_Node_Ptr(0),
9801  f_GP_Equ_BP_Node_Ptr(0),
9802  f_GP_Equ_DI_Node_Ptr(0),
9803  f_GP_Equ_GP_Node_Ptr(0),
9804  f_BS_Equ_SI_Node_Ptr(0),
9805  f_BS_Equ_BS_Node_Ptr(0),
9806  f_SI_Equ_BS_Node_Ptr(0),
9807  f_BS_Equ_DI_Node_Ptr(0),
9808  f_BS_Equ_BD_Node_Ptr(0),
9809  f_SI_Equ_BD_Node_Ptr(0),
9810  f_BD_Equ_SI_Node_Ptr(0),
9811  f_BD_Equ_BS_Node_Ptr(0),
9812  f_DI_Equ_BS_Node_Ptr(0),
9813  f_BD_Equ_DI_Node_Ptr(0),
9814  f_BD_Equ_BD_Node_Ptr(0),
9815  f_DI_Equ_BD_Node_Ptr(0),
9816  f_G_Equ_G_Node_Ptr(0),
9817  f_G_Equ_GP_Node_Ptr(0),
9818  f_GP_Equ_G_Node_Ptr(0),
9819  f_S_Equ_S_Node_Ptr(0),
9820  f_S_Equ_SI_Node_Ptr(0),
9821  f_SI_Equ_S_Node_Ptr(0),
9822  f_D_Equ_D_Node_Ptr(0),
9823  f_D_Equ_DI_Node_Ptr(0),
9824  f_DI_Equ_D_Node_Ptr(0),
9825  f_BP_Equ_BI_Node_Ptr(0),
9826  f_BI_Equ_BP_Node_Ptr(0),
9827  f_BI_Equ_BI_Node_Ptr(0),
9828  f_BS_Equ_BI_Node_Ptr(0),
9829  f_BI_Equ_BS_Node_Ptr(0),
9830  f_BD_Equ_BI_Node_Ptr(0),
9831  f_BI_Equ_BD_Node_Ptr(0),
9832  f_B_Equ_B_Node_Ptr(0),
9833  f_B_Equ_BI_Node_Ptr(0),
9834  f_BI_Equ_B_Node_Ptr(0),
9835  q_DI_Equ_SI_Node_Ptr(0),
9836  q_DI_Equ_BP_Node_Ptr(0),
9837  q_BP_Equ_SI_Node_Ptr(0),
9838  q_BP_Equ_BP_Node_Ptr(0),
9839  q_DI_Equ_GP_Node_Ptr(0),
9840  q_BP_Equ_GP_Node_Ptr(0),
9841  q_DI_Equ_DI_Node_Ptr(0),
9842  q_BP_Equ_DI_Node_Ptr(0),
9843  q_SI_Equ_SI_Node_Ptr(0),
9844  q_SI_Equ_BP_Node_Ptr(0),
9845  q_SI_Equ_GP_Node_Ptr(0),
9846  q_SI_Equ_DI_Node_Ptr(0),
9847  q_GP_Equ_SI_Node_Ptr(0),
9848  q_GP_Equ_BP_Node_Ptr(0),
9849  q_GP_Equ_DI_Node_Ptr(0),
9850  q_GP_Equ_GP_Node_Ptr(0),
9851  q_BS_Equ_SI_Node_Ptr(0),
9852  q_BS_Equ_BS_Node_Ptr(0),
9853  q_SI_Equ_BS_Node_Ptr(0),
9854  q_BS_Equ_DI_Node_Ptr(0),
9855  q_BS_Equ_BD_Node_Ptr(0),
9856  q_SI_Equ_BD_Node_Ptr(0),
9857  q_BD_Equ_SI_Node_Ptr(0),
9858  q_BD_Equ_BS_Node_Ptr(0),
9859  q_DI_Equ_BS_Node_Ptr(0),
9860  q_BD_Equ_DI_Node_Ptr(0),
9861  q_BD_Equ_BD_Node_Ptr(0),
9862  q_DI_Equ_BD_Node_Ptr(0),
9863  q_G_Equ_G_Node_Ptr(0),
9864  q_G_Equ_GP_Node_Ptr(0),
9865  q_GP_Equ_G_Node_Ptr(0),
9866  q_S_Equ_S_Node_Ptr(0),
9867  q_S_Equ_SI_Node_Ptr(0),
9868  q_SI_Equ_S_Node_Ptr(0),
9869  q_D_Equ_D_Node_Ptr(0),
9870  q_D_Equ_DI_Node_Ptr(0),
9871  q_DI_Equ_D_Node_Ptr(0),
9872  q_BP_Equ_BI_Node_Ptr(0),
9873  q_BI_Equ_BP_Node_Ptr(0),
9874  q_BI_Equ_BI_Node_Ptr(0),
9875  q_BS_Equ_BI_Node_Ptr(0),
9876  q_BI_Equ_BS_Node_Ptr(0),
9877  q_BD_Equ_BI_Node_Ptr(0),
9878  q_BI_Equ_BD_Node_Ptr(0),
9879  q_B_Equ_B_Node_Ptr(0),
9880  q_B_Equ_BI_Node_Ptr(0),
9881  q_BI_Equ_B_Node_Ptr(0),
9882  admsTemperature(getDeviceOptions().temp.getImmutableValue<double>())
9883 
9884 {
9885  numIntVars = 7 + 0;
9886  numExtVars = 4;
9887 
9888 
9889  // Right now, we only have state for limited probes...
9890  numStateVars = 0;
9891 
9892 
9893  // Set up jacobian stamp:
9894 
9895  if (jacStamp.empty())
9896  {
9897  jacStamp.resize(11);
9898  jacStamp[admsNodeID_D].resize(2);
9901  jacStamp[admsNodeID_G].resize(2);
9904  jacStamp[admsNodeID_S].resize(2);
9907  jacStamp[admsNodeID_B].resize(2);
9910  jacStamp[admsNodeID_GP].resize(5);
9916  jacStamp[admsNodeID_SI].resize(7);
9924  jacStamp[admsNodeID_DI].resize(7);
9932  jacStamp[admsNodeID_BI].resize(5);
9938  jacStamp[admsNodeID_BP].resize(5);
9944  jacStamp[admsNodeID_BS].resize(5);
9950  jacStamp[admsNodeID_BD].resize(5);
9956 
9957 
9958  // This is really not strictly necessary when not mapping away nodes,
9959  // but makes life easier when we get to registerJacLIDs. This block
9960  // simply makes a map that leaves everything in place. Later, when we
9961  // start making nodes go away, we will need to modify this.
9962 
9963  int mapSize = jacStamp.size();
9964  jacMap.clear();
9965  jacMap2.clear();
9966  jacMap.resize(mapSize);
9967  jacMap2.resize(mapSize);
9968  for (int i=0;i<mapSize;++i)
9969  {
9970  int rowSize=jacStamp[i].size();
9971  jacMap[i]=i;
9972  jacMap2[i].resize(rowSize);
9973  for (int j=0;j<rowSize;++j)
9974  {
9975  jacMap2[i][j] = j;
9976  }
9977  }
9978 
9979  }
9980 
9981 
9982  setDefaultParams();
9983  setParams(instance_block.params);
9984  // set any non-constant parameter defaults
9985 
9986  // copy any model variables that have associated instance variables, but
9987  // are only given in the model card:
9988 
9989 
9990 
9991  // Set any parameters that were not given and whose defaults depend on other
9992  // parameters:
9993 
9994 
9995  // Real bogosity here...
9996  if (!given("XYCEADMSINSTTEMP"))
9997  admsInstTemp=getDeviceOptions().temp.getImmutableValue<double>();
9998 
9999  //calculate any parameters specified as expressions
10001 
10002  // calculate dependent (i.e. computed params) and check for errors.
10003  processParams();
10004  collapseNodes();
10005 }
10006 
10007 //-----------------------------------------------------------------------------
10008 // Function : Instance::collapseNodes
10009 // Purpose : function to handle collapsing of nodes
10010 // Special Notes :
10011 // Scope : public
10012 // Creator : admsXml
10013 // Creation Date :
10014 //-----------------------------------------------------------------------------
10016 {
10017  // Many, many lines of unnecessary and incorrect code manually deleted.
10018 
10019  if (!((RG_i>0.0)))
10020  {
10021 
10022  collapseNode_GP = true;
10023 
10024  }
10025 
10026  if (!((RSE_i>0.0)))
10027  {
10028 
10029  collapseNode_SI = true;
10030 
10031  }
10032 
10033  if (!((RDE_i>0.0)))
10034  {
10035 
10036  collapseNode_DI = true;
10037 
10038  }
10039 
10040  if (!((RBULK_i>0.0)))
10041  {
10042 
10043  collapseNode_BP = true;
10044 
10045  }
10046 
10047  if (!((RJUNS_i>0.0)))
10048  {
10049 
10050  collapseNode_BS = true;
10051 
10052  }
10053 
10054  if (!((RJUND_i>0.0)))
10055  {
10056 
10057  collapseNode_BD = true;
10058 
10059  }
10060 
10061  if (!((RWELL_i>0.0)))
10062  {
10063 
10064  collapseNode_BI = true;
10065 
10066  }
10067 
10068  // end block named loadStatic
10069 
10070 
10071 
10072  // Map away any unneeded internal nodes:
10073  // temporary stamps and maps
10074  std::vector< std::vector<int> > tempStamp;
10075  std::vector<int> tempMap;
10076  std::vector< std::vector<int> > tempMap2;
10077 
10078  int OriginalSize = jacMap.size();
10079 
10080  // If the columns of the jacstamp are not in ascending order then
10081  // jacStampMap will do bogus things. Our ADMS back-end doesn't guarantee
10082  // in-order jacStamps. So we reorder (through the maps)
10083  jacStampMap_fixOrder(jacStamp,jacMap2,tempStamp,tempMap2);
10084  jacStamp=tempStamp; jacMap2=tempMap2;
10085 
10086  if (collapseNode_GP)
10087  {
10088  tempStamp.clear(); tempMap.clear(); tempMap2.clear();
10090  tempStamp, tempMap, tempMap2,
10092  OriginalSize);
10093  // now move the new stuff into the old place
10094  jacStamp = tempStamp; jacMap = tempMap; jacMap2 = tempMap2;
10095  numIntVars--;
10096  }
10097  if (collapseNode_SI)
10098  {
10099  tempStamp.clear(); tempMap.clear(); tempMap2.clear();
10101  tempStamp, tempMap, tempMap2,
10103  OriginalSize);
10104  // now move the new stuff into the old place
10105  jacStamp = tempStamp; jacMap = tempMap; jacMap2 = tempMap2;
10106  numIntVars--;
10107  }
10108  if (collapseNode_DI)
10109  {
10110  tempStamp.clear(); tempMap.clear(); tempMap2.clear();
10112  tempStamp, tempMap, tempMap2,
10114  OriginalSize);
10115  // now move the new stuff into the old place
10116  jacStamp = tempStamp; jacMap = tempMap; jacMap2 = tempMap2;
10117  numIntVars--;
10118  }
10119  if (collapseNode_BI)
10120  {
10121  tempStamp.clear(); tempMap.clear(); tempMap2.clear();
10123  tempStamp, tempMap, tempMap2,
10125  OriginalSize);
10126  // now move the new stuff into the old place
10127  jacStamp = tempStamp; jacMap = tempMap; jacMap2 = tempMap2;
10128  numIntVars--;
10129  }
10130  if (collapseNode_BP)
10131  {
10132  tempStamp.clear(); tempMap.clear(); tempMap2.clear();
10134  tempStamp, tempMap, tempMap2,
10136  OriginalSize);
10137  // now move the new stuff into the old place
10138  jacStamp = tempStamp; jacMap = tempMap; jacMap2 = tempMap2;
10139  numIntVars--;
10140  }
10141  if (collapseNode_BS)
10142  {
10143  tempStamp.clear(); tempMap.clear(); tempMap2.clear();
10145  tempStamp, tempMap, tempMap2,
10147  OriginalSize);
10148  // now move the new stuff into the old place
10149  jacStamp = tempStamp; jacMap = tempMap; jacMap2 = tempMap2;
10150  numIntVars--;
10151  }
10152  if (collapseNode_BD)
10153  {
10154  tempStamp.clear(); tempMap.clear(); tempMap2.clear();
10156  tempStamp, tempMap, tempMap2,
10158  OriginalSize);
10159  // now move the new stuff into the old place
10160  jacStamp = tempStamp; jacMap = tempMap; jacMap2 = tempMap2;
10161  numIntVars--;
10162  }
10163 }
10164 
10165 //-----------------------------------------------------------------------------
10166 // Function : Instance::~Instance
10167 // Purpose : destructor
10168 // Special Notes :
10169 // Scope : public
10170 // Creator : admsXml
10171 // Creation Date :
10172 //-----------------------------------------------------------------------------
10174 {
10175 }
10176 
10177 //-----------------------------------------------------------------------------
10178 // Function : Instance::registerLIDs
10179 // Purpose : function for registering, and setting up, local ID's.
10180 // Special Notes :
10181 // Scope : public
10182 // Creator : admsXml
10183 // Creation Date :
10184 //-----------------------------------------------------------------------------
10185 void Instance::registerLIDs( const std::vector<int> & intLIDVecRef,
10186  const std::vector<int> & extLIDVecRef)
10187 {
10188  AssertLIDs(intLIDVecRef.size() == numIntVars);
10189  AssertLIDs(extLIDVecRef.size() == numExtVars);
10190 
10191 #ifdef Xyce_DEBUG_DEVICE
10192 
10193  if (getDeviceOptions().debugLevel > 0)
10194  {
10195  Xyce::dout() << std::endl << section_divider << std::endl;
10196  Xyce::dout() << "In ADMSPSP103VA::Instance::register LIDs\n\n";
10197  Xyce::dout() << "name = " << getName() << std::endl;
10198  Xyce::dout() << "number of internal variables: " << numIntVars << std::endl;
10199  Xyce::dout() << "number of external variables: " << numExtVars << std::endl;
10200  }
10201 #endif
10202 
10203  // copy over the global ID lists.
10204  intLIDVec = intLIDVecRef;
10205  extLIDVec = extLIDVecRef;
10206 
10207  // Now use these lists to obtain the indices into the linear algebra
10208  // entities. This assumes an order.
10209  int i=0;
10210  li_D = extLIDVecRef[i++];
10211  li_G = extLIDVecRef[i++];
10212  li_S = extLIDVecRef[i++];
10213  li_B = extLIDVecRef[i++];
10214 
10215 
10216  i=0;
10217  if (!collapseNode_GP)
10218  li_GP = intLIDVecRef[i++];
10219  else
10220  li_GP = li_G;
10221  if (!collapseNode_SI)
10222  li_SI = intLIDVecRef[i++];
10223  else
10224  li_SI = li_S;
10225  if (!collapseNode_DI)
10226  li_DI = intLIDVecRef[i++];
10227  else
10228  li_DI = li_D;
10229  if (!collapseNode_BI)
10230  li_BI = intLIDVecRef[i++];
10231  else
10232  li_BI = li_B;
10233  if (!collapseNode_BP)
10234  li_BP = intLIDVecRef[i++];
10235  else
10236  li_BP = li_BI;
10237  if (!collapseNode_BS)
10238  li_BS = intLIDVecRef[i++];
10239  else
10240  li_BS = li_BI;
10241  if (!collapseNode_BD)
10242  li_BD = intLIDVecRef[i++];
10243  else
10244  li_BD = li_BI;
10245 
10246 
10247 #ifdef Xyce_DEBUG_DEVICE
10248  if (getDeviceOptions().debugLevel > 0)
10249  {
10250  Xyce::dout() << "\nSolution and RHS variables:\n";
10251  Xyce::dout() << "\nli_D = " << li_D << std::endl;
10252  Xyce::dout() << "\nli_G = " << li_G << std::endl;
10253  Xyce::dout() << "\nli_S = " << li_S << std::endl;
10254  Xyce::dout() << "\nli_B = " << li_B << std::endl;
10255  Xyce::dout() << "\nli_GP = " << li_GP << std::endl;
10256  Xyce::dout() << "\nli_SI = " << li_SI << std::endl;
10257  Xyce::dout() << "\nli_DI = " << li_DI << std::endl;
10258  Xyce::dout() << "\nli_BI = " << li_BI << std::endl;
10259  Xyce::dout() << "\nli_BP = " << li_BP << std::endl;
10260  Xyce::dout() << "\nli_BS = " << li_BS << std::endl;
10261  Xyce::dout() << "\nli_BD = " << li_BD << std::endl;
10262  }
10263 #endif
10264 
10265 #ifdef Xyce_DEBUG_DEVICE
10266  if (getDeviceOptions().debugLevel > 0)
10267  {
10268  Xyce::dout() << "\nEnd of ADMSPSP103VA::Instance::register LIDs\n";
10269  Xyce::dout() << section_divider << std::endl;
10270  }
10271 #endif
10272 }
10273 
10274 //-----------------------------------------------------------------------------
10275 // Function : Instance::getIntNameMap
10276 // Purpose :
10277 // Special Notes :
10278 // Scope : public
10279 // Creator : admsXml
10280 // Creation Date :
10281 //-----------------------------------------------------------------------------
10282 std::map<int,std::string> & Instance::getIntNameMap ()
10283 {
10284  if (intNameMap.empty())
10285  {
10286  if (!collapseNode_GP)
10287  {
10289  }
10290  if (!collapseNode_SI)
10291  {
10293  }
10294  if (!collapseNode_DI)
10295  {
10297  }
10298  if (!collapseNode_BI)
10299  {
10301  }
10302  if (!collapseNode_BP)
10303  {
10305  }
10306  if (!collapseNode_BS)
10307  {
10309  }
10310  if (!collapseNode_BD)
10311  {
10313  }
10314  }
10315  return intNameMap;
10316 }
10317 
10318 //-----------------------------------------------------------------------------
10319 // Function : Instance::registerStateLIDs
10320 // Purpose :
10321 // Special Notes :
10322 // Scope : public
10323 // Creator : admsXml
10324 // Creation Date :
10325 //-----------------------------------------------------------------------------
10326 void Instance::registerStateLIDs( const std::vector<int> & staLIDVecRef)
10327 {
10328  AssertLIDs(staLIDVecRef.size() == numStateVars);
10329 }
10330 
10331 //-----------------------------------------------------------------------------
10332 // Function : Instance::jacobianStamp
10333 // Purpose :
10334 // Special Notes : In initial version, we won't support mapping away nodes
10335 // Scope : public
10336 // Creator : admsXml
10337 // Creation Date :
10338 //-----------------------------------------------------------------------------
10339 const std::vector< std::vector<int> > & Instance::jacobianStamp() const
10340 {
10341  return jacStamp;
10342 }
10343 
10344 //-----------------------------------------------------------------------------
10345 // Function : Instance::registerJacLIDs
10346 // Purpose : Create Offset variables used for referencing jacobian
10347 // elements
10348 // Special Notes :
10349 // Scope : public
10350 // Creator : admsXml
10351 // Creation Date :
10352 //-----------------------------------------------------------------------------
10353 void Instance::registerJacLIDs( const std::vector< std::vector<int> > & jacLIDVec)
10354 {
10356  std::vector<int> & map=jacMap;
10357  std::vector< std::vector<int> > & map2=jacMap2;
10358 
10359 
10360  // do nothing, we won't use the jac lids anymore, we'll use pointers
10361 
10362 }
10363 
10364 //-----------------------------------------------------------------------------
10365 // Function : Instance::setupPointers
10366 // Purpose : Create pointer variables used for referencing jacobian
10367 // elements
10368 // Special Notes :
10369 // Scope : public
10370 // Creator : admsXml
10371 // Creation Date :
10372 //-----------------------------------------------------------------------------
10374 {
10375 
10376  N_LAS_Matrix * dFdxMatPtr = extData.dFdxMatrixPtr;
10377  N_LAS_Matrix * dQdxMatPtr = extData.dQdxMatrixPtr;
10378  f_D_Equ_D_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_D,li_D);
10379  q_D_Equ_D_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_D,li_D);
10380  f_D_Equ_DI_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_D,li_DI);
10381  q_D_Equ_DI_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_D,li_DI);
10382  f_G_Equ_G_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_G,li_G);
10383  q_G_Equ_G_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_G,li_G);
10384  f_G_Equ_GP_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_G,li_GP);
10385  q_G_Equ_GP_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_G,li_GP);
10386  f_S_Equ_S_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_S,li_S);
10387  q_S_Equ_S_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_S,li_S);
10388  f_S_Equ_SI_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_S,li_SI);
10389  q_S_Equ_SI_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_S,li_SI);
10390  f_B_Equ_B_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_B,li_B);
10391  q_B_Equ_B_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_B,li_B);
10392  f_B_Equ_BI_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_B,li_BI);
10393  q_B_Equ_BI_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_B,li_BI);
10394  f_GP_Equ_SI_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_GP,li_SI);
10395  q_GP_Equ_SI_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_GP,li_SI);
10396  f_GP_Equ_BP_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_GP,li_BP);
10397  q_GP_Equ_BP_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_GP,li_BP);
10398  f_GP_Equ_DI_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_GP,li_DI);
10399  q_GP_Equ_DI_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_GP,li_DI);
10400  f_GP_Equ_GP_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_GP,li_GP);
10401  q_GP_Equ_GP_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_GP,li_GP);
10402  f_GP_Equ_G_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_GP,li_G);
10403  q_GP_Equ_G_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_GP,li_G);
10404  f_SI_Equ_SI_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_SI,li_SI);
10405  q_SI_Equ_SI_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_SI,li_SI);
10406  f_SI_Equ_BP_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_SI,li_BP);
10407  q_SI_Equ_BP_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_SI,li_BP);
10408  f_SI_Equ_GP_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_SI,li_GP);
10409  q_SI_Equ_GP_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_SI,li_GP);
10410  f_SI_Equ_DI_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_SI,li_DI);
10411  q_SI_Equ_DI_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_SI,li_DI);
10412  f_SI_Equ_BS_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_SI,li_BS);
10413  q_SI_Equ_BS_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_SI,li_BS);
10414  f_SI_Equ_BD_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_SI,li_BD);
10415  q_SI_Equ_BD_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_SI,li_BD);
10416  f_SI_Equ_S_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_SI,li_S);
10417  q_SI_Equ_S_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_SI,li_S);
10418  f_DI_Equ_SI_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_DI,li_SI);
10419  q_DI_Equ_SI_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_DI,li_SI);
10420  f_DI_Equ_BP_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_DI,li_BP);
10421  q_DI_Equ_BP_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_DI,li_BP);
10422  f_DI_Equ_GP_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_DI,li_GP);
10423  q_DI_Equ_GP_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_DI,li_GP);
10424  f_DI_Equ_DI_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_DI,li_DI);
10425  q_DI_Equ_DI_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_DI,li_DI);
10426  f_DI_Equ_BS_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_DI,li_BS);
10427  q_DI_Equ_BS_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_DI,li_BS);
10428  f_DI_Equ_BD_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_DI,li_BD);
10429  q_DI_Equ_BD_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_DI,li_BD);
10430  f_DI_Equ_D_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_DI,li_D);
10431  q_DI_Equ_D_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_DI,li_D);
10432  f_BI_Equ_BP_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_BI,li_BP);
10433  q_BI_Equ_BP_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_BI,li_BP);
10434  f_BI_Equ_BI_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_BI,li_BI);
10435  q_BI_Equ_BI_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_BI,li_BI);
10436  f_BI_Equ_BS_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_BI,li_BS);
10437  q_BI_Equ_BS_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_BI,li_BS);
10438  f_BI_Equ_BD_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_BI,li_BD);
10439  q_BI_Equ_BD_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_BI,li_BD);
10440  f_BI_Equ_B_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_BI,li_B);
10441  q_BI_Equ_B_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_BI,li_B);
10442  f_BP_Equ_SI_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_BP,li_SI);
10443  q_BP_Equ_SI_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_BP,li_SI);
10444  f_BP_Equ_BP_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_BP,li_BP);
10445  q_BP_Equ_BP_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_BP,li_BP);
10446  f_BP_Equ_GP_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_BP,li_GP);
10447  q_BP_Equ_GP_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_BP,li_GP);
10448  f_BP_Equ_DI_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_BP,li_DI);
10449  q_BP_Equ_DI_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_BP,li_DI);
10450  f_BP_Equ_BI_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_BP,li_BI);
10451  q_BP_Equ_BI_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_BP,li_BI);
10452  f_BS_Equ_SI_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_BS,li_SI);
10453  q_BS_Equ_SI_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_BS,li_SI);
10454  f_BS_Equ_BS_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_BS,li_BS);
10455  q_BS_Equ_BS_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_BS,li_BS);
10456  f_BS_Equ_DI_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_BS,li_DI);
10457  q_BS_Equ_DI_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_BS,li_DI);
10458  f_BS_Equ_BD_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_BS,li_BD);
10459  q_BS_Equ_BD_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_BS,li_BD);
10460  f_BS_Equ_BI_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_BS,li_BI);
10461  q_BS_Equ_BI_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_BS,li_BI);
10462  f_BD_Equ_SI_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_BD,li_SI);
10463  q_BD_Equ_SI_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_BD,li_SI);
10464  f_BD_Equ_BS_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_BD,li_BS);
10465  q_BD_Equ_BS_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_BD,li_BS);
10466  f_BD_Equ_DI_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_BD,li_DI);
10467  q_BD_Equ_DI_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_BD,li_DI);
10468  f_BD_Equ_BD_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_BD,li_BD);
10469  q_BD_Equ_BD_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_BD,li_BD);
10470  f_BD_Equ_BI_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_BD,li_BI);
10471  q_BD_Equ_BI_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_BD,li_BI);
10472 
10473 
10474 }
10475 
10476 // RHS load functions
10477 
10478 //-----------------------------------------------------------------------------
10479 // Function : Instance::loadDAEFVector
10480 // Purpose : load F vector (static contributions) for one instance for
10481 // NEW DAE formulation
10482 // Special Notes :
10483 // Scope : public
10484 // Creator : admsXml
10485 // Creation Date :
10486 //-----------------------------------------------------------------------------
10488 {
10489 
10490  bool bsuccess=true;
10491 
10503 
10504  return bsuccess;
10505 }
10506 
10507 //-----------------------------------------------------------------------------
10508 // Function : Instance::loadDAEQVector
10509 // Purpose : load Q vector (dynamic contributions) for one instance for
10510 // NEW DAE formulation
10511 // Special Notes :
10512 // Scope : public
10513 // Creator : admsXml
10514 // Creation Date :
10515 //-----------------------------------------------------------------------------
10517 {
10529 
10530  return true;
10531 }
10532 
10533 
10534 //-----------------------------------------------------------------------------
10535 // Function : Instance::updatePrimaryState
10536 // Purpose :
10537 // Special Notes : In this initial implementation, does little more than
10538 // call updateIntermediateVars()
10539 // Scope : public
10540 // Creator : admsXml
10541 // Creation Date :
10542 //-----------------------------------------------------------------------------
10544 {
10545  bool bsuccess = true;
10546 
10547  bsuccess = updateIntermediateVars();
10548 
10549  // if old DAE were implemented, we'd save dynamic contributions as state
10550  // here.
10551 
10552 
10553  return bsuccess;
10554 }
10555 
10556 //-----------------------------------------------------------------------------
10557 // Function : Instance::updateSecondaryState
10558 // Purpose :
10559 // Special Notes : In this initial implementation, does nothing
10560 // Scope : public
10561 // Creator : admsXml
10562 // Creation Date :
10563 //-----------------------------------------------------------------------------
10565 {
10566  bool bsuccess = true;
10567 
10568  // were old DAE implemented, we'd pull dynamic contribution derivatives
10569  // out of state.
10570 
10571  return bsuccess;
10572 }
10573 
10574 //-----------------------------------------------------------------------------
10575 // Function : Instance::updateIntermediateVars
10576 // Purpose : update intermediate variables for one PSP103VA instance
10577 // Special Notes :
10578 // Scope : public
10579 // Creator : admsXml
10580 // Creation Date :
10581 //-----------------------------------------------------------------------------
10583 {
10584 
10585  bool bsuccess=true;
10586  N_LAS_Vector * solVectorPtr = extData.nextSolVectorPtr;
10587 
10588 #ifdef Xyce_DEBUG_DEVICE
10589  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
10590  {
10591  Xyce::dout() << std::endl << subsection_divider << std::endl;
10592  Xyce::dout() << " In ADMSPSP103VA::Instance::updateIntermediateVars\n\n";
10593  Xyce::dout() << " name = " << getName() << std::endl;
10594  }
10595 #endif
10596 
10597  // Local variables
10598  AdmsFadType Qs;
10599  AdmsFadType Idse;
10600  AdmsFadType Igbe;
10601  AdmsFadType Igcse;
10602  AdmsFadType Igcde;
10603  AdmsFadType Igsove;
10604  AdmsFadType Igdove;
10605  AdmsFadType Igidle;
10606  AdmsFadType Igisle;
10607  AdmsFadType Iimpacte;
10608  double rgatenoise;
10609  double rsourcenoise;
10610  double rdrainnoise;
10611  double rbulknoise;
10612  double rjunsnoise;
10613  double rjundnoise;
10614  double rwellnoise;
10615  AdmsFadType vbbt;
10616  AdmsFadType two_psistar;
10617  AdmsFadType z;
10618  AdmsFadType vjlim;
10619  AdmsFadType tmp;
10620  AdmsFadType id;
10621  AdmsFadType wsrhstep;
10622  AdmsFadType dwsrh;
10623  AdmsFadType isrh;
10624  AdmsFadType btat;
10625  AdmsFadType twoatatoverthreebtat;
10626  AdmsFadType umaxbeforelimiting;
10627  AdmsFadType umax;
10628  AdmsFadType sqrtumax;
10629  AdmsFadType umaxpoweronepointfive;
10630  AdmsFadType wgamma;
10631  AdmsFadType wtat;
10632  AdmsFadType ktat;
10633  AdmsFadType ltat;
10634  AdmsFadType mtat;
10635  AdmsFadType xerfc;
10636  AdmsFadType ysq;
10637  AdmsFadType terfc;
10638  AdmsFadType erfcpos;
10639  AdmsFadType erfctimesexpmtat;
10640  AdmsFadType gammamax;
10641  AdmsFadType itat;
10642  AdmsFadType Fmaxr;
10643  AdmsFadType ibbt;
10644  AdmsFadType fbreakdown;
10645  AdmsFadType tm0;
10646  AdmsFadType tm1;
10647  AdmsFadType ijunfor1;
10648  AdmsFadType ijunfor2;
10649  AdmsFadType ijunrev;
10650  AdmsFadType h5;
10651  AdmsFadType h4;
10652  AdmsFadType h3;
10653  AdmsFadType h2d;
10654  double h2;
10655  double h1;
10656  AdmsFadType Gf_ac;
10657  AdmsFadType x_m_ac;
10658  AdmsFadType Gmob_dL_ac;
10659  AdmsFadType Gvsat_ac;
10660  AdmsFadType eta_p_ac;
10661  AdmsFadType H_ac;
10662  AdmsFadType GdL_ac;
10663  AdmsFadType qim1_ac;
10664  AdmsFadType qim_ac;
10665  AdmsFadType dps_ac;
10666  AdmsFadType alpha_ac;
10667  AdmsFadType Voxm_ac;
10668  AdmsFadType qeff1_ac;
10669  AdmsFadType xg_ac;
10670  AdmsFadType Vsbstar_ac;
10671  AdmsFadType Vgb;
10672  AdmsFadType COX_qm;
10673  AdmsFadType Fj;
10674  AdmsFadType Fj2;
10675  AdmsFadType QG;
10676  AdmsFadType QI;
10677  AdmsFadType QD;
10678  AdmsFadType QB;
10679  AdmsFadType Qg;
10680  AdmsFadType Qd;
10681  AdmsFadType Qb;
10682  AdmsFadType Qgs_ov;
10683  AdmsFadType Qgd_ov;
10684  AdmsFadType Qgb_ov;
10685  AdmsFadType Qfgs;
10686  AdmsFadType Qfgd;
10687  AdmsFadType QCLM;
10688  AdmsFadType xs_ov;
10689  AdmsFadType xd_ov;
10690  AdmsFadType Vovs;
10691  AdmsFadType Vovd;
10692  AdmsFadType Iimpact;
10693  AdmsFadType mavl;
10694  AdmsFadType Vrg;
10695  AdmsFadType Vrs;
10696  AdmsFadType Vrd;
10697  AdmsFadType Vrjuns;
10698  AdmsFadType Vrjund;
10699  AdmsFadType Vrbulk;
10700  AdmsFadType Vrwell;
10701  AdmsFadType Vgs;
10702  AdmsFadType Vds;
10703  AdmsFadType Vsb;
10704  AdmsFadType Vjun_s;
10705  AdmsFadType Vjun_d;
10706  AdmsFadType VgsPrime;
10707  AdmsFadType VsbPrime;
10708  AdmsFadType VdbPrime;
10709  AdmsFadType VgdPrime;
10710  AdmsFadType xgs_ov;
10711  AdmsFadType xgd_ov;
10712  double sigVds;
10713  AdmsFadType Vgd;
10714  AdmsFadType Vdb;
10715  AdmsFadType Vdsx;
10716  AdmsFadType Udse_dc;
10717  AdmsFadType Vdsat_dc;
10718  AdmsFadType Gf_dc;
10719  AdmsFadType x_m_dc;
10720  AdmsFadType x_ds_dc;
10721  AdmsFadType Gmob_dL_dc;
10722  AdmsFadType Gvsatinv_dc;
10723  AdmsFadType Gvsat_dc;
10724  AdmsFadType eta_p_dc;
10725  AdmsFadType H_dc;
10726  AdmsFadType FdL_dc;
10727  AdmsFadType GdL_dc;
10728  AdmsFadType qim1_dc;
10729  AdmsFadType qim_dc;
10730  AdmsFadType dps_dc;
10731  AdmsFadType alpha_dc;
10732  AdmsFadType Voxm_dc;
10733  AdmsFadType qeff1_dc;
10734  AdmsFadType xg_dc;
10735  AdmsFadType help;
10736  AdmsFadType temp1;
10737  AdmsFadType temp2;
10738  AdmsFadType mutau;
10739  AdmsFadType nu;
10740  AdmsFadType delVg;
10741  AdmsFadType Vgb1;
10742  AdmsFadType Vgbstar;
10743  AdmsFadType Vdbstar;
10744  AdmsFadType Vsbnud;
10745  AdmsFadType Vmbnew;
10746  AdmsFadType usnew;
10747  AdmsFadType us;
10748  AdmsFadType Vmb;
10749  AdmsFadType Vsbstar_dc;
10750  AdmsFadType temp;
10751  AdmsFadType delVsat;
10752  AdmsFadType Ids;
10753  double GOV;
10754  double GOV2;
10755  double xi_ov;
10756  double inv_xi_ov;
10757  double x_mrg_ov;
10758  double inv_xg1;
10759  double SP_OV_Afac;
10760  AdmsFadType SP_OV_xbar;
10761  AdmsFadType SP_OV_x0;
10762  AdmsFadType SP_OV_u;
10763  AdmsFadType SP_OV_yg;
10764  AdmsFadType SP_OV_z;
10765  AdmsFadType SP_OV_eta;
10766  AdmsFadType SP_OV_a;
10767  AdmsFadType SP_OV_c;
10768  AdmsFadType SP_OV_tau;
10769  AdmsFadType SP_OV_y0;
10770  AdmsFadType SP_OV_D0;
10771  AdmsFadType SP_OV_temp;
10772  AdmsFadType SP_OV_p;
10773  AdmsFadType SP_OV_q;
10774  AdmsFadType SP_OV_xi;
10775  AdmsFadType SP_OV_w;
10776  AdmsFadType Igsov;
10777  AdmsFadType Igdov;
10778  AdmsFadType Igc;
10779  AdmsFadType Igb;
10780  AdmsFadType Igcs;
10781  AdmsFadType Igcd;
10782  AdmsFadType arg2mina;
10783  AdmsFadType psi_t;
10784  AdmsFadType zg;
10785  AdmsFadType arg1;
10786  AdmsFadType Dsi;
10787  AdmsFadType Dgate;
10788  AdmsFadType TP;
10789  AdmsFadType Vm;
10790  AdmsFadType Igc0;
10791  AdmsFadType u0;
10792  AdmsFadType x;
10793  AdmsFadType u0_div_H;
10794  AdmsFadType Bg;
10795  AdmsFadType Ag;
10796  AdmsFadType inv_x;
10797  AdmsFadType ex;
10798  AdmsFadType inv_ex;
10799  AdmsFadType xsq;
10800  AdmsFadType igc;
10801  AdmsFadType igcd_h;
10802  AdmsFadType Sg;
10803  AdmsFadType Igidl;
10804  AdmsFadType Igisl;
10805  AdmsFadType Vtovd;
10806  AdmsFadType Vtovs;
10807 
10808 
10809  // set the sizes of the Fad arrays:
10810 
10811  if (probeVars.size() != (12))
10812  {
10813  probeVars.resize(12);
10814  staticContributions.resize(11+0);
10815  dynamicContributions.resize(11+0);
10816  }
10817 
10818  // initialize contributions to zero (automatically sets derivatives to zero)
10819  for (int i=0; i < 11+0 ; ++i)
10820  {
10821  staticContributions[i]=0;
10822  dynamicContributions[i]=0;
10823  }
10824 
10825  // extract solution variables and set as Fad independent variables.
10826  probeVars[admsProbeID_V_DI_BD] = (*solVectorPtr)[li_DI] - (*solVectorPtr)[li_BD];
10828 
10829  probeVars[admsProbeID_V_SI_BS] = (*solVectorPtr)[li_SI] - (*solVectorPtr)[li_BS];
10831 
10832  probeVars[admsProbeID_V_SI_BP] = (*solVectorPtr)[li_SI] - (*solVectorPtr)[li_BP];
10834 
10835  probeVars[admsProbeID_V_DI_SI] = (*solVectorPtr)[li_DI] - (*solVectorPtr)[li_SI];
10837 
10838  probeVars[admsProbeID_V_GP_SI] = (*solVectorPtr)[li_GP] - (*solVectorPtr)[li_SI];
10840 
10841  probeVars[admsProbeID_V_B_BI] = (*solVectorPtr)[li_B] - (*solVectorPtr)[li_BI];
10843 
10844  probeVars[admsProbeID_V_BP_BI] = (*solVectorPtr)[li_BP] - (*solVectorPtr)[li_BI];
10846 
10847  probeVars[admsProbeID_V_BD_BI] = (*solVectorPtr)[li_BD] - (*solVectorPtr)[li_BI];
10849 
10850  probeVars[admsProbeID_V_BS_BI] = (*solVectorPtr)[li_BS] - (*solVectorPtr)[li_BI];
10852 
10853  probeVars[admsProbeID_V_D_DI] = (*solVectorPtr)[li_D] - (*solVectorPtr)[li_DI];
10855 
10856  probeVars[admsProbeID_V_S_SI] = (*solVectorPtr)[li_S] - (*solVectorPtr)[li_SI];
10858 
10859  probeVars[admsProbeID_V_G_GP] = (*solVectorPtr)[li_G] - (*solVectorPtr)[li_GP];
10861 
10862 
10863  // -- code converted from analog/code block
10864  //Begin block evaluateStatic
10865  {
10866  QCLM = 0.0;
10867  xs_ov = 0.0;
10868  xd_ov = 0.0;
10869  Vovs = 0.0;
10870  Vovd = 0.0;
10871  Iimpact = 0.0;
10872  mavl = 0.0;
10873  Vrg = (probeVars[admsProbeID_V_G_GP]);
10874  Vrs = (probeVars[admsProbeID_V_S_SI]);
10875  Vrd = (probeVars[admsProbeID_V_D_DI]);
10876  Vrjuns = (probeVars[admsProbeID_V_BS_BI]);
10877  Vrjund = (probeVars[admsProbeID_V_BD_BI]);
10878  Vrbulk = (probeVars[admsProbeID_V_BP_BI]);
10879  Vrwell = (probeVars[admsProbeID_V_B_BI]);
10880  if (((model_.CHNL_TYPE)==(+1)))
10881  {
10882  Vgs = (probeVars[admsProbeID_V_GP_SI]);
10883  Vds = (probeVars[admsProbeID_V_DI_SI]);
10884  Vsb = (probeVars[admsProbeID_V_SI_BP]);
10885  Vjun_s = (-(probeVars[admsProbeID_V_SI_BS]));
10886  Vjun_d = (-(probeVars[admsProbeID_V_DI_BD]));
10887  }
10888  else
10889  {
10890  Vgs = (-(probeVars[admsProbeID_V_GP_SI]));
10891  Vds = (-(probeVars[admsProbeID_V_DI_SI]));
10892  Vsb = (-(probeVars[admsProbeID_V_SI_BP]));
10893  Vjun_s = (probeVars[admsProbeID_V_SI_BS]);
10894  Vjun_d = (probeVars[admsProbeID_V_DI_BD]);
10895  }
10896  VgsPrime = Vgs;
10897  VsbPrime = Vsb;
10898  VdbPrime = (Vds+Vsb);
10899  VgdPrime = (Vgs-Vds);
10900  xgs_ov = ((-VgsPrime)*(model_.inv_phit));
10901  xgd_ov = ((-VgdPrime)*(model_.inv_phit));
10902  sigVds = 1.0;
10903  if ((Vds<0.0))
10904  {
10905  sigVds = (-1.0);
10906  Vgs = (Vgs-Vds);
10907  Vsb = (Vsb+Vds);
10908  Vds = (-Vds);
10909  }
10910  Vgd = (Vgs-Vds);
10911  Vdb = (Vds+Vsb);
10912  Vdsx = (sqrt(((Vds*Vds)+0.01))-0.1);
10913  //Begin block SPcalc_dc
10914  {
10915  //Block-local variables for block SPcalc_dc
10916  double phib;
10917  double G_0;
10918  double sqrt_phib;
10919  AdmsFadType Vsbstar;
10920  AdmsFadType Vsbx;
10921  //End of Block-local variables
10922  //Block-local variables for block SPcalc_dc
10923  AdmsFadType xg;
10924  AdmsFadType qeff;
10925  AdmsFadType qeff1;
10926  AdmsFadType Voxm;
10927  AdmsFadType alpha;
10928  AdmsFadType dps;
10929  AdmsFadType qim;
10930  AdmsFadType qim1;
10931  AdmsFadType GdL;
10932  AdmsFadType H;
10933  AdmsFadType eta_p;
10934  AdmsFadType s1;
10935  //End of Block-local variables
10936  //Block-local variables for block SPcalc_dc
10937  AdmsFadType Gvsat;
10938  AdmsFadType Gvsatinv;
10939  AdmsFadType Gmob_dL;
10940  AdmsFadType x_ds;
10941  AdmsFadType x_m;
10942  //End of Block-local variables
10943  //Block-local variables for block SPcalc_dc
10944  AdmsFadType Dnsub;
10945  //End of Block-local variables
10946  //Block-local variables for block SPcalc_dc
10947  AdmsFadType x_s;
10948  AdmsFadType sqm;
10949  AdmsFadType alpha1;
10950  AdmsFadType phi_inf;
10951  AdmsFadType za;
10952  AdmsFadType xitsb;
10953  AdmsFadType rhob;
10954  //End of Block-local variables
10955  //Block-local variables for block SPcalc_dc
10956  AdmsFadType thesat1;
10957  AdmsFadType wsat;
10958  AdmsFadType ysat;
10959  AdmsFadType zsat;
10960  AdmsFadType dL;
10961  AdmsFadType GR;
10962  AdmsFadType Gmob;
10963  //End of Block-local variables
10964  //Block-local variables for block SPcalc_dc
10965  AdmsFadType xgm;
10966  AdmsFadType Ux;
10967  //End of Block-local variables
10968  //Block-local variables for block SPcalc_dc
10969  AdmsFadType xn_s;
10970  AdmsFadType delta_ns;
10971  //End of Block-local variables
10972  //Block-local variables for block SPcalc_dc
10973  AdmsFadType Gf;
10974  AdmsFadType Gf2;
10975  AdmsFadType inv_Gf2;
10976  AdmsFadType xi;
10977  AdmsFadType inv_xi;
10978  AdmsFadType margin;
10979  //End of Block-local variables
10980  //Block-local variables for block SPcalc_dc
10981  AdmsFadType SP_xg1;
10982  AdmsFadType SP_S_temp;
10983  AdmsFadType SP_S_temp1;
10984  AdmsFadType SP_S_temp2;
10985  //End of Block-local variables
10986  //Block-local variables for block SPcalc_dc
10987  AdmsFadType SP_S_yg;
10988  AdmsFadType SP_S_ysub;
10989  AdmsFadType SP_S_y0;
10990  AdmsFadType SP_S_a;
10991  AdmsFadType SP_S_b;
10992  AdmsFadType SP_S_c;
10993  //End of Block-local variables
10994  //Block-local variables for block SPcalc_dc
10995  AdmsFadType SP_S_bx;
10996  AdmsFadType SP_S_tau;
10997  AdmsFadType SP_S_eta;
10998  AdmsFadType SP_S_delta0;
10999  AdmsFadType SP_S_delta1;
11000  //End of Block-local variables
11001  //Block-local variables for block SPcalc_dc
11002  AdmsFadType SP_S_pC;
11003  AdmsFadType SP_S_qC;
11004  AdmsFadType SP_S_A_fac;
11005  //End of Block-local variables
11006  //Block-local variables for block SPcalc_dc
11007  AdmsFadType SP_S_x1;
11008  AdmsFadType SP_S_w;
11009  AdmsFadType SP_S_xbar;
11010  AdmsFadType SP_S_x0;
11011  //End of Block-local variables
11012  //Block-local variables for block SPcalc_dc
11013  AdmsFadType SP_S_xi0;
11014  AdmsFadType SP_S_xi1;
11015  AdmsFadType SP_S_xi2;
11016  //End of Block-local variables
11017  //Block-local variables for block SPcalc_dc
11018  AdmsFadType x_d;
11019  AdmsFadType Rxcor;
11020  AdmsFadType delta_1s;
11021  AdmsFadType xi0s;
11022  AdmsFadType xi1s;
11023  AdmsFadType xi2s;
11024  AdmsFadType xi0d;
11025  //End of Block-local variables
11026  //Block-local variables for block SPcalc_dc
11027  AdmsFadType Es;
11028  AdmsFadType Em;
11029  AdmsFadType Ed;
11030  AdmsFadType Ds;
11031  AdmsFadType Dm;
11032  AdmsFadType Dd;
11033  AdmsFadType Ps;
11034  AdmsFadType xgs;
11035  AdmsFadType qis;
11036  AdmsFadType qbs;
11037  AdmsFadType qbm;
11038  AdmsFadType Eeffm;
11039  //End of Block-local variables
11040  //Block-local variables for block SPcalc_dc
11041  AdmsFadType Phi_0;
11042  AdmsFadType Phi_2;
11043  AdmsFadType asat;
11044  AdmsFadType Phi_0_2;
11045  AdmsFadType Phi0_Phi2;
11046  //End of Block-local variables
11047  //Block-local variables for block SPcalc_dc
11048  AdmsFadType Vdse;
11049  AdmsFadType Vdsat;
11050  AdmsFadType Udse;
11051  AdmsFadType xn_d;
11052  AdmsFadType k_ds;
11053  //End of Block-local variables
11054  //Block-local variables for block SPcalc_dc
11055  AdmsFadType Mutmp;
11056  AdmsFadType Phi_sat;
11057  AdmsFadType delta_nd;
11058  //End of Block-local variables
11059  //Block-local variables for block SPcalc_dc
11060  AdmsFadType pC;
11061  AdmsFadType qC;
11062  AdmsFadType Pm;
11063  //End of Block-local variables
11064  //Block-local variables for block SPcalc_dc
11065  AdmsFadType d0;
11066  AdmsFadType D_bar;
11067  AdmsFadType km;
11068  AdmsFadType x_pm;
11069  AdmsFadType xi_pd;
11070  AdmsFadType p_pd;
11071  AdmsFadType u_pd;
11072  AdmsFadType q_pd;
11073  //End of Block-local variables
11074  //Block-local variables for block SPcalc_dc
11075  AdmsFadType FdL;
11076  AdmsFadType qim1_1;
11077  AdmsFadType r1;
11078  AdmsFadType r2;
11079  AdmsFadType s2;
11080  AdmsFadType dL1;
11081  //End of Block-local variables
11082  temp = ((0.5*((Vdb+Vsb)-sqrt((((Vdb-Vsb)*(Vdb-Vsb))+bphi_dc))))+phix_dc);
11083  Vsbstar_dc = ((Vsb-(0.5*((temp)-sqrt((((temp)*(temp))+aphi_dc)))))+phix1_dc);
11084  if ((((model_.SWNUD_i)!=0)&&(GFACNUD_i!=1.0)))
11085  {
11086  Vmb = (Vsbstar_dc+(0.5*(Vds-Vdsx)));
11087  us = (sqrt((Vmb+phib_dc))-sqrt_phib_dc);
11088  temp = (((2*(us-us1))/us21)-1);
11089  usnew = (us-(((0.25*(1-GFACNUD_i))*us21)*(temp+sqrt(((temp*temp)+0.4804530139182)))));
11090  Vmbnew = ((usnew*usnew)+((2*sqrt_phib_dc)*usnew));
11091  Vsbnud = (Vmbnew-(0.5*(Vds-Vdsx)));
11092  }
11093  else
11094  {
11095  Vsbnud = Vsbstar_dc;
11096  }
11097  phib = phib_dc;
11098  G_0 = G_0_dc;
11099  sqrt_phib = sqrt_phib_dc;
11100  Vsbstar = Vsbnud;
11101  FdL = 1.0;
11102  alpha = 0.0;
11103  GdL = 1.0;
11104  dL = 0.0;
11105  qbm = 0.0;
11106  dps = 0.0;
11107  qim = 0.0;
11108  qim1 = 0.0;
11109  H = 1.0;
11110  eta_p = 1.0;
11111  Gvsat = 1.0;
11112  Gvsatinv = 1.0;
11113  SP_S_x1 = 0.0;
11114  x_s = 0.0;
11115  sqm = 0.0;
11116  xitsb = 0.0;
11117  rhob = 0.0;
11118  Gmob = 1.0;
11119  Gmob_dL = 1.0;
11120  Udse = 0.0;
11121  thesat1 = 0.0;
11122  xgm = 0.0;
11123  Vdbstar = (Vds+Vsbstar);
11124  Vgbstar = (Vgs+Vsbstar);
11125  Vgb1 = (Vgbstar-VFB_i);
11126  Vsbx = (Vsbstar+(0.5*(Vds-Vdsx)));
11127  delVg = (CF_i*(Vdsx*(1+(CFB_i*Vsbx))));
11128  Vgb1 = (Vgb1+delVg);
11129  xg = (Vgb1*inv_phit1);
11130  if ((DNSUB_i>0.0))
11131  {
11132  Dnsub = ((DNSUB_i*0.5)*((+((Vgs+Vsb)-VNSUB_i))+sqrt((((-((Vgs+Vsb)-VNSUB_i))*(-((Vgs+Vsb)-VNSUB_i)))+NSLP_i))));
11133  Gf = (G_0*sqrt((1.0+Dnsub)));
11134  }
11135  else
11136  {
11137  Gf = G_0;
11138  }
11139  Gf2 = (Gf*Gf);
11140  inv_Gf2 = (1.0/Gf2);
11141  xi = (1.0+(Gf*7.0710678118654746e-01));
11142  inv_xi = (1.0/xi);
11143  Ux = (Vsbstar*inv_phit1);
11144  xn_s = ((phib*inv_phit1)+Ux);
11145  if ((xn_s<4.6051701859880916e+02))
11146  {
11147  delta_ns = exp((-xn_s));
11148  }
11149  else
11150  {
11151  delta_ns = (1.0e-200/(1.0+((xn_s-4.6051701859880916e+02)*(1.0+(0.5*((xn_s-4.6051701859880916e+02)*(1.0+((xn_s-4.6051701859880916e+02)*3.3333333333333333e-01))))))));
11152  }
11153  margin = (1e-5*xi);
11154  if ((fabs(xg)<=margin))
11155  {
11156  SP_S_temp1 = (((inv_xi*inv_xi)*1.6666666666666667e-01)*7.0710678118654746e-01);
11157  x_s = ((xg*inv_xi)*(1.0+(((xg*(1.0-delta_ns))*Gf)*SP_S_temp1)));
11158  }
11159  else
11160  {
11161  if ((xg<(-margin)))
11162  {
11163  SP_S_yg = (-xg);
11164  SP_S_ysub = (1.25*(SP_S_yg*inv_xi));
11165  SP_S_eta = (0.5*((SP_S_ysub+10)-sqrt((((SP_S_ysub-6.0)*(SP_S_ysub-6.0))+64.0))));
11166  SP_S_temp = (SP_S_yg-SP_S_eta);
11167  SP_S_a = ((SP_S_temp*SP_S_temp)+(Gf2*(SP_S_eta+1.0)));
11168  SP_S_c = ((2.0*SP_S_temp)-Gf2);
11169  SP_S_tau = ((-SP_S_eta)+log((SP_S_a*inv_Gf2)));
11170  nu = (SP_S_a+SP_S_c);
11171  mutau = ((nu*nu)+(SP_S_tau*((0.5*(SP_S_c*SP_S_c))-SP_S_a)));
11172  SP_S_y0 = (SP_S_eta+(((SP_S_a*nu)*SP_S_tau)/(mutau+(((((nu/mutau)*SP_S_tau)*SP_S_tau)*SP_S_c)*(((SP_S_c*SP_S_c)*3.3333333333333333e-01)-SP_S_a)))));
11173  if ((SP_S_y0<2.3025850929940458e+02))
11174  {
11175  SP_S_delta0 = exp(SP_S_y0);
11176  }
11177  else
11178  {
11179  SP_S_delta0 = (1.0e100*(1.0+((SP_S_y0-2.3025850929940458e+02)*(1.0+(0.5*((SP_S_y0-2.3025850929940458e+02)*(1.0+((SP_S_y0-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
11180  }
11181  SP_S_delta1 = (1.0/SP_S_delta0);
11182  SP_S_temp = (1.0/(2.0+(SP_S_y0*SP_S_y0)));
11183  SP_S_xi0 = ((SP_S_y0*SP_S_y0)*SP_S_temp);
11184  SP_S_xi1 = (4.0*((SP_S_y0*SP_S_temp)*SP_S_temp));
11185  SP_S_xi2 = ((((8.0*SP_S_temp)-(12.0*SP_S_xi0))*SP_S_temp)*SP_S_temp);
11186  SP_S_temp = (SP_S_yg-SP_S_y0);
11187  SP_S_temp1 = (delta_ns*SP_S_delta1);
11188  SP_S_pC = ((2.0*SP_S_temp)+(Gf2*(((SP_S_delta0-1.0)-SP_S_temp1)+(delta_ns*(1.0-SP_S_xi1)))));
11189  SP_S_qC = ((SP_S_temp*SP_S_temp)-(Gf2*((((SP_S_delta0-SP_S_y0)-1.0)+SP_S_temp1)+(delta_ns*((SP_S_y0-1.0)-SP_S_xi0)))));
11190  SP_S_temp = (2.0-(Gf2*((SP_S_delta0+SP_S_temp1)-(delta_ns*SP_S_xi2))));
11191  SP_S_temp = ((SP_S_pC*SP_S_pC)-(2.0*(SP_S_qC*SP_S_temp)));
11192  x_s = ((-SP_S_y0)-(2.0*(SP_S_qC/(SP_S_pC+sqrt(SP_S_temp)))));
11193  }
11194  else
11195  {
11196  SP_xg1 = (1.0/(x1+(Gf*7.324648775608221e-001)));
11197  SP_S_A_fac = ((((xi*x1)*SP_xg1)-1.0)*SP_xg1);
11198  SP_S_xbar = ((xg*inv_xi)*(1.0+(SP_S_A_fac*xg)));
11199  if (((-SP_S_xbar)>(-2.3025850929940458e+02)))
11200  {
11201  SP_S_temp = exp((-SP_S_xbar));
11202  }
11203  else
11204  {
11205  SP_S_temp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-(-SP_S_xbar))*(1.0+(0.5*(((-2.3025850929940458e+02)-(-SP_S_xbar))*(1.0+(((-2.3025850929940458e+02)-(-SP_S_xbar))*3.3333333333333333e-01))))))));
11206  }
11207  SP_S_w = (1.0-SP_S_temp);
11208  SP_S_x1 = ((xg+(Gf2*0.5))-(Gf*sqrt(((xg+(Gf2*0.25))-SP_S_w))));
11209  SP_S_bx = (xn_s+3.0);
11210  SP_S_eta = ((0.5*((SP_S_x1+SP_S_bx)-sqrt((((SP_S_x1-SP_S_bx)*(SP_S_x1-SP_S_bx))+5.0))))-(0.5*(SP_S_bx-sqrt(((SP_S_bx*SP_S_bx)+5.0)))));
11211  SP_S_temp = (xg-SP_S_eta);
11212  SP_S_temp1 = exp((-SP_S_eta));
11213  SP_S_temp2 = (1.0/(2.0+(SP_S_eta*SP_S_eta)));
11214  SP_S_xi0 = ((SP_S_eta*SP_S_eta)*SP_S_temp2);
11215  SP_S_xi1 = (4.0*((SP_S_eta*SP_S_temp2)*SP_S_temp2));
11216  SP_S_xi2 = ((((8.0*SP_S_temp2)-(12.0*SP_S_xi0))*SP_S_temp2)*SP_S_temp2);
11217  SP_S_a = max(1.0e-40,((SP_S_temp*SP_S_temp)-(Gf2*(((SP_S_temp1+SP_S_eta)-1.0)-(delta_ns*((SP_S_eta+1.0)+SP_S_xi0))))));
11218  SP_S_b = (1.0-(0.5*(Gf2*(SP_S_temp1-(delta_ns*SP_S_xi2)))));
11219  SP_S_c = ((2.0*SP_S_temp)+(Gf2*((1.0-SP_S_temp1)-(delta_ns*(1.0+SP_S_xi1)))));
11220  SP_S_tau = ((xn_s-SP_S_eta)+log((SP_S_a/Gf2)));
11221  nu = (SP_S_a+SP_S_c);
11222  mutau = ((nu*nu)+(SP_S_tau*((0.5*(SP_S_c*SP_S_c))-(SP_S_a*SP_S_b))));
11223  SP_S_x0 = (SP_S_eta+(((SP_S_a*nu)*SP_S_tau)/(mutau+(((((nu/mutau)*SP_S_tau)*SP_S_tau)*SP_S_c)*(((SP_S_c*SP_S_c)*3.3333333333333333e-01)-(SP_S_a*SP_S_b))))));
11224  if ((SP_S_x0<2.3025850929940458e+02))
11225  {
11226  SP_S_delta0 = exp(SP_S_x0);
11227  SP_S_delta1 = (1.0/SP_S_delta0);
11228  SP_S_delta0 = (delta_ns*SP_S_delta0);
11229  }
11230  else
11231  {
11232  if ((SP_S_x0>(xn_s-2.3025850929940458e+02)))
11233  {
11234  SP_S_delta0 = exp((SP_S_x0-xn_s));
11235  SP_S_delta1 = (delta_ns/SP_S_delta0);
11236  }
11237  else
11238  {
11239  SP_S_delta0 = (1.0e-100/(1.0+(((xn_s-SP_S_x0)-2.3025850929940458e+02)*(1.0+(0.5*(((xn_s-SP_S_x0)-2.3025850929940458e+02)*(1.0+(((xn_s-SP_S_x0)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
11240  SP_S_delta1 = (1.0e-100/(1.0+((SP_S_x0-2.3025850929940458e+02)*(1.0+(0.5*((SP_S_x0-2.3025850929940458e+02)*(1.0+((SP_S_x0-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
11241  }
11242  }
11243  SP_S_temp = (1.0/(2.0+(SP_S_x0*SP_S_x0)));
11244  SP_S_xi0 = ((SP_S_x0*SP_S_x0)*SP_S_temp);
11245  SP_S_xi1 = (4.0*((SP_S_x0*SP_S_temp)*SP_S_temp));
11246  SP_S_xi2 = ((((8.0*SP_S_temp)-(12.0*SP_S_xi0))*SP_S_temp)*SP_S_temp);
11247  SP_S_temp = (xg-SP_S_x0);
11248  SP_S_pC = ((2.0*SP_S_temp)+(Gf2*(((1.0-SP_S_delta1)+SP_S_delta0)-(delta_ns*(1.0+SP_S_xi1)))));
11249  SP_S_qC = ((SP_S_temp*SP_S_temp)-(Gf2*((((SP_S_delta1+SP_S_x0)-1.0)+SP_S_delta0)-(delta_ns*((SP_S_x0+1.0)+SP_S_xi0)))));
11250  SP_S_temp = (2.0-(Gf2*((SP_S_delta1+SP_S_delta0)-(delta_ns*SP_S_xi2))));
11251  SP_S_temp = ((SP_S_pC*SP_S_pC)-(2.0*(SP_S_qC*SP_S_temp)));
11252  x_s = (SP_S_x0+(2.0*(SP_S_qC/(SP_S_pC+sqrt(SP_S_temp)))));
11253  }
11254  }
11255  x_d = x_s;
11256  x_m = x_s;
11257  x_ds = 0.0;
11258  if ((xg<=0.0))
11259  {
11260  qis = 0.0;
11261  xgm = (xg-x_s);
11262  Voxm = (xgm*phit1);
11263  qeff1 = Voxm;
11264  Vdsat = Vdsat_lim;
11265  }
11266  else
11267  {
11268  delta_1s = 0.0;
11269  temp = (1.0/(2.0+(x_s*x_s)));
11270  xi0s = ((x_s*x_s)*temp);
11271  xi1s = (4.0*((x_s*temp)*temp));
11272  xi2s = ((((8.0*temp)-(12.0*xi0s))*temp)*temp);
11273  if ((x_s<2.3025850929940458e+02))
11274  {
11275  delta_1s = exp(x_s);
11276  Es = (1.0/delta_1s);
11277  delta_1s = (delta_ns*delta_1s);
11278  }
11279  else
11280  {
11281  if ((x_s>(xn_s-2.3025850929940458e+02)))
11282  {
11283  delta_1s = exp((x_s-xn_s));
11284  Es = (delta_ns/delta_1s);
11285  }
11286  else
11287  {
11288  delta_1s = (1.0e-100/(1.0+(((xn_s-x_s)-2.3025850929940458e+02)*(1.0+(0.5*(((xn_s-x_s)-2.3025850929940458e+02)*(1.0+(((xn_s-x_s)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
11289  Es = (1.0e-100/(1.0+((x_s-2.3025850929940458e+02)*(1.0+(0.5*((x_s-2.3025850929940458e+02)*(1.0+((x_s-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
11290  }
11291  }
11292  Ds = (delta_1s-(delta_ns*((x_s+1.0)+xi0s)));
11293  if ((x_s<1.0e-5))
11294  {
11295  Ps = (0.5*((x_s*x_s)*(1.0-(3.3333333333333333e-01*(x_s*(1.0-(0.25*x_s)))))));
11296  Ds = (1.6666666666666667e-01*((((delta_ns*x_s)*x_s)*x_s)*(1.0+(1.75*x_s))));
11297  temp = sqrt((1.0-(3.3333333333333333e-01*(x_s*(1.0-(0.25*x_s))))));
11298  sqm = (7.0710678118654746e-01*(x_s*temp));
11299  alpha = (1.0+(((Gf*7.0710678118654746e-01)*((1.0-(0.5*x_s))+(1.6666666666666667e-01*(x_s*x_s))))/temp));
11300  }
11301  else
11302  {
11303  Ps = ((x_s-1.0)+Es);
11304  sqm = sqrt(Ps);
11305  alpha = (1.0+(0.5*((Gf*(1.0-Es))/sqm)));
11306  }
11307  Em = Es;
11308  Ed = Em;
11309  Dm = Ds;
11310  Dd = Dm;
11311  Rxcor = ((1.0+((0.2*XCOR_i)*Vsbx))/(1.0+(XCOR_i*Vsbx)));
11312  if ((Ds>1.0e-100))
11313  {
11314  xgs = (Gf*sqrt((Ps+Ds)));
11315  qis = (((Gf2*Ds)*phit1)/(xgs+(Gf*sqm)));
11316  qbs = ((sqm*Gf)*phit1);
11317  if ((RSB_i<0))
11318  {
11319  rhob = (1.0/(1.0-(RSB_i*Vsbx)));
11320  }
11321  else
11322  {
11323  rhob = (1.0+(RSB_i*Vsbx));
11324  }
11325  if ((RSG_i<0))
11326  {
11327  temp = (1.0-(RSG_i*qis));
11328  }
11329  else
11330  {
11331  temp = (1.0/(1.0+(RSG_i*qis)));
11332  }
11333  GR = (THER_i*((rhob*temp)*qis));
11334  Eeffm = (E_eff0*(qbs+(eta_mu*qis)));
11335  if (((Eeffm*MUE_i)!=0))
11336  {
11337  Mutmp = (pow((Eeffm*MUE_i),THEMU_i)+(CS_i*(Ps/((Ps+Ds)+1.0e-14))));
11338  }
11339  else
11340  {
11341  Mutmp = (CS_i*(Ps/((Ps+Ds)+1.0e-14)));
11342  }
11343  Gmob = (((1.0+Mutmp)+GR)*Rxcor);
11344  if ((THESATB_i<0))
11345  {
11346  xitsb = (1.0/(1.0-(THESATB_i*Vsbx)));
11347  }
11348  else
11349  {
11350  xitsb = (1.0+(THESATB_i*Vsbx));
11351  }
11352  temp2 = (qis*xitsb);
11353  wsat = (100.0*(temp2/(100.0+temp2)));
11354  if ((THESATG_i<0))
11355  {
11356  temp = (1/(1-(THESATG_i*wsat)));
11357  }
11358  else
11359  {
11360  temp = (1+(THESATG_i*wsat));
11361  }
11362  thesat1 = (THESAT_i*(temp/Gmob));
11363  phi_inf = ((qis/alpha)+phit1);
11364  ysat = ((thesat1*phi_inf)*7.0710678118654746e-01);
11365  if (((model_.CHNL_TYPE)==(-1)))
11366  {
11367  ysat = (ysat/sqrt((1.0+ysat)));
11368  }
11369  za = (2.0/(1.0+sqrt((1.0+(4.0*ysat)))));
11370  temp1 = (za*ysat);
11371  Phi_0 = ((phi_inf*za)*(1.0+(0.86*((temp1*(1.0-(temp1*za)))/(1.0+(4.0*((temp1*temp1)*za)))))));
11372  asat = (xgs+(0.5*Gf2));
11373  Phi_2 = (0.98*(((Gf2*Ds)*phit1)/(asat+sqrt(((asat*asat)-((Gf2*Ds)*0.98))))));
11374  Phi_0_2 = (Phi_0+Phi_2);
11375  Phi0_Phi2 = (2.0*(Phi_0*Phi_2));
11376  Phi_sat = (Phi0_Phi2/(Phi_0_2+sqrt(((Phi_0_2*Phi_0_2)-(1.98*Phi0_Phi2)))));
11377  Vdsat = (Phi_sat-(phit1*log((1.0+(((Phi_sat*(Phi_sat-((2.0*asat)*phit1)))*inv_Gf2)/((phit1*phit1)*Ds))))));
11378  }
11379  else
11380  {
11381  Vdsat = Vdsat_lim;
11382  }
11383  if (((Vds/Vdsat)!=0))
11384  {
11385  temp = pow((Vds/Vdsat),AX_i);
11386  }
11387  else
11388  {
11389  temp = 0;
11390  }
11391  Vdse = (Vds*pow((1.0+temp),(-inv_AX)));
11392  Udse = (Vdse*inv_phit1);
11393  xn_d = (xn_s+Udse);
11394  if ((Udse<4.6051701859880916e+02))
11395  {
11396  k_ds = exp((-Udse));
11397  }
11398  else
11399  {
11400  k_ds = (1.0e-200/(1.0+((Udse-4.6051701859880916e+02)*(1.0+(0.5*((Udse-4.6051701859880916e+02)*(1.0+((Udse-4.6051701859880916e+02)*3.3333333333333333e-01))))))));
11401  }
11402  delta_nd = (delta_ns*k_ds);
11403  if ((fabs(xg)<=margin))
11404  {
11405  SP_S_temp1 = (((inv_xi*inv_xi)*1.6666666666666667e-01)*7.0710678118654746e-01);
11406  x_d = ((xg*inv_xi)*(1.0+(((xg*(1.0-delta_nd))*Gf)*SP_S_temp1)));
11407  }
11408  else
11409  {
11410  SP_S_bx = (xn_d+3);
11411  SP_S_eta = ((0.5*((SP_S_x1+SP_S_bx)-sqrt((((SP_S_x1-SP_S_bx)*(SP_S_x1-SP_S_bx))+5.0))))-(0.5*(SP_S_bx-sqrt(((SP_S_bx*SP_S_bx)+5.0)))));
11412  SP_S_temp = (xg-SP_S_eta);
11413  SP_S_temp1 = exp((-SP_S_eta));
11414  SP_S_temp2 = (1.0/(2.0+(SP_S_eta*SP_S_eta)));
11415  SP_S_xi0 = ((SP_S_eta*SP_S_eta)*SP_S_temp2);
11416  SP_S_xi1 = (4.0*((SP_S_eta*SP_S_temp2)*SP_S_temp2));
11417  SP_S_xi2 = ((((8.0*SP_S_temp2)-(12.0*SP_S_xi0))*SP_S_temp2)*SP_S_temp2);
11418  SP_S_a = max(1.0e-40,((SP_S_temp*SP_S_temp)-(Gf2*(((SP_S_temp1+SP_S_eta)-1.0)-(delta_nd*((SP_S_eta+1.0)+SP_S_xi0))))));
11419  SP_S_b = (1.0-(0.5*(Gf2*(SP_S_temp1-(delta_nd*SP_S_xi2)))));
11420  SP_S_c = ((2.0*SP_S_temp)+(Gf2*((1.0-SP_S_temp1)-(delta_nd*(1.0+SP_S_xi1)))));
11421  SP_S_tau = ((xn_d-SP_S_eta)+log((SP_S_a/Gf2)));
11422  nu = (SP_S_a+SP_S_c);
11423  mutau = ((nu*nu)+(SP_S_tau*((0.5*(SP_S_c*SP_S_c))-(SP_S_a*SP_S_b))));
11424  SP_S_x0 = (SP_S_eta+(((SP_S_a*nu)*SP_S_tau)/(mutau+(((((nu/mutau)*SP_S_tau)*SP_S_tau)*SP_S_c)*(((SP_S_c*SP_S_c)*3.3333333333333333e-01)-(SP_S_a*SP_S_b))))));
11425  if ((SP_S_x0<2.3025850929940458e+02))
11426  {
11427  SP_S_delta0 = exp(SP_S_x0);
11428  SP_S_delta1 = (1.0/SP_S_delta0);
11429  SP_S_delta0 = (delta_nd*SP_S_delta0);
11430  }
11431  else
11432  {
11433  if ((SP_S_x0>(xn_d-2.3025850929940458e+02)))
11434  {
11435  SP_S_delta0 = exp((SP_S_x0-xn_d));
11436  SP_S_delta1 = (delta_nd/SP_S_delta0);
11437  }
11438  else
11439  {
11440  SP_S_delta0 = (1.0e-100/(1.0+(((xn_d-SP_S_x0)-2.3025850929940458e+02)*(1.0+(0.5*(((xn_d-SP_S_x0)-2.3025850929940458e+02)*(1.0+(((xn_d-SP_S_x0)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
11441  SP_S_delta1 = (1.0e-100/(1.0+((SP_S_x0-2.3025850929940458e+02)*(1.0+(0.5*((SP_S_x0-2.3025850929940458e+02)*(1.0+((SP_S_x0-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
11442  }
11443  }
11444  SP_S_temp = (1.0/(2.0+(SP_S_x0*SP_S_x0)));
11445  SP_S_xi0 = ((SP_S_x0*SP_S_x0)*SP_S_temp);
11446  SP_S_xi1 = (4.0*((SP_S_x0*SP_S_temp)*SP_S_temp));
11447  SP_S_xi2 = ((((8.0*SP_S_temp)-(12.0*SP_S_xi0))*SP_S_temp)*SP_S_temp);
11448  SP_S_temp = (xg-SP_S_x0);
11449  SP_S_pC = ((2.0*SP_S_temp)+(Gf2*(((1.0-SP_S_delta1)+SP_S_delta0)-(delta_nd*(1.0+SP_S_xi1)))));
11450  SP_S_qC = ((SP_S_temp*SP_S_temp)-(Gf2*((((SP_S_delta1+SP_S_x0)-1.0)+SP_S_delta0)-(delta_nd*((SP_S_x0+1.0)+SP_S_xi0)))));
11451  SP_S_temp = (2.0-(Gf2*((SP_S_delta1+SP_S_delta0)-(delta_nd*SP_S_xi2))));
11452  SP_S_temp = ((SP_S_pC*SP_S_pC)-(2.0*(SP_S_qC*SP_S_temp)));
11453  x_d = (SP_S_x0+(2.0*(SP_S_qC/(SP_S_pC+sqrt(SP_S_temp)))));
11454  }
11455  x_ds = (x_d-x_s);
11456  if ((x_ds<1.0E-10))
11457  {
11458  pC = ((2.0*(xg-x_s))+(Gf2*(((1.0-Es)+(delta_1s*k_ds))-(delta_nd*(1.0+xi1s)))));
11459  qC = ((Gf2*(1.0-k_ds))*Ds);
11460  temp = (2.0-(Gf2*((Es+(delta_1s*k_ds))-(delta_nd*xi2s))));
11461  temp = ((pC*pC)-(2.0*(temp*qC)));
11462  x_ds = (2.0*(qC/(pC+sqrt(temp))));
11463  x_d = (x_s+x_ds);
11464  }
11465  dps = (x_ds*phit1);
11466  xi0d = ((x_d*x_d)/(2.0+(x_d*x_d)));
11467  if ((x_d<2.3025850929940458e+02))
11468  {
11469  Ed = exp((-x_d));
11470  if ((x_d<1.0e-5))
11471  {
11472  Dd = (((((1.6666666666666667e-01*delta_nd)*x_d)*x_d)*x_d)*(1.0+(1.75*x_d)));
11473  }
11474  else
11475  {
11476  Dd = (delta_nd*((((1.0/Ed)-x_d)-1.0)-xi0d));
11477  }
11478  }
11479  else
11480  {
11481  if ((x_d>(xn_d-2.3025850929940458e+02)))
11482  {
11483  temp = exp((x_d-xn_d));
11484  Ed = (delta_nd/temp);
11485  Dd = (temp-(delta_nd*((x_d+1.0)+xi0d)));
11486  }
11487  else
11488  {
11489  Ed = (1.0e-100/(1.0+((x_d-2.3025850929940458e+02)*(1.0+(0.5*((x_d-2.3025850929940458e+02)*(1.0+((x_d-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
11490  temp = (1.0e-100/(1.0+(((xn_d-x_d)-2.3025850929940458e+02)*(1.0+(0.5*(((xn_d-x_d)-2.3025850929940458e+02)*(1.0+(((xn_d-x_d)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
11491  Dd = (temp-(delta_nd*((x_d+1.0)+xi0d)));
11492  }
11493  }
11494  x_m = (0.5*(x_s+x_d));
11495  Em = 0.0;
11496  temp = (Ed*Es);
11497  if ((temp>0.0))
11498  {
11499  Em = sqrt(temp);
11500  }
11501  D_bar = (0.5*(Ds+Dd));
11502  Dm = (D_bar+(0.125*((x_ds*x_ds)*(Em-(2.0*inv_Gf2)))));
11503  if ((x_m<1.0e-5))
11504  {
11505  Pm = (0.5*((x_m*x_m)*(1.0-(3.3333333333333333e-01*(x_m*(1.0-(0.25*x_m)))))));
11506  xgm = (Gf*sqrt((Dm+Pm)));
11507  if ((kp>0.0))
11508  {
11509  eta_p = (1.0/sqrt((1.0+(kp*xgm))));
11510  }
11511  temp = sqrt((1.0-(3.3333333333333333e-01*(x_m*(1.0-(0.25*x_m))))));
11512  sqm = (7.0710678118654746e-01*(x_m*temp));
11513  alpha = (eta_p+(7.0710678118654746e-01*((Gf*((1.0-(0.5*x_m))+(1.6666666666666667e-01*(x_m*x_m))))/temp)));
11514  }
11515  else
11516  {
11517  Pm = ((x_m-1.0)+Em);
11518  xgm = (Gf*sqrt((Dm+Pm)));
11519  if ((kp>0.0))
11520  {
11521  d0 = ((1.0-Em)+(2.0*(xgm*inv_Gf2)));
11522  eta_p = (1.0/sqrt((1.0+(kp*xgm))));
11523  temp = (eta_p/(eta_p+1.0));
11524  x_pm = (kp*(((temp*temp)*Gf2)*Dm));
11525  p_pd = ((2.0*(xgm-x_pm))+(Gf2*((1.0-Em)+Dm)));
11526  q_pd = (x_pm*(x_pm-(2.0*xgm)));
11527  xi_pd = (1.0-(0.5*(Gf2*(Em+Dm))));
11528  u_pd = ((q_pd*p_pd)/((p_pd*p_pd)-(xi_pd*q_pd)));
11529  x_m = (x_m+u_pd);
11530  km = exp(u_pd);
11531  Em = (Em/km);
11532  Dm = (Dm*km);
11533  Pm = ((x_m-1.0)+Em);
11534  xgm = (Gf*sqrt((Dm+Pm)));
11535  help = ((1.0-Em)+(2.0*((xgm*eta_p)*inv_Gf2)));
11536  x_ds = (((x_ds*km)*(d0+D_bar))/(help+(km*D_bar)));
11537  dps = (x_ds*phit1);
11538  }
11539  sqm = sqrt(Pm);
11540  alpha = (eta_p+(0.5*((Gf*(1.0-Em))/sqm)));
11541  }
11542  qim = (phit1*((Gf2*Dm)/(xgm+(Gf*sqm))));
11543  qim1 = (qim+(phit1*alpha));
11544  qbm = ((sqm*Gf)*phit1);
11545  if ((RSG_i<0))
11546  {
11547  temp = (1.0-(RSG_i*qim));
11548  }
11549  else
11550  {
11551  temp = (1.0/(1.0+(RSG_i*qim)));
11552  }
11553  GR = (THER_i*((rhob*temp)*qim));
11554  qeff = (qbm+(eta_mu*qim));
11555  qeff1 = (qbm+(eta_mu1*qim));
11556  Eeffm = (E_eff0*qeff);
11557  if (((Eeffm*MUE_i)!=0))
11558  {
11559  Mutmp = (pow((Eeffm*MUE_i),THEMU_i)+(CS_i*(Pm/((Pm+Dm)+1.0e-14))));
11560  }
11561  else
11562  {
11563  Mutmp = (CS_i*(Pm/((Pm+Dm)+1.0e-14)));
11564  }
11565  Gmob = (((1.0+Mutmp)+GR)*Rxcor);
11566  s1 = log(((1.0+((Vds-dps)*inv_VP))/(1.0+((Vdse-dps)*inv_VP))));
11567  dL = (ALP_i*s1);
11568  GdL = (1.0/((1.0+dL)+(dL*dL)));
11569  temp2 = (qim*xitsb);
11570  wsat = (100.0*(temp2/(100.0+temp2)));
11571  Gmob_dL = (Gmob*GdL);
11572  if ((THESATG_i<0))
11573  {
11574  temp = (1/(1-(THESATG_i*wsat)));
11575  }
11576  else
11577  {
11578  temp = (1+(THESATG_i*wsat));
11579  }
11580  thesat1 = (THESAT_i*(temp/Gmob_dL));
11581  zsat = (((thesat1*thesat1)*dps)*dps);
11582  if (((model_.CHNL_TYPE)==(-1)))
11583  {
11584  zsat = (zsat/(1.0+(thesat1*dps)));
11585  }
11586  Gvsat = (0.5*(Gmob_dL*(1.0+sqrt((1.0+(2.0*zsat))))));
11587  Gvsatinv = (1.0/Gvsat);
11588  Voxm = (xgm*phit1);
11589  temp = (Gmob_dL*Gvsatinv);
11590  alpha1 = (alpha*(1.0+(0.5*((zsat*temp)*temp))));
11591  H = ((temp*qim1)/alpha1);
11592  }
11593  if ((xg>0.0))
11594  {
11595  qim1_1 = (1.0/qim1);
11596  r1 = (qim*qim1_1);
11597  r2 = (phit1*(alpha*qim1_1));
11598  s2 = log((1.0+(Vdsx*inv_VP)));
11599  dL1 = ((dL+(ALP1_i*((qim1_1*r1)*s1)))+(ALP2_i*(((qbm*r2)*r2)*s2)));
11600  FdL = (((1.0+dL1)+(dL1*dL1))*GdL);
11601  }
11602  xg_dc = xg;
11603  qeff1_dc = qeff1;
11604  Voxm_dc = Voxm;
11605  alpha_dc = alpha;
11606  dps_dc = dps;
11607  qim_dc = qim;
11608  qim1_dc = qim1;
11609  GdL_dc = GdL;
11610  FdL_dc = FdL;
11611  H_dc = H;
11612  eta_p_dc = eta_p;
11613  Gvsat_dc = Gvsat;
11614  Gvsatinv_dc = Gvsatinv;
11615  Gmob_dL_dc = Gmob_dL;
11616  x_ds_dc = x_ds;
11617  x_m_dc = x_m;
11618  Gf_dc = Gf;
11619  Vdsat_dc = Vdsat;
11620  Udse_dc = Udse;
11621  }
11622  // End block SPcalc_dc
11623  if ((xg_dc<=0))
11624  {
11625  Ids = 0.0;
11626  }
11627  else
11628  {
11629  Ids = (BET_i*(((FdL_dc*qim1_dc)*dps_dc)*Gvsatinv_dc));
11630  if (((model_.SWIMPACT_i)!=0))
11631  {
11632  delVsat = (Vds-(A3_i*dps_dc));
11633  if ((delVsat>0))
11634  {
11635  temp2 = (A2_i*((1.0+(A4_i*(sqrt((phib_dc+Vsbnud))-sqrt_phib_dc)))/(delVsat+1e-30)));
11636  if (((-temp2)>(-2.3025850929940458e+02)))
11637  {
11638  temp = exp((-temp2));
11639  }
11640  else
11641  {
11642  temp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-(-temp2))*(1.0+(0.5*(((-2.3025850929940458e+02)-(-temp2))*(1.0+(((-2.3025850929940458e+02)-(-temp2))*3.3333333333333333e-01))))))));
11643  }
11644  mavl = (A1_i*(delVsat*temp));
11645  Iimpact = (Ids*mavl);
11646  }
11647  }
11648  }
11649  if (((((((model_.SWIGATE_i)!=0)&&((IGOV_i>0)||(IGOVD_i>0)))||(((model_.SWGIDL_i)!=0)&&((AGIDL_i>0)||(AGIDLD_i>0))))||(CGOV_i>0))||(CGOVD_i>0)))
11650  {
11651  GOV = GOV_s;
11652  GOV2 = GOV2_s;
11653  xi_ov = xi_ov_s;
11654  inv_xi_ov = inv_xi_ov_s;
11655  x_mrg_ov = x_mrg_ov_s;
11656  inv_xg1 = inv_xg1_s;
11657  if ((fabs(xgs_ov)<=x_mrg_ov))
11658  {
11659  xs_ov = ((-xgs_ov)*inv_xi_ov);
11660  }
11661  else
11662  {
11663  if ((xgs_ov<(-x_mrg_ov)))
11664  {
11665  SP_OV_yg = (-xgs_ov);
11666  SP_OV_z = ((x1*SP_OV_yg)*inv_xi_ov);
11667  SP_OV_eta = (0.5*((SP_OV_z+10.0)-sqrt((((SP_OV_z-6.0)*(SP_OV_z-6.0))+64.0))));
11668  SP_OV_a = (((SP_OV_yg-SP_OV_eta)*(SP_OV_yg-SP_OV_eta))+(GOV2*(SP_OV_eta+1.0)));
11669  SP_OV_c = ((2.0*(SP_OV_yg-SP_OV_eta))-GOV2);
11670  SP_OV_tau = (log((SP_OV_a/GOV2))-SP_OV_eta);
11671  nu = (SP_OV_a+SP_OV_c);
11672  mutau = ((nu*nu)+(SP_OV_tau*((0.5*(SP_OV_c*SP_OV_c))-SP_OV_a)));
11673  SP_OV_y0 = (SP_OV_eta+(((SP_OV_a*nu)*SP_OV_tau)/(mutau+(((((nu/mutau)*SP_OV_tau)*SP_OV_tau)*SP_OV_c)*(((SP_OV_c*SP_OV_c)*3.3333333333333333e-01)-SP_OV_a)))));
11674  SP_OV_D0 = exp(SP_OV_y0);
11675  SP_OV_temp = (SP_OV_yg-SP_OV_y0);
11676  SP_OV_p = ((2.0*SP_OV_temp)+(GOV2*(SP_OV_D0-1.0)));
11677  SP_OV_q = ((SP_OV_temp*SP_OV_temp)+(GOV2*((SP_OV_y0+1.0)-SP_OV_D0)));
11678  SP_OV_xi = (1.0-((GOV2*0.5)*SP_OV_D0));
11679  SP_OV_temp = ((SP_OV_p*SP_OV_p)-(4.0*(SP_OV_xi*SP_OV_q)));
11680  SP_OV_w = (2.0*(SP_OV_q/(SP_OV_p+sqrt(SP_OV_temp))));
11681  xs_ov = (-(SP_OV_y0+SP_OV_w));
11682  }
11683  else
11684  {
11685  SP_OV_Afac = ((((xi_ov*x1)*inv_xg1)-1.0)*inv_xg1);
11686  SP_OV_xbar = ((xgs_ov*inv_xi_ov)*(1.0+(SP_OV_Afac*xgs_ov)));
11687  if (((-SP_OV_xbar)>(-2.3025850929940458e+02)))
11688  {
11689  SP_OV_temp = exp((-SP_OV_xbar));
11690  }
11691  else
11692  {
11693  SP_OV_temp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-(-SP_OV_xbar))*(1.0+(0.5*(((-2.3025850929940458e+02)-(-SP_OV_xbar))*(1.0+(((-2.3025850929940458e+02)-(-SP_OV_xbar))*3.3333333333333333e-01))))))));
11694  }
11695  SP_OV_w = (1.0-SP_OV_temp);
11696  SP_OV_x0 = ((xgs_ov+(GOV2*0.5))-(GOV*sqrt(((xgs_ov+(GOV2*0.25))-SP_OV_w))));
11697  if (((-SP_OV_x0)>(-2.3025850929940458e+02)))
11698  {
11699  SP_OV_D0 = exp((-SP_OV_x0));
11700  }
11701  else
11702  {
11703  SP_OV_D0 = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-(-SP_OV_x0))*(1.0+(0.5*(((-2.3025850929940458e+02)-(-SP_OV_x0))*(1.0+(((-2.3025850929940458e+02)-(-SP_OV_x0))*3.3333333333333333e-01))))))));
11704  }
11705  SP_OV_p = ((2.0*(xgs_ov-SP_OV_x0))+(GOV2*(1-SP_OV_D0)));
11706  SP_OV_q = (((xgs_ov-SP_OV_x0)*(xgs_ov-SP_OV_x0))-(GOV2*((SP_OV_x0-1.0)+SP_OV_D0)));
11707  SP_OV_xi = (1.0-((GOV2*0.5)*SP_OV_D0));
11708  SP_OV_temp = ((SP_OV_p*SP_OV_p)-(4.0*(SP_OV_xi*SP_OV_q)));
11709  SP_OV_u = (2.0*(SP_OV_q/(SP_OV_p+sqrt(SP_OV_temp))));
11710  xs_ov = (SP_OV_x0+SP_OV_u);
11711  }
11712  xs_ov = (-xs_ov);
11713  }
11714  GOV = GOV_d;
11715  GOV2 = GOV2_d;
11716  xi_ov = xi_ov_d;
11717  inv_xi_ov = inv_xi_ov_d;
11718  x_mrg_ov = x_mrg_ov_d;
11719  inv_xg1 = inv_xg1_d;
11720  if ((fabs(xgd_ov)<=x_mrg_ov))
11721  {
11722  xd_ov = ((-xgd_ov)*inv_xi_ov);
11723  }
11724  else
11725  {
11726  if ((xgd_ov<(-x_mrg_ov)))
11727  {
11728  SP_OV_yg = (-xgd_ov);
11729  SP_OV_z = ((x1*SP_OV_yg)*inv_xi_ov);
11730  SP_OV_eta = (0.5*((SP_OV_z+10.0)-sqrt((((SP_OV_z-6.0)*(SP_OV_z-6.0))+64.0))));
11731  SP_OV_a = (((SP_OV_yg-SP_OV_eta)*(SP_OV_yg-SP_OV_eta))+(GOV2*(SP_OV_eta+1.0)));
11732  SP_OV_c = ((2.0*(SP_OV_yg-SP_OV_eta))-GOV2);
11733  SP_OV_tau = (log((SP_OV_a/GOV2))-SP_OV_eta);
11734  nu = (SP_OV_a+SP_OV_c);
11735  mutau = ((nu*nu)+(SP_OV_tau*((0.5*(SP_OV_c*SP_OV_c))-SP_OV_a)));
11736  SP_OV_y0 = (SP_OV_eta+(((SP_OV_a*nu)*SP_OV_tau)/(mutau+(((((nu/mutau)*SP_OV_tau)*SP_OV_tau)*SP_OV_c)*(((SP_OV_c*SP_OV_c)*3.3333333333333333e-01)-SP_OV_a)))));
11737  SP_OV_D0 = exp(SP_OV_y0);
11738  SP_OV_temp = (SP_OV_yg-SP_OV_y0);
11739  SP_OV_p = ((2.0*SP_OV_temp)+(GOV2*(SP_OV_D0-1.0)));
11740  SP_OV_q = ((SP_OV_temp*SP_OV_temp)+(GOV2*((SP_OV_y0+1.0)-SP_OV_D0)));
11741  SP_OV_xi = (1.0-((GOV2*0.5)*SP_OV_D0));
11742  SP_OV_temp = ((SP_OV_p*SP_OV_p)-(4.0*(SP_OV_xi*SP_OV_q)));
11743  SP_OV_w = (2.0*(SP_OV_q/(SP_OV_p+sqrt(SP_OV_temp))));
11744  xd_ov = (-(SP_OV_y0+SP_OV_w));
11745  }
11746  else
11747  {
11748  SP_OV_Afac = ((((xi_ov*x1)*inv_xg1)-1.0)*inv_xg1);
11749  SP_OV_xbar = ((xgd_ov*inv_xi_ov)*(1.0+(SP_OV_Afac*xgd_ov)));
11750  if (((-SP_OV_xbar)>(-2.3025850929940458e+02)))
11751  {
11752  SP_OV_temp = exp((-SP_OV_xbar));
11753  }
11754  else
11755  {
11756  SP_OV_temp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-(-SP_OV_xbar))*(1.0+(0.5*(((-2.3025850929940458e+02)-(-SP_OV_xbar))*(1.0+(((-2.3025850929940458e+02)-(-SP_OV_xbar))*3.3333333333333333e-01))))))));
11757  }
11758  SP_OV_w = (1.0-SP_OV_temp);
11759  SP_OV_x0 = ((xgd_ov+(GOV2*0.5))-(GOV*sqrt(((xgd_ov+(GOV2*0.25))-SP_OV_w))));
11760  if (((-SP_OV_x0)>(-2.3025850929940458e+02)))
11761  {
11762  SP_OV_D0 = exp((-SP_OV_x0));
11763  }
11764  else
11765  {
11766  SP_OV_D0 = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-(-SP_OV_x0))*(1.0+(0.5*(((-2.3025850929940458e+02)-(-SP_OV_x0))*(1.0+(((-2.3025850929940458e+02)-(-SP_OV_x0))*3.3333333333333333e-01))))))));
11767  }
11768  SP_OV_p = ((2.0*(xgd_ov-SP_OV_x0))+(GOV2*(1-SP_OV_D0)));
11769  SP_OV_q = (((xgd_ov-SP_OV_x0)*(xgd_ov-SP_OV_x0))-(GOV2*((SP_OV_x0-1.0)+SP_OV_D0)));
11770  SP_OV_xi = (1.0-((GOV2*0.5)*SP_OV_D0));
11771  SP_OV_temp = ((SP_OV_p*SP_OV_p)-(4.0*(SP_OV_xi*SP_OV_q)));
11772  SP_OV_u = (2.0*(SP_OV_q/(SP_OV_p+sqrt(SP_OV_temp))));
11773  xd_ov = (SP_OV_x0+SP_OV_u);
11774  }
11775  xd_ov = (-xd_ov);
11776  }
11777  Vovs = ((-(model_.phit))*(xgs_ov+xs_ov));
11778  Vovd = ((-(model_.phit))*(xgd_ov+xd_ov));
11779  }
11780  Igsov = 0.0;
11781  Igdov = 0.0;
11782  Igc = 0.0;
11783  Igb = 0.0;
11784  Igcs = 0.0;
11785  Igcd = 0.0;
11786  if (((model_.SWIGATE_i)!=0))
11787  {
11788  if ((IGOV_i>0))
11789  {
11790  arg2mina = (Vovs+Dov);
11791  psi_t = (0.5*((+arg2mina)-sqrt((((-arg2mina)*(-arg2mina))+0.01))));
11792  zg = (sqrt(((Vovs*Vovs)+1.0e-6))*inv_CHIB);
11793  if ((GC3_i<0))
11794  {
11795  zg = (0.5*((zg+GCQ)-sqrt((((zg-GCQ)*(zg-GCQ))+1.0e-6))));
11796  }
11797  arg1 = ((3.0+xs_ov)+(psi_t*(model_.inv_phit)));
11798  if ((fabs(arg1)<2.3025850929940458e+02))
11799  {
11800  Dsi = exp(arg1);
11801  }
11802  else
11803  {
11804  if ((arg1<(-2.3025850929940458e+02)))
11805  {
11806  Dsi = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-arg1)*(1.0+(0.5*(((-2.3025850929940458e+02)-arg1)*(1.0+(((-2.3025850929940458e+02)-arg1)*3.3333333333333333e-01))))))));
11807  }
11808  else
11809  {
11810  Dsi = (1.0e100*(1.0+((arg1-2.3025850929940458e+02)*(1.0+(0.5*((arg1-2.3025850929940458e+02)*(1.0+((arg1-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
11811  }
11812  }
11813  arg1 = ((-VgsPrime)*(model_.inv_phit));
11814  if ((fabs(arg1)<2.3025850929940458e+02))
11815  {
11816  temp = exp(arg1);
11817  }
11818  else
11819  {
11820  if ((arg1<(-2.3025850929940458e+02)))
11821  {
11822  temp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-arg1)*(1.0+(0.5*(((-2.3025850929940458e+02)-arg1)*(1.0+(((-2.3025850929940458e+02)-arg1)*3.3333333333333333e-01))))))));
11823  }
11824  else
11825  {
11826  temp = (1.0e100*(1.0+((arg1-2.3025850929940458e+02)*(1.0+(0.5*((arg1-2.3025850929940458e+02)*(1.0+((arg1-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
11827  }
11828  }
11829  Dgate = (Dsi*temp);
11830  temp = (BOV*((-1.5)+(zg*(GC2_i+(GC3_i*zg)))));
11831  if ((temp>0))
11832  {
11833  TP = (1.0+(temp*(1.0+(0.5*(temp*(1.0+(temp*3.3333333333333333e-01)))))));
11834  }
11835  else
11836  {
11837  if ((temp>(-2.3025850929940458e+02)))
11838  {
11839  TP = exp(temp);
11840  }
11841  else
11842  {
11843  TP = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-temp)*(1.0+(0.5*(((-2.3025850929940458e+02)-temp)*(1.0+(((-2.3025850929940458e+02)-temp)*3.3333333333333333e-01))))))));
11844  }
11845  }
11846  Igsov = (IGOV_i*(TP*log(((1.0+Dsi)/(1.0+Dgate)))));
11847  }
11848  if ((IGOVD_i>0))
11849  {
11850  arg2mina = (Vovd+Dov);
11851  psi_t = (0.5*((+arg2mina)-sqrt((((-arg2mina)*(-arg2mina))+0.01))));
11852  zg = (sqrt(((Vovd*Vovd)+1.0e-6))*inv_CHIB);
11853  if ((GC3_i<0))
11854  {
11855  zg = (0.5*((zg+GCQ)-sqrt((((zg-GCQ)*(zg-GCQ))+1.0e-6))));
11856  }
11857  arg1 = ((3.0+xd_ov)+(psi_t*(model_.inv_phit)));
11858  if ((fabs(arg1)<2.3025850929940458e+02))
11859  {
11860  Dsi = exp(arg1);
11861  }
11862  else
11863  {
11864  if ((arg1<(-2.3025850929940458e+02)))
11865  {
11866  Dsi = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-arg1)*(1.0+(0.5*(((-2.3025850929940458e+02)-arg1)*(1.0+(((-2.3025850929940458e+02)-arg1)*3.3333333333333333e-01))))))));
11867  }
11868  else
11869  {
11870  Dsi = (1.0e100*(1.0+((arg1-2.3025850929940458e+02)*(1.0+(0.5*((arg1-2.3025850929940458e+02)*(1.0+((arg1-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
11871  }
11872  }
11873  arg1 = ((-VgdPrime)*(model_.inv_phit));
11874  if ((fabs(arg1)<2.3025850929940458e+02))
11875  {
11876  temp = exp(arg1);
11877  }
11878  else
11879  {
11880  if ((arg1<(-2.3025850929940458e+02)))
11881  {
11882  temp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-arg1)*(1.0+(0.5*(((-2.3025850929940458e+02)-arg1)*(1.0+(((-2.3025850929940458e+02)-arg1)*3.3333333333333333e-01))))))));
11883  }
11884  else
11885  {
11886  temp = (1.0e100*(1.0+((arg1-2.3025850929940458e+02)*(1.0+(0.5*((arg1-2.3025850929940458e+02)*(1.0+((arg1-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
11887  }
11888  }
11889  Dgate = (Dsi*temp);
11890  temp = (BOV_d*((-1.5)+(zg*(GC2_i+(GC3_i*zg)))));
11891  if ((temp>0))
11892  {
11893  TP = (1.0+(temp*(1.0+(0.5*(temp*(1.0+(temp*3.3333333333333333e-01)))))));
11894  }
11895  else
11896  {
11897  if ((temp>(-2.3025850929940458e+02)))
11898  {
11899  TP = exp(temp);
11900  }
11901  else
11902  {
11903  TP = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-temp)*(1.0+(0.5*(((-2.3025850929940458e+02)-temp)*(1.0+(((-2.3025850929940458e+02)-temp)*3.3333333333333333e-01))))))));
11904  }
11905  }
11906  Igdov = (IGOVD_i*(TP*log(((1.0+Dsi)/(1.0+Dgate)))));
11907  }
11908  if ((IGINV_i>0))
11909  {
11910  if ((xg_dc<=0.0))
11911  {
11912  temp = pow((Vds/Vdsat_lim),AX_i);
11913  Udse_dc = ((Vds*pow((1.0+temp),(-inv_AX)))*inv_phit1);
11914  }
11915  if (((x_ds_dc-Udse_dc)>(-2.3025850929940458e+02)))
11916  {
11917  temp = exp((x_ds_dc-Udse_dc));
11918  }
11919  else
11920  {
11921  temp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-(x_ds_dc-Udse_dc))*(1.0+(0.5*(((-2.3025850929940458e+02)-(x_ds_dc-Udse_dc))*(1.0+(((-2.3025850929940458e+02)-(x_ds_dc-Udse_dc))*3.3333333333333333e-01))))))));
11922  }
11923  Vm = (Vsbnud+(phit1*((0.5*x_ds_dc)-log((0.5*(1.0+temp))))));
11924  arg2mina = (Voxm_dc+Dch);
11925  psi_t = (0.5*((+arg2mina)-sqrt((((-arg2mina)*(-arg2mina))+0.01))));
11926  zg = (sqrt(((Voxm_dc*Voxm_dc)+1.0e-6))*inv_CHIB);
11927  if ((GC3_i<0))
11928  {
11929  zg = (0.5*((zg+GCQ)-sqrt((((zg-GCQ)*(zg-GCQ))+1.0e-06))));
11930  }
11931  arg1 = (x_m_dc+(((psi_t-alpha_b)-Vm)*inv_phit1));
11932  if ((fabs(arg1)<2.3025850929940458e+02))
11933  {
11934  Dsi = exp(arg1);
11935  }
11936  else
11937  {
11938  if ((arg1<(-2.3025850929940458e+02)))
11939  {
11940  Dsi = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-arg1)*(1.0+(0.5*(((-2.3025850929940458e+02)-arg1)*(1.0+(((-2.3025850929940458e+02)-arg1)*3.3333333333333333e-01))))))));
11941  }
11942  else
11943  {
11944  Dsi = (1.0e100*(1.0+((arg1-2.3025850929940458e+02)*(1.0+(0.5*((arg1-2.3025850929940458e+02)*(1.0+((arg1-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
11945  }
11946  }
11947  arg1 = ((-((Vgs+Vsbnud)-Vm))*inv_phit1);
11948  if ((fabs(arg1)<2.3025850929940458e+02))
11949  {
11950  temp = exp(arg1);
11951  }
11952  else
11953  {
11954  if ((arg1<(-2.3025850929940458e+02)))
11955  {
11956  temp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-arg1)*(1.0+(0.5*(((-2.3025850929940458e+02)-arg1)*(1.0+(((-2.3025850929940458e+02)-arg1)*3.3333333333333333e-01))))))));
11957  }
11958  else
11959  {
11960  temp = (1.0e100*(1.0+((arg1-2.3025850929940458e+02)*(1.0+(0.5*((arg1-2.3025850929940458e+02)*(1.0+((arg1-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
11961  }
11962  }
11963  Dgate = (Dsi*temp);
11964  temp = (BCH*((-1.5)+(zg*(GC2_i+(GC3_i*zg)))));
11965  if ((temp>0))
11966  {
11967  TP = (1.0+(temp*(1.0+(0.5*(temp*(1.0+(temp*3.3333333333333333e-01)))))));
11968  }
11969  else
11970  {
11971  if ((temp>(-2.3025850929940458e+02)))
11972  {
11973  TP = exp(temp);
11974  }
11975  else
11976  {
11977  TP = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-temp)*(1.0+(0.5*(((-2.3025850929940458e+02)-temp)*(1.0+(((-2.3025850929940458e+02)-temp)*3.3333333333333333e-01))))))));
11978  }
11979  }
11980  Igc0 = (IGINV_i*(TP*log(((1.0+Dsi)/(1.0+Dgate)))));
11981  if (((xg_dc<=0)||((GC2_i==0)&&(GC3_i==0))))
11982  {
11983  igc = 1.0;
11984  igcd_h = 0.5;
11985  }
11986  else
11987  {
11988  temp = (GC2_i+((2.0*GC3_i)*zg));
11989  u0 = (CHIB_i/(temp*BCH));
11990  x = (0.5*(dps_dc/u0));
11991  u0_div_H = (u0/H_dc);
11992  Bg = ((u0_div_H*(1.0-u0_div_H))*0.5);
11993  Ag = (0.5-(3.0*Bg));
11994  if ((x<1.0e-3))
11995  {
11996  xsq = (x*x);
11997  igc = (1.0+(xsq*((1.6666666666666667e-01+(u0_div_H*3.3333333333333333e-01))+(1.6666666666666667e-01*(xsq*(0.05+(0.2*u0_div_H)))))));
11998  igcd_h = ((0.5*igc)-(1.6666666666666667e-01*(x*(1.0+(xsq*((0.4*(Bg+0.25))+(0.0285714285714*(xsq*(0.125+Bg)))))))));
11999  }
12000  else
12001  {
12002  inv_x = (1.0/x);
12003  if ((fabs(x)<2.3025850929940458e+02))
12004  {
12005  ex = exp(x);
12006  }
12007  else
12008  {
12009  if ((x<(-2.3025850929940458e+02)))
12010  {
12011  ex = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-x)*(1.0+(0.5*(((-2.3025850929940458e+02)-x)*(1.0+(((-2.3025850929940458e+02)-x)*3.3333333333333333e-01))))))));
12012  }
12013  else
12014  {
12015  ex = (1.0e100*(1.0+((x-2.3025850929940458e+02)*(1.0+(0.5*((x-2.3025850929940458e+02)*(1.0+((x-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
12016  }
12017  }
12018  inv_ex = (1.0/ex);
12019  temp = (ex-inv_ex);
12020  temp2 = (ex+inv_ex);
12021  igc = (0.5*((((1.0-u0_div_H)*temp)*inv_x)+(u0_div_H*temp2)));
12022  igcd_h = (0.5*((igc-(temp*(Bg-((Ag*inv_x)*inv_x))))-((Ag*temp2)*inv_x)));
12023  }
12024  }
12025  Sg = (0.5*(1.0+(xg_dc/sqrt(((xg_dc*xg_dc)+1.0e-6)))));
12026  Igc = ((Igc0*igc)*Sg);
12027  Igcd = ((Igc0*igcd_h)*Sg);
12028  Igcs = (Igc-Igcd);
12029  Igb = ((Igc0*igc)*(1.0-Sg));
12030  }
12031  }
12032  Igidl = 0.0;
12033  Igisl = 0.0;
12034  if (((model_.SWGIDL_i)!=0))
12035  {
12036  if (((AGIDLD_i>0)&&(Vovd<0)))
12037  {
12038  Vtovd = sqrt((((Vovd*Vovd)+((CGIDLD_i*CGIDLD_i)*(VdbPrime*VdbPrime)))+1.0e-6));
12039  temp = ((-BGIDLD_i)/Vtovd);
12040  if ((temp>(-2.3025850929940458e+02)))
12041  {
12042  temp2 = exp(temp);
12043  }
12044  else
12045  {
12046  temp2 = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-temp)*(1.0+(0.5*(((-2.3025850929940458e+02)-temp)*(1.0+(((-2.3025850929940458e+02)-temp)*3.3333333333333333e-01))))))));
12047  }
12048  Igidl = ((-AGIDLD_i)*(((VdbPrime*Vovd)*Vtovd)*temp2));
12049  }
12050  if (((AGIDL_i>0)&&(Vovs<0)))
12051  {
12052  Vtovs = sqrt((((Vovs*Vovs)+((CGIDL_i*CGIDL_i)*(VsbPrime*VsbPrime)))+1.0e-6));
12053  temp = ((-BGIDL_i)/Vtovs);
12054  if ((temp>(-2.3025850929940458e+02)))
12055  {
12056  temp2 = exp(temp);
12057  }
12058  else
12059  {
12060  temp2 = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-temp)*(1.0+(0.5*(((-2.3025850929940458e+02)-temp)*(1.0+(((-2.3025850929940458e+02)-temp)*3.3333333333333333e-01))))))));
12061  }
12062  Igisl = ((-AGIDL_i)*(((VsbPrime*Vovs)*Vtovs)*temp2));
12063  }
12064  }
12065  }
12066  // End block evaluateStatic
12067  //Begin block evaluateDynamic
12068  {
12069  //Begin block SPcalc_ac
12070  {
12071  //Block-local variables for block SPcalc_ac
12072  double phib;
12073  double G_0;
12074  double sqrt_phib;
12075  AdmsFadType Vsbstar;
12076  AdmsFadType Vsbx;
12077  //End of Block-local variables
12078  //Block-local variables for block SPcalc_ac
12079  AdmsFadType xg;
12080  AdmsFadType qeff;
12081  AdmsFadType qeff1;
12082  AdmsFadType Voxm;
12083  AdmsFadType alpha;
12084  AdmsFadType dps;
12085  AdmsFadType qim;
12086  AdmsFadType qim1;
12087  AdmsFadType GdL;
12088  AdmsFadType H;
12089  AdmsFadType eta_p;
12090  AdmsFadType s1;
12091  //End of Block-local variables
12092  //Block-local variables for block SPcalc_ac
12093  AdmsFadType Gvsat;
12094  AdmsFadType Gvsatinv;
12095  AdmsFadType Gmob_dL;
12096  AdmsFadType x_ds;
12097  AdmsFadType x_m;
12098  //End of Block-local variables
12099  //Block-local variables for block SPcalc_ac
12100  AdmsFadType Dnsub;
12101  //End of Block-local variables
12102  //Block-local variables for block SPcalc_ac
12103  AdmsFadType x_s;
12104  AdmsFadType sqm;
12105  AdmsFadType alpha1;
12106  AdmsFadType phi_inf;
12107  AdmsFadType za;
12108  AdmsFadType xitsb;
12109  AdmsFadType rhob;
12110  //End of Block-local variables
12111  //Block-local variables for block SPcalc_ac
12112  AdmsFadType thesat1;
12113  AdmsFadType wsat;
12114  AdmsFadType ysat;
12115  AdmsFadType zsat;
12116  AdmsFadType dL;
12117  AdmsFadType GR;
12118  AdmsFadType Gmob;
12119  //End of Block-local variables
12120  //Block-local variables for block SPcalc_ac
12121  AdmsFadType xgm;
12122  AdmsFadType Ux;
12123  //End of Block-local variables
12124  //Block-local variables for block SPcalc_ac
12125  AdmsFadType xn_s;
12126  AdmsFadType delta_ns;
12127  //End of Block-local variables
12128  //Block-local variables for block SPcalc_ac
12129  AdmsFadType Gf;
12130  AdmsFadType Gf2;
12131  AdmsFadType inv_Gf2;
12132  AdmsFadType xi;
12133  AdmsFadType inv_xi;
12134  AdmsFadType margin;
12135  //End of Block-local variables
12136  //Block-local variables for block SPcalc_ac
12137  AdmsFadType SP_xg1;
12138  AdmsFadType SP_S_temp;
12139  AdmsFadType SP_S_temp1;
12140  AdmsFadType SP_S_temp2;
12141  //End of Block-local variables
12142  //Block-local variables for block SPcalc_ac
12143  AdmsFadType SP_S_yg;
12144  AdmsFadType SP_S_ysub;
12145  AdmsFadType SP_S_y0;
12146  AdmsFadType SP_S_a;
12147  AdmsFadType SP_S_b;
12148  AdmsFadType SP_S_c;
12149  //End of Block-local variables
12150  //Block-local variables for block SPcalc_ac
12151  AdmsFadType SP_S_bx;
12152  AdmsFadType SP_S_tau;
12153  AdmsFadType SP_S_eta;
12154  AdmsFadType SP_S_delta0;
12155  AdmsFadType SP_S_delta1;
12156  //End of Block-local variables
12157  //Block-local variables for block SPcalc_ac
12158  AdmsFadType SP_S_pC;
12159  AdmsFadType SP_S_qC;
12160  AdmsFadType SP_S_A_fac;
12161  //End of Block-local variables
12162  //Block-local variables for block SPcalc_ac
12163  AdmsFadType SP_S_x1;
12164  AdmsFadType SP_S_w;
12165  AdmsFadType SP_S_xbar;
12166  AdmsFadType SP_S_x0;
12167  //End of Block-local variables
12168  //Block-local variables for block SPcalc_ac
12169  AdmsFadType SP_S_xi0;
12170  AdmsFadType SP_S_xi1;
12171  AdmsFadType SP_S_xi2;
12172  //End of Block-local variables
12173  //Block-local variables for block SPcalc_ac
12174  AdmsFadType x_d;
12175  AdmsFadType Rxcor;
12176  AdmsFadType delta_1s;
12177  AdmsFadType xi0s;
12178  AdmsFadType xi1s;
12179  AdmsFadType xi2s;
12180  AdmsFadType xi0d;
12181  //End of Block-local variables
12182  //Block-local variables for block SPcalc_ac
12183  AdmsFadType Es;
12184  AdmsFadType Em;
12185  AdmsFadType Ed;
12186  AdmsFadType Ds;
12187  AdmsFadType Dm;
12188  AdmsFadType Dd;
12189  AdmsFadType Ps;
12190  AdmsFadType xgs;
12191  AdmsFadType qis;
12192  AdmsFadType qbs;
12193  AdmsFadType qbm;
12194  AdmsFadType Eeffm;
12195  //End of Block-local variables
12196  //Block-local variables for block SPcalc_ac
12197  AdmsFadType Phi_0;
12198  AdmsFadType Phi_2;
12199  AdmsFadType asat;
12200  AdmsFadType Phi_0_2;
12201  AdmsFadType Phi0_Phi2;
12202  //End of Block-local variables
12203  //Block-local variables for block SPcalc_ac
12204  AdmsFadType Vdse;
12205  AdmsFadType Vdsat;
12206  AdmsFadType Udse;
12207  AdmsFadType xn_d;
12208  AdmsFadType k_ds;
12209  //End of Block-local variables
12210  //Block-local variables for block SPcalc_ac
12211  AdmsFadType Mutmp;
12212  AdmsFadType Phi_sat;
12213  AdmsFadType delta_nd;
12214  //End of Block-local variables
12215  //Block-local variables for block SPcalc_ac
12216  AdmsFadType pC;
12217  AdmsFadType qC;
12218  AdmsFadType Pm;
12219  //End of Block-local variables
12220  //Block-local variables for block SPcalc_ac
12221  AdmsFadType d0;
12222  AdmsFadType D_bar;
12223  AdmsFadType km;
12224  AdmsFadType x_pm;
12225  AdmsFadType xi_pd;
12226  AdmsFadType p_pd;
12227  AdmsFadType u_pd;
12228  AdmsFadType q_pd;
12229  //End of Block-local variables
12230  if ((((model_.SWNUD_i)==1)||((model_.SWDELVTAC_i)!=0)))
12231  {
12232  if (((model_.SWDELVTAC_i)!=0))
12233  {
12234  temp = ((0.5*((Vdb+Vsb)-sqrt((((Vdb-Vsb)*(Vdb-Vsb))+bphi_ac))))+phix_ac);
12235  Vsbstar_ac = ((Vsb-(0.5*((temp)-sqrt((((temp)*(temp))+aphi_ac)))))+phix1_ac);
12236  Vsbstar = Vsbstar_ac;
12237  phib = phib_ac;
12238  G_0 = G_0_ac;
12239  sqrt_phib = sqrt_phib_ac;
12240  }
12241  else
12242  {
12243  Vsbstar = Vsbstar_dc;
12244  phib = phib_dc;
12245  G_0 = G_0_dc;
12246  sqrt_phib = sqrt_phib_dc;
12247  }
12248  alpha = 0.0;
12249  GdL = 1.0;
12250  dL = 0.0;
12251  qbm = 0.0;
12252  dps = 0.0;
12253  qim = 0.0;
12254  qim1 = 0.0;
12255  H = 1.0;
12256  eta_p = 1.0;
12257  Gvsat = 1.0;
12258  Gvsatinv = 1.0;
12259  SP_S_x1 = 0.0;
12260  x_s = 0.0;
12261  sqm = 0.0;
12262  xitsb = 0.0;
12263  rhob = 0.0;
12264  Gmob = 1.0;
12265  Gmob_dL = 1.0;
12266  Udse = 0.0;
12267  thesat1 = 0.0;
12268  xgm = 0.0;
12269  Vdbstar = (Vds+Vsbstar);
12270  Vgbstar = (Vgs+Vsbstar);
12271  Vgb1 = (Vgbstar-VFB_i);
12272  Vsbx = (Vsbstar+(0.5*(Vds-Vdsx)));
12273  delVg = (CF_i*(Vdsx*(1+(CFB_i*Vsbx))));
12274  Vgb1 = (Vgb1+delVg);
12275  xg = (Vgb1*inv_phit1);
12276  if ((DNSUB_i>0.0))
12277  {
12278  Dnsub = ((DNSUB_i*0.5)*((+((Vgs+Vsb)-VNSUB_i))+sqrt((((-((Vgs+Vsb)-VNSUB_i))*(-((Vgs+Vsb)-VNSUB_i)))+NSLP_i))));
12279  Gf = (G_0*sqrt((1.0+Dnsub)));
12280  }
12281  else
12282  {
12283  Gf = G_0;
12284  }
12285  Gf2 = (Gf*Gf);
12286  inv_Gf2 = (1.0/Gf2);
12287  xi = (1.0+(Gf*7.0710678118654746e-01));
12288  inv_xi = (1.0/xi);
12289  Ux = (Vsbstar*inv_phit1);
12290  xn_s = ((phib*inv_phit1)+Ux);
12291  if ((xn_s<4.6051701859880916e+02))
12292  {
12293  delta_ns = exp((-xn_s));
12294  }
12295  else
12296  {
12297  delta_ns = (1.0e-200/(1.0+((xn_s-4.6051701859880916e+02)*(1.0+(0.5*((xn_s-4.6051701859880916e+02)*(1.0+((xn_s-4.6051701859880916e+02)*3.3333333333333333e-01))))))));
12298  }
12299  margin = (1e-5*xi);
12300  if ((fabs(xg)<=margin))
12301  {
12302  SP_S_temp1 = (((inv_xi*inv_xi)*1.6666666666666667e-01)*7.0710678118654746e-01);
12303  x_s = ((xg*inv_xi)*(1.0+(((xg*(1.0-delta_ns))*Gf)*SP_S_temp1)));
12304  }
12305  else
12306  {
12307  if ((xg<(-margin)))
12308  {
12309  SP_S_yg = (-xg);
12310  SP_S_ysub = (1.25*(SP_S_yg*inv_xi));
12311  SP_S_eta = (0.5*((SP_S_ysub+10)-sqrt((((SP_S_ysub-6.0)*(SP_S_ysub-6.0))+64.0))));
12312  SP_S_temp = (SP_S_yg-SP_S_eta);
12313  SP_S_a = ((SP_S_temp*SP_S_temp)+(Gf2*(SP_S_eta+1.0)));
12314  SP_S_c = ((2.0*SP_S_temp)-Gf2);
12315  SP_S_tau = ((-SP_S_eta)+log((SP_S_a*inv_Gf2)));
12316  nu = (SP_S_a+SP_S_c);
12317  mutau = ((nu*nu)+(SP_S_tau*((0.5*(SP_S_c*SP_S_c))-SP_S_a)));
12318  SP_S_y0 = (SP_S_eta+(((SP_S_a*nu)*SP_S_tau)/(mutau+(((((nu/mutau)*SP_S_tau)*SP_S_tau)*SP_S_c)*(((SP_S_c*SP_S_c)*3.3333333333333333e-01)-SP_S_a)))));
12319  if ((SP_S_y0<2.3025850929940458e+02))
12320  {
12321  SP_S_delta0 = exp(SP_S_y0);
12322  }
12323  else
12324  {
12325  SP_S_delta0 = (1.0e100*(1.0+((SP_S_y0-2.3025850929940458e+02)*(1.0+(0.5*((SP_S_y0-2.3025850929940458e+02)*(1.0+((SP_S_y0-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
12326  }
12327  SP_S_delta1 = (1.0/SP_S_delta0);
12328  SP_S_temp = (1.0/(2.0+(SP_S_y0*SP_S_y0)));
12329  SP_S_xi0 = ((SP_S_y0*SP_S_y0)*SP_S_temp);
12330  SP_S_xi1 = (4.0*((SP_S_y0*SP_S_temp)*SP_S_temp));
12331  SP_S_xi2 = ((((8.0*SP_S_temp)-(12.0*SP_S_xi0))*SP_S_temp)*SP_S_temp);
12332  SP_S_temp = (SP_S_yg-SP_S_y0);
12333  SP_S_temp1 = (delta_ns*SP_S_delta1);
12334  SP_S_pC = ((2.0*SP_S_temp)+(Gf2*(((SP_S_delta0-1.0)-SP_S_temp1)+(delta_ns*(1.0-SP_S_xi1)))));
12335  SP_S_qC = ((SP_S_temp*SP_S_temp)-(Gf2*((((SP_S_delta0-SP_S_y0)-1.0)+SP_S_temp1)+(delta_ns*((SP_S_y0-1.0)-SP_S_xi0)))));
12336  SP_S_temp = (2.0-(Gf2*((SP_S_delta0+SP_S_temp1)-(delta_ns*SP_S_xi2))));
12337  SP_S_temp = ((SP_S_pC*SP_S_pC)-(2.0*(SP_S_qC*SP_S_temp)));
12338  x_s = ((-SP_S_y0)-(2.0*(SP_S_qC/(SP_S_pC+sqrt(SP_S_temp)))));
12339  }
12340  else
12341  {
12342  SP_xg1 = (1.0/(x1+(Gf*7.324648775608221e-001)));
12343  SP_S_A_fac = ((((xi*x1)*SP_xg1)-1.0)*SP_xg1);
12344  SP_S_xbar = ((xg*inv_xi)*(1.0+(SP_S_A_fac*xg)));
12345  if (((-SP_S_xbar)>(-2.3025850929940458e+02)))
12346  {
12347  SP_S_temp = exp((-SP_S_xbar));
12348  }
12349  else
12350  {
12351  SP_S_temp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-(-SP_S_xbar))*(1.0+(0.5*(((-2.3025850929940458e+02)-(-SP_S_xbar))*(1.0+(((-2.3025850929940458e+02)-(-SP_S_xbar))*3.3333333333333333e-01))))))));
12352  }
12353  SP_S_w = (1.0-SP_S_temp);
12354  SP_S_x1 = ((xg+(Gf2*0.5))-(Gf*sqrt(((xg+(Gf2*0.25))-SP_S_w))));
12355  SP_S_bx = (xn_s+3.0);
12356  SP_S_eta = ((0.5*((SP_S_x1+SP_S_bx)-sqrt((((SP_S_x1-SP_S_bx)*(SP_S_x1-SP_S_bx))+5.0))))-(0.5*(SP_S_bx-sqrt(((SP_S_bx*SP_S_bx)+5.0)))));
12357  SP_S_temp = (xg-SP_S_eta);
12358  SP_S_temp1 = exp((-SP_S_eta));
12359  SP_S_temp2 = (1.0/(2.0+(SP_S_eta*SP_S_eta)));
12360  SP_S_xi0 = ((SP_S_eta*SP_S_eta)*SP_S_temp2);
12361  SP_S_xi1 = (4.0*((SP_S_eta*SP_S_temp2)*SP_S_temp2));
12362  SP_S_xi2 = ((((8.0*SP_S_temp2)-(12.0*SP_S_xi0))*SP_S_temp2)*SP_S_temp2);
12363  SP_S_a = max(1.0e-40,((SP_S_temp*SP_S_temp)-(Gf2*(((SP_S_temp1+SP_S_eta)-1.0)-(delta_ns*((SP_S_eta+1.0)+SP_S_xi0))))));
12364  SP_S_b = (1.0-(0.5*(Gf2*(SP_S_temp1-(delta_ns*SP_S_xi2)))));
12365  SP_S_c = ((2.0*SP_S_temp)+(Gf2*((1.0-SP_S_temp1)-(delta_ns*(1.0+SP_S_xi1)))));
12366  SP_S_tau = ((xn_s-SP_S_eta)+log((SP_S_a/Gf2)));
12367  nu = (SP_S_a+SP_S_c);
12368  mutau = ((nu*nu)+(SP_S_tau*((0.5*(SP_S_c*SP_S_c))-(SP_S_a*SP_S_b))));
12369  SP_S_x0 = (SP_S_eta+(((SP_S_a*nu)*SP_S_tau)/(mutau+(((((nu/mutau)*SP_S_tau)*SP_S_tau)*SP_S_c)*(((SP_S_c*SP_S_c)*3.3333333333333333e-01)-(SP_S_a*SP_S_b))))));
12370  if ((SP_S_x0<2.3025850929940458e+02))
12371  {
12372  SP_S_delta0 = exp(SP_S_x0);
12373  SP_S_delta1 = (1.0/SP_S_delta0);
12374  SP_S_delta0 = (delta_ns*SP_S_delta0);
12375  }
12376  else
12377  {
12378  if ((SP_S_x0>(xn_s-2.3025850929940458e+02)))
12379  {
12380  SP_S_delta0 = exp((SP_S_x0-xn_s));
12381  SP_S_delta1 = (delta_ns/SP_S_delta0);
12382  }
12383  else
12384  {
12385  SP_S_delta0 = (1.0e-100/(1.0+(((xn_s-SP_S_x0)-2.3025850929940458e+02)*(1.0+(0.5*(((xn_s-SP_S_x0)-2.3025850929940458e+02)*(1.0+(((xn_s-SP_S_x0)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
12386  SP_S_delta1 = (1.0e-100/(1.0+((SP_S_x0-2.3025850929940458e+02)*(1.0+(0.5*((SP_S_x0-2.3025850929940458e+02)*(1.0+((SP_S_x0-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
12387  }
12388  }
12389  SP_S_temp = (1.0/(2.0+(SP_S_x0*SP_S_x0)));
12390  SP_S_xi0 = ((SP_S_x0*SP_S_x0)*SP_S_temp);
12391  SP_S_xi1 = (4.0*((SP_S_x0*SP_S_temp)*SP_S_temp));
12392  SP_S_xi2 = ((((8.0*SP_S_temp)-(12.0*SP_S_xi0))*SP_S_temp)*SP_S_temp);
12393  SP_S_temp = (xg-SP_S_x0);
12394  SP_S_pC = ((2.0*SP_S_temp)+(Gf2*(((1.0-SP_S_delta1)+SP_S_delta0)-(delta_ns*(1.0+SP_S_xi1)))));
12395  SP_S_qC = ((SP_S_temp*SP_S_temp)-(Gf2*((((SP_S_delta1+SP_S_x0)-1.0)+SP_S_delta0)-(delta_ns*((SP_S_x0+1.0)+SP_S_xi0)))));
12396  SP_S_temp = (2.0-(Gf2*((SP_S_delta1+SP_S_delta0)-(delta_ns*SP_S_xi2))));
12397  SP_S_temp = ((SP_S_pC*SP_S_pC)-(2.0*(SP_S_qC*SP_S_temp)));
12398  x_s = (SP_S_x0+(2.0*(SP_S_qC/(SP_S_pC+sqrt(SP_S_temp)))));
12399  }
12400  }
12401  x_d = x_s;
12402  x_m = x_s;
12403  x_ds = 0.0;
12404  if ((xg<=0.0))
12405  {
12406  qis = 0.0;
12407  xgm = (xg-x_s);
12408  Voxm = (xgm*phit1);
12409  qeff1 = Voxm;
12410  Vdsat = Vdsat_lim;
12411  }
12412  else
12413  {
12414  delta_1s = 0.0;
12415  temp = (1.0/(2.0+(x_s*x_s)));
12416  xi0s = ((x_s*x_s)*temp);
12417  xi1s = (4.0*((x_s*temp)*temp));
12418  xi2s = ((((8.0*temp)-(12.0*xi0s))*temp)*temp);
12419  if ((x_s<2.3025850929940458e+02))
12420  {
12421  delta_1s = exp(x_s);
12422  Es = (1.0/delta_1s);
12423  delta_1s = (delta_ns*delta_1s);
12424  }
12425  else
12426  {
12427  if ((x_s>(xn_s-2.3025850929940458e+02)))
12428  {
12429  delta_1s = exp((x_s-xn_s));
12430  Es = (delta_ns/delta_1s);
12431  }
12432  else
12433  {
12434  delta_1s = (1.0e-100/(1.0+(((xn_s-x_s)-2.3025850929940458e+02)*(1.0+(0.5*(((xn_s-x_s)-2.3025850929940458e+02)*(1.0+(((xn_s-x_s)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
12435  Es = (1.0e-100/(1.0+((x_s-2.3025850929940458e+02)*(1.0+(0.5*((x_s-2.3025850929940458e+02)*(1.0+((x_s-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
12436  }
12437  }
12438  Ds = (delta_1s-(delta_ns*((x_s+1.0)+xi0s)));
12439  if ((x_s<1.0e-5))
12440  {
12441  Ps = (0.5*((x_s*x_s)*(1.0-(3.3333333333333333e-01*(x_s*(1.0-(0.25*x_s)))))));
12442  Ds = (1.6666666666666667e-01*((((delta_ns*x_s)*x_s)*x_s)*(1.0+(1.75*x_s))));
12443  temp = sqrt((1.0-(3.3333333333333333e-01*(x_s*(1.0-(0.25*x_s))))));
12444  sqm = (7.0710678118654746e-01*(x_s*temp));
12445  alpha = (1.0+(((Gf*7.0710678118654746e-01)*((1.0-(0.5*x_s))+(1.6666666666666667e-01*(x_s*x_s))))/temp));
12446  }
12447  else
12448  {
12449  Ps = ((x_s-1.0)+Es);
12450  sqm = sqrt(Ps);
12451  alpha = (1.0+(0.5*((Gf*(1.0-Es))/sqm)));
12452  }
12453  Em = Es;
12454  Ed = Em;
12455  Dm = Ds;
12456  Dd = Dm;
12457  Rxcor = ((1.0+((0.2*XCOR_i)*Vsbx))/(1.0+(XCOR_i*Vsbx)));
12458  if ((Ds>1.0e-100))
12459  {
12460  xgs = (Gf*sqrt((Ps+Ds)));
12461  qis = (((Gf2*Ds)*phit1)/(xgs+(Gf*sqm)));
12462  qbs = ((sqm*Gf)*phit1);
12463  if ((RSB_i<0))
12464  {
12465  rhob = (1.0/(1.0-(RSB_i*Vsbx)));
12466  }
12467  else
12468  {
12469  rhob = (1.0+(RSB_i*Vsbx));
12470  }
12471  if ((RSG_i<0))
12472  {
12473  temp = (1.0-(RSG_i*qis));
12474  }
12475  else
12476  {
12477  temp = (1.0/(1.0+(RSG_i*qis)));
12478  }
12479  GR = (THER_i*((rhob*temp)*qis));
12480  Eeffm = (E_eff0*(qbs+(eta_mu*qis)));
12481  if (((Eeffm*MUE_i)!=0))
12482  {
12483  Mutmp = (pow((Eeffm*MUE_i),THEMU_i)+(CS_i*(Ps/((Ps+Ds)+1.0e-14))));
12484  }
12485  else
12486  {
12487  Mutmp = (CS_i*(Ps/((Ps+Ds)+1.0e-14)));
12488  }
12489  Gmob = (((1.0+Mutmp)+GR)*Rxcor);
12490  if ((THESATB_i<0))
12491  {
12492  xitsb = (1.0/(1.0-(THESATB_i*Vsbx)));
12493  }
12494  else
12495  {
12496  xitsb = (1.0+(THESATB_i*Vsbx));
12497  }
12498  temp2 = (qis*xitsb);
12499  wsat = (100.0*(temp2/(100.0+temp2)));
12500  if ((THESATG_i<0))
12501  {
12502  temp = (1/(1-(THESATG_i*wsat)));
12503  }
12504  else
12505  {
12506  temp = (1+(THESATG_i*wsat));
12507  }
12508  thesat1 = (THESAT_i*(temp/Gmob));
12509  phi_inf = ((qis/alpha)+phit1);
12510  ysat = ((thesat1*phi_inf)*7.0710678118654746e-01);
12511  if (((model_.CHNL_TYPE)==(-1)))
12512  {
12513  ysat = (ysat/sqrt((1.0+ysat)));
12514  }
12515  za = (2.0/(1.0+sqrt((1.0+(4.0*ysat)))));
12516  temp1 = (za*ysat);
12517  Phi_0 = ((phi_inf*za)*(1.0+(0.86*((temp1*(1.0-(temp1*za)))/(1.0+(4.0*((temp1*temp1)*za)))))));
12518  asat = (xgs+(0.5*Gf2));
12519  Phi_2 = (0.98*(((Gf2*Ds)*phit1)/(asat+sqrt(((asat*asat)-((Gf2*Ds)*0.98))))));
12520  Phi_0_2 = (Phi_0+Phi_2);
12521  Phi0_Phi2 = (2.0*(Phi_0*Phi_2));
12522  Phi_sat = (Phi0_Phi2/(Phi_0_2+sqrt(((Phi_0_2*Phi_0_2)-(1.98*Phi0_Phi2)))));
12523  Vdsat = (Phi_sat-(phit1*log((1.0+(((Phi_sat*(Phi_sat-((2.0*asat)*phit1)))*inv_Gf2)/((phit1*phit1)*Ds))))));
12524  }
12525  else
12526  {
12527  Vdsat = Vdsat_lim;
12528  }
12529  if (((Vds/Vdsat)!=0))
12530  {
12531  temp = pow((Vds/Vdsat),AX_i);
12532  }
12533  else
12534  {
12535  temp = 0;
12536  }
12537  Vdse = (Vds*pow((1.0+temp),(-inv_AX)));
12538  Udse = (Vdse*inv_phit1);
12539  xn_d = (xn_s+Udse);
12540  if ((Udse<4.6051701859880916e+02))
12541  {
12542  k_ds = exp((-Udse));
12543  }
12544  else
12545  {
12546  k_ds = (1.0e-200/(1.0+((Udse-4.6051701859880916e+02)*(1.0+(0.5*((Udse-4.6051701859880916e+02)*(1.0+((Udse-4.6051701859880916e+02)*3.3333333333333333e-01))))))));
12547  }
12548  delta_nd = (delta_ns*k_ds);
12549  if ((fabs(xg)<=margin))
12550  {
12551  SP_S_temp1 = (((inv_xi*inv_xi)*1.6666666666666667e-01)*7.0710678118654746e-01);
12552  x_d = ((xg*inv_xi)*(1.0+(((xg*(1.0-delta_nd))*Gf)*SP_S_temp1)));
12553  }
12554  else
12555  {
12556  SP_S_bx = (xn_d+3);
12557  SP_S_eta = ((0.5*((SP_S_x1+SP_S_bx)-sqrt((((SP_S_x1-SP_S_bx)*(SP_S_x1-SP_S_bx))+5.0))))-(0.5*(SP_S_bx-sqrt(((SP_S_bx*SP_S_bx)+5.0)))));
12558  SP_S_temp = (xg-SP_S_eta);
12559  SP_S_temp1 = exp((-SP_S_eta));
12560  SP_S_temp2 = (1.0/(2.0+(SP_S_eta*SP_S_eta)));
12561  SP_S_xi0 = ((SP_S_eta*SP_S_eta)*SP_S_temp2);
12562  SP_S_xi1 = (4.0*((SP_S_eta*SP_S_temp2)*SP_S_temp2));
12563  SP_S_xi2 = ((((8.0*SP_S_temp2)-(12.0*SP_S_xi0))*SP_S_temp2)*SP_S_temp2);
12564  SP_S_a = max(1.0e-40,((SP_S_temp*SP_S_temp)-(Gf2*(((SP_S_temp1+SP_S_eta)-1.0)-(delta_nd*((SP_S_eta+1.0)+SP_S_xi0))))));
12565  SP_S_b = (1.0-(0.5*(Gf2*(SP_S_temp1-(delta_nd*SP_S_xi2)))));
12566  SP_S_c = ((2.0*SP_S_temp)+(Gf2*((1.0-SP_S_temp1)-(delta_nd*(1.0+SP_S_xi1)))));
12567  SP_S_tau = ((xn_d-SP_S_eta)+log((SP_S_a/Gf2)));
12568  nu = (SP_S_a+SP_S_c);
12569  mutau = ((nu*nu)+(SP_S_tau*((0.5*(SP_S_c*SP_S_c))-(SP_S_a*SP_S_b))));
12570  SP_S_x0 = (SP_S_eta+(((SP_S_a*nu)*SP_S_tau)/(mutau+(((((nu/mutau)*SP_S_tau)*SP_S_tau)*SP_S_c)*(((SP_S_c*SP_S_c)*3.3333333333333333e-01)-(SP_S_a*SP_S_b))))));
12571  if ((SP_S_x0<2.3025850929940458e+02))
12572  {
12573  SP_S_delta0 = exp(SP_S_x0);
12574  SP_S_delta1 = (1.0/SP_S_delta0);
12575  SP_S_delta0 = (delta_nd*SP_S_delta0);
12576  }
12577  else
12578  {
12579  if ((SP_S_x0>(xn_d-2.3025850929940458e+02)))
12580  {
12581  SP_S_delta0 = exp((SP_S_x0-xn_d));
12582  SP_S_delta1 = (delta_nd/SP_S_delta0);
12583  }
12584  else
12585  {
12586  SP_S_delta0 = (1.0e-100/(1.0+(((xn_d-SP_S_x0)-2.3025850929940458e+02)*(1.0+(0.5*(((xn_d-SP_S_x0)-2.3025850929940458e+02)*(1.0+(((xn_d-SP_S_x0)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
12587  SP_S_delta1 = (1.0e-100/(1.0+((SP_S_x0-2.3025850929940458e+02)*(1.0+(0.5*((SP_S_x0-2.3025850929940458e+02)*(1.0+((SP_S_x0-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
12588  }
12589  }
12590  SP_S_temp = (1.0/(2.0+(SP_S_x0*SP_S_x0)));
12591  SP_S_xi0 = ((SP_S_x0*SP_S_x0)*SP_S_temp);
12592  SP_S_xi1 = (4.0*((SP_S_x0*SP_S_temp)*SP_S_temp));
12593  SP_S_xi2 = ((((8.0*SP_S_temp)-(12.0*SP_S_xi0))*SP_S_temp)*SP_S_temp);
12594  SP_S_temp = (xg-SP_S_x0);
12595  SP_S_pC = ((2.0*SP_S_temp)+(Gf2*(((1.0-SP_S_delta1)+SP_S_delta0)-(delta_nd*(1.0+SP_S_xi1)))));
12596  SP_S_qC = ((SP_S_temp*SP_S_temp)-(Gf2*((((SP_S_delta1+SP_S_x0)-1.0)+SP_S_delta0)-(delta_nd*((SP_S_x0+1.0)+SP_S_xi0)))));
12597  SP_S_temp = (2.0-(Gf2*((SP_S_delta1+SP_S_delta0)-(delta_nd*SP_S_xi2))));
12598  SP_S_temp = ((SP_S_pC*SP_S_pC)-(2.0*(SP_S_qC*SP_S_temp)));
12599  x_d = (SP_S_x0+(2.0*(SP_S_qC/(SP_S_pC+sqrt(SP_S_temp)))));
12600  }
12601  x_ds = (x_d-x_s);
12602  if ((x_ds<1.0E-10))
12603  {
12604  pC = ((2.0*(xg-x_s))+(Gf2*(((1.0-Es)+(delta_1s*k_ds))-(delta_nd*(1.0+xi1s)))));
12605  qC = ((Gf2*(1.0-k_ds))*Ds);
12606  temp = (2.0-(Gf2*((Es+(delta_1s*k_ds))-(delta_nd*xi2s))));
12607  temp = ((pC*pC)-(2.0*(temp*qC)));
12608  x_ds = (2.0*(qC/(pC+sqrt(temp))));
12609  x_d = (x_s+x_ds);
12610  }
12611  dps = (x_ds*phit1);
12612  xi0d = ((x_d*x_d)/(2.0+(x_d*x_d)));
12613  if ((x_d<2.3025850929940458e+02))
12614  {
12615  Ed = exp((-x_d));
12616  if ((x_d<1.0e-5))
12617  {
12618  Dd = (((((1.6666666666666667e-01*delta_nd)*x_d)*x_d)*x_d)*(1.0+(1.75*x_d)));
12619  }
12620  else
12621  {
12622  Dd = (delta_nd*((((1.0/Ed)-x_d)-1.0)-xi0d));
12623  }
12624  }
12625  else
12626  {
12627  if ((x_d>(xn_d-2.3025850929940458e+02)))
12628  {
12629  temp = exp((x_d-xn_d));
12630  Ed = (delta_nd/temp);
12631  Dd = (temp-(delta_nd*((x_d+1.0)+xi0d)));
12632  }
12633  else
12634  {
12635  Ed = (1.0e-100/(1.0+((x_d-2.3025850929940458e+02)*(1.0+(0.5*((x_d-2.3025850929940458e+02)*(1.0+((x_d-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
12636  temp = (1.0e-100/(1.0+(((xn_d-x_d)-2.3025850929940458e+02)*(1.0+(0.5*(((xn_d-x_d)-2.3025850929940458e+02)*(1.0+(((xn_d-x_d)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
12637  Dd = (temp-(delta_nd*((x_d+1.0)+xi0d)));
12638  }
12639  }
12640  x_m = (0.5*(x_s+x_d));
12641  Em = 0.0;
12642  temp = (Ed*Es);
12643  if ((temp>0.0))
12644  {
12645  Em = sqrt(temp);
12646  }
12647  D_bar = (0.5*(Ds+Dd));
12648  Dm = (D_bar+(0.125*((x_ds*x_ds)*(Em-(2.0*inv_Gf2)))));
12649  if ((x_m<1.0e-5))
12650  {
12651  Pm = (0.5*((x_m*x_m)*(1.0-(3.3333333333333333e-01*(x_m*(1.0-(0.25*x_m)))))));
12652  xgm = (Gf*sqrt((Dm+Pm)));
12653  if ((kp>0.0))
12654  {
12655  eta_p = (1.0/sqrt((1.0+(kp*xgm))));
12656  }
12657  temp = sqrt((1.0-(3.3333333333333333e-01*(x_m*(1.0-(0.25*x_m))))));
12658  sqm = (7.0710678118654746e-01*(x_m*temp));
12659  alpha = (eta_p+(7.0710678118654746e-01*((Gf*((1.0-(0.5*x_m))+(1.6666666666666667e-01*(x_m*x_m))))/temp)));
12660  }
12661  else
12662  {
12663  Pm = ((x_m-1.0)+Em);
12664  xgm = (Gf*sqrt((Dm+Pm)));
12665  if ((kp>0.0))
12666  {
12667  d0 = ((1.0-Em)+(2.0*(xgm*inv_Gf2)));
12668  eta_p = (1.0/sqrt((1.0+(kp*xgm))));
12669  temp = (eta_p/(eta_p+1.0));
12670  x_pm = (kp*(((temp*temp)*Gf2)*Dm));
12671  p_pd = ((2.0*(xgm-x_pm))+(Gf2*((1.0-Em)+Dm)));
12672  q_pd = (x_pm*(x_pm-(2.0*xgm)));
12673  xi_pd = (1.0-(0.5*(Gf2*(Em+Dm))));
12674  u_pd = ((q_pd*p_pd)/((p_pd*p_pd)-(xi_pd*q_pd)));
12675  x_m = (x_m+u_pd);
12676  km = exp(u_pd);
12677  Em = (Em/km);
12678  Dm = (Dm*km);
12679  Pm = ((x_m-1.0)+Em);
12680  xgm = (Gf*sqrt((Dm+Pm)));
12681  help = ((1.0-Em)+(2.0*((xgm*eta_p)*inv_Gf2)));
12682  x_ds = (((x_ds*km)*(d0+D_bar))/(help+(km*D_bar)));
12683  dps = (x_ds*phit1);
12684  }
12685  sqm = sqrt(Pm);
12686  alpha = (eta_p+(0.5*((Gf*(1.0-Em))/sqm)));
12687  }
12688  qim = (phit1*((Gf2*Dm)/(xgm+(Gf*sqm))));
12689  qim1 = (qim+(phit1*alpha));
12690  qbm = ((sqm*Gf)*phit1);
12691  if ((RSG_i<0))
12692  {
12693  temp = (1.0-(RSG_i*qim));
12694  }
12695  else
12696  {
12697  temp = (1.0/(1.0+(RSG_i*qim)));
12698  }
12699  GR = (THER_i*((rhob*temp)*qim));
12700  qeff = (qbm+(eta_mu*qim));
12701  qeff1 = (qbm+(eta_mu1*qim));
12702  Eeffm = (E_eff0*qeff);
12703  if (((Eeffm*MUE_i)!=0))
12704  {
12705  Mutmp = (pow((Eeffm*MUE_i),THEMU_i)+(CS_i*(Pm/((Pm+Dm)+1.0e-14))));
12706  }
12707  else
12708  {
12709  Mutmp = (CS_i*(Pm/((Pm+Dm)+1.0e-14)));
12710  }
12711  Gmob = (((1.0+Mutmp)+GR)*Rxcor);
12712  s1 = log(((1.0+((Vds-dps)*inv_VP))/(1.0+((Vdse-dps)*inv_VP))));
12713  dL = (ALP_i*s1);
12714  GdL = (1.0/((1.0+dL)+(dL*dL)));
12715  temp2 = (qim*xitsb);
12716  wsat = (100.0*(temp2/(100.0+temp2)));
12717  Gmob_dL = (Gmob*GdL);
12718  if ((THESATG_i<0))
12719  {
12720  temp = (1/(1-(THESATG_i*wsat)));
12721  }
12722  else
12723  {
12724  temp = (1+(THESATG_i*wsat));
12725  }
12726  thesat1 = (THESAT_i*(temp/Gmob_dL));
12727  zsat = (((thesat1*thesat1)*dps)*dps);
12728  if (((model_.CHNL_TYPE)==(-1)))
12729  {
12730  zsat = (zsat/(1.0+(thesat1*dps)));
12731  }
12732  Gvsat = (0.5*(Gmob_dL*(1.0+sqrt((1.0+(2.0*zsat))))));
12733  Gvsatinv = (1.0/Gvsat);
12734  Voxm = (xgm*phit1);
12735  temp = (Gmob_dL*Gvsatinv);
12736  alpha1 = (alpha*(1.0+(0.5*((zsat*temp)*temp))));
12737  H = ((temp*qim1)/alpha1);
12738  }
12739  xg_ac = xg;
12740  qeff1_ac = qeff1;
12741  Voxm_ac = Voxm;
12742  alpha_ac = alpha;
12743  dps_ac = dps;
12744  qim_ac = qim;
12745  qim1_ac = qim1;
12746  GdL_ac = GdL;
12747  H_ac = H;
12748  eta_p_ac = eta_p;
12749  Gvsat_ac = Gvsat;
12750  Gmob_dL_ac = Gmob_dL;
12751  x_m_ac = x_m;
12752  Gf_ac = Gf;
12753  }
12754  else
12755  {
12756  xg_ac = xg_dc;
12757  qeff1_ac = qeff1_dc;
12758  Voxm_ac = Voxm_dc;
12759  alpha_ac = alpha_dc;
12760  dps_ac = dps_dc;
12761  qim_ac = qim_dc;
12762  qim1_ac = qim1_dc;
12763  GdL_ac = GdL_dc;
12764  H_ac = H_dc;
12765  eta_p_ac = eta_p_dc;
12766  Gvsat_ac = Gvsat_dc;
12767  Gmob_dL_ac = Gmob_dL_dc;
12768  x_m_ac = x_m_dc;
12769  Gf_ac = Gf_dc;
12770  }
12771  }
12772  // End block SPcalc_ac
12773  Vgb = (Vgs+Vsb);
12774  COX_qm = COX_i;
12775  if ((qq>0.0))
12776  {
12777  COX_qm = (COX_i/(1.0+(qq*pow(((qeff1_ac*qeff1_ac)+qlim2),((-1.0)*1.6666666666666667e-01)))));
12778  }
12779  if ((xg_ac<=0.0))
12780  {
12781  QG = Voxm_ac;
12782  QI = 0.0;
12783  QD = 0.0;
12784  QB = QG;
12785  }
12786  else
12787  {
12788  Fj = (0.5*(dps_ac/H_ac));
12789  Fj2 = (Fj*Fj);
12790  QCLM = ((1.0-GdL_ac)*(qim_ac-(0.5*(alpha_ac*dps_ac))));
12791  QG = (Voxm_ac+(0.5*((eta_p_ac*dps_ac)*((((Fj*GdL_ac)*3.3333333333333333e-01)-1.0)+GdL_ac))));
12792  temp = ((alpha_ac*dps_ac)*1.6666666666666667e-01);
12793  QI = ((GdL_ac*(qim_ac+(temp*Fj)))+QCLM);
12794  QD = (0.5*(((GdL_ac*GdL_ac)*(qim_ac-(temp*((1.0-Fj)-(0.2*Fj2)))))+(QCLM*(1.0+GdL_ac))));
12795  QB = (QG-QI);
12796  }
12797  Qg = (QG*COX_qm);
12798  Qd = ((-QD)*COX_qm);
12799  Qb = ((-QB)*COX_qm);
12800  Qgs_ov = (CGOV_i*Vovs);
12801  Qgd_ov = (CGOVD_i*Vovd);
12802  Qgb_ov = (CGBOV_i*Vgb);
12803  Qfgs = (CFR_i*VgsPrime);
12804  Qfgd = (CFRD_i*VgdPrime);
12805  }
12806  // End block evaluateDynamic
12807  //Begin block evaluateStaticDynamic
12808  {
12809  if (((model_.SWJUNCAP_i)>0))
12810  {
12811  if (((model_.SWJUNEXP_i)==1))
12812  {
12813  tm0 = ((Vjun_s*(model_.phitdinv))*MFOR1_s);
12814  if ((tm0<(-2.3025850929940458e+02)))
12815  {
12816  tm1 = (1.0e-100/(((-2.3025850929940458e+02)-tm0)+1));
12817  }
12818  else
12819  {
12820  if ((tm0>xhighf1_s))
12821  {
12822  tm1 = (expxhf1_s*((tm0-xhighf1_s)+1));
12823  }
12824  else
12825  {
12826  tm1 = exp(tm0);
12827  }
12828  }
12829  ijunfor1 = (ISATFOR1_s*(tm1-1.0));
12830  tm0 = ((Vjun_s*(model_.phitdinv))*MFOR2_s);
12831  if ((tm0<(-2.3025850929940458e+02)))
12832  {
12833  tm1 = (1.0e-100/(((-2.3025850929940458e+02)-tm0)+1));
12834  }
12835  else
12836  {
12837  if ((tm0>xhighf2_s))
12838  {
12839  tm1 = (expxhf2_s*((tm0-xhighf2_s)+1));
12840  }
12841  else
12842  {
12843  tm1 = exp(tm0);
12844  }
12845  }
12846  ijunfor2 = (ISATFOR2_s*(tm1-1.0));
12847  ijunrev = 0.0;
12848  if ((m0flag_s>0))
12849  {
12850  ijunrev = (Vjun_s*(ISATREV_s+(Vjun_s*MREV_s)));
12851  }
12852  else
12853  {
12854  tm0 = (((-Vjun_s)*(model_.phitdinv))*MREV_s);
12855  if ((tm0<(-2.3025850929940458e+02)))
12856  {
12857  tm1 = (1.0e-100/(((-2.3025850929940458e+02)-tm0)+1));
12858  }
12859  else
12860  {
12861  if ((tm0>xhighr_s))
12862  {
12863  tm1 = (expxhr_s*((tm0-xhighr_s)+1));
12864  }
12865  else
12866  {
12867  tm1 = exp(tm0);
12868  }
12869  }
12870  ijunrev = ((-ISATREV_s)*(tm1-1.0));
12871  }
12872  ijun_s = ((ijunfor1+ijunfor2)+ijunrev);
12873  tm0 = ((Vjun_d*(model_.phitdinv))*MFOR1_d);
12874  if ((tm0<(-2.3025850929940458e+02)))
12875  {
12876  tm1 = (1.0e-100/(((-2.3025850929940458e+02)-tm0)+1));
12877  }
12878  else
12879  {
12880  if ((tm0>xhighf1_d))
12881  {
12882  tm1 = (expxhf1_d*((tm0-xhighf1_d)+1));
12883  }
12884  else
12885  {
12886  tm1 = exp(tm0);
12887  }
12888  }
12889  ijunfor1 = (ISATFOR1_d*(tm1-1.0));
12890  tm0 = ((Vjun_d*(model_.phitdinv))*MFOR2_d);
12891  if ((tm0<(-2.3025850929940458e+02)))
12892  {
12893  tm1 = (1.0e-100/(((-2.3025850929940458e+02)-tm0)+1));
12894  }
12895  else
12896  {
12897  if ((tm0>xhighf2_d))
12898  {
12899  tm1 = (expxhf2_d*((tm0-xhighf2_d)+1));
12900  }
12901  else
12902  {
12903  tm1 = exp(tm0);
12904  }
12905  }
12906  ijunfor2 = (ISATFOR2_d*(tm1-1.0));
12907  ijunrev = 0.0;
12908  if ((m0flag_d>0))
12909  {
12910  ijunrev = (Vjun_d*(ISATREV_d+(Vjun_d*MREV_d)));
12911  }
12912  else
12913  {
12914  tm0 = (((-Vjun_d)*(model_.phitdinv))*MREV_d);
12915  if ((tm0<(-2.3025850929940458e+02)))
12916  {
12917  tm1 = (1.0e-100/(((-2.3025850929940458e+02)-tm0)+1));
12918  }
12919  else
12920  {
12921  if ((tm0>xhighr_d))
12922  {
12923  tm1 = (expxhr_d*((tm0-xhighr_d)+1));
12924  }
12925  else
12926  {
12927  tm1 = exp(tm0);
12928  }
12929  }
12930  ijunrev = ((-ISATREV_d)*(tm1-1.0));
12931  }
12932  ijun_d = ((ijunfor1+ijunfor2)+ijunrev);
12933  //Begin block evaluateDynamic
12934  {
12941  (model_.PBOT_i) = (model_.PBOTS_i);
12942  (model_.PSTI_i) = (model_.PSTIS_i);
12943  (model_.PGAT_i) = (model_.PGATS_i);
12977  (model_.FJUNQ_i) = (model_.FJUNQS_i);
12984  (model_.ftdbot) = (model_.ftdbot_s);
12985  (model_.ftdsti) = (model_.ftdsti_s);
12986  (model_.ftdgat) = (model_.ftdgat_s);
12990  (model_.ubibot) = (model_.ubibot_s);
12991  (model_.ubisti) = (model_.ubisti_s);
12992  (model_.ubigat) = (model_.ubigat_s);
12993  (model_.vbibot) = (model_.vbibot_s);
12994  (model_.vbisti) = (model_.vbisti_s);
12995  (model_.vbigat) = (model_.vbigat_s);
13005  (model_.cjobot) = (model_.cjobot_s);
13006  (model_.cjosti) = (model_.cjosti_s);
13007  (model_.cjogat) = (model_.cjogat_s);
13047  h1 = ((4.0*vch_s)*vch_s);
13048  h2 = (vch_s/vfmin_s);
13049  h2d = (Vjun_s+(vch_s*h2));
13050  h3 = (vfmin_s+h2d);
13051  h4 = (vfmin_s-h2d);
13052  h5 = sqrt(((h4*h4)+h1));
13053  vjv = (2.0*((Vjun_s*vfmin_s)/(h3+h5)));
13054  if ((zflagbot_s>0.5))
13055  {
13056  if (((model_.one_minus_PBOT)==0.5))
13057  {
13058  tmpv = sqrt((1-(vjv*(model_.vbiinvbot))));
13059  }
13060  else
13061  {
13062  tmpv = pow((1-(vjv*(model_.vbiinvbot))),(model_.one_minus_PBOT));
13063  }
13064  qjunbot_s = (((model_.qprefbot)*(1-tmpv))+((model_.qpref2bot)*(Vjun_s-vjv)));
13065  }
13066  if ((zflagsti_s>0.5))
13067  {
13068  if (((model_.one_minus_PSTI)==0.5))
13069  {
13070  tmpv = sqrt((1-(vjv*(model_.vbiinvsti))));
13071  }
13072  else
13073  {
13074  tmpv = pow((1-(vjv*(model_.vbiinvsti))),(model_.one_minus_PSTI));
13075  }
13076  qjunsti_s = (((model_.qprefsti)*(1-tmpv))+((model_.qpref2sti)*(Vjun_s-vjv)));
13077  }
13078  if ((zflaggat_s>0.5))
13079  {
13080  if (((model_.one_minus_PGAT)==0.5))
13081  {
13082  tmpv = sqrt((1-(vjv*(model_.vbiinvgat))));
13083  }
13084  else
13085  {
13086  tmpv = pow((1-(vjv*(model_.vbiinvgat))),(model_.one_minus_PGAT));
13087  }
13088  qjungat_s = (((model_.qprefgat)*(1-tmpv))+((model_.qpref2gat)*(Vjun_s-vjv)));
13089  }
13096  (model_.PBOT_i) = (model_.PBOTD_i);
13097  (model_.PSTI_i) = (model_.PSTID_i);
13098  (model_.PGAT_i) = (model_.PGATD_i);
13132  (model_.FJUNQ_i) = (model_.FJUNQD_i);
13139  (model_.ftdbot) = (model_.ftdbot_d);
13140  (model_.ftdsti) = (model_.ftdsti_d);
13141  (model_.ftdgat) = (model_.ftdgat_d);
13145  (model_.ubibot) = (model_.ubibot_d);
13146  (model_.ubisti) = (model_.ubisti_d);
13147  (model_.ubigat) = (model_.ubigat_d);
13148  (model_.vbibot) = (model_.vbibot_d);
13149  (model_.vbisti) = (model_.vbisti_d);
13150  (model_.vbigat) = (model_.vbigat_d);
13160  (model_.cjobot) = (model_.cjobot_d);
13161  (model_.cjosti) = (model_.cjosti_d);
13162  (model_.cjogat) = (model_.cjogat_d);
13202  h1 = ((4.0*vch_d)*vch_d);
13203  h2 = (vch_d/vfmin_d);
13204  h2d = (Vjun_d+(vch_d*h2));
13205  h3 = (vfmin_d+h2d);
13206  h4 = (vfmin_d-h2d);
13207  h5 = sqrt(((h4*h4)+h1));
13208  vjv = (2.0*((Vjun_d*vfmin_d)/(h3+h5)));
13209  if ((zflagbot_d>0.5))
13210  {
13211  if (((model_.one_minus_PBOT)==0.5))
13212  {
13213  tmpv = sqrt((1-(vjv*(model_.vbiinvbot))));
13214  }
13215  else
13216  {
13217  tmpv = pow((1-(vjv*(model_.vbiinvbot))),(model_.one_minus_PBOT));
13218  }
13219  qjunbot_d = (((model_.qprefbot)*(1-tmpv))+((model_.qpref2bot)*(Vjun_d-vjv)));
13220  }
13221  if ((zflagsti_d>0.5))
13222  {
13223  if (((model_.one_minus_PSTI)==0.5))
13224  {
13225  tmpv = sqrt((1-(vjv*(model_.vbiinvsti))));
13226  }
13227  else
13228  {
13229  tmpv = pow((1-(vjv*(model_.vbiinvsti))),(model_.one_minus_PSTI));
13230  }
13231  qjunsti_d = (((model_.qprefsti)*(1-tmpv))+((model_.qpref2sti)*(Vjun_d-vjv)));
13232  }
13233  if ((zflaggat_d>0.5))
13234  {
13235  if (((model_.one_minus_PGAT)==0.5))
13236  {
13237  tmpv = sqrt((1-(vjv*(model_.vbiinvgat))));
13238  }
13239  else
13240  {
13241  tmpv = pow((1-(vjv*(model_.vbiinvgat))),(model_.one_minus_PGAT));
13242  }
13243  qjungat_d = (((model_.qprefgat)*(1-tmpv))+((model_.qpref2gat)*(Vjun_d-vjv)));
13244  }
13245  }
13246  // End block evaluateDynamic
13247  }
13248  else
13249  {
13256  (model_.PBOT_i) = (model_.PBOTS_i);
13257  (model_.PSTI_i) = (model_.PSTIS_i);
13258  (model_.PGAT_i) = (model_.PGATS_i);
13292  (model_.FJUNQ_i) = (model_.FJUNQS_i);
13299  (model_.ftdbot) = (model_.ftdbot_s);
13300  (model_.ftdsti) = (model_.ftdsti_s);
13301  (model_.ftdgat) = (model_.ftdgat_s);
13305  (model_.ubibot) = (model_.ubibot_s);
13306  (model_.ubisti) = (model_.ubisti_s);
13307  (model_.ubigat) = (model_.ubigat_s);
13308  (model_.vbibot) = (model_.vbibot_s);
13309  (model_.vbisti) = (model_.vbisti_s);
13310  (model_.vbigat) = (model_.vbigat_s);
13320  (model_.cjobot) = (model_.cjobot_s);
13321  (model_.cjosti) = (model_.cjosti_s);
13322  (model_.cjogat) = (model_.cjogat_s);
13362  vbbt = 0.0;
13363  two_psistar = 0.0;
13364  if ((!(((ABSOURCE_i==0)&&(LSSOURCE_i==0))&&(LGSOURCE_i==0))))
13365  {
13366  h1 = ((4.0*vch_s)*vch_s);
13367  h2 = (vch_s/vfmin_s);
13368  h2d = (Vjun_s+(vch_s*h2));
13369  h3 = (vfmin_s+h2d);
13370  h4 = (vfmin_s-h2d);
13371  h5 = sqrt(((h4*h4)+h1));
13372  vj = (2.0*((Vjun_s*vfmin_s)/(h3+h5)));
13373  if ((Vjun_s<VMAX_s))
13374  {
13375  if ((fabs((0.5*(Vjun_s*(model_.phitdinv))))<2.3025850929940458e+02))
13376  {
13377  zinv = exp((0.5*(Vjun_s*(model_.phitdinv))));
13378  }
13379  else
13380  {
13381  if (((0.5*(Vjun_s*(model_.phitdinv)))<(-2.3025850929940458e+02)))
13382  {
13383  zinv = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-(0.5*(Vjun_s*(model_.phitdinv))))*(1.0+(0.5*(((-2.3025850929940458e+02)-(0.5*(Vjun_s*(model_.phitdinv))))*(1.0+(((-2.3025850929940458e+02)-(0.5*(Vjun_s*(model_.phitdinv))))*3.3333333333333333e-01))))))));
13384  }
13385  else
13386  {
13387  zinv = (1.0e100*(1.0+(((0.5*(Vjun_s*(model_.phitdinv)))-2.3025850929940458e+02)*(1.0+(0.5*(((0.5*(Vjun_s*(model_.phitdinv)))-2.3025850929940458e+02)*(1.0+(((0.5*(Vjun_s*(model_.phitdinv)))-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
13388  }
13389  }
13390  idmult = (zinv*zinv);
13391  }
13392  else
13393  {
13394  idmult = ((1+((Vjun_s-VMAX_s)*(model_.phitdinv)))*exp_VMAX_over_phitd_s);
13395  zinv = sqrt(idmult);
13396  }
13397  idmult = (idmult-1.0);
13398  z = (1/zinv);
13399  if ((Vjun_s>0))
13400  {
13401  two_psistar = (2.0*((model_.phitd)*log(((2.0+z)+sqrt(((z+1.0)*(z+3.0)))))));
13402  }
13403  else
13404  {
13405  two_psistar = ((-Vjun_s)+(2.0*((model_.phitd)*log((((2*zinv)+1)+sqrt(((1+zinv)*(1+(3*zinv)))))))));
13406  }
13407  vjlim = (vbimin_s-two_psistar);
13408  vjsrh = (0.5*((Vjun_s+vjlim)-sqrt((((Vjun_s-vjlim)*(Vjun_s-vjlim))+((4*(model_.phitd))*(model_.phitd))))));
13409  vbbt = (0.5*((Vjun_s+vbbtlim_s)-sqrt((((Vjun_s-vbbtlim_s)*(Vjun_s-vbbtlim_s))+((4*(model_.phitr))*(model_.phitr))))));
13410  vav = (0.5*((Vjun_s)-sqrt((((Vjun_s)*(Vjun_s))+((4*1E-6)*1E-6)))));
13411  }
13412  if ((ABSOURCE_i==0))
13413  {
13414  ijunbot_s = 0;
13415  qjunbot_s = 0;
13416  }
13417  else
13418  {
13419  if (((model_.one_minus_PBOT)==0.5))
13420  {
13421  tmp = sqrt((1-(vj*(model_.vbiinvbot))));
13422  }
13423  else
13424  {
13425  tmp = pow((1-(vj*(model_.vbiinvbot))),(model_.one_minus_PBOT));
13426  }
13427  qjunbot_s = (((model_.qprefbot)*(1-tmp))+((model_.qpref2bot)*(Vjun_s-vj)));
13428  id = ((model_.idsatbot)*idmult);
13429  if ((((model_.CSRHBOT_i)==0)&&((model_.CTATBOT_i)==0)))
13430  {
13431  isrh = 0;
13432  }
13433  else
13434  {
13436  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
13437  if (((model_.PBOT_i)==0.5))
13438  {
13439  dwsrh = 0;
13440  }
13441  else
13442  {
13443  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PBOT_i))));
13444  }
13445  wsrh = (wsrhstep+dwsrh);
13446  if (((model_.PBOT_i)==0.5))
13447  {
13448  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRBOTinv)));
13449  }
13450  else
13451  {
13452  tmp = pow((vbi_minus_vjsrh*(model_.VBIRBOTinv)),(model_.PBOT_i));
13453  }
13454  wdep = ((model_.wdepnulrbot)*tmp);
13455  asrh = ((model_.ftdbot)*((zinv-1)*wdep));
13456  isrh = ((model_.CSRHBOT_i)*(asrh*wsrh));
13457  }
13458  if (((model_.CTATBOT_i)==0))
13459  {
13460  itat = 0;
13461  }
13462  else
13463  {
13465  twoatatoverthreebtat = ((0.666666666666667*(model_.atatbot))/btat);
13466  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
13467  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
13468  sqrtumax = sqrt(fabs(umax));
13469  umaxpoweronepointfive = (umax*sqrtumax);
13470  if ((((-(model_.PBOT_i))*(model_.one_over_one_minus_PBOT))==(-1)))
13471  {
13472  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
13473  }
13474  else
13475  {
13476  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PBOT_i))*(model_.one_over_one_minus_PBOT)));
13477  }
13478  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
13479  ktat = sqrt((0.375*(btat/sqrtumax)));
13480  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
13481  mtat = (((((model_.atatbot)*twoatatoverthreebtat)*sqrtumax)-((model_.atatbot)*umax))+(0.5*(btat*umaxpoweronepointfive)));
13482  xerfc = ((ltat-1)*ktat);
13483  ysq = (xerfc*xerfc);
13484  if ((xerfc>0))
13485  {
13486  terfc = (1/(1+((model_.perfc)*xerfc)));
13487  }
13488  else
13489  {
13490  terfc = (1/(1-((model_.perfc)*xerfc)));
13491  }
13492  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
13493  {
13494  tmp = exp(((-ysq)+mtat));
13495  }
13496  else
13497  {
13498  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
13499  }
13500  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
13501  if ((xerfc>0))
13502  {
13503  erfctimesexpmtat = erfcpos;
13504  }
13505  else
13506  {
13507  if ((mtat>(-2.3025850929940458e+02)))
13508  {
13509  tmp = exp(mtat);
13510  }
13511  else
13512  {
13513  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
13514  }
13515  erfctimesexpmtat = ((2*tmp)-erfcpos);
13516  }
13517  gammamax = ((1.77245385090551603*0.5)*(((model_.atatbot)*erfctimesexpmtat)/ktat));
13518  itat = ((model_.CTATBOT_i)*((asrh*gammamax)*wtat));
13519  }
13520  if (((model_.CBBTBOT_i)==0))
13521  {
13522  ibbt = 0;
13523  }
13524  else
13525  {
13526  if (((model_.PBOT_i)==0.5))
13527  {
13528  tmp = sqrt((((model_.VBIRBOT_i)-vbbt)*(model_.VBIRBOTinv)));
13529  }
13530  else
13531  {
13532  tmp = pow((((model_.VBIRBOT_i)-vbbt)*(model_.VBIRBOTinv)),(model_.PBOT_i));
13533  }
13534  Fmaxr = ((model_.one_over_one_minus_PBOT)*((((model_.VBIRBOT_i)-vbbt)*(model_.wdepnulrinvbot))/tmp));
13535  if ((fabs(((-(model_.fbbtbot))/Fmaxr))<2.3025850929940458e+02))
13536  {
13537  tmp = exp(((-(model_.fbbtbot))/Fmaxr));
13538  }
13539  else
13540  {
13541  if ((((-(model_.fbbtbot))/Fmaxr)<(-2.3025850929940458e+02)))
13542  {
13543  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*3.3333333333333333e-01))))))));
13544  }
13545  else
13546  {
13547  tmp = (1.0e100*(1.0+((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
13548  }
13549  }
13550  ibbt = ((model_.CBBTBOT_i)*(((Vjun_s*Fmaxr)*Fmaxr)*tmp));
13551  }
13552  if (((model_.VBRBOT_i)>1000))
13553  {
13554  fbreakdown = 1;
13555  }
13556  else
13557  {
13558  if ((vav>((-0.999)*(model_.VBRBOT_i))))
13559  {
13560  if (((model_.PBRBOT_i)==4))
13561  {
13562  tmp = (((fabs((vav*(model_.VBRinvbot)))*fabs((vav*(model_.VBRinvbot))))*fabs((vav*(model_.VBRinvbot))))*fabs((vav*(model_.VBRinvbot))));
13563  }
13564  else
13565  {
13566  tmp = pow(fabs((vav*(model_.VBRinvbot))),(model_.PBRBOT_i));
13567  }
13568  fbreakdown = (1/(1-tmp));
13569  }
13570  else
13571  {
13572  fbreakdown = ((model_.fstopbot)+((vav+(0.999*(model_.VBRBOT_i)))*(model_.slopebot)));
13573  }
13574  }
13575  ijunbot_s = ((((id+isrh)+itat)+ibbt)*fbreakdown);
13576  }
13577  if ((LSSOURCE_i==0))
13578  {
13579  ijunsti_s = 0;
13580  qjunsti_s = 0;
13581  }
13582  else
13583  {
13584  if (((model_.one_minus_PSTI)==0.5))
13585  {
13586  tmp = sqrt((1-(vj*(model_.vbiinvsti))));
13587  }
13588  else
13589  {
13590  tmp = pow((1-(vj*(model_.vbiinvsti))),(model_.one_minus_PSTI));
13591  }
13592  qjunsti_s = (((model_.qprefsti)*(1-tmp))+((model_.qpref2sti)*(Vjun_s-vj)));
13593  id = ((model_.idsatsti)*idmult);
13594  if ((((model_.CSRHSTI_i)==0)&&((model_.CTATSTI_i)==0)))
13595  {
13596  isrh = 0;
13597  }
13598  else
13599  {
13601  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
13602  if (((model_.PSTI_i)==0.5))
13603  {
13604  dwsrh = 0;
13605  }
13606  else
13607  {
13608  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PSTI_i))));
13609  }
13610  wsrh = (wsrhstep+dwsrh);
13611  if (((model_.PSTI_i)==0.5))
13612  {
13613  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRSTIinv)));
13614  }
13615  else
13616  {
13617  tmp = pow((vbi_minus_vjsrh*(model_.VBIRSTIinv)),(model_.PSTI_i));
13618  }
13619  wdep = ((model_.wdepnulrsti)*tmp);
13620  asrh = ((model_.ftdsti)*((zinv-1)*wdep));
13621  isrh = ((model_.CSRHSTI_i)*(asrh*wsrh));
13622  }
13623  if (((model_.CTATSTI_i)==0))
13624  {
13625  itat = 0;
13626  }
13627  else
13628  {
13630  twoatatoverthreebtat = ((0.666666666666667*(model_.atatsti))/btat);
13631  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
13632  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
13633  sqrtumax = sqrt(fabs(umax));
13634  umaxpoweronepointfive = (umax*sqrtumax);
13635  if ((((-(model_.PSTI_i))*(model_.one_over_one_minus_PSTI))==(-1)))
13636  {
13637  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
13638  }
13639  else
13640  {
13641  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PSTI_i))*(model_.one_over_one_minus_PSTI)));
13642  }
13643  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
13644  ktat = sqrt((0.375*(btat/sqrtumax)));
13645  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
13646  mtat = (((((model_.atatsti)*twoatatoverthreebtat)*sqrtumax)-((model_.atatsti)*umax))+(0.5*(btat*umaxpoweronepointfive)));
13647  xerfc = ((ltat-1)*ktat);
13648  ysq = (xerfc*xerfc);
13649  if ((xerfc>0))
13650  {
13651  terfc = (1/(1+((model_.perfc)*xerfc)));
13652  }
13653  else
13654  {
13655  terfc = (1/(1-((model_.perfc)*xerfc)));
13656  }
13657  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
13658  {
13659  tmp = exp(((-ysq)+mtat));
13660  }
13661  else
13662  {
13663  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
13664  }
13665  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
13666  if ((xerfc>0))
13667  {
13668  erfctimesexpmtat = erfcpos;
13669  }
13670  else
13671  {
13672  if ((mtat>(-2.3025850929940458e+02)))
13673  {
13674  tmp = exp(mtat);
13675  }
13676  else
13677  {
13678  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
13679  }
13680  erfctimesexpmtat = ((2*tmp)-erfcpos);
13681  }
13682  gammamax = ((1.77245385090551603*0.5)*(((model_.atatsti)*erfctimesexpmtat)/ktat));
13683  itat = ((model_.CTATSTI_i)*((asrh*gammamax)*wtat));
13684  }
13685  if (((model_.CBBTSTI_i)==0))
13686  {
13687  ibbt = 0;
13688  }
13689  else
13690  {
13691  if (((model_.PSTI_i)==0.5))
13692  {
13693  tmp = sqrt((((model_.VBIRSTI_i)-vbbt)*(model_.VBIRSTIinv)));
13694  }
13695  else
13696  {
13697  tmp = pow((((model_.VBIRSTI_i)-vbbt)*(model_.VBIRSTIinv)),(model_.PSTI_i));
13698  }
13699  Fmaxr = ((model_.one_over_one_minus_PSTI)*((((model_.VBIRSTI_i)-vbbt)*(model_.wdepnulrinvsti))/tmp));
13700  if ((fabs(((-(model_.fbbtsti))/Fmaxr))<2.3025850929940458e+02))
13701  {
13702  tmp = exp(((-(model_.fbbtsti))/Fmaxr));
13703  }
13704  else
13705  {
13706  if ((((-(model_.fbbtsti))/Fmaxr)<(-2.3025850929940458e+02)))
13707  {
13708  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*3.3333333333333333e-01))))))));
13709  }
13710  else
13711  {
13712  tmp = (1.0e100*(1.0+((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
13713  }
13714  }
13715  ibbt = ((model_.CBBTSTI_i)*(((Vjun_s*Fmaxr)*Fmaxr)*tmp));
13716  }
13717  if (((model_.VBRSTI_i)>1000))
13718  {
13719  fbreakdown = 1;
13720  }
13721  else
13722  {
13723  if ((vav>((-0.999)*(model_.VBRSTI_i))))
13724  {
13725  if (((model_.PBRSTI_i)==4))
13726  {
13727  tmp = (((fabs((vav*(model_.VBRinvsti)))*fabs((vav*(model_.VBRinvsti))))*fabs((vav*(model_.VBRinvsti))))*fabs((vav*(model_.VBRinvsti))));
13728  }
13729  else
13730  {
13731  tmp = pow(fabs((vav*(model_.VBRinvsti))),(model_.PBRSTI_i));
13732  }
13733  fbreakdown = (1/(1-tmp));
13734  }
13735  else
13736  {
13737  fbreakdown = ((model_.fstopsti)+((vav+(0.999*(model_.VBRSTI_i)))*(model_.slopesti)));
13738  }
13739  }
13740  ijunsti_s = ((((id+isrh)+itat)+ibbt)*fbreakdown);
13741  }
13742  if ((LGSOURCE_i==0))
13743  {
13744  ijungat_s = 0;
13745  qjungat_s = 0;
13746  }
13747  else
13748  {
13749  if (((model_.one_minus_PGAT)==0.5))
13750  {
13751  tmp = sqrt((1-(vj*(model_.vbiinvgat))));
13752  }
13753  else
13754  {
13755  tmp = pow((1-(vj*(model_.vbiinvgat))),(model_.one_minus_PGAT));
13756  }
13757  qjungat_s = (((model_.qprefgat)*(1-tmp))+((model_.qpref2gat)*(Vjun_s-vj)));
13758  id = ((model_.idsatgat)*idmult);
13759  if ((((model_.CSRHGAT_i)==0)&&((model_.CTATGAT_i)==0)))
13760  {
13761  isrh = 0;
13762  }
13763  else
13764  {
13766  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
13767  if (((model_.PGAT_i)==0.5))
13768  {
13769  dwsrh = 0;
13770  }
13771  else
13772  {
13773  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PGAT_i))));
13774  }
13775  wsrh = (wsrhstep+dwsrh);
13776  if (((model_.PGAT_i)==0.5))
13777  {
13778  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRGATinv)));
13779  }
13780  else
13781  {
13782  tmp = pow((vbi_minus_vjsrh*(model_.VBIRGATinv)),(model_.PGAT_i));
13783  }
13784  wdep = ((model_.wdepnulrgat)*tmp);
13785  asrh = ((model_.ftdgat)*((zinv-1)*wdep));
13786  isrh = ((model_.CSRHGAT_i)*(asrh*wsrh));
13787  }
13788  if (((model_.CTATGAT_i)==0))
13789  {
13790  itat = 0;
13791  }
13792  else
13793  {
13795  twoatatoverthreebtat = ((0.666666666666667*(model_.atatgat))/btat);
13796  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
13797  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
13798  sqrtumax = sqrt(fabs(umax));
13799  umaxpoweronepointfive = (umax*sqrtumax);
13800  if ((((-(model_.PGAT_i))*(model_.one_over_one_minus_PGAT))==(-1)))
13801  {
13802  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
13803  }
13804  else
13805  {
13806  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PGAT_i))*(model_.one_over_one_minus_PGAT)));
13807  }
13808  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
13809  ktat = sqrt((0.375*(btat/sqrtumax)));
13810  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
13811  mtat = (((((model_.atatgat)*twoatatoverthreebtat)*sqrtumax)-((model_.atatgat)*umax))+(0.5*(btat*umaxpoweronepointfive)));
13812  xerfc = ((ltat-1)*ktat);
13813  ysq = (xerfc*xerfc);
13814  if ((xerfc>0))
13815  {
13816  terfc = (1/(1+((model_.perfc)*xerfc)));
13817  }
13818  else
13819  {
13820  terfc = (1/(1-((model_.perfc)*xerfc)));
13821  }
13822  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
13823  {
13824  tmp = exp(((-ysq)+mtat));
13825  }
13826  else
13827  {
13828  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
13829  }
13830  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
13831  if ((xerfc>0))
13832  {
13833  erfctimesexpmtat = erfcpos;
13834  }
13835  else
13836  {
13837  if ((mtat>(-2.3025850929940458e+02)))
13838  {
13839  tmp = exp(mtat);
13840  }
13841  else
13842  {
13843  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
13844  }
13845  erfctimesexpmtat = ((2*tmp)-erfcpos);
13846  }
13847  gammamax = ((1.77245385090551603*0.5)*(((model_.atatgat)*erfctimesexpmtat)/ktat));
13848  itat = ((model_.CTATGAT_i)*((asrh*gammamax)*wtat));
13849  }
13850  if (((model_.CBBTGAT_i)==0))
13851  {
13852  ibbt = 0;
13853  }
13854  else
13855  {
13856  if (((model_.PGAT_i)==0.5))
13857  {
13858  tmp = sqrt((((model_.VBIRGAT_i)-vbbt)*(model_.VBIRGATinv)));
13859  }
13860  else
13861  {
13862  tmp = pow((((model_.VBIRGAT_i)-vbbt)*(model_.VBIRGATinv)),(model_.PGAT_i));
13863  }
13864  Fmaxr = ((model_.one_over_one_minus_PGAT)*((((model_.VBIRGAT_i)-vbbt)*(model_.wdepnulrinvgat))/tmp));
13865  if ((fabs(((-(model_.fbbtgat))/Fmaxr))<2.3025850929940458e+02))
13866  {
13867  tmp = exp(((-(model_.fbbtgat))/Fmaxr));
13868  }
13869  else
13870  {
13871  if ((((-(model_.fbbtgat))/Fmaxr)<(-2.3025850929940458e+02)))
13872  {
13873  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*3.3333333333333333e-01))))))));
13874  }
13875  else
13876  {
13877  tmp = (1.0e100*(1.0+((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
13878  }
13879  }
13880  ibbt = ((model_.CBBTGAT_i)*(((Vjun_s*Fmaxr)*Fmaxr)*tmp));
13881  }
13882  if (((model_.VBRGAT_i)>1000))
13883  {
13884  fbreakdown = 1;
13885  }
13886  else
13887  {
13888  if ((vav>((-0.999)*(model_.VBRGAT_i))))
13889  {
13890  if (((model_.PBRGAT_i)==4))
13891  {
13892  tmp = (((fabs((vav*(model_.VBRinvgat)))*fabs((vav*(model_.VBRinvgat))))*fabs((vav*(model_.VBRinvgat))))*fabs((vav*(model_.VBRinvgat))));
13893  }
13894  else
13895  {
13896  tmp = pow(fabs((vav*(model_.VBRinvgat))),(model_.PBRGAT_i));
13897  }
13898  fbreakdown = (1/(1-tmp));
13899  }
13900  else
13901  {
13902  fbreakdown = ((model_.fstopgat)+((vav+(0.999*(model_.VBRGAT_i)))*(model_.slopegat)));
13903  }
13904  }
13905  ijungat_s = ((((id+isrh)+itat)+ibbt)*fbreakdown);
13906  }
13914  (model_.PBOT_i) = (model_.PBOTD_i);
13915  (model_.PSTI_i) = (model_.PSTID_i);
13916  (model_.PGAT_i) = (model_.PGATD_i);
13950  (model_.FJUNQ_i) = (model_.FJUNQD_i);
13957  (model_.ftdbot) = (model_.ftdbot_d);
13958  (model_.ftdsti) = (model_.ftdsti_d);
13959  (model_.ftdgat) = (model_.ftdgat_d);
13963  (model_.ubibot) = (model_.ubibot_d);
13964  (model_.ubisti) = (model_.ubisti_d);
13965  (model_.ubigat) = (model_.ubigat_d);
13966  (model_.vbibot) = (model_.vbibot_d);
13967  (model_.vbisti) = (model_.vbisti_d);
13968  (model_.vbigat) = (model_.vbigat_d);
13978  (model_.cjobot) = (model_.cjobot_d);
13979  (model_.cjosti) = (model_.cjosti_d);
13980  (model_.cjogat) = (model_.cjogat_d);
14020  vbbt = 0.0;
14021  two_psistar = 0.0;
14022  if ((!(((ABDRAIN_i==0)&&(LSDRAIN_i==0))&&(LGDRAIN_i==0))))
14023  {
14024  h1 = ((4.0*vch_d)*vch_d);
14025  h2 = (vch_d/vfmin_d);
14026  h2d = (Vjun_d+(vch_d*h2));
14027  h3 = (vfmin_d+h2d);
14028  h4 = (vfmin_d-h2d);
14029  h5 = sqrt(((h4*h4)+h1));
14030  vj = (2.0*((Vjun_d*vfmin_d)/(h3+h5)));
14031  if ((Vjun_d<VMAX_d))
14032  {
14033  if ((fabs((0.5*(Vjun_d*(model_.phitdinv))))<2.3025850929940458e+02))
14034  {
14035  zinv = exp((0.5*(Vjun_d*(model_.phitdinv))));
14036  }
14037  else
14038  {
14039  if (((0.5*(Vjun_d*(model_.phitdinv)))<(-2.3025850929940458e+02)))
14040  {
14041  zinv = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-(0.5*(Vjun_d*(model_.phitdinv))))*(1.0+(0.5*(((-2.3025850929940458e+02)-(0.5*(Vjun_d*(model_.phitdinv))))*(1.0+(((-2.3025850929940458e+02)-(0.5*(Vjun_d*(model_.phitdinv))))*3.3333333333333333e-01))))))));
14042  }
14043  else
14044  {
14045  zinv = (1.0e100*(1.0+(((0.5*(Vjun_d*(model_.phitdinv)))-2.3025850929940458e+02)*(1.0+(0.5*(((0.5*(Vjun_d*(model_.phitdinv)))-2.3025850929940458e+02)*(1.0+(((0.5*(Vjun_d*(model_.phitdinv)))-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
14046  }
14047  }
14048  idmult = (zinv*zinv);
14049  }
14050  else
14051  {
14052  idmult = ((1+((Vjun_d-VMAX_d)*(model_.phitdinv)))*exp_VMAX_over_phitd_d);
14053  zinv = sqrt(idmult);
14054  }
14055  idmult = (idmult-1.0);
14056  z = (1/zinv);
14057  if ((Vjun_d>0))
14058  {
14059  two_psistar = (2.0*((model_.phitd)*log(((2.0+z)+sqrt(((z+1.0)*(z+3.0)))))));
14060  }
14061  else
14062  {
14063  two_psistar = ((-Vjun_d)+(2.0*((model_.phitd)*log((((2*zinv)+1)+sqrt(((1+zinv)*(1+(3*zinv)))))))));
14064  }
14065  vjlim = (vbimin_d-two_psistar);
14066  vjsrh = (0.5*((Vjun_d+vjlim)-sqrt((((Vjun_d-vjlim)*(Vjun_d-vjlim))+((4*(model_.phitd))*(model_.phitd))))));
14067  vbbt = (0.5*((Vjun_d+vbbtlim_d)-sqrt((((Vjun_d-vbbtlim_d)*(Vjun_d-vbbtlim_d))+((4*(model_.phitr))*(model_.phitr))))));
14068  vav = (0.5*((Vjun_d)-sqrt((((Vjun_d)*(Vjun_d))+((4*1E-6)*1E-6)))));
14069  }
14070  if ((ABDRAIN_i==0))
14071  {
14072  ijunbot_d = 0;
14073  qjunbot_d = 0;
14074  }
14075  else
14076  {
14077  if (((model_.one_minus_PBOT)==0.5))
14078  {
14079  tmp = sqrt((1-(vj*(model_.vbiinvbot))));
14080  }
14081  else
14082  {
14083  tmp = pow((1-(vj*(model_.vbiinvbot))),(model_.one_minus_PBOT));
14084  }
14085  qjunbot_d = (((model_.qprefbot)*(1-tmp))+((model_.qpref2bot)*(Vjun_d-vj)));
14086  id = ((model_.idsatbot)*idmult);
14087  if ((((model_.CSRHBOT_i)==0)&&((model_.CTATBOT_i)==0)))
14088  {
14089  isrh = 0;
14090  }
14091  else
14092  {
14094  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
14095  if (((model_.PBOT_i)==0.5))
14096  {
14097  dwsrh = 0;
14098  }
14099  else
14100  {
14101  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PBOT_i))));
14102  }
14103  wsrh = (wsrhstep+dwsrh);
14104  if (((model_.PBOT_i)==0.5))
14105  {
14106  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRBOTinv)));
14107  }
14108  else
14109  {
14110  tmp = pow((vbi_minus_vjsrh*(model_.VBIRBOTinv)),(model_.PBOT_i));
14111  }
14112  wdep = ((model_.wdepnulrbot)*tmp);
14113  asrh = ((model_.ftdbot)*((zinv-1)*wdep));
14114  isrh = ((model_.CSRHBOT_i)*(asrh*wsrh));
14115  }
14116  if (((model_.CTATBOT_i)==0))
14117  {
14118  itat = 0;
14119  }
14120  else
14121  {
14123  twoatatoverthreebtat = ((0.666666666666667*(model_.atatbot))/btat);
14124  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
14125  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
14126  sqrtumax = sqrt(fabs(umax));
14127  umaxpoweronepointfive = (umax*sqrtumax);
14128  if ((((-(model_.PBOT_i))*(model_.one_over_one_minus_PBOT))==(-1)))
14129  {
14130  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
14131  }
14132  else
14133  {
14134  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PBOT_i))*(model_.one_over_one_minus_PBOT)));
14135  }
14136  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
14137  ktat = sqrt((0.375*(btat/sqrtumax)));
14138  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
14139  mtat = (((((model_.atatbot)*twoatatoverthreebtat)*sqrtumax)-((model_.atatbot)*umax))+(0.5*(btat*umaxpoweronepointfive)));
14140  xerfc = ((ltat-1)*ktat);
14141  ysq = (xerfc*xerfc);
14142  if ((xerfc>0))
14143  {
14144  terfc = (1/(1+((model_.perfc)*xerfc)));
14145  }
14146  else
14147  {
14148  terfc = (1/(1-((model_.perfc)*xerfc)));
14149  }
14150  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
14151  {
14152  tmp = exp(((-ysq)+mtat));
14153  }
14154  else
14155  {
14156  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
14157  }
14158  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
14159  if ((xerfc>0))
14160  {
14161  erfctimesexpmtat = erfcpos;
14162  }
14163  else
14164  {
14165  if ((mtat>(-2.3025850929940458e+02)))
14166  {
14167  tmp = exp(mtat);
14168  }
14169  else
14170  {
14171  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
14172  }
14173  erfctimesexpmtat = ((2*tmp)-erfcpos);
14174  }
14175  gammamax = ((1.77245385090551603*0.5)*(((model_.atatbot)*erfctimesexpmtat)/ktat));
14176  itat = ((model_.CTATBOT_i)*((asrh*gammamax)*wtat));
14177  }
14178  if (((model_.CBBTBOT_i)==0))
14179  {
14180  ibbt = 0;
14181  }
14182  else
14183  {
14184  if (((model_.PBOT_i)==0.5))
14185  {
14186  tmp = sqrt((((model_.VBIRBOT_i)-vbbt)*(model_.VBIRBOTinv)));
14187  }
14188  else
14189  {
14190  tmp = pow((((model_.VBIRBOT_i)-vbbt)*(model_.VBIRBOTinv)),(model_.PBOT_i));
14191  }
14192  Fmaxr = ((model_.one_over_one_minus_PBOT)*((((model_.VBIRBOT_i)-vbbt)*(model_.wdepnulrinvbot))/tmp));
14193  if ((fabs(((-(model_.fbbtbot))/Fmaxr))<2.3025850929940458e+02))
14194  {
14195  tmp = exp(((-(model_.fbbtbot))/Fmaxr));
14196  }
14197  else
14198  {
14199  if ((((-(model_.fbbtbot))/Fmaxr)<(-2.3025850929940458e+02)))
14200  {
14201  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*3.3333333333333333e-01))))))));
14202  }
14203  else
14204  {
14205  tmp = (1.0e100*(1.0+((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
14206  }
14207  }
14208  ibbt = ((model_.CBBTBOT_i)*(((Vjun_d*Fmaxr)*Fmaxr)*tmp));
14209  }
14210  if (((model_.VBRBOT_i)>1000))
14211  {
14212  fbreakdown = 1;
14213  }
14214  else
14215  {
14216  if ((vav>((-0.999)*(model_.VBRBOT_i))))
14217  {
14218  if (((model_.PBRBOT_i)==4))
14219  {
14220  tmp = (((fabs((vav*(model_.VBRinvbot)))*fabs((vav*(model_.VBRinvbot))))*fabs((vav*(model_.VBRinvbot))))*fabs((vav*(model_.VBRinvbot))));
14221  }
14222  else
14223  {
14224  tmp = pow(fabs((vav*(model_.VBRinvbot))),(model_.PBRBOT_i));
14225  }
14226  fbreakdown = (1/(1-tmp));
14227  }
14228  else
14229  {
14230  fbreakdown = ((model_.fstopbot)+((vav+(0.999*(model_.VBRBOT_i)))*(model_.slopebot)));
14231  }
14232  }
14233  ijunbot_d = ((((id+isrh)+itat)+ibbt)*fbreakdown);
14234  }
14235  if ((LSDRAIN_i==0))
14236  {
14237  ijunsti_d = 0;
14238  qjunsti_d = 0;
14239  }
14240  else
14241  {
14242  if (((model_.one_minus_PSTI)==0.5))
14243  {
14244  tmp = sqrt((1-(vj*(model_.vbiinvsti))));
14245  }
14246  else
14247  {
14248  tmp = pow((1-(vj*(model_.vbiinvsti))),(model_.one_minus_PSTI));
14249  }
14250  qjunsti_d = (((model_.qprefsti)*(1-tmp))+((model_.qpref2sti)*(Vjun_d-vj)));
14251  id = ((model_.idsatsti)*idmult);
14252  if ((((model_.CSRHSTI_i)==0)&&((model_.CTATSTI_i)==0)))
14253  {
14254  isrh = 0;
14255  }
14256  else
14257  {
14259  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
14260  if (((model_.PSTI_i)==0.5))
14261  {
14262  dwsrh = 0;
14263  }
14264  else
14265  {
14266  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PSTI_i))));
14267  }
14268  wsrh = (wsrhstep+dwsrh);
14269  if (((model_.PSTI_i)==0.5))
14270  {
14271  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRSTIinv)));
14272  }
14273  else
14274  {
14275  tmp = pow((vbi_minus_vjsrh*(model_.VBIRSTIinv)),(model_.PSTI_i));
14276  }
14277  wdep = ((model_.wdepnulrsti)*tmp);
14278  asrh = ((model_.ftdsti)*((zinv-1)*wdep));
14279  isrh = ((model_.CSRHSTI_i)*(asrh*wsrh));
14280  }
14281  if (((model_.CTATSTI_i)==0))
14282  {
14283  itat = 0;
14284  }
14285  else
14286  {
14288  twoatatoverthreebtat = ((0.666666666666667*(model_.atatsti))/btat);
14289  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
14290  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
14291  sqrtumax = sqrt(fabs(umax));
14292  umaxpoweronepointfive = (umax*sqrtumax);
14293  if ((((-(model_.PSTI_i))*(model_.one_over_one_minus_PSTI))==(-1)))
14294  {
14295  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
14296  }
14297  else
14298  {
14299  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PSTI_i))*(model_.one_over_one_minus_PSTI)));
14300  }
14301  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
14302  ktat = sqrt((0.375*(btat/sqrtumax)));
14303  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
14304  mtat = (((((model_.atatsti)*twoatatoverthreebtat)*sqrtumax)-((model_.atatsti)*umax))+(0.5*(btat*umaxpoweronepointfive)));
14305  xerfc = ((ltat-1)*ktat);
14306  ysq = (xerfc*xerfc);
14307  if ((xerfc>0))
14308  {
14309  terfc = (1/(1+((model_.perfc)*xerfc)));
14310  }
14311  else
14312  {
14313  terfc = (1/(1-((model_.perfc)*xerfc)));
14314  }
14315  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
14316  {
14317  tmp = exp(((-ysq)+mtat));
14318  }
14319  else
14320  {
14321  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
14322  }
14323  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
14324  if ((xerfc>0))
14325  {
14326  erfctimesexpmtat = erfcpos;
14327  }
14328  else
14329  {
14330  if ((mtat>(-2.3025850929940458e+02)))
14331  {
14332  tmp = exp(mtat);
14333  }
14334  else
14335  {
14336  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
14337  }
14338  erfctimesexpmtat = ((2*tmp)-erfcpos);
14339  }
14340  gammamax = ((1.77245385090551603*0.5)*(((model_.atatsti)*erfctimesexpmtat)/ktat));
14341  itat = ((model_.CTATSTI_i)*((asrh*gammamax)*wtat));
14342  }
14343  if (((model_.CBBTSTI_i)==0))
14344  {
14345  ibbt = 0;
14346  }
14347  else
14348  {
14349  if (((model_.PSTI_i)==0.5))
14350  {
14351  tmp = sqrt((((model_.VBIRSTI_i)-vbbt)*(model_.VBIRSTIinv)));
14352  }
14353  else
14354  {
14355  tmp = pow((((model_.VBIRSTI_i)-vbbt)*(model_.VBIRSTIinv)),(model_.PSTI_i));
14356  }
14357  Fmaxr = ((model_.one_over_one_minus_PSTI)*((((model_.VBIRSTI_i)-vbbt)*(model_.wdepnulrinvsti))/tmp));
14358  if ((fabs(((-(model_.fbbtsti))/Fmaxr))<2.3025850929940458e+02))
14359  {
14360  tmp = exp(((-(model_.fbbtsti))/Fmaxr));
14361  }
14362  else
14363  {
14364  if ((((-(model_.fbbtsti))/Fmaxr)<(-2.3025850929940458e+02)))
14365  {
14366  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*3.3333333333333333e-01))))))));
14367  }
14368  else
14369  {
14370  tmp = (1.0e100*(1.0+((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
14371  }
14372  }
14373  ibbt = ((model_.CBBTSTI_i)*(((Vjun_d*Fmaxr)*Fmaxr)*tmp));
14374  }
14375  if (((model_.VBRSTI_i)>1000))
14376  {
14377  fbreakdown = 1;
14378  }
14379  else
14380  {
14381  if ((vav>((-0.999)*(model_.VBRSTI_i))))
14382  {
14383  if (((model_.PBRSTI_i)==4))
14384  {
14385  tmp = (((fabs((vav*(model_.VBRinvsti)))*fabs((vav*(model_.VBRinvsti))))*fabs((vav*(model_.VBRinvsti))))*fabs((vav*(model_.VBRinvsti))));
14386  }
14387  else
14388  {
14389  tmp = pow(fabs((vav*(model_.VBRinvsti))),(model_.PBRSTI_i));
14390  }
14391  fbreakdown = (1/(1-tmp));
14392  }
14393  else
14394  {
14395  fbreakdown = ((model_.fstopsti)+((vav+(0.999*(model_.VBRSTI_i)))*(model_.slopesti)));
14396  }
14397  }
14398  ijunsti_d = ((((id+isrh)+itat)+ibbt)*fbreakdown);
14399  }
14400  if ((LGDRAIN_i==0))
14401  {
14402  ijungat_d = 0;
14403  qjungat_d = 0;
14404  }
14405  else
14406  {
14407  if (((model_.one_minus_PGAT)==0.5))
14408  {
14409  tmp = sqrt((1-(vj*(model_.vbiinvgat))));
14410  }
14411  else
14412  {
14413  tmp = pow((1-(vj*(model_.vbiinvgat))),(model_.one_minus_PGAT));
14414  }
14415  qjungat_d = (((model_.qprefgat)*(1-tmp))+((model_.qpref2gat)*(Vjun_d-vj)));
14416  id = ((model_.idsatgat)*idmult);
14417  if ((((model_.CSRHGAT_i)==0)&&((model_.CTATGAT_i)==0)))
14418  {
14419  isrh = 0;
14420  }
14421  else
14422  {
14424  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
14425  if (((model_.PGAT_i)==0.5))
14426  {
14427  dwsrh = 0;
14428  }
14429  else
14430  {
14431  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PGAT_i))));
14432  }
14433  wsrh = (wsrhstep+dwsrh);
14434  if (((model_.PGAT_i)==0.5))
14435  {
14436  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRGATinv)));
14437  }
14438  else
14439  {
14440  tmp = pow((vbi_minus_vjsrh*(model_.VBIRGATinv)),(model_.PGAT_i));
14441  }
14442  wdep = ((model_.wdepnulrgat)*tmp);
14443  asrh = ((model_.ftdgat)*((zinv-1)*wdep));
14444  isrh = ((model_.CSRHGAT_i)*(asrh*wsrh));
14445  }
14446  if (((model_.CTATGAT_i)==0))
14447  {
14448  itat = 0;
14449  }
14450  else
14451  {
14453  twoatatoverthreebtat = ((0.666666666666667*(model_.atatgat))/btat);
14454  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
14455  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
14456  sqrtumax = sqrt(fabs(umax));
14457  umaxpoweronepointfive = (umax*sqrtumax);
14458  if ((((-(model_.PGAT_i))*(model_.one_over_one_minus_PGAT))==(-1)))
14459  {
14460  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
14461  }
14462  else
14463  {
14464  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PGAT_i))*(model_.one_over_one_minus_PGAT)));
14465  }
14466  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
14467  ktat = sqrt((0.375*(btat/sqrtumax)));
14468  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
14469  mtat = (((((model_.atatgat)*twoatatoverthreebtat)*sqrtumax)-((model_.atatgat)*umax))+(0.5*(btat*umaxpoweronepointfive)));
14470  xerfc = ((ltat-1)*ktat);
14471  ysq = (xerfc*xerfc);
14472  if ((xerfc>0))
14473  {
14474  terfc = (1/(1+((model_.perfc)*xerfc)));
14475  }
14476  else
14477  {
14478  terfc = (1/(1-((model_.perfc)*xerfc)));
14479  }
14480  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
14481  {
14482  tmp = exp(((-ysq)+mtat));
14483  }
14484  else
14485  {
14486  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
14487  }
14488  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
14489  if ((xerfc>0))
14490  {
14491  erfctimesexpmtat = erfcpos;
14492  }
14493  else
14494  {
14495  if ((mtat>(-2.3025850929940458e+02)))
14496  {
14497  tmp = exp(mtat);
14498  }
14499  else
14500  {
14501  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
14502  }
14503  erfctimesexpmtat = ((2*tmp)-erfcpos);
14504  }
14505  gammamax = ((1.77245385090551603*0.5)*(((model_.atatgat)*erfctimesexpmtat)/ktat));
14506  itat = ((model_.CTATGAT_i)*((asrh*gammamax)*wtat));
14507  }
14508  if (((model_.CBBTGAT_i)==0))
14509  {
14510  ibbt = 0;
14511  }
14512  else
14513  {
14514  if (((model_.PGAT_i)==0.5))
14515  {
14516  tmp = sqrt((((model_.VBIRGAT_i)-vbbt)*(model_.VBIRGATinv)));
14517  }
14518  else
14519  {
14520  tmp = pow((((model_.VBIRGAT_i)-vbbt)*(model_.VBIRGATinv)),(model_.PGAT_i));
14521  }
14522  Fmaxr = ((model_.one_over_one_minus_PGAT)*((((model_.VBIRGAT_i)-vbbt)*(model_.wdepnulrinvgat))/tmp));
14523  if ((fabs(((-(model_.fbbtgat))/Fmaxr))<2.3025850929940458e+02))
14524  {
14525  tmp = exp(((-(model_.fbbtgat))/Fmaxr));
14526  }
14527  else
14528  {
14529  if ((((-(model_.fbbtgat))/Fmaxr)<(-2.3025850929940458e+02)))
14530  {
14531  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*3.3333333333333333e-01))))))));
14532  }
14533  else
14534  {
14535  tmp = (1.0e100*(1.0+((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
14536  }
14537  }
14538  ibbt = ((model_.CBBTGAT_i)*(((Vjun_d*Fmaxr)*Fmaxr)*tmp));
14539  }
14540  if (((model_.VBRGAT_i)>1000))
14541  {
14542  fbreakdown = 1;
14543  }
14544  else
14545  {
14546  if ((vav>((-0.999)*(model_.VBRGAT_i))))
14547  {
14548  if (((model_.PBRGAT_i)==4))
14549  {
14550  tmp = (((fabs((vav*(model_.VBRinvgat)))*fabs((vav*(model_.VBRinvgat))))*fabs((vav*(model_.VBRinvgat))))*fabs((vav*(model_.VBRinvgat))));
14551  }
14552  else
14553  {
14554  tmp = pow(fabs((vav*(model_.VBRinvgat))),(model_.PBRGAT_i));
14555  }
14556  fbreakdown = (1/(1-tmp));
14557  }
14558  else
14559  {
14560  fbreakdown = ((model_.fstopgat)+((vav+(0.999*(model_.VBRGAT_i)))*(model_.slopegat)));
14561  }
14562  }
14563  ijungat_d = ((((id+isrh)+itat)+ibbt)*fbreakdown);
14564  }
14566  }
14567  }
14568  }
14569  // End block evaluateStaticDynamic
14570  //Begin block loadStatic
14571  {
14572  Idse = (MULT_i*Ids);
14573  Igbe = (MULT_i*Igb);
14574  Igcse = (MULT_i*Igcs);
14575  Igcde = (MULT_i*Igcd);
14576  Igsove = (MULT_i*Igsov);
14577  Igdove = (MULT_i*Igdov);
14578  Igidle = (MULT_i*Igidl);
14579  Igisle = (MULT_i*Igisl);
14580  Iimpacte = (MULT_i*Iimpact);
14581  ijun_s = (MULT_i*ijun_s);
14582  ijun_d = (MULT_i*ijun_d);
14583  if ((sigVds>0))
14584  {
14585  // I(DI,BP) <+ ((CHNL_TYPE*Iimpacte))
14588  // I(DI,SI) <+ ((CHNL_TYPE*Idse))
14591  // I(GP,SI) <+ ((CHNL_TYPE*Igcse))
14594  // I(GP,DI) <+ ((CHNL_TYPE*Igcde))
14597  }
14598  else
14599  {
14600  // I(SI,BP) <+ ((CHNL_TYPE*Iimpacte))
14603  // I(SI,DI) <+ ((CHNL_TYPE*Idse))
14606  // I(GP,DI) <+ ((CHNL_TYPE*Igcse))
14609  // I(GP,SI) <+ ((CHNL_TYPE*Igcde))
14612  }
14613  // I(GP,BP) <+ ((CHNL_TYPE*Igbe))
14616  // I(GP,SI) <+ ((CHNL_TYPE*Igsove))
14619  // I(GP,DI) <+ ((CHNL_TYPE*Igdove))
14622  // I(SI,BP) <+ ((CHNL_TYPE*Igisle))
14625  // I(DI,BP) <+ ((CHNL_TYPE*Igidle))
14628  // I(BS,SI) <+ ((CHNL_TYPE*ijun_s))
14631  // I(BD,DI) <+ ((CHNL_TYPE*ijun_d))
14634  rgatenoise = (((model_.nt0)*MULT_i)*ggate);
14635  rsourcenoise = (((model_.nt0)*MULT_i)*gsource);
14636  rdrainnoise = (((model_.nt0)*MULT_i)*gdrain);
14637  rbulknoise = (((model_.nt0)*MULT_i)*gbulk);
14638  rjunsnoise = (((model_.nt0)*MULT_i)*gjuns);
14639  rjundnoise = (((model_.nt0)*MULT_i)*gjund);
14640  rwellnoise = (((model_.nt0)*MULT_i)*gwell);
14641  if ((RG_i>0.0))
14642  {
14643  // I(G,GP) <+ (((MULT_i*ggate)*V(G,GP)))
14645  staticContributions[admsNodeID_GP] -= ((MULT_i*ggate)*(probeVars[admsProbeID_V_G_GP]));
14646  // I(G,GP) <+ (white_noise(rgatenoise,"rgate"))
14647  }
14648  else
14649  {
14650  // V(G,GP) <+ (0.0)
14651  // do nothing at all
14652  }
14653  if ((RSE_i>0.0))
14654  {
14655  // I(S,SI) <+ (((MULT_i*gsource)*V(S,SI)))
14657  staticContributions[admsNodeID_SI] -= ((MULT_i*gsource)*(probeVars[admsProbeID_V_S_SI]));
14658  // I(S,SI) <+ (white_noise(rsourcenoise,"rsource"))
14659  }
14660  else
14661  {
14662  // V(S,SI) <+ (0.0)
14663  // do nothing at all
14664  }
14665  if ((RDE_i>0.0))
14666  {
14667  // I(D,DI) <+ (((MULT_i*gdrain)*V(D,DI)))
14669  staticContributions[admsNodeID_DI] -= ((MULT_i*gdrain)*(probeVars[admsProbeID_V_D_DI]));
14670  // I(D,DI) <+ (white_noise(rdrainnoise,"rdrain"))
14671  }
14672  else
14673  {
14674  // V(D,DI) <+ (0.0)
14675  // do nothing at all
14676  }
14677  if ((RBULK_i>0.0))
14678  {
14679  // I(BP,BI) <+ (((MULT_i*gbulk)*V(BP,BI)))
14681  staticContributions[admsNodeID_BI] -= ((MULT_i*gbulk)*(probeVars[admsProbeID_V_BP_BI]));
14682  // I(BP,BI) <+ (white_noise(rbulknoise,"rbulk"))
14683  }
14684  else
14685  {
14686  // V(BP,BI) <+ (0.0)
14687  // do nothing at all
14688  }
14689  if ((RJUNS_i>0.0))
14690  {
14691  // I(BS,BI) <+ (((MULT_i*gjuns)*V(BS,BI)))
14693  staticContributions[admsNodeID_BI] -= ((MULT_i*gjuns)*(probeVars[admsProbeID_V_BS_BI]));
14694  // I(BS,BI) <+ (white_noise(rjunsnoise,"rjuns"))
14695  }
14696  else
14697  {
14698  // V(BS,BI) <+ (0.0)
14699  // do nothing at all
14700  }
14701  if ((RJUND_i>0.0))
14702  {
14703  // I(BD,BI) <+ (((MULT_i*gjund)*V(BD,BI)))
14705  staticContributions[admsNodeID_BI] -= ((MULT_i*gjund)*(probeVars[admsProbeID_V_BD_BI]));
14706  // I(BD,BI) <+ (white_noise(rjundnoise,"rjund"))
14707  }
14708  else
14709  {
14710  // V(BD,BI) <+ (0.0)
14711  // do nothing at all
14712  }
14713  if ((RWELL_i>0.0))
14714  {
14715  // I(B,BI) <+ (((MULT_i*gwell)*V(B,BI)))
14717  staticContributions[admsNodeID_BI] -= ((MULT_i*gwell)*(probeVars[admsProbeID_V_B_BI]));
14718  // I(B,BI) <+ (white_noise(rwellnoise,"rwell"))
14719  }
14720  else
14721  {
14722  // V(B,BI) <+ (0.0)
14723  // do nothing at all
14724  }
14725  // I(DI,SI) <+ ((1E-15*V(DI,SI)))
14728  }
14729  // End block loadStatic
14730  //Begin block loadDynamic
14731  {
14732  Qg = (MULT_i*Qg);
14733  Qb = (MULT_i*Qb);
14734  Qd = (MULT_i*Qd);
14735  Qs = (-((Qg+Qb)+Qd));
14736  Qfgs = (MULT_i*(Qfgs+Qgs_ov));
14737  Qfgd = (MULT_i*(Qfgd+Qgd_ov));
14738  Qgb_ov = (MULT_i*Qgb_ov);
14741  if ((sigVds<0))
14742  {
14743  temp = Qd;
14744  Qd = Qs;
14745  Qs = temp;
14746  }
14747  // I(GP,SI) <+ (ddt((CHNL_TYPE*Qg)))
14750  // I(BP,SI) <+ (ddt((CHNL_TYPE*Qb)))
14753  // I(DI,SI) <+ (ddt((CHNL_TYPE*Qd)))
14756  // I(GP,SI) <+ (ddt((CHNL_TYPE*Qfgs)))
14759  // I(GP,DI) <+ (ddt((CHNL_TYPE*Qfgd)))
14762  // I(GP,BP) <+ (ddt((CHNL_TYPE*Qgb_ov)))
14765  // I(BS,SI) <+ (ddt((CHNL_TYPE*qjun_s)))
14768  // I(BD,DI) <+ (ddt((CHNL_TYPE*qjun_d)))
14771  }
14772  // End block loadDynamic
14773 
14774 
14775  // -- endcode converted from analog/code block
14776 #ifdef Xyce_DEBUG_DEVICE
14778  {
14779  Xyce::dout() << " probeVars[admsProbeID_V_DI_BD] = "
14780  <<probeVars[admsProbeID_V_DI_BD].val() << std::endl;
14781  Xyce::dout() << " probeVars[admsProbeID_V_SI_BS] = "
14782  <<probeVars[admsProbeID_V_SI_BS].val() << std::endl;
14783  Xyce::dout() << " probeVars[admsProbeID_V_SI_BP] = "
14784  <<probeVars[admsProbeID_V_SI_BP].val() << std::endl;
14785  Xyce::dout() << " probeVars[admsProbeID_V_DI_SI] = "
14786  <<probeVars[admsProbeID_V_DI_SI].val() << std::endl;
14787  Xyce::dout() << " probeVars[admsProbeID_V_GP_SI] = "
14788  <<probeVars[admsProbeID_V_GP_SI].val() << std::endl;
14789  Xyce::dout() << " probeVars[admsProbeID_V_B_BI] = "
14790  <<probeVars[admsProbeID_V_B_BI].val() << std::endl;
14791  Xyce::dout() << " probeVars[admsProbeID_V_BP_BI] = "
14792  <<probeVars[admsProbeID_V_BP_BI].val() << std::endl;
14793  Xyce::dout() << " probeVars[admsProbeID_V_BD_BI] = "
14794  <<probeVars[admsProbeID_V_BD_BI].val() << std::endl;
14795  Xyce::dout() << " probeVars[admsProbeID_V_BS_BI] = "
14796  <<probeVars[admsProbeID_V_BS_BI].val() << std::endl;
14797  Xyce::dout() << " probeVars[admsProbeID_V_D_DI] = "
14798  <<probeVars[admsProbeID_V_D_DI].val() << std::endl;
14799  Xyce::dout() << " probeVars[admsProbeID_V_S_SI] = "
14800  <<probeVars[admsProbeID_V_S_SI].val() << std::endl;
14801  Xyce::dout() << " probeVars[admsProbeID_V_G_GP] = "
14802  <<probeVars[admsProbeID_V_G_GP].val() << std::endl;
14803  Xyce::dout() << " staticContributions[admsNodeID_D] = "
14804  <<staticContributions[admsNodeID_D].val() << std::endl;
14805  Xyce::dout() << " staticContributions[admsNodeID_D].dx(admsProbeID_V_DI_BD) = " <<staticContributions[admsNodeID_D].dx(admsProbeID_V_DI_BD) << std::endl;
14806  Xyce::dout() << " staticContributions[admsNodeID_D].dx(admsProbeID_V_SI_BS) = " <<staticContributions[admsNodeID_D].dx(admsProbeID_V_SI_BS) << std::endl;
14807  Xyce::dout() << " staticContributions[admsNodeID_D].dx(admsProbeID_V_SI_BP) = " <<staticContributions[admsNodeID_D].dx(admsProbeID_V_SI_BP) << std::endl;
14808  Xyce::dout() << " staticContributions[admsNodeID_D].dx(admsProbeID_V_DI_SI) = " <<staticContributions[admsNodeID_D].dx(admsProbeID_V_DI_SI) << std::endl;
14809  Xyce::dout() << " staticContributions[admsNodeID_D].dx(admsProbeID_V_GP_SI) = " <<staticContributions[admsNodeID_D].dx(admsProbeID_V_GP_SI) << std::endl;
14810  Xyce::dout() << " staticContributions[admsNodeID_D].dx(admsProbeID_V_B_BI) = " <<staticContributions[admsNodeID_D].dx(admsProbeID_V_B_BI) << std::endl;
14811  Xyce::dout() << " staticContributions[admsNodeID_D].dx(admsProbeID_V_BP_BI) = " <<staticContributions[admsNodeID_D].dx(admsProbeID_V_BP_BI) << std::endl;
14812  Xyce::dout() << " staticContributions[admsNodeID_D].dx(admsProbeID_V_BD_BI) = " <<staticContributions[admsNodeID_D].dx(admsProbeID_V_BD_BI) << std::endl;
14813  Xyce::dout() << " staticContributions[admsNodeID_D].dx(admsProbeID_V_BS_BI) = " <<staticContributions[admsNodeID_D].dx(admsProbeID_V_BS_BI) << std::endl;
14814  Xyce::dout() << " staticContributions[admsNodeID_D].dx(admsProbeID_V_D_DI) = " <<staticContributions[admsNodeID_D].dx(admsProbeID_V_D_DI) << std::endl;
14815  Xyce::dout() << " staticContributions[admsNodeID_D].dx(admsProbeID_V_S_SI) = " <<staticContributions[admsNodeID_D].dx(admsProbeID_V_S_SI) << std::endl;
14816  Xyce::dout() << " staticContributions[admsNodeID_D].dx(admsProbeID_V_G_GP) = " <<staticContributions[admsNodeID_D].dx(admsProbeID_V_G_GP) << std::endl;
14817  Xyce::dout() << " dynamicContributions[admsNodeID_D] = "
14818  <<dynamicContributions[admsNodeID_D].val() << std::endl;
14819  Xyce::dout() << " dynamicContributions[admsNodeID_D].dx(admsProbeID_V_DI_BD) = " <<dynamicContributions[admsNodeID_D].dx(admsProbeID_V_DI_BD) << std::endl;
14820  Xyce::dout() << " dynamicContributions[admsNodeID_D].dx(admsProbeID_V_SI_BS) = " <<dynamicContributions[admsNodeID_D].dx(admsProbeID_V_SI_BS) << std::endl;
14821  Xyce::dout() << " dynamicContributions[admsNodeID_D].dx(admsProbeID_V_SI_BP) = " <<dynamicContributions[admsNodeID_D].dx(admsProbeID_V_SI_BP) << std::endl;
14822  Xyce::dout() << " dynamicContributions[admsNodeID_D].dx(admsProbeID_V_DI_SI) = " <<dynamicContributions[admsNodeID_D].dx(admsProbeID_V_DI_SI) << std::endl;
14823  Xyce::dout() << " dynamicContributions[admsNodeID_D].dx(admsProbeID_V_GP_SI) = " <<dynamicContributions[admsNodeID_D].dx(admsProbeID_V_GP_SI) << std::endl;
14824  Xyce::dout() << " dynamicContributions[admsNodeID_D].dx(admsProbeID_V_B_BI) = " <<dynamicContributions[admsNodeID_D].dx(admsProbeID_V_B_BI) << std::endl;
14825  Xyce::dout() << " dynamicContributions[admsNodeID_D].dx(admsProbeID_V_BP_BI) = " <<dynamicContributions[admsNodeID_D].dx(admsProbeID_V_BP_BI) << std::endl;
14826  Xyce::dout() << " dynamicContributions[admsNodeID_D].dx(admsProbeID_V_BD_BI) = " <<dynamicContributions[admsNodeID_D].dx(admsProbeID_V_BD_BI) << std::endl;
14827  Xyce::dout() << " dynamicContributions[admsNodeID_D].dx(admsProbeID_V_BS_BI) = " <<dynamicContributions[admsNodeID_D].dx(admsProbeID_V_BS_BI) << std::endl;
14828  Xyce::dout() << " dynamicContributions[admsNodeID_D].dx(admsProbeID_V_D_DI) = " <<dynamicContributions[admsNodeID_D].dx(admsProbeID_V_D_DI) << std::endl;
14829  Xyce::dout() << " dynamicContributions[admsNodeID_D].dx(admsProbeID_V_S_SI) = " <<dynamicContributions[admsNodeID_D].dx(admsProbeID_V_S_SI) << std::endl;
14830  Xyce::dout() << " dynamicContributions[admsNodeID_D].dx(admsProbeID_V_G_GP) = " <<dynamicContributions[admsNodeID_D].dx(admsProbeID_V_G_GP) << std::endl;
14831  Xyce::dout() << " staticContributions[admsNodeID_G] = "
14832  <<staticContributions[admsNodeID_G].val() << std::endl;
14833  Xyce::dout() << " staticContributions[admsNodeID_G].dx(admsProbeID_V_DI_BD) = " <<staticContributions[admsNodeID_G].dx(admsProbeID_V_DI_BD) << std::endl;
14834  Xyce::dout() << " staticContributions[admsNodeID_G].dx(admsProbeID_V_SI_BS) = " <<staticContributions[admsNodeID_G].dx(admsProbeID_V_SI_BS) << std::endl;
14835  Xyce::dout() << " staticContributions[admsNodeID_G].dx(admsProbeID_V_SI_BP) = " <<staticContributions[admsNodeID_G].dx(admsProbeID_V_SI_BP) << std::endl;
14836  Xyce::dout() << " staticContributions[admsNodeID_G].dx(admsProbeID_V_DI_SI) = " <<staticContributions[admsNodeID_G].dx(admsProbeID_V_DI_SI) << std::endl;
14837  Xyce::dout() << " staticContributions[admsNodeID_G].dx(admsProbeID_V_GP_SI) = " <<staticContributions[admsNodeID_G].dx(admsProbeID_V_GP_SI) << std::endl;
14838  Xyce::dout() << " staticContributions[admsNodeID_G].dx(admsProbeID_V_B_BI) = " <<staticContributions[admsNodeID_G].dx(admsProbeID_V_B_BI) << std::endl;
14839  Xyce::dout() << " staticContributions[admsNodeID_G].dx(admsProbeID_V_BP_BI) = " <<staticContributions[admsNodeID_G].dx(admsProbeID_V_BP_BI) << std::endl;
14840  Xyce::dout() << " staticContributions[admsNodeID_G].dx(admsProbeID_V_BD_BI) = " <<staticContributions[admsNodeID_G].dx(admsProbeID_V_BD_BI) << std::endl;
14841  Xyce::dout() << " staticContributions[admsNodeID_G].dx(admsProbeID_V_BS_BI) = " <<staticContributions[admsNodeID_G].dx(admsProbeID_V_BS_BI) << std::endl;
14842  Xyce::dout() << " staticContributions[admsNodeID_G].dx(admsProbeID_V_D_DI) = " <<staticContributions[admsNodeID_G].dx(admsProbeID_V_D_DI) << std::endl;
14843  Xyce::dout() << " staticContributions[admsNodeID_G].dx(admsProbeID_V_S_SI) = " <<staticContributions[admsNodeID_G].dx(admsProbeID_V_S_SI) << std::endl;
14844  Xyce::dout() << " staticContributions[admsNodeID_G].dx(admsProbeID_V_G_GP) = " <<staticContributions[admsNodeID_G].dx(admsProbeID_V_G_GP) << std::endl;
14845  Xyce::dout() << " dynamicContributions[admsNodeID_G] = "
14846  <<dynamicContributions[admsNodeID_G].val() << std::endl;
14847  Xyce::dout() << " dynamicContributions[admsNodeID_G].dx(admsProbeID_V_DI_BD) = " <<dynamicContributions[admsNodeID_G].dx(admsProbeID_V_DI_BD) << std::endl;
14848  Xyce::dout() << " dynamicContributions[admsNodeID_G].dx(admsProbeID_V_SI_BS) = " <<dynamicContributions[admsNodeID_G].dx(admsProbeID_V_SI_BS) << std::endl;
14849  Xyce::dout() << " dynamicContributions[admsNodeID_G].dx(admsProbeID_V_SI_BP) = " <<dynamicContributions[admsNodeID_G].dx(admsProbeID_V_SI_BP) << std::endl;
14850  Xyce::dout() << " dynamicContributions[admsNodeID_G].dx(admsProbeID_V_DI_SI) = " <<dynamicContributions[admsNodeID_G].dx(admsProbeID_V_DI_SI) << std::endl;
14851  Xyce::dout() << " dynamicContributions[admsNodeID_G].dx(admsProbeID_V_GP_SI) = " <<dynamicContributions[admsNodeID_G].dx(admsProbeID_V_GP_SI) << std::endl;
14852  Xyce::dout() << " dynamicContributions[admsNodeID_G].dx(admsProbeID_V_B_BI) = " <<dynamicContributions[admsNodeID_G].dx(admsProbeID_V_B_BI) << std::endl;
14853  Xyce::dout() << " dynamicContributions[admsNodeID_G].dx(admsProbeID_V_BP_BI) = " <<dynamicContributions[admsNodeID_G].dx(admsProbeID_V_BP_BI) << std::endl;
14854  Xyce::dout() << " dynamicContributions[admsNodeID_G].dx(admsProbeID_V_BD_BI) = " <<dynamicContributions[admsNodeID_G].dx(admsProbeID_V_BD_BI) << std::endl;
14855  Xyce::dout() << " dynamicContributions[admsNodeID_G].dx(admsProbeID_V_BS_BI) = " <<dynamicContributions[admsNodeID_G].dx(admsProbeID_V_BS_BI) << std::endl;
14856  Xyce::dout() << " dynamicContributions[admsNodeID_G].dx(admsProbeID_V_D_DI) = " <<dynamicContributions[admsNodeID_G].dx(admsProbeID_V_D_DI) << std::endl;
14857  Xyce::dout() << " dynamicContributions[admsNodeID_G].dx(admsProbeID_V_S_SI) = " <<dynamicContributions[admsNodeID_G].dx(admsProbeID_V_S_SI) << std::endl;
14858  Xyce::dout() << " dynamicContributions[admsNodeID_G].dx(admsProbeID_V_G_GP) = " <<dynamicContributions[admsNodeID_G].dx(admsProbeID_V_G_GP) << std::endl;
14859  Xyce::dout() << " staticContributions[admsNodeID_S] = "
14860  <<staticContributions[admsNodeID_S].val() << std::endl;
14861  Xyce::dout() << " staticContributions[admsNodeID_S].dx(admsProbeID_V_DI_BD) = " <<staticContributions[admsNodeID_S].dx(admsProbeID_V_DI_BD) << std::endl;
14862  Xyce::dout() << " staticContributions[admsNodeID_S].dx(admsProbeID_V_SI_BS) = " <<staticContributions[admsNodeID_S].dx(admsProbeID_V_SI_BS) << std::endl;
14863  Xyce::dout() << " staticContributions[admsNodeID_S].dx(admsProbeID_V_SI_BP) = " <<staticContributions[admsNodeID_S].dx(admsProbeID_V_SI_BP) << std::endl;
14864  Xyce::dout() << " staticContributions[admsNodeID_S].dx(admsProbeID_V_DI_SI) = " <<staticContributions[admsNodeID_S].dx(admsProbeID_V_DI_SI) << std::endl;
14865  Xyce::dout() << " staticContributions[admsNodeID_S].dx(admsProbeID_V_GP_SI) = " <<staticContributions[admsNodeID_S].dx(admsProbeID_V_GP_SI) << std::endl;
14866  Xyce::dout() << " staticContributions[admsNodeID_S].dx(admsProbeID_V_B_BI) = " <<staticContributions[admsNodeID_S].dx(admsProbeID_V_B_BI) << std::endl;
14867  Xyce::dout() << " staticContributions[admsNodeID_S].dx(admsProbeID_V_BP_BI) = " <<staticContributions[admsNodeID_S].dx(admsProbeID_V_BP_BI) << std::endl;
14868  Xyce::dout() << " staticContributions[admsNodeID_S].dx(admsProbeID_V_BD_BI) = " <<staticContributions[admsNodeID_S].dx(admsProbeID_V_BD_BI) << std::endl;
14869  Xyce::dout() << " staticContributions[admsNodeID_S].dx(admsProbeID_V_BS_BI) = " <<staticContributions[admsNodeID_S].dx(admsProbeID_V_BS_BI) << std::endl;
14870  Xyce::dout() << " staticContributions[admsNodeID_S].dx(admsProbeID_V_D_DI) = " <<staticContributions[admsNodeID_S].dx(admsProbeID_V_D_DI) << std::endl;
14871  Xyce::dout() << " staticContributions[admsNodeID_S].dx(admsProbeID_V_S_SI) = " <<staticContributions[admsNodeID_S].dx(admsProbeID_V_S_SI) << std::endl;
14872  Xyce::dout() << " staticContributions[admsNodeID_S].dx(admsProbeID_V_G_GP) = " <<staticContributions[admsNodeID_S].dx(admsProbeID_V_G_GP) << std::endl;
14873  Xyce::dout() << " dynamicContributions[admsNodeID_S] = "
14874  <<dynamicContributions[admsNodeID_S].val() << std::endl;
14875  Xyce::dout() << " dynamicContributions[admsNodeID_S].dx(admsProbeID_V_DI_BD) = " <<dynamicContributions[admsNodeID_S].dx(admsProbeID_V_DI_BD) << std::endl;
14876  Xyce::dout() << " dynamicContributions[admsNodeID_S].dx(admsProbeID_V_SI_BS) = " <<dynamicContributions[admsNodeID_S].dx(admsProbeID_V_SI_BS) << std::endl;
14877  Xyce::dout() << " dynamicContributions[admsNodeID_S].dx(admsProbeID_V_SI_BP) = " <<dynamicContributions[admsNodeID_S].dx(admsProbeID_V_SI_BP) << std::endl;
14878  Xyce::dout() << " dynamicContributions[admsNodeID_S].dx(admsProbeID_V_DI_SI) = " <<dynamicContributions[admsNodeID_S].dx(admsProbeID_V_DI_SI) << std::endl;
14879  Xyce::dout() << " dynamicContributions[admsNodeID_S].dx(admsProbeID_V_GP_SI) = " <<dynamicContributions[admsNodeID_S].dx(admsProbeID_V_GP_SI) << std::endl;
14880  Xyce::dout() << " dynamicContributions[admsNodeID_S].dx(admsProbeID_V_B_BI) = " <<dynamicContributions[admsNodeID_S].dx(admsProbeID_V_B_BI) << std::endl;
14881  Xyce::dout() << " dynamicContributions[admsNodeID_S].dx(admsProbeID_V_BP_BI) = " <<dynamicContributions[admsNodeID_S].dx(admsProbeID_V_BP_BI) << std::endl;
14882  Xyce::dout() << " dynamicContributions[admsNodeID_S].dx(admsProbeID_V_BD_BI) = " <<dynamicContributions[admsNodeID_S].dx(admsProbeID_V_BD_BI) << std::endl;
14883  Xyce::dout() << " dynamicContributions[admsNodeID_S].dx(admsProbeID_V_BS_BI) = " <<dynamicContributions[admsNodeID_S].dx(admsProbeID_V_BS_BI) << std::endl;
14884  Xyce::dout() << " dynamicContributions[admsNodeID_S].dx(admsProbeID_V_D_DI) = " <<dynamicContributions[admsNodeID_S].dx(admsProbeID_V_D_DI) << std::endl;
14885  Xyce::dout() << " dynamicContributions[admsNodeID_S].dx(admsProbeID_V_S_SI) = " <<dynamicContributions[admsNodeID_S].dx(admsProbeID_V_S_SI) << std::endl;
14886  Xyce::dout() << " dynamicContributions[admsNodeID_S].dx(admsProbeID_V_G_GP) = " <<dynamicContributions[admsNodeID_S].dx(admsProbeID_V_G_GP) << std::endl;
14887  Xyce::dout() << " staticContributions[admsNodeID_B] = "
14888  <<staticContributions[admsNodeID_B].val() << std::endl;
14889  Xyce::dout() << " staticContributions[admsNodeID_B].dx(admsProbeID_V_DI_BD) = " <<staticContributions[admsNodeID_B].dx(admsProbeID_V_DI_BD) << std::endl;
14890  Xyce::dout() << " staticContributions[admsNodeID_B].dx(admsProbeID_V_SI_BS) = " <<staticContributions[admsNodeID_B].dx(admsProbeID_V_SI_BS) << std::endl;
14891  Xyce::dout() << " staticContributions[admsNodeID_B].dx(admsProbeID_V_SI_BP) = " <<staticContributions[admsNodeID_B].dx(admsProbeID_V_SI_BP) << std::endl;
14892  Xyce::dout() << " staticContributions[admsNodeID_B].dx(admsProbeID_V_DI_SI) = " <<staticContributions[admsNodeID_B].dx(admsProbeID_V_DI_SI) << std::endl;
14893  Xyce::dout() << " staticContributions[admsNodeID_B].dx(admsProbeID_V_GP_SI) = " <<staticContributions[admsNodeID_B].dx(admsProbeID_V_GP_SI) << std::endl;
14894  Xyce::dout() << " staticContributions[admsNodeID_B].dx(admsProbeID_V_B_BI) = " <<staticContributions[admsNodeID_B].dx(admsProbeID_V_B_BI) << std::endl;
14895  Xyce::dout() << " staticContributions[admsNodeID_B].dx(admsProbeID_V_BP_BI) = " <<staticContributions[admsNodeID_B].dx(admsProbeID_V_BP_BI) << std::endl;
14896  Xyce::dout() << " staticContributions[admsNodeID_B].dx(admsProbeID_V_BD_BI) = " <<staticContributions[admsNodeID_B].dx(admsProbeID_V_BD_BI) << std::endl;
14897  Xyce::dout() << " staticContributions[admsNodeID_B].dx(admsProbeID_V_BS_BI) = " <<staticContributions[admsNodeID_B].dx(admsProbeID_V_BS_BI) << std::endl;
14898  Xyce::dout() << " staticContributions[admsNodeID_B].dx(admsProbeID_V_D_DI) = " <<staticContributions[admsNodeID_B].dx(admsProbeID_V_D_DI) << std::endl;
14899  Xyce::dout() << " staticContributions[admsNodeID_B].dx(admsProbeID_V_S_SI) = " <<staticContributions[admsNodeID_B].dx(admsProbeID_V_S_SI) << std::endl;
14900  Xyce::dout() << " staticContributions[admsNodeID_B].dx(admsProbeID_V_G_GP) = " <<staticContributions[admsNodeID_B].dx(admsProbeID_V_G_GP) << std::endl;
14901  Xyce::dout() << " dynamicContributions[admsNodeID_B] = "
14902  <<dynamicContributions[admsNodeID_B].val() << std::endl;
14903  Xyce::dout() << " dynamicContributions[admsNodeID_B].dx(admsProbeID_V_DI_BD) = " <<dynamicContributions[admsNodeID_B].dx(admsProbeID_V_DI_BD) << std::endl;
14904  Xyce::dout() << " dynamicContributions[admsNodeID_B].dx(admsProbeID_V_SI_BS) = " <<dynamicContributions[admsNodeID_B].dx(admsProbeID_V_SI_BS) << std::endl;
14905  Xyce::dout() << " dynamicContributions[admsNodeID_B].dx(admsProbeID_V_SI_BP) = " <<dynamicContributions[admsNodeID_B].dx(admsProbeID_V_SI_BP) << std::endl;
14906  Xyce::dout() << " dynamicContributions[admsNodeID_B].dx(admsProbeID_V_DI_SI) = " <<dynamicContributions[admsNodeID_B].dx(admsProbeID_V_DI_SI) << std::endl;
14907  Xyce::dout() << " dynamicContributions[admsNodeID_B].dx(admsProbeID_V_GP_SI) = " <<dynamicContributions[admsNodeID_B].dx(admsProbeID_V_GP_SI) << std::endl;
14908  Xyce::dout() << " dynamicContributions[admsNodeID_B].dx(admsProbeID_V_B_BI) = " <<dynamicContributions[admsNodeID_B].dx(admsProbeID_V_B_BI) << std::endl;
14909  Xyce::dout() << " dynamicContributions[admsNodeID_B].dx(admsProbeID_V_BP_BI) = " <<dynamicContributions[admsNodeID_B].dx(admsProbeID_V_BP_BI) << std::endl;
14910  Xyce::dout() << " dynamicContributions[admsNodeID_B].dx(admsProbeID_V_BD_BI) = " <<dynamicContributions[admsNodeID_B].dx(admsProbeID_V_BD_BI) << std::endl;
14911  Xyce::dout() << " dynamicContributions[admsNodeID_B].dx(admsProbeID_V_BS_BI) = " <<dynamicContributions[admsNodeID_B].dx(admsProbeID_V_BS_BI) << std::endl;
14912  Xyce::dout() << " dynamicContributions[admsNodeID_B].dx(admsProbeID_V_D_DI) = " <<dynamicContributions[admsNodeID_B].dx(admsProbeID_V_D_DI) << std::endl;
14913  Xyce::dout() << " dynamicContributions[admsNodeID_B].dx(admsProbeID_V_S_SI) = " <<dynamicContributions[admsNodeID_B].dx(admsProbeID_V_S_SI) << std::endl;
14914  Xyce::dout() << " dynamicContributions[admsNodeID_B].dx(admsProbeID_V_G_GP) = " <<dynamicContributions[admsNodeID_B].dx(admsProbeID_V_G_GP) << std::endl;
14915  Xyce::dout() << " staticContributions[admsNodeID_GP] = "
14916  <<staticContributions[admsNodeID_GP].val() << std::endl;
14917  Xyce::dout() << " staticContributions[admsNodeID_GP].dx(admsProbeID_V_DI_BD) = " <<staticContributions[admsNodeID_GP].dx(admsProbeID_V_DI_BD) << std::endl;
14918  Xyce::dout() << " staticContributions[admsNodeID_GP].dx(admsProbeID_V_SI_BS) = " <<staticContributions[admsNodeID_GP].dx(admsProbeID_V_SI_BS) << std::endl;
14919  Xyce::dout() << " staticContributions[admsNodeID_GP].dx(admsProbeID_V_SI_BP) = " <<staticContributions[admsNodeID_GP].dx(admsProbeID_V_SI_BP) << std::endl;
14920  Xyce::dout() << " staticContributions[admsNodeID_GP].dx(admsProbeID_V_DI_SI) = " <<staticContributions[admsNodeID_GP].dx(admsProbeID_V_DI_SI) << std::endl;
14921  Xyce::dout() << " staticContributions[admsNodeID_GP].dx(admsProbeID_V_GP_SI) = " <<staticContributions[admsNodeID_GP].dx(admsProbeID_V_GP_SI) << std::endl;
14922  Xyce::dout() << " staticContributions[admsNodeID_GP].dx(admsProbeID_V_B_BI) = " <<staticContributions[admsNodeID_GP].dx(admsProbeID_V_B_BI) << std::endl;
14923  Xyce::dout() << " staticContributions[admsNodeID_GP].dx(admsProbeID_V_BP_BI) = " <<staticContributions[admsNodeID_GP].dx(admsProbeID_V_BP_BI) << std::endl;
14924  Xyce::dout() << " staticContributions[admsNodeID_GP].dx(admsProbeID_V_BD_BI) = " <<staticContributions[admsNodeID_GP].dx(admsProbeID_V_BD_BI) << std::endl;
14925  Xyce::dout() << " staticContributions[admsNodeID_GP].dx(admsProbeID_V_BS_BI) = " <<staticContributions[admsNodeID_GP].dx(admsProbeID_V_BS_BI) << std::endl;
14926  Xyce::dout() << " staticContributions[admsNodeID_GP].dx(admsProbeID_V_D_DI) = " <<staticContributions[admsNodeID_GP].dx(admsProbeID_V_D_DI) << std::endl;
14927  Xyce::dout() << " staticContributions[admsNodeID_GP].dx(admsProbeID_V_S_SI) = " <<staticContributions[admsNodeID_GP].dx(admsProbeID_V_S_SI) << std::endl;
14928  Xyce::dout() << " staticContributions[admsNodeID_GP].dx(admsProbeID_V_G_GP) = " <<staticContributions[admsNodeID_GP].dx(admsProbeID_V_G_GP) << std::endl;
14929  Xyce::dout() << " dynamicContributions[admsNodeID_GP] = "
14930  <<dynamicContributions[admsNodeID_GP].val() << std::endl;
14931  Xyce::dout() << " dynamicContributions[admsNodeID_GP].dx(admsProbeID_V_DI_BD) = " <<dynamicContributions[admsNodeID_GP].dx(admsProbeID_V_DI_BD) << std::endl;
14932  Xyce::dout() << " dynamicContributions[admsNodeID_GP].dx(admsProbeID_V_SI_BS) = " <<dynamicContributions[admsNodeID_GP].dx(admsProbeID_V_SI_BS) << std::endl;
14933  Xyce::dout() << " dynamicContributions[admsNodeID_GP].dx(admsProbeID_V_SI_BP) = " <<dynamicContributions[admsNodeID_GP].dx(admsProbeID_V_SI_BP) << std::endl;
14934  Xyce::dout() << " dynamicContributions[admsNodeID_GP].dx(admsProbeID_V_DI_SI) = " <<dynamicContributions[admsNodeID_GP].dx(admsProbeID_V_DI_SI) << std::endl;
14935  Xyce::dout() << " dynamicContributions[admsNodeID_GP].dx(admsProbeID_V_GP_SI) = " <<dynamicContributions[admsNodeID_GP].dx(admsProbeID_V_GP_SI) << std::endl;
14936  Xyce::dout() << " dynamicContributions[admsNodeID_GP].dx(admsProbeID_V_B_BI) = " <<dynamicContributions[admsNodeID_GP].dx(admsProbeID_V_B_BI) << std::endl;
14937  Xyce::dout() << " dynamicContributions[admsNodeID_GP].dx(admsProbeID_V_BP_BI) = " <<dynamicContributions[admsNodeID_GP].dx(admsProbeID_V_BP_BI) << std::endl;
14938  Xyce::dout() << " dynamicContributions[admsNodeID_GP].dx(admsProbeID_V_BD_BI) = " <<dynamicContributions[admsNodeID_GP].dx(admsProbeID_V_BD_BI) << std::endl;
14939  Xyce::dout() << " dynamicContributions[admsNodeID_GP].dx(admsProbeID_V_BS_BI) = " <<dynamicContributions[admsNodeID_GP].dx(admsProbeID_V_BS_BI) << std::endl;
14940  Xyce::dout() << " dynamicContributions[admsNodeID_GP].dx(admsProbeID_V_D_DI) = " <<dynamicContributions[admsNodeID_GP].dx(admsProbeID_V_D_DI) << std::endl;
14941  Xyce::dout() << " dynamicContributions[admsNodeID_GP].dx(admsProbeID_V_S_SI) = " <<dynamicContributions[admsNodeID_GP].dx(admsProbeID_V_S_SI) << std::endl;
14942  Xyce::dout() << " dynamicContributions[admsNodeID_GP].dx(admsProbeID_V_G_GP) = " <<dynamicContributions[admsNodeID_GP].dx(admsProbeID_V_G_GP) << std::endl;
14943  Xyce::dout() << " staticContributions[admsNodeID_SI] = "
14944  <<staticContributions[admsNodeID_SI].val() << std::endl;
14945  Xyce::dout() << " staticContributions[admsNodeID_SI].dx(admsProbeID_V_DI_BD) = " <<staticContributions[admsNodeID_SI].dx(admsProbeID_V_DI_BD) << std::endl;
14946  Xyce::dout() << " staticContributions[admsNodeID_SI].dx(admsProbeID_V_SI_BS) = " <<staticContributions[admsNodeID_SI].dx(admsProbeID_V_SI_BS) << std::endl;
14947  Xyce::dout() << " staticContributions[admsNodeID_SI].dx(admsProbeID_V_SI_BP) = " <<staticContributions[admsNodeID_SI].dx(admsProbeID_V_SI_BP) << std::endl;
14948  Xyce::dout() << " staticContributions[admsNodeID_SI].dx(admsProbeID_V_DI_SI) = " <<staticContributions[admsNodeID_SI].dx(admsProbeID_V_DI_SI) << std::endl;
14949  Xyce::dout() << " staticContributions[admsNodeID_SI].dx(admsProbeID_V_GP_SI) = " <<staticContributions[admsNodeID_SI].dx(admsProbeID_V_GP_SI) << std::endl;
14950  Xyce::dout() << " staticContributions[admsNodeID_SI].dx(admsProbeID_V_B_BI) = " <<staticContributions[admsNodeID_SI].dx(admsProbeID_V_B_BI) << std::endl;
14951  Xyce::dout() << " staticContributions[admsNodeID_SI].dx(admsProbeID_V_BP_BI) = " <<staticContributions[admsNodeID_SI].dx(admsProbeID_V_BP_BI) << std::endl;
14952  Xyce::dout() << " staticContributions[admsNodeID_SI].dx(admsProbeID_V_BD_BI) = " <<staticContributions[admsNodeID_SI].dx(admsProbeID_V_BD_BI) << std::endl;
14953  Xyce::dout() << " staticContributions[admsNodeID_SI].dx(admsProbeID_V_BS_BI) = " <<staticContributions[admsNodeID_SI].dx(admsProbeID_V_BS_BI) << std::endl;
14954  Xyce::dout() << " staticContributions[admsNodeID_SI].dx(admsProbeID_V_D_DI) = " <<staticContributions[admsNodeID_SI].dx(admsProbeID_V_D_DI) << std::endl;
14955  Xyce::dout() << " staticContributions[admsNodeID_SI].dx(admsProbeID_V_S_SI) = " <<staticContributions[admsNodeID_SI].dx(admsProbeID_V_S_SI) << std::endl;
14956  Xyce::dout() << " staticContributions[admsNodeID_SI].dx(admsProbeID_V_G_GP) = " <<staticContributions[admsNodeID_SI].dx(admsProbeID_V_G_GP) << std::endl;
14957  Xyce::dout() << " dynamicContributions[admsNodeID_SI] = "
14958  <<dynamicContributions[admsNodeID_SI].val() << std::endl;
14959  Xyce::dout() << " dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_DI_BD) = " <<dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_DI_BD) << std::endl;
14960  Xyce::dout() << " dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_SI_BS) = " <<dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_SI_BS) << std::endl;
14961  Xyce::dout() << " dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_SI_BP) = " <<dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_SI_BP) << std::endl;
14962  Xyce::dout() << " dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_DI_SI) = " <<dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_DI_SI) << std::endl;
14963  Xyce::dout() << " dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_GP_SI) = " <<dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_GP_SI) << std::endl;
14964  Xyce::dout() << " dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_B_BI) = " <<dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_B_BI) << std::endl;
14965  Xyce::dout() << " dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_BP_BI) = " <<dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_BP_BI) << std::endl;
14966  Xyce::dout() << " dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_BD_BI) = " <<dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_BD_BI) << std::endl;
14967  Xyce::dout() << " dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_BS_BI) = " <<dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_BS_BI) << std::endl;
14968  Xyce::dout() << " dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_D_DI) = " <<dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_D_DI) << std::endl;
14969  Xyce::dout() << " dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_S_SI) = " <<dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_S_SI) << std::endl;
14970  Xyce::dout() << " dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_G_GP) = " <<dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_G_GP) << std::endl;
14971  Xyce::dout() << " staticContributions[admsNodeID_DI] = "
14972  <<staticContributions[admsNodeID_DI].val() << std::endl;
14973  Xyce::dout() << " staticContributions[admsNodeID_DI].dx(admsProbeID_V_DI_BD) = " <<staticContributions[admsNodeID_DI].dx(admsProbeID_V_DI_BD) << std::endl;
14974  Xyce::dout() << " staticContributions[admsNodeID_DI].dx(admsProbeID_V_SI_BS) = " <<staticContributions[admsNodeID_DI].dx(admsProbeID_V_SI_BS) << std::endl;
14975  Xyce::dout() << " staticContributions[admsNodeID_DI].dx(admsProbeID_V_SI_BP) = " <<staticContributions[admsNodeID_DI].dx(admsProbeID_V_SI_BP) << std::endl;
14976  Xyce::dout() << " staticContributions[admsNodeID_DI].dx(admsProbeID_V_DI_SI) = " <<staticContributions[admsNodeID_DI].dx(admsProbeID_V_DI_SI) << std::endl;
14977  Xyce::dout() << " staticContributions[admsNodeID_DI].dx(admsProbeID_V_GP_SI) = " <<staticContributions[admsNodeID_DI].dx(admsProbeID_V_GP_SI) << std::endl;
14978  Xyce::dout() << " staticContributions[admsNodeID_DI].dx(admsProbeID_V_B_BI) = " <<staticContributions[admsNodeID_DI].dx(admsProbeID_V_B_BI) << std::endl;
14979  Xyce::dout() << " staticContributions[admsNodeID_DI].dx(admsProbeID_V_BP_BI) = " <<staticContributions[admsNodeID_DI].dx(admsProbeID_V_BP_BI) << std::endl;
14980  Xyce::dout() << " staticContributions[admsNodeID_DI].dx(admsProbeID_V_BD_BI) = " <<staticContributions[admsNodeID_DI].dx(admsProbeID_V_BD_BI) << std::endl;
14981  Xyce::dout() << " staticContributions[admsNodeID_DI].dx(admsProbeID_V_BS_BI) = " <<staticContributions[admsNodeID_DI].dx(admsProbeID_V_BS_BI) << std::endl;
14982  Xyce::dout() << " staticContributions[admsNodeID_DI].dx(admsProbeID_V_D_DI) = " <<staticContributions[admsNodeID_DI].dx(admsProbeID_V_D_DI) << std::endl;
14983  Xyce::dout() << " staticContributions[admsNodeID_DI].dx(admsProbeID_V_S_SI) = " <<staticContributions[admsNodeID_DI].dx(admsProbeID_V_S_SI) << std::endl;
14984  Xyce::dout() << " staticContributions[admsNodeID_DI].dx(admsProbeID_V_G_GP) = " <<staticContributions[admsNodeID_DI].dx(admsProbeID_V_G_GP) << std::endl;
14985  Xyce::dout() << " dynamicContributions[admsNodeID_DI] = "
14986  <<dynamicContributions[admsNodeID_DI].val() << std::endl;
14987  Xyce::dout() << " dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_DI_BD) = " <<dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_DI_BD) << std::endl;
14988  Xyce::dout() << " dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_SI_BS) = " <<dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_SI_BS) << std::endl;
14989  Xyce::dout() << " dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_SI_BP) = " <<dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_SI_BP) << std::endl;
14990  Xyce::dout() << " dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_DI_SI) = " <<dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_DI_SI) << std::endl;
14991  Xyce::dout() << " dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_GP_SI) = " <<dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_GP_SI) << std::endl;
14992  Xyce::dout() << " dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_B_BI) = " <<dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_B_BI) << std::endl;
14993  Xyce::dout() << " dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_BP_BI) = " <<dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_BP_BI) << std::endl;
14994  Xyce::dout() << " dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_BD_BI) = " <<dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_BD_BI) << std::endl;
14995  Xyce::dout() << " dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_BS_BI) = " <<dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_BS_BI) << std::endl;
14996  Xyce::dout() << " dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_D_DI) = " <<dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_D_DI) << std::endl;
14997  Xyce::dout() << " dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_S_SI) = " <<dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_S_SI) << std::endl;
14998  Xyce::dout() << " dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_G_GP) = " <<dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_G_GP) << std::endl;
14999  Xyce::dout() << " staticContributions[admsNodeID_BI] = "
15000  <<staticContributions[admsNodeID_BI].val() << std::endl;
15001  Xyce::dout() << " staticContributions[admsNodeID_BI].dx(admsProbeID_V_DI_BD) = " <<staticContributions[admsNodeID_BI].dx(admsProbeID_V_DI_BD) << std::endl;
15002  Xyce::dout() << " staticContributions[admsNodeID_BI].dx(admsProbeID_V_SI_BS) = " <<staticContributions[admsNodeID_BI].dx(admsProbeID_V_SI_BS) << std::endl;
15003  Xyce::dout() << " staticContributions[admsNodeID_BI].dx(admsProbeID_V_SI_BP) = " <<staticContributions[admsNodeID_BI].dx(admsProbeID_V_SI_BP) << std::endl;
15004  Xyce::dout() << " staticContributions[admsNodeID_BI].dx(admsProbeID_V_DI_SI) = " <<staticContributions[admsNodeID_BI].dx(admsProbeID_V_DI_SI) << std::endl;
15005  Xyce::dout() << " staticContributions[admsNodeID_BI].dx(admsProbeID_V_GP_SI) = " <<staticContributions[admsNodeID_BI].dx(admsProbeID_V_GP_SI) << std::endl;
15006  Xyce::dout() << " staticContributions[admsNodeID_BI].dx(admsProbeID_V_B_BI) = " <<staticContributions[admsNodeID_BI].dx(admsProbeID_V_B_BI) << std::endl;
15007  Xyce::dout() << " staticContributions[admsNodeID_BI].dx(admsProbeID_V_BP_BI) = " <<staticContributions[admsNodeID_BI].dx(admsProbeID_V_BP_BI) << std::endl;
15008  Xyce::dout() << " staticContributions[admsNodeID_BI].dx(admsProbeID_V_BD_BI) = " <<staticContributions[admsNodeID_BI].dx(admsProbeID_V_BD_BI) << std::endl;
15009  Xyce::dout() << " staticContributions[admsNodeID_BI].dx(admsProbeID_V_BS_BI) = " <<staticContributions[admsNodeID_BI].dx(admsProbeID_V_BS_BI) << std::endl;
15010  Xyce::dout() << " staticContributions[admsNodeID_BI].dx(admsProbeID_V_D_DI) = " <<staticContributions[admsNodeID_BI].dx(admsProbeID_V_D_DI) << std::endl;
15011  Xyce::dout() << " staticContributions[admsNodeID_BI].dx(admsProbeID_V_S_SI) = " <<staticContributions[admsNodeID_BI].dx(admsProbeID_V_S_SI) << std::endl;
15012  Xyce::dout() << " staticContributions[admsNodeID_BI].dx(admsProbeID_V_G_GP) = " <<staticContributions[admsNodeID_BI].dx(admsProbeID_V_G_GP) << std::endl;
15013  Xyce::dout() << " dynamicContributions[admsNodeID_BI] = "
15014  <<dynamicContributions[admsNodeID_BI].val() << std::endl;
15015  Xyce::dout() << " dynamicContributions[admsNodeID_BI].dx(admsProbeID_V_DI_BD) = " <<dynamicContributions[admsNodeID_BI].dx(admsProbeID_V_DI_BD) << std::endl;
15016  Xyce::dout() << " dynamicContributions[admsNodeID_BI].dx(admsProbeID_V_SI_BS) = " <<dynamicContributions[admsNodeID_BI].dx(admsProbeID_V_SI_BS) << std::endl;
15017  Xyce::dout() << " dynamicContributions[admsNodeID_BI].dx(admsProbeID_V_SI_BP) = " <<dynamicContributions[admsNodeID_BI].dx(admsProbeID_V_SI_BP) << std::endl;
15018  Xyce::dout() << " dynamicContributions[admsNodeID_BI].dx(admsProbeID_V_DI_SI) = " <<dynamicContributions[admsNodeID_BI].dx(admsProbeID_V_DI_SI) << std::endl;
15019  Xyce::dout() << " dynamicContributions[admsNodeID_BI].dx(admsProbeID_V_GP_SI) = " <<dynamicContributions[admsNodeID_BI].dx(admsProbeID_V_GP_SI) << std::endl;
15020  Xyce::dout() << " dynamicContributions[admsNodeID_BI].dx(admsProbeID_V_B_BI) = " <<dynamicContributions[admsNodeID_BI].dx(admsProbeID_V_B_BI) << std::endl;
15021  Xyce::dout() << " dynamicContributions[admsNodeID_BI].dx(admsProbeID_V_BP_BI) = " <<dynamicContributions[admsNodeID_BI].dx(admsProbeID_V_BP_BI) << std::endl;
15022  Xyce::dout() << " dynamicContributions[admsNodeID_BI].dx(admsProbeID_V_BD_BI) = " <<dynamicContributions[admsNodeID_BI].dx(admsProbeID_V_BD_BI) << std::endl;
15023  Xyce::dout() << " dynamicContributions[admsNodeID_BI].dx(admsProbeID_V_BS_BI) = " <<dynamicContributions[admsNodeID_BI].dx(admsProbeID_V_BS_BI) << std::endl;
15024  Xyce::dout() << " dynamicContributions[admsNodeID_BI].dx(admsProbeID_V_D_DI) = " <<dynamicContributions[admsNodeID_BI].dx(admsProbeID_V_D_DI) << std::endl;
15025  Xyce::dout() << " dynamicContributions[admsNodeID_BI].dx(admsProbeID_V_S_SI) = " <<dynamicContributions[admsNodeID_BI].dx(admsProbeID_V_S_SI) << std::endl;
15026  Xyce::dout() << " dynamicContributions[admsNodeID_BI].dx(admsProbeID_V_G_GP) = " <<dynamicContributions[admsNodeID_BI].dx(admsProbeID_V_G_GP) << std::endl;
15027  Xyce::dout() << " staticContributions[admsNodeID_BP] = "
15028  <<staticContributions[admsNodeID_BP].val() << std::endl;
15029  Xyce::dout() << " staticContributions[admsNodeID_BP].dx(admsProbeID_V_DI_BD) = " <<staticContributions[admsNodeID_BP].dx(admsProbeID_V_DI_BD) << std::endl;
15030  Xyce::dout() << " staticContributions[admsNodeID_BP].dx(admsProbeID_V_SI_BS) = " <<staticContributions[admsNodeID_BP].dx(admsProbeID_V_SI_BS) << std::endl;
15031  Xyce::dout() << " staticContributions[admsNodeID_BP].dx(admsProbeID_V_SI_BP) = " <<staticContributions[admsNodeID_BP].dx(admsProbeID_V_SI_BP) << std::endl;
15032  Xyce::dout() << " staticContributions[admsNodeID_BP].dx(admsProbeID_V_DI_SI) = " <<staticContributions[admsNodeID_BP].dx(admsProbeID_V_DI_SI) << std::endl;
15033  Xyce::dout() << " staticContributions[admsNodeID_BP].dx(admsProbeID_V_GP_SI) = " <<staticContributions[admsNodeID_BP].dx(admsProbeID_V_GP_SI) << std::endl;
15034  Xyce::dout() << " staticContributions[admsNodeID_BP].dx(admsProbeID_V_B_BI) = " <<staticContributions[admsNodeID_BP].dx(admsProbeID_V_B_BI) << std::endl;
15035  Xyce::dout() << " staticContributions[admsNodeID_BP].dx(admsProbeID_V_BP_BI) = " <<staticContributions[admsNodeID_BP].dx(admsProbeID_V_BP_BI) << std::endl;
15036  Xyce::dout() << " staticContributions[admsNodeID_BP].dx(admsProbeID_V_BD_BI) = " <<staticContributions[admsNodeID_BP].dx(admsProbeID_V_BD_BI) << std::endl;
15037  Xyce::dout() << " staticContributions[admsNodeID_BP].dx(admsProbeID_V_BS_BI) = " <<staticContributions[admsNodeID_BP].dx(admsProbeID_V_BS_BI) << std::endl;
15038  Xyce::dout() << " staticContributions[admsNodeID_BP].dx(admsProbeID_V_D_DI) = " <<staticContributions[admsNodeID_BP].dx(admsProbeID_V_D_DI) << std::endl;
15039  Xyce::dout() << " staticContributions[admsNodeID_BP].dx(admsProbeID_V_S_SI) = " <<staticContributions[admsNodeID_BP].dx(admsProbeID_V_S_SI) << std::endl;
15040  Xyce::dout() << " staticContributions[admsNodeID_BP].dx(admsProbeID_V_G_GP) = " <<staticContributions[admsNodeID_BP].dx(admsProbeID_V_G_GP) << std::endl;
15041  Xyce::dout() << " dynamicContributions[admsNodeID_BP] = "
15042  <<dynamicContributions[admsNodeID_BP].val() << std::endl;
15043  Xyce::dout() << " dynamicContributions[admsNodeID_BP].dx(admsProbeID_V_DI_BD) = " <<dynamicContributions[admsNodeID_BP].dx(admsProbeID_V_DI_BD) << std::endl;
15044  Xyce::dout() << " dynamicContributions[admsNodeID_BP].dx(admsProbeID_V_SI_BS) = " <<dynamicContributions[admsNodeID_BP].dx(admsProbeID_V_SI_BS) << std::endl;
15045  Xyce::dout() << " dynamicContributions[admsNodeID_BP].dx(admsProbeID_V_SI_BP) = " <<dynamicContributions[admsNodeID_BP].dx(admsProbeID_V_SI_BP) << std::endl;
15046  Xyce::dout() << " dynamicContributions[admsNodeID_BP].dx(admsProbeID_V_DI_SI) = " <<dynamicContributions[admsNodeID_BP].dx(admsProbeID_V_DI_SI) << std::endl;
15047  Xyce::dout() << " dynamicContributions[admsNodeID_BP].dx(admsProbeID_V_GP_SI) = " <<dynamicContributions[admsNodeID_BP].dx(admsProbeID_V_GP_SI) << std::endl;
15048  Xyce::dout() << " dynamicContributions[admsNodeID_BP].dx(admsProbeID_V_B_BI) = " <<dynamicContributions[admsNodeID_BP].dx(admsProbeID_V_B_BI) << std::endl;
15049  Xyce::dout() << " dynamicContributions[admsNodeID_BP].dx(admsProbeID_V_BP_BI) = " <<dynamicContributions[admsNodeID_BP].dx(admsProbeID_V_BP_BI) << std::endl;
15050  Xyce::dout() << " dynamicContributions[admsNodeID_BP].dx(admsProbeID_V_BD_BI) = " <<dynamicContributions[admsNodeID_BP].dx(admsProbeID_V_BD_BI) << std::endl;
15051  Xyce::dout() << " dynamicContributions[admsNodeID_BP].dx(admsProbeID_V_BS_BI) = " <<dynamicContributions[admsNodeID_BP].dx(admsProbeID_V_BS_BI) << std::endl;
15052  Xyce::dout() << " dynamicContributions[admsNodeID_BP].dx(admsProbeID_V_D_DI) = " <<dynamicContributions[admsNodeID_BP].dx(admsProbeID_V_D_DI) << std::endl;
15053  Xyce::dout() << " dynamicContributions[admsNodeID_BP].dx(admsProbeID_V_S_SI) = " <<dynamicContributions[admsNodeID_BP].dx(admsProbeID_V_S_SI) << std::endl;
15054  Xyce::dout() << " dynamicContributions[admsNodeID_BP].dx(admsProbeID_V_G_GP) = " <<dynamicContributions[admsNodeID_BP].dx(admsProbeID_V_G_GP) << std::endl;
15055  Xyce::dout() << " staticContributions[admsNodeID_BS] = "
15056  <<staticContributions[admsNodeID_BS].val() << std::endl;
15057  Xyce::dout() << " staticContributions[admsNodeID_BS].dx(admsProbeID_V_DI_BD) = " <<staticContributions[admsNodeID_BS].dx(admsProbeID_V_DI_BD) << std::endl;
15058  Xyce::dout() << " staticContributions[admsNodeID_BS].dx(admsProbeID_V_SI_BS) = " <<staticContributions[admsNodeID_BS].dx(admsProbeID_V_SI_BS) << std::endl;
15059  Xyce::dout() << " staticContributions[admsNodeID_BS].dx(admsProbeID_V_SI_BP) = " <<staticContributions[admsNodeID_BS].dx(admsProbeID_V_SI_BP) << std::endl;
15060  Xyce::dout() << " staticContributions[admsNodeID_BS].dx(admsProbeID_V_DI_SI) = " <<staticContributions[admsNodeID_BS].dx(admsProbeID_V_DI_SI) << std::endl;
15061  Xyce::dout() << " staticContributions[admsNodeID_BS].dx(admsProbeID_V_GP_SI) = " <<staticContributions[admsNodeID_BS].dx(admsProbeID_V_GP_SI) << std::endl;
15062  Xyce::dout() << " staticContributions[admsNodeID_BS].dx(admsProbeID_V_B_BI) = " <<staticContributions[admsNodeID_BS].dx(admsProbeID_V_B_BI) << std::endl;
15063  Xyce::dout() << " staticContributions[admsNodeID_BS].dx(admsProbeID_V_BP_BI) = " <<staticContributions[admsNodeID_BS].dx(admsProbeID_V_BP_BI) << std::endl;
15064  Xyce::dout() << " staticContributions[admsNodeID_BS].dx(admsProbeID_V_BD_BI) = " <<staticContributions[admsNodeID_BS].dx(admsProbeID_V_BD_BI) << std::endl;
15065  Xyce::dout() << " staticContributions[admsNodeID_BS].dx(admsProbeID_V_BS_BI) = " <<staticContributions[admsNodeID_BS].dx(admsProbeID_V_BS_BI) << std::endl;
15066  Xyce::dout() << " staticContributions[admsNodeID_BS].dx(admsProbeID_V_D_DI) = " <<staticContributions[admsNodeID_BS].dx(admsProbeID_V_D_DI) << std::endl;
15067  Xyce::dout() << " staticContributions[admsNodeID_BS].dx(admsProbeID_V_S_SI) = " <<staticContributions[admsNodeID_BS].dx(admsProbeID_V_S_SI) << std::endl;
15068  Xyce::dout() << " staticContributions[admsNodeID_BS].dx(admsProbeID_V_G_GP) = " <<staticContributions[admsNodeID_BS].dx(admsProbeID_V_G_GP) << std::endl;
15069  Xyce::dout() << " dynamicContributions[admsNodeID_BS] = "
15070  <<dynamicContributions[admsNodeID_BS].val() << std::endl;
15071  Xyce::dout() << " dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_DI_BD) = " <<dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_DI_BD) << std::endl;
15072  Xyce::dout() << " dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_SI_BS) = " <<dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_SI_BS) << std::endl;
15073  Xyce::dout() << " dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_SI_BP) = " <<dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_SI_BP) << std::endl;
15074  Xyce::dout() << " dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_DI_SI) = " <<dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_DI_SI) << std::endl;
15075  Xyce::dout() << " dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_GP_SI) = " <<dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_GP_SI) << std::endl;
15076  Xyce::dout() << " dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_B_BI) = " <<dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_B_BI) << std::endl;
15077  Xyce::dout() << " dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_BP_BI) = " <<dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_BP_BI) << std::endl;
15078  Xyce::dout() << " dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_BD_BI) = " <<dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_BD_BI) << std::endl;
15079  Xyce::dout() << " dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_BS_BI) = " <<dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_BS_BI) << std::endl;
15080  Xyce::dout() << " dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_D_DI) = " <<dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_D_DI) << std::endl;
15081  Xyce::dout() << " dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_S_SI) = " <<dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_S_SI) << std::endl;
15082  Xyce::dout() << " dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_G_GP) = " <<dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_G_GP) << std::endl;
15083  Xyce::dout() << " staticContributions[admsNodeID_BD] = "
15084  <<staticContributions[admsNodeID_BD].val() << std::endl;
15085  Xyce::dout() << " staticContributions[admsNodeID_BD].dx(admsProbeID_V_DI_BD) = " <<staticContributions[admsNodeID_BD].dx(admsProbeID_V_DI_BD) << std::endl;
15086  Xyce::dout() << " staticContributions[admsNodeID_BD].dx(admsProbeID_V_SI_BS) = " <<staticContributions[admsNodeID_BD].dx(admsProbeID_V_SI_BS) << std::endl;
15087  Xyce::dout() << " staticContributions[admsNodeID_BD].dx(admsProbeID_V_SI_BP) = " <<staticContributions[admsNodeID_BD].dx(admsProbeID_V_SI_BP) << std::endl;
15088  Xyce::dout() << " staticContributions[admsNodeID_BD].dx(admsProbeID_V_DI_SI) = " <<staticContributions[admsNodeID_BD].dx(admsProbeID_V_DI_SI) << std::endl;
15089  Xyce::dout() << " staticContributions[admsNodeID_BD].dx(admsProbeID_V_GP_SI) = " <<staticContributions[admsNodeID_BD].dx(admsProbeID_V_GP_SI) << std::endl;
15090  Xyce::dout() << " staticContributions[admsNodeID_BD].dx(admsProbeID_V_B_BI) = " <<staticContributions[admsNodeID_BD].dx(admsProbeID_V_B_BI) << std::endl;
15091  Xyce::dout() << " staticContributions[admsNodeID_BD].dx(admsProbeID_V_BP_BI) = " <<staticContributions[admsNodeID_BD].dx(admsProbeID_V_BP_BI) << std::endl;
15092  Xyce::dout() << " staticContributions[admsNodeID_BD].dx(admsProbeID_V_BD_BI) = " <<staticContributions[admsNodeID_BD].dx(admsProbeID_V_BD_BI) << std::endl;
15093  Xyce::dout() << " staticContributions[admsNodeID_BD].dx(admsProbeID_V_BS_BI) = " <<staticContributions[admsNodeID_BD].dx(admsProbeID_V_BS_BI) << std::endl;
15094  Xyce::dout() << " staticContributions[admsNodeID_BD].dx(admsProbeID_V_D_DI) = " <<staticContributions[admsNodeID_BD].dx(admsProbeID_V_D_DI) << std::endl;
15095  Xyce::dout() << " staticContributions[admsNodeID_BD].dx(admsProbeID_V_S_SI) = " <<staticContributions[admsNodeID_BD].dx(admsProbeID_V_S_SI) << std::endl;
15096  Xyce::dout() << " staticContributions[admsNodeID_BD].dx(admsProbeID_V_G_GP) = " <<staticContributions[admsNodeID_BD].dx(admsProbeID_V_G_GP) << std::endl;
15097  Xyce::dout() << " dynamicContributions[admsNodeID_BD] = "
15098  <<dynamicContributions[admsNodeID_BD].val() << std::endl;
15099  Xyce::dout() << " dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_DI_BD) = " <<dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_DI_BD) << std::endl;
15100  Xyce::dout() << " dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_SI_BS) = " <<dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_SI_BS) << std::endl;
15101  Xyce::dout() << " dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_SI_BP) = " <<dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_SI_BP) << std::endl;
15102  Xyce::dout() << " dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_DI_SI) = " <<dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_DI_SI) << std::endl;
15103  Xyce::dout() << " dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_GP_SI) = " <<dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_GP_SI) << std::endl;
15104  Xyce::dout() << " dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_B_BI) = " <<dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_B_BI) << std::endl;
15105  Xyce::dout() << " dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_BP_BI) = " <<dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_BP_BI) << std::endl;
15106  Xyce::dout() << " dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_BD_BI) = " <<dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_BD_BI) << std::endl;
15107  Xyce::dout() << " dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_BS_BI) = " <<dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_BS_BI) << std::endl;
15108  Xyce::dout() << " dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_D_DI) = " <<dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_D_DI) << std::endl;
15109  Xyce::dout() << " dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_S_SI) = " <<dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_S_SI) << std::endl;
15110  Xyce::dout() << " dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_G_GP) = " <<dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_G_GP) << std::endl;
15111 
15112  if (!origFlag)
15113  Xyce::dout() << "This step was limited by this device." << std::endl;
15114  }
15115 #endif // Xyce_DEBUG_DEVICE
15116  return true;
15117 }
15118 
15119 //-----------------------------------------------------------------------------
15120 // Function : Instance::loadDAEdFdx
15121 // Purpose :
15122 // Special Notes : Load the dFdx ("static jacobian") matrix
15123 // Scope : public
15124 // Creator : admsXml
15125 // Creation Date :
15126 //-----------------------------------------------------------------------------
15128 {
15129  bool bsuccess = true;
15130  N_LAS_Matrix * dFdxMatPtr = extData.dFdxMatrixPtr;
15131 
15132 #ifdef Xyce_DEBUG_DEVICE
15133  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15134  {
15135  Xyce::dout() << subsection_divider << std::endl;
15136  Xyce::dout() << "ADMSPSP103VA::Instance::loadDAEdFdx (" << getName() << "):" << std::endl;
15137  }
15138 #endif
15140 
15141 
15142 #ifdef Xyce_DEBUG_DEVICE
15143  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15144  {
15146  }
15147 #endif
15148  (*f_DI_Equ_BP_Node_Ptr) += -staticContributions[admsNodeID_DI].dx(admsProbeID_V_SI_BP);
15149 
15150 
15151 #ifdef Xyce_DEBUG_DEVICE
15152  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15153  {
15154  Xyce::dout() << " (*f_DI_Equ_BP_Node_Ptr) += " << -staticContributions[admsNodeID_DI].dx(admsProbeID_V_SI_BP)<< std::endl;
15155  }
15156 #endif
15158 
15159 
15160 #ifdef Xyce_DEBUG_DEVICE
15161  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15162  {
15164  }
15165 #endif
15167 
15168 
15169 #ifdef Xyce_DEBUG_DEVICE
15170  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15171  {
15172  Xyce::dout() << " (*f_BP_Equ_BP_Node_Ptr) += " << +staticContributions[admsNodeID_BP].dx(admsProbeID_V_BP_BI) -staticContributions[admsNodeID_BP].dx(admsProbeID_V_SI_BP)<< std::endl;
15173  }
15174 #endif
15175  (*f_DI_Equ_GP_Node_Ptr) += +staticContributions[admsNodeID_DI].dx(admsProbeID_V_GP_SI);
15176 
15177 
15178 #ifdef Xyce_DEBUG_DEVICE
15179  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15180  {
15181  Xyce::dout() << " (*f_DI_Equ_GP_Node_Ptr) += " << +staticContributions[admsNodeID_DI].dx(admsProbeID_V_GP_SI)<< std::endl;
15182  }
15183 #endif
15184  (*f_BP_Equ_GP_Node_Ptr) += +staticContributions[admsNodeID_BP].dx(admsProbeID_V_GP_SI);
15185 
15186 
15187 #ifdef Xyce_DEBUG_DEVICE
15188  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15189  {
15190  Xyce::dout() << " (*f_BP_Equ_GP_Node_Ptr) += " << +staticContributions[admsNodeID_BP].dx(admsProbeID_V_GP_SI)<< std::endl;
15191  }
15192 #endif
15194 
15195 
15196 #ifdef Xyce_DEBUG_DEVICE
15197  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15198  {
15200  }
15201 #endif
15202  (*f_BP_Equ_DI_Node_Ptr) += +staticContributions[admsNodeID_BP].dx(admsProbeID_V_DI_SI);
15203 
15204 
15205 #ifdef Xyce_DEBUG_DEVICE
15206  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15207  {
15208  Xyce::dout() << " (*f_BP_Equ_DI_Node_Ptr) += " << +staticContributions[admsNodeID_BP].dx(admsProbeID_V_DI_SI)<< std::endl;
15209  }
15210 #endif
15212 
15213 
15214 #ifdef Xyce_DEBUG_DEVICE
15215  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15216  {
15218  }
15219 #endif
15220  (*f_SI_Equ_BP_Node_Ptr) += -staticContributions[admsNodeID_SI].dx(admsProbeID_V_SI_BP);
15221 
15222 
15223 #ifdef Xyce_DEBUG_DEVICE
15224  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15225  {
15226  Xyce::dout() << " (*f_SI_Equ_BP_Node_Ptr) += " << -staticContributions[admsNodeID_SI].dx(admsProbeID_V_SI_BP)<< std::endl;
15227  }
15228 #endif
15229  (*f_SI_Equ_GP_Node_Ptr) += +staticContributions[admsNodeID_SI].dx(admsProbeID_V_GP_SI);
15230 
15231 
15232 #ifdef Xyce_DEBUG_DEVICE
15233  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15234  {
15235  Xyce::dout() << " (*f_SI_Equ_GP_Node_Ptr) += " << +staticContributions[admsNodeID_SI].dx(admsProbeID_V_GP_SI)<< std::endl;
15236  }
15237 #endif
15239 
15240 
15241 #ifdef Xyce_DEBUG_DEVICE
15242  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15243  {
15244  Xyce::dout() << " (*f_SI_Equ_DI_Node_Ptr) += " << +staticContributions[admsNodeID_SI].dx(admsProbeID_V_DI_BD) +staticContributions[admsNodeID_SI].dx(admsProbeID_V_DI_SI)<< std::endl;
15245  }
15246 #endif
15248 
15249 
15250 #ifdef Xyce_DEBUG_DEVICE
15251  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15252  {
15254  }
15255 #endif
15256  (*f_GP_Equ_BP_Node_Ptr) += -staticContributions[admsNodeID_GP].dx(admsProbeID_V_SI_BP);
15257 
15258 
15259 #ifdef Xyce_DEBUG_DEVICE
15260  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15261  {
15262  Xyce::dout() << " (*f_GP_Equ_BP_Node_Ptr) += " << -staticContributions[admsNodeID_GP].dx(admsProbeID_V_SI_BP)<< std::endl;
15263  }
15264 #endif
15265  (*f_GP_Equ_DI_Node_Ptr) += +staticContributions[admsNodeID_GP].dx(admsProbeID_V_DI_SI);
15266 
15267 
15268 #ifdef Xyce_DEBUG_DEVICE
15269  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15270  {
15271  Xyce::dout() << " (*f_GP_Equ_DI_Node_Ptr) += " << +staticContributions[admsNodeID_GP].dx(admsProbeID_V_DI_SI)<< std::endl;
15272  }
15273 #endif
15275 
15276 
15277 #ifdef Xyce_DEBUG_DEVICE
15278  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15279  {
15280  Xyce::dout() << " (*f_GP_Equ_GP_Node_Ptr) += " << -staticContributions[admsNodeID_GP].dx(admsProbeID_V_G_GP) +staticContributions[admsNodeID_GP].dx(admsProbeID_V_GP_SI)<< std::endl;
15281  }
15282 #endif
15283  (*f_BS_Equ_SI_Node_Ptr) += +staticContributions[admsNodeID_BS].dx(admsProbeID_V_SI_BS);
15284 
15285 
15286 #ifdef Xyce_DEBUG_DEVICE
15287  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15288  {
15289  Xyce::dout() << " (*f_BS_Equ_SI_Node_Ptr) += " << +staticContributions[admsNodeID_BS].dx(admsProbeID_V_SI_BS)<< std::endl;
15290  }
15291 #endif
15293 
15294 
15295 #ifdef Xyce_DEBUG_DEVICE
15296  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15297  {
15298  Xyce::dout() << " (*f_BS_Equ_BS_Node_Ptr) += " << +staticContributions[admsNodeID_BS].dx(admsProbeID_V_BS_BI) -staticContributions[admsNodeID_BS].dx(admsProbeID_V_SI_BS)<< std::endl;
15299  }
15300 #endif
15301  (*f_SI_Equ_BS_Node_Ptr) += -staticContributions[admsNodeID_SI].dx(admsProbeID_V_SI_BS);
15302 
15303 
15304 #ifdef Xyce_DEBUG_DEVICE
15305  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15306  {
15307  Xyce::dout() << " (*f_SI_Equ_BS_Node_Ptr) += " << -staticContributions[admsNodeID_SI].dx(admsProbeID_V_SI_BS)<< std::endl;
15308  }
15309 #endif
15310  (*f_BS_Equ_DI_Node_Ptr) += +staticContributions[admsNodeID_BS].dx(admsProbeID_V_DI_BD);
15311 
15312 
15313 #ifdef Xyce_DEBUG_DEVICE
15314  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15315  {
15316  Xyce::dout() << " (*f_BS_Equ_DI_Node_Ptr) += " << +staticContributions[admsNodeID_BS].dx(admsProbeID_V_DI_BD)<< std::endl;
15317  }
15318 #endif
15319  (*f_BS_Equ_BD_Node_Ptr) += -staticContributions[admsNodeID_BS].dx(admsProbeID_V_DI_BD);
15320 
15321 
15322 #ifdef Xyce_DEBUG_DEVICE
15323  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15324  {
15325  Xyce::dout() << " (*f_BS_Equ_BD_Node_Ptr) += " << -staticContributions[admsNodeID_BS].dx(admsProbeID_V_DI_BD)<< std::endl;
15326  }
15327 #endif
15328  (*f_SI_Equ_BD_Node_Ptr) += -staticContributions[admsNodeID_SI].dx(admsProbeID_V_DI_BD);
15329 
15330 
15331 #ifdef Xyce_DEBUG_DEVICE
15332  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15333  {
15334  Xyce::dout() << " (*f_SI_Equ_BD_Node_Ptr) += " << -staticContributions[admsNodeID_SI].dx(admsProbeID_V_DI_BD)<< std::endl;
15335  }
15336 #endif
15337  (*f_BD_Equ_SI_Node_Ptr) += +staticContributions[admsNodeID_BD].dx(admsProbeID_V_SI_BS);
15338 
15339 
15340 #ifdef Xyce_DEBUG_DEVICE
15341  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15342  {
15343  Xyce::dout() << " (*f_BD_Equ_SI_Node_Ptr) += " << +staticContributions[admsNodeID_BD].dx(admsProbeID_V_SI_BS)<< std::endl;
15344  }
15345 #endif
15346  (*f_BD_Equ_BS_Node_Ptr) += -staticContributions[admsNodeID_BD].dx(admsProbeID_V_SI_BS);
15347 
15348 
15349 #ifdef Xyce_DEBUG_DEVICE
15350  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15351  {
15352  Xyce::dout() << " (*f_BD_Equ_BS_Node_Ptr) += " << -staticContributions[admsNodeID_BD].dx(admsProbeID_V_SI_BS)<< std::endl;
15353  }
15354 #endif
15355  (*f_DI_Equ_BS_Node_Ptr) += -staticContributions[admsNodeID_DI].dx(admsProbeID_V_SI_BS);
15356 
15357 
15358 #ifdef Xyce_DEBUG_DEVICE
15359  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15360  {
15361  Xyce::dout() << " (*f_DI_Equ_BS_Node_Ptr) += " << -staticContributions[admsNodeID_DI].dx(admsProbeID_V_SI_BS)<< std::endl;
15362  }
15363 #endif
15364  (*f_BD_Equ_DI_Node_Ptr) += +staticContributions[admsNodeID_BD].dx(admsProbeID_V_DI_BD);
15365 
15366 
15367 #ifdef Xyce_DEBUG_DEVICE
15368  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15369  {
15370  Xyce::dout() << " (*f_BD_Equ_DI_Node_Ptr) += " << +staticContributions[admsNodeID_BD].dx(admsProbeID_V_DI_BD)<< std::endl;
15371  }
15372 #endif
15374 
15375 
15376 #ifdef Xyce_DEBUG_DEVICE
15377  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15378  {
15379  Xyce::dout() << " (*f_BD_Equ_BD_Node_Ptr) += " << +staticContributions[admsNodeID_BD].dx(admsProbeID_V_BD_BI) -staticContributions[admsNodeID_BD].dx(admsProbeID_V_DI_BD)<< std::endl;
15380  }
15381 #endif
15382  (*f_DI_Equ_BD_Node_Ptr) += -staticContributions[admsNodeID_DI].dx(admsProbeID_V_DI_BD);
15383 
15384 
15385 #ifdef Xyce_DEBUG_DEVICE
15386  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15387  {
15388  Xyce::dout() << " (*f_DI_Equ_BD_Node_Ptr) += " << -staticContributions[admsNodeID_DI].dx(admsProbeID_V_DI_BD)<< std::endl;
15389  }
15390 #endif
15391  (*f_G_Equ_G_Node_Ptr) += +staticContributions[admsNodeID_G].dx(admsProbeID_V_G_GP);
15392 
15393 
15394 #ifdef Xyce_DEBUG_DEVICE
15395  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15396  {
15397  Xyce::dout() << " (*f_G_Equ_G_Node_Ptr) += " << +staticContributions[admsNodeID_G].dx(admsProbeID_V_G_GP)<< std::endl;
15398  }
15399 #endif
15400  (*f_G_Equ_GP_Node_Ptr) += -staticContributions[admsNodeID_G].dx(admsProbeID_V_G_GP);
15401 
15402 
15403 #ifdef Xyce_DEBUG_DEVICE
15404  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15405  {
15406  Xyce::dout() << " (*f_G_Equ_GP_Node_Ptr) += " << -staticContributions[admsNodeID_G].dx(admsProbeID_V_G_GP)<< std::endl;
15407  }
15408 #endif
15409  (*f_GP_Equ_G_Node_Ptr) += +staticContributions[admsNodeID_GP].dx(admsProbeID_V_G_GP);
15410 
15411 
15412 #ifdef Xyce_DEBUG_DEVICE
15413  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15414  {
15415  Xyce::dout() << " (*f_GP_Equ_G_Node_Ptr) += " << +staticContributions[admsNodeID_GP].dx(admsProbeID_V_G_GP)<< std::endl;
15416  }
15417 #endif
15418  (*f_S_Equ_S_Node_Ptr) += +staticContributions[admsNodeID_S].dx(admsProbeID_V_S_SI);
15419 
15420 
15421 #ifdef Xyce_DEBUG_DEVICE
15422  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15423  {
15424  Xyce::dout() << " (*f_S_Equ_S_Node_Ptr) += " << +staticContributions[admsNodeID_S].dx(admsProbeID_V_S_SI)<< std::endl;
15425  }
15426 #endif
15427  (*f_S_Equ_SI_Node_Ptr) += -staticContributions[admsNodeID_S].dx(admsProbeID_V_S_SI);
15428 
15429 
15430 #ifdef Xyce_DEBUG_DEVICE
15431  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15432  {
15433  Xyce::dout() << " (*f_S_Equ_SI_Node_Ptr) += " << -staticContributions[admsNodeID_S].dx(admsProbeID_V_S_SI)<< std::endl;
15434  }
15435 #endif
15436  (*f_SI_Equ_S_Node_Ptr) += +staticContributions[admsNodeID_SI].dx(admsProbeID_V_S_SI);
15437 
15438 
15439 #ifdef Xyce_DEBUG_DEVICE
15440  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15441  {
15442  Xyce::dout() << " (*f_SI_Equ_S_Node_Ptr) += " << +staticContributions[admsNodeID_SI].dx(admsProbeID_V_S_SI)<< std::endl;
15443  }
15444 #endif
15445  (*f_D_Equ_D_Node_Ptr) += +staticContributions[admsNodeID_D].dx(admsProbeID_V_D_DI);
15446 
15447 
15448 #ifdef Xyce_DEBUG_DEVICE
15449  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15450  {
15451  Xyce::dout() << " (*f_D_Equ_D_Node_Ptr) += " << +staticContributions[admsNodeID_D].dx(admsProbeID_V_D_DI)<< std::endl;
15452  }
15453 #endif
15454  (*f_D_Equ_DI_Node_Ptr) += -staticContributions[admsNodeID_D].dx(admsProbeID_V_D_DI);
15455 
15456 
15457 #ifdef Xyce_DEBUG_DEVICE
15458  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15459  {
15460  Xyce::dout() << " (*f_D_Equ_DI_Node_Ptr) += " << -staticContributions[admsNodeID_D].dx(admsProbeID_V_D_DI)<< std::endl;
15461  }
15462 #endif
15463  (*f_DI_Equ_D_Node_Ptr) += +staticContributions[admsNodeID_DI].dx(admsProbeID_V_D_DI);
15464 
15465 
15466 #ifdef Xyce_DEBUG_DEVICE
15467  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15468  {
15469  Xyce::dout() << " (*f_DI_Equ_D_Node_Ptr) += " << +staticContributions[admsNodeID_DI].dx(admsProbeID_V_D_DI)<< std::endl;
15470  }
15471 #endif
15472  (*f_BP_Equ_BI_Node_Ptr) += -staticContributions[admsNodeID_BP].dx(admsProbeID_V_BP_BI);
15473 
15474 
15475 #ifdef Xyce_DEBUG_DEVICE
15476  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15477  {
15478  Xyce::dout() << " (*f_BP_Equ_BI_Node_Ptr) += " << -staticContributions[admsNodeID_BP].dx(admsProbeID_V_BP_BI)<< std::endl;
15479  }
15480 #endif
15481  (*f_BI_Equ_BP_Node_Ptr) += +staticContributions[admsNodeID_BI].dx(admsProbeID_V_BP_BI);
15482 
15483 
15484 #ifdef Xyce_DEBUG_DEVICE
15485  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15486  {
15487  Xyce::dout() << " (*f_BI_Equ_BP_Node_Ptr) += " << +staticContributions[admsNodeID_BI].dx(admsProbeID_V_BP_BI)<< std::endl;
15488  }
15489 #endif
15491 
15492 
15493 #ifdef Xyce_DEBUG_DEVICE
15494  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15495  {
15497  }
15498 #endif
15499  (*f_BS_Equ_BI_Node_Ptr) += -staticContributions[admsNodeID_BS].dx(admsProbeID_V_BS_BI);
15500 
15501 
15502 #ifdef Xyce_DEBUG_DEVICE
15503  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15504  {
15505  Xyce::dout() << " (*f_BS_Equ_BI_Node_Ptr) += " << -staticContributions[admsNodeID_BS].dx(admsProbeID_V_BS_BI)<< std::endl;
15506  }
15507 #endif
15508  (*f_BI_Equ_BS_Node_Ptr) += +staticContributions[admsNodeID_BI].dx(admsProbeID_V_BS_BI);
15509 
15510 
15511 #ifdef Xyce_DEBUG_DEVICE
15512  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15513  {
15514  Xyce::dout() << " (*f_BI_Equ_BS_Node_Ptr) += " << +staticContributions[admsNodeID_BI].dx(admsProbeID_V_BS_BI)<< std::endl;
15515  }
15516 #endif
15517  (*f_BD_Equ_BI_Node_Ptr) += -staticContributions[admsNodeID_BD].dx(admsProbeID_V_BD_BI);
15518 
15519 
15520 #ifdef Xyce_DEBUG_DEVICE
15521  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15522  {
15523  Xyce::dout() << " (*f_BD_Equ_BI_Node_Ptr) += " << -staticContributions[admsNodeID_BD].dx(admsProbeID_V_BD_BI)<< std::endl;
15524  }
15525 #endif
15526  (*f_BI_Equ_BD_Node_Ptr) += +staticContributions[admsNodeID_BI].dx(admsProbeID_V_BD_BI);
15527 
15528 
15529 #ifdef Xyce_DEBUG_DEVICE
15530  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15531  {
15532  Xyce::dout() << " (*f_BI_Equ_BD_Node_Ptr) += " << +staticContributions[admsNodeID_BI].dx(admsProbeID_V_BD_BI)<< std::endl;
15533  }
15534 #endif
15535  (*f_B_Equ_B_Node_Ptr) += +staticContributions[admsNodeID_B].dx(admsProbeID_V_B_BI);
15536 
15537 
15538 #ifdef Xyce_DEBUG_DEVICE
15539  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15540  {
15541  Xyce::dout() << " (*f_B_Equ_B_Node_Ptr) += " << +staticContributions[admsNodeID_B].dx(admsProbeID_V_B_BI)<< std::endl;
15542  }
15543 #endif
15544  (*f_B_Equ_BI_Node_Ptr) += -staticContributions[admsNodeID_B].dx(admsProbeID_V_B_BI);
15545 
15546 
15547 #ifdef Xyce_DEBUG_DEVICE
15548  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15549  {
15550  Xyce::dout() << " (*f_B_Equ_BI_Node_Ptr) += " << -staticContributions[admsNodeID_B].dx(admsProbeID_V_B_BI)<< std::endl;
15551  }
15552 #endif
15553  (*f_BI_Equ_B_Node_Ptr) += +staticContributions[admsNodeID_BI].dx(admsProbeID_V_B_BI);
15554 
15555 
15556 #ifdef Xyce_DEBUG_DEVICE
15557  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15558  {
15559  Xyce::dout() << " (*f_BI_Equ_B_Node_Ptr) += " << +staticContributions[admsNodeID_BI].dx(admsProbeID_V_B_BI)<< std::endl;
15560  }
15561 #endif
15562 
15563 
15564  return bsuccess;
15565 }
15566 
15567 
15568 //-----------------------------------------------------------------------------
15569 // Function : Instance::loadDAEdQdx
15570 // Purpose :
15571 // Special Notes : Load the dQdx ("dynamic jacobian") matrix
15572 // Scope : public
15573 // Creator : admsXml
15574 // Creation Date :
15575 //-----------------------------------------------------------------------------
15577 {
15578  bool bsuccess = true;
15579  N_LAS_Matrix * dQdxMatPtr = extData.dQdxMatrixPtr;
15580 
15581 #ifdef Xyce_DEBUG_DEVICE
15582  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15583  {
15584  Xyce::dout() << subsection_divider << std::endl;
15585  Xyce::dout() << "ADMSPSP103VA::Instance::loadDAEdQdx (" << getName() << "):" << std::endl;
15586  }
15587 #endif
15589 
15590 
15591 #ifdef Xyce_DEBUG_DEVICE
15592  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15593  {
15595  }
15596 #endif
15597  (*q_DI_Equ_BP_Node_Ptr) += -dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_SI_BP);
15598 
15599 
15600 #ifdef Xyce_DEBUG_DEVICE
15601  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15602  {
15603  Xyce::dout() << " (*q_DI_Equ_BP_Node_Ptr) += " << -dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_SI_BP)<< std::endl;
15604  }
15605 #endif
15607 
15608 
15609 #ifdef Xyce_DEBUG_DEVICE
15610  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15611  {
15613  }
15614 #endif
15615  (*q_BP_Equ_BP_Node_Ptr) += -dynamicContributions[admsNodeID_BP].dx(admsProbeID_V_SI_BP);
15616 
15617 
15618 #ifdef Xyce_DEBUG_DEVICE
15619  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15620  {
15621  Xyce::dout() << " (*q_BP_Equ_BP_Node_Ptr) += " << -dynamicContributions[admsNodeID_BP].dx(admsProbeID_V_SI_BP)<< std::endl;
15622  }
15623 #endif
15624  (*q_DI_Equ_GP_Node_Ptr) += +dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_GP_SI);
15625 
15626 
15627 #ifdef Xyce_DEBUG_DEVICE
15628  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15629  {
15630  Xyce::dout() << " (*q_DI_Equ_GP_Node_Ptr) += " << +dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_GP_SI)<< std::endl;
15631  }
15632 #endif
15633  (*q_BP_Equ_GP_Node_Ptr) += +dynamicContributions[admsNodeID_BP].dx(admsProbeID_V_GP_SI);
15634 
15635 
15636 #ifdef Xyce_DEBUG_DEVICE
15637  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15638  {
15639  Xyce::dout() << " (*q_BP_Equ_GP_Node_Ptr) += " << +dynamicContributions[admsNodeID_BP].dx(admsProbeID_V_GP_SI)<< std::endl;
15640  }
15641 #endif
15643 
15644 
15645 #ifdef Xyce_DEBUG_DEVICE
15646  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15647  {
15648  Xyce::dout() << " (*q_DI_Equ_DI_Node_Ptr) += " << +dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_DI_BD) +dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_DI_SI)<< std::endl;
15649  }
15650 #endif
15651  (*q_BP_Equ_DI_Node_Ptr) += +dynamicContributions[admsNodeID_BP].dx(admsProbeID_V_DI_SI);
15652 
15653 
15654 #ifdef Xyce_DEBUG_DEVICE
15655  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15656  {
15657  Xyce::dout() << " (*q_BP_Equ_DI_Node_Ptr) += " << +dynamicContributions[admsNodeID_BP].dx(admsProbeID_V_DI_SI)<< std::endl;
15658  }
15659 #endif
15661 
15662 
15663 #ifdef Xyce_DEBUG_DEVICE
15664  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15665  {
15667  }
15668 #endif
15669  (*q_SI_Equ_BP_Node_Ptr) += -dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_SI_BP);
15670 
15671 
15672 #ifdef Xyce_DEBUG_DEVICE
15673  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15674  {
15675  Xyce::dout() << " (*q_SI_Equ_BP_Node_Ptr) += " << -dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_SI_BP)<< std::endl;
15676  }
15677 #endif
15678  (*q_SI_Equ_GP_Node_Ptr) += +dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_GP_SI);
15679 
15680 
15681 #ifdef Xyce_DEBUG_DEVICE
15682  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15683  {
15684  Xyce::dout() << " (*q_SI_Equ_GP_Node_Ptr) += " << +dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_GP_SI)<< std::endl;
15685  }
15686 #endif
15688 
15689 
15690 #ifdef Xyce_DEBUG_DEVICE
15691  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15692  {
15693  Xyce::dout() << " (*q_SI_Equ_DI_Node_Ptr) += " << +dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_DI_BD) +dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_DI_SI)<< std::endl;
15694  }
15695 #endif
15697 
15698 
15699 #ifdef Xyce_DEBUG_DEVICE
15700  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15701  {
15703  }
15704 #endif
15705  (*q_GP_Equ_BP_Node_Ptr) += -dynamicContributions[admsNodeID_GP].dx(admsProbeID_V_SI_BP);
15706 
15707 
15708 #ifdef Xyce_DEBUG_DEVICE
15709  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15710  {
15711  Xyce::dout() << " (*q_GP_Equ_BP_Node_Ptr) += " << -dynamicContributions[admsNodeID_GP].dx(admsProbeID_V_SI_BP)<< std::endl;
15712  }
15713 #endif
15714  (*q_GP_Equ_DI_Node_Ptr) += +dynamicContributions[admsNodeID_GP].dx(admsProbeID_V_DI_SI);
15715 
15716 
15717 #ifdef Xyce_DEBUG_DEVICE
15718  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15719  {
15720  Xyce::dout() << " (*q_GP_Equ_DI_Node_Ptr) += " << +dynamicContributions[admsNodeID_GP].dx(admsProbeID_V_DI_SI)<< std::endl;
15721  }
15722 #endif
15723  (*q_GP_Equ_GP_Node_Ptr) += +dynamicContributions[admsNodeID_GP].dx(admsProbeID_V_GP_SI);
15724 
15725 
15726 #ifdef Xyce_DEBUG_DEVICE
15727  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15728  {
15729  Xyce::dout() << " (*q_GP_Equ_GP_Node_Ptr) += " << +dynamicContributions[admsNodeID_GP].dx(admsProbeID_V_GP_SI)<< std::endl;
15730  }
15731 #endif
15732  (*q_BS_Equ_SI_Node_Ptr) += +dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_SI_BS);
15733 
15734 
15735 #ifdef Xyce_DEBUG_DEVICE
15736  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15737  {
15738  Xyce::dout() << " (*q_BS_Equ_SI_Node_Ptr) += " << +dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_SI_BS)<< std::endl;
15739  }
15740 #endif
15741  (*q_BS_Equ_BS_Node_Ptr) += -dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_SI_BS);
15742 
15743 
15744 #ifdef Xyce_DEBUG_DEVICE
15745  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15746  {
15747  Xyce::dout() << " (*q_BS_Equ_BS_Node_Ptr) += " << -dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_SI_BS)<< std::endl;
15748  }
15749 #endif
15750  (*q_SI_Equ_BS_Node_Ptr) += -dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_SI_BS);
15751 
15752 
15753 #ifdef Xyce_DEBUG_DEVICE
15754  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15755  {
15756  Xyce::dout() << " (*q_SI_Equ_BS_Node_Ptr) += " << -dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_SI_BS)<< std::endl;
15757  }
15758 #endif
15759  (*q_BS_Equ_DI_Node_Ptr) += +dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_DI_BD);
15760 
15761 
15762 #ifdef Xyce_DEBUG_DEVICE
15763  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15764  {
15765  Xyce::dout() << " (*q_BS_Equ_DI_Node_Ptr) += " << +dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_DI_BD)<< std::endl;
15766  }
15767 #endif
15768  (*q_BS_Equ_BD_Node_Ptr) += -dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_DI_BD);
15769 
15770 
15771 #ifdef Xyce_DEBUG_DEVICE
15772  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15773  {
15774  Xyce::dout() << " (*q_BS_Equ_BD_Node_Ptr) += " << -dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_DI_BD)<< std::endl;
15775  }
15776 #endif
15777  (*q_SI_Equ_BD_Node_Ptr) += -dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_DI_BD);
15778 
15779 
15780 #ifdef Xyce_DEBUG_DEVICE
15781  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15782  {
15783  Xyce::dout() << " (*q_SI_Equ_BD_Node_Ptr) += " << -dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_DI_BD)<< std::endl;
15784  }
15785 #endif
15786  (*q_BD_Equ_SI_Node_Ptr) += +dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_SI_BS);
15787 
15788 
15789 #ifdef Xyce_DEBUG_DEVICE
15790  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15791  {
15792  Xyce::dout() << " (*q_BD_Equ_SI_Node_Ptr) += " << +dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_SI_BS)<< std::endl;
15793  }
15794 #endif
15795  (*q_BD_Equ_BS_Node_Ptr) += -dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_SI_BS);
15796 
15797 
15798 #ifdef Xyce_DEBUG_DEVICE
15799  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15800  {
15801  Xyce::dout() << " (*q_BD_Equ_BS_Node_Ptr) += " << -dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_SI_BS)<< std::endl;
15802  }
15803 #endif
15804  (*q_DI_Equ_BS_Node_Ptr) += -dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_SI_BS);
15805 
15806 
15807 #ifdef Xyce_DEBUG_DEVICE
15808  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15809  {
15810  Xyce::dout() << " (*q_DI_Equ_BS_Node_Ptr) += " << -dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_SI_BS)<< std::endl;
15811  }
15812 #endif
15813  (*q_BD_Equ_DI_Node_Ptr) += +dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_DI_BD);
15814 
15815 
15816 #ifdef Xyce_DEBUG_DEVICE
15817  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15818  {
15819  Xyce::dout() << " (*q_BD_Equ_DI_Node_Ptr) += " << +dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_DI_BD)<< std::endl;
15820  }
15821 #endif
15822  (*q_BD_Equ_BD_Node_Ptr) += -dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_DI_BD);
15823 
15824 
15825 #ifdef Xyce_DEBUG_DEVICE
15826  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15827  {
15828  Xyce::dout() << " (*q_BD_Equ_BD_Node_Ptr) += " << -dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_DI_BD)<< std::endl;
15829  }
15830 #endif
15831  (*q_DI_Equ_BD_Node_Ptr) += -dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_DI_BD);
15832 
15833 
15834 #ifdef Xyce_DEBUG_DEVICE
15835  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15836  {
15837  Xyce::dout() << " (*q_DI_Equ_BD_Node_Ptr) += " << -dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_DI_BD)<< std::endl;
15838  }
15839 #endif
15840 
15841 
15842  return bsuccess;
15843 }
15844 
15845 //-----------------------------------------------------------------------------
15846 // Function : Instance::updateTemperature
15847 // Purpose : Set temperature and update any parameters that depend on it
15848 // Special Notes : In Xyce ADMS, we'll simply copy the temperature, which is
15849 // in Kelvin, to our "admsTemperature" variable, which needs
15850 // to be in Celsius.
15851 // Scope : public
15852 // Creator : admsXml
15853 // Creation Date :
15854 //-----------------------------------------------------------------------------
15855 bool Instance::updateTemperature(const double & temperatureTemp)
15856 {
15857 
15858  admsTemperature = temperatureTemp;
15859  adms_vt_nom = adms_vt(temperatureTemp);
15860 
15861  return true;
15862 }
15863 
15864 // Class Model
15865 //-----------------------------------------------------------------------------
15866 // Function : Model::processParams
15867 // Purpose :
15868 // Special Notes :
15869 // Scope : public
15870 // Creator : admsXml
15871 // Creation Date :
15872 //-----------------------------------------------------------------------------
15874 {
15875 
15876  // Now we need to check that any parameters are within their ranges as
15877  // specified in the verilog:
15878 
15879  // Parameter TYPE : [ (-1.0), 1.0 ]
15880  if ( (!((TYPE >=(-1.0) && TYPE <=1.0 ))) )
15881  {
15882  UserError0(*this) << "ADMSPSP103VA: Parameter TYPE value " << TYPE << " out of range [ (-1.0), 1.0 ]";
15883  }
15884 
15885  // Parameter TR : [ (-273.0), (+inf) [
15886  if ( (!((TR >=(-273.0)))) )
15887  {
15888  UserError0(*this) << "ADMSPSP103VA: Parameter TR value " << TR << " out of range [ (-273.0), (+inf) [";
15889  }
15890 
15891  // Parameter SWGEO : [ 0.0, 2.0 ]
15892  if ( (!((SWGEO >=0.0 && SWGEO <=2.0 ))) )
15893  {
15894  UserError0(*this) << "ADMSPSP103VA: Parameter SWGEO value " << SWGEO << " out of range [ 0.0, 2.0 ]";
15895  }
15896 
15897  // Parameter SWIGATE : [ 0.0, 1.0 ]
15898  if ( (!((SWIGATE >=0.0 && SWIGATE <=1.0 ))) )
15899  {
15900  UserError0(*this) << "ADMSPSP103VA: Parameter SWIGATE value " << SWIGATE << " out of range [ 0.0, 1.0 ]";
15901  }
15902 
15903  // Parameter SWIMPACT : [ 0.0, 1.0 ]
15904  if ( (!((SWIMPACT >=0.0 && SWIMPACT <=1.0 ))) )
15905  {
15906  UserError0(*this) << "ADMSPSP103VA: Parameter SWIMPACT value " << SWIMPACT << " out of range [ 0.0, 1.0 ]";
15907  }
15908 
15909  // Parameter SWGIDL : [ 0.0, 1.0 ]
15910  if ( (!((SWGIDL >=0.0 && SWGIDL <=1.0 ))) )
15911  {
15912  UserError0(*this) << "ADMSPSP103VA: Parameter SWGIDL value " << SWGIDL << " out of range [ 0.0, 1.0 ]";
15913  }
15914 
15915  // Parameter SWJUNCAP : [ 0.0, 3.0 ]
15916  if ( (!((SWJUNCAP >=0.0 && SWJUNCAP <=3.0 ))) )
15917  {
15918  UserError0(*this) << "ADMSPSP103VA: Parameter SWJUNCAP value " << SWJUNCAP << " out of range [ 0.0, 3.0 ]";
15919  }
15920 
15921  // Parameter SWNUD : [ 0.0, 2.0 ]
15922  if ( (!((SWNUD >=0.0 && SWNUD <=2.0 ))) )
15923  {
15924  UserError0(*this) << "ADMSPSP103VA: Parameter SWNUD value " << SWNUD << " out of range [ 0.0, 2.0 ]";
15925  }
15926 
15927  // Parameter SWDELVTAC : [ 0.0, 1.0 ]
15928  if ( (!((SWDELVTAC >=0.0 && SWDELVTAC <=1.0 ))) )
15929  {
15930  UserError0(*this) << "ADMSPSP103VA: Parameter SWDELVTAC value " << SWDELVTAC << " out of range [ 0.0, 1.0 ]";
15931  }
15932 
15933  // Parameter QMC : [ 0.0, (+inf) [
15934  if ( (!((QMC >=0.0))) )
15935  {
15936  UserError0(*this) << "ADMSPSP103VA: Parameter QMC value " << QMC << " out of range [ 0.0, (+inf) [";
15937  }
15938 
15939  // Parameter TOX : [ 1e-10, (+inf) [
15940  if ( (!((TOX >=1e-10))) )
15941  {
15942  UserError0(*this) << "ADMSPSP103VA: Parameter TOX value " << TOX << " out of range [ 1e-10, (+inf) [";
15943  }
15944 
15945  // Parameter EPSROX : [ 1.0, (+inf) [
15946  if ( (!((EPSROX >=1.0))) )
15947  {
15948  UserError0(*this) << "ADMSPSP103VA: Parameter EPSROX value " << EPSROX << " out of range [ 1.0, (+inf) [";
15949  }
15950 
15951  // Parameter NEFF : [ 1e20, 1e26 ]
15952  if ( (!((NEFF >=1e20 && NEFF <=1e26 ))) )
15953  {
15954  UserError0(*this) << "ADMSPSP103VA: Parameter NEFF value " << NEFF << " out of range [ 1e20, 1e26 ]";
15955  }
15956 
15957  // Parameter FACNEFFAC : [ 0.0, (+inf) [
15958  if ( (!((FACNEFFAC >=0.0))) )
15959  {
15960  UserError0(*this) << "ADMSPSP103VA: Parameter FACNEFFAC value " << FACNEFFAC << " out of range [ 0.0, (+inf) [";
15961  }
15962 
15963  // Parameter GFACNUD : [ 0.01, (+inf) [
15964  if ( (!((GFACNUD >=0.01))) )
15965  {
15966  UserError0(*this) << "ADMSPSP103VA: Parameter GFACNUD value " << GFACNUD << " out of range [ 0.01, (+inf) [";
15967  }
15968 
15969  // Parameter VSBNUD : [ 0.0, (+inf) [
15970  if ( (!((VSBNUD >=0.0))) )
15971  {
15972  UserError0(*this) << "ADMSPSP103VA: Parameter VSBNUD value " << VSBNUD << " out of range [ 0.0, (+inf) [";
15973  }
15974 
15975  // Parameter DVSBNUD : [ 0.1, (+inf) [
15976  if ( (!((DVSBNUD >=0.1))) )
15977  {
15978  UserError0(*this) << "ADMSPSP103VA: Parameter DVSBNUD value " << DVSBNUD << " out of range [ 0.1, (+inf) [";
15979  }
15980 
15981  // Parameter NSLP : [ 1e-3, (+inf) [
15982  if ( (!((NSLP >=1e-3))) )
15983  {
15984  UserError0(*this) << "ADMSPSP103VA: Parameter NSLP value " << NSLP << " out of range [ 1e-3, (+inf) [";
15985  }
15986 
15987  // Parameter DNSUB : [ 0.0, 1.0 ]
15988  if ( (!((DNSUB >=0.0 && DNSUB <=1.0 ))) )
15989  {
15990  UserError0(*this) << "ADMSPSP103VA: Parameter DNSUB value " << DNSUB << " out of range [ 0.0, 1.0 ]";
15991  }
15992 
15993  // Parameter NP : [ 0.0, (+inf) [
15994  if ( (!((NP >=0.0))) )
15995  {
15996  UserError0(*this) << "ADMSPSP103VA: Parameter NP value " << NP << " out of range [ 0.0, (+inf) [";
15997  }
15998 
15999  // Parameter CT : [ 0.0, (+inf) [
16000  if ( (!((CT >=0.0))) )
16001  {
16002  UserError0(*this) << "ADMSPSP103VA: Parameter CT value " << CT << " out of range [ 0.0, (+inf) [";
16003  }
16004 
16005  // Parameter TOXOV : [ 1e-10, (+inf) [
16006  if ( (!((TOXOV >=1e-10))) )
16007  {
16008  UserError0(*this) << "ADMSPSP103VA: Parameter TOXOV value " << TOXOV << " out of range [ 1e-10, (+inf) [";
16009  }
16010 
16011  // Parameter TOXOVD : [ 1e-10, (+inf) [
16012  if ( (!((TOXOVD >=1e-10))) )
16013  {
16014  UserError0(*this) << "ADMSPSP103VA: Parameter TOXOVD value " << TOXOVD << " out of range [ 1e-10, (+inf) [";
16015  }
16016 
16017  // Parameter NOV : [ 1e20, 1e27 ]
16018  if ( (!((NOV >=1e20 && NOV <=1e27 ))) )
16019  {
16020  UserError0(*this) << "ADMSPSP103VA: Parameter NOV value " << NOV << " out of range [ 1e20, 1e27 ]";
16021  }
16022 
16023  // Parameter NOVD : [ 1e20, 1e27 ]
16024  if ( (!((NOVD >=1e20 && NOVD <=1e27 ))) )
16025  {
16026  UserError0(*this) << "ADMSPSP103VA: Parameter NOVD value " << NOVD << " out of range [ 1e20, 1e27 ]";
16027  }
16028 
16029  // Parameter CF : [ 0.0, (+inf) [
16030  if ( (!((CF >=0.0))) )
16031  {
16032  UserError0(*this) << "ADMSPSP103VA: Parameter CF value " << CF << " out of range [ 0.0, (+inf) [";
16033  }
16034 
16035  // Parameter CFB : [ 0.0, 1.0 ]
16036  if ( (!((CFB >=0.0 && CFB <=1.0 ))) )
16037  {
16038  UserError0(*this) << "ADMSPSP103VA: Parameter CFB value " << CFB << " out of range [ 0.0, 1.0 ]";
16039  }
16040 
16041  // Parameter BETN : [ 0.0, (+inf) [
16042  if ( (!((BETN >=0.0))) )
16043  {
16044  UserError0(*this) << "ADMSPSP103VA: Parameter BETN value " << BETN << " out of range [ 0.0, (+inf) [";
16045  }
16046 
16047  // Parameter MUE : [ 0.0, (+inf) [
16048  if ( (!((MUE >=0.0))) )
16049  {
16050  UserError0(*this) << "ADMSPSP103VA: Parameter MUE value " << MUE << " out of range [ 0.0, (+inf) [";
16051  }
16052 
16053  // Parameter THEMU : [ 0.0, (+inf) [
16054  if ( (!((THEMU >=0.0))) )
16055  {
16056  UserError0(*this) << "ADMSPSP103VA: Parameter THEMU value " << THEMU << " out of range [ 0.0, (+inf) [";
16057  }
16058 
16059  // Parameter CS : [ 0.0, (+inf) [
16060  if ( (!((CS >=0.0))) )
16061  {
16062  UserError0(*this) << "ADMSPSP103VA: Parameter CS value " << CS << " out of range [ 0.0, (+inf) [";
16063  }
16064 
16065  // Parameter XCOR : [ 0.0, (+inf) [
16066  if ( (!((XCOR >=0.0))) )
16067  {
16068  UserError0(*this) << "ADMSPSP103VA: Parameter XCOR value " << XCOR << " out of range [ 0.0, (+inf) [";
16069  }
16070 
16071  // Parameter FETA : [ 0.0, (+inf) [
16072  if ( (!((FETA >=0.0))) )
16073  {
16074  UserError0(*this) << "ADMSPSP103VA: Parameter FETA value " << FETA << " out of range [ 0.0, (+inf) [";
16075  }
16076 
16077  // Parameter RS : [ 0.0, (+inf) [
16078  if ( (!((RS >=0.0))) )
16079  {
16080  UserError0(*this) << "ADMSPSP103VA: Parameter RS value " << RS << " out of range [ 0.0, (+inf) [";
16081  }
16082 
16083  // Parameter RSB : [ (-0.5), 1.0 ]
16084  if ( (!((RSB >=(-0.5) && RSB <=1.0 ))) )
16085  {
16086  UserError0(*this) << "ADMSPSP103VA: Parameter RSB value " << RSB << " out of range [ (-0.5), 1.0 ]";
16087  }
16088 
16089  // Parameter RSG : [ (-0.5), (+inf) [
16090  if ( (!((RSG >=(-0.5)))) )
16091  {
16092  UserError0(*this) << "ADMSPSP103VA: Parameter RSG value " << RSG << " out of range [ (-0.5), (+inf) [";
16093  }
16094 
16095  // Parameter THESAT : [ 0.0, (+inf) [
16096  if ( (!((THESAT >=0.0))) )
16097  {
16098  UserError0(*this) << "ADMSPSP103VA: Parameter THESAT value " << THESAT << " out of range [ 0.0, (+inf) [";
16099  }
16100 
16101  // Parameter THESATB : [ (-0.5), 1.0 ]
16102  if ( (!((THESATB >=(-0.5) && THESATB <=1.0 ))) )
16103  {
16104  UserError0(*this) << "ADMSPSP103VA: Parameter THESATB value " << THESATB << " out of range [ (-0.5), 1.0 ]";
16105  }
16106 
16107  // Parameter THESATG : [ (-0.5), (+inf) [
16108  if ( (!((THESATG >=(-0.5)))) )
16109  {
16110  UserError0(*this) << "ADMSPSP103VA: Parameter THESATG value " << THESATG << " out of range [ (-0.5), (+inf) [";
16111  }
16112 
16113  // Parameter AX : [ 2.0, (+inf) [
16114  if ( (!((AX >=2.0))) )
16115  {
16116  UserError0(*this) << "ADMSPSP103VA: Parameter AX value " << AX << " out of range [ 2.0, (+inf) [";
16117  }
16118 
16119  // Parameter ALP : [ 0.0, (+inf) [
16120  if ( (!((ALP >=0.0))) )
16121  {
16122  UserError0(*this) << "ADMSPSP103VA: Parameter ALP value " << ALP << " out of range [ 0.0, (+inf) [";
16123  }
16124 
16125  // Parameter ALP1 : [ 0.0, (+inf) [
16126  if ( (!((ALP1 >=0.0))) )
16127  {
16128  UserError0(*this) << "ADMSPSP103VA: Parameter ALP1 value " << ALP1 << " out of range [ 0.0, (+inf) [";
16129  }
16130 
16131  // Parameter ALP2 : [ 0.0, (+inf) [
16132  if ( (!((ALP2 >=0.0))) )
16133  {
16134  UserError0(*this) << "ADMSPSP103VA: Parameter ALP2 value " << ALP2 << " out of range [ 0.0, (+inf) [";
16135  }
16136 
16137  // Parameter VP : [ 1e-10, (+inf) [
16138  if ( (!((VP >=1e-10))) )
16139  {
16140  UserError0(*this) << "ADMSPSP103VA: Parameter VP value " << VP << " out of range [ 1e-10, (+inf) [";
16141  }
16142 
16143  // Parameter A1 : [ 0.0, (+inf) [
16144  if ( (!((A1 >=0.0))) )
16145  {
16146  UserError0(*this) << "ADMSPSP103VA: Parameter A1 value " << A1 << " out of range [ 0.0, (+inf) [";
16147  }
16148 
16149  // Parameter A2 : [ 0.0, (+inf) [
16150  if ( (!((A2 >=0.0))) )
16151  {
16152  UserError0(*this) << "ADMSPSP103VA: Parameter A2 value " << A2 << " out of range [ 0.0, (+inf) [";
16153  }
16154 
16155  // Parameter A3 : [ 0.0, (+inf) [
16156  if ( (!((A3 >=0.0))) )
16157  {
16158  UserError0(*this) << "ADMSPSP103VA: Parameter A3 value " << A3 << " out of range [ 0.0, (+inf) [";
16159  }
16160 
16161  // Parameter A4 : [ 0.0, (+inf) [
16162  if ( (!((A4 >=0.0))) )
16163  {
16164  UserError0(*this) << "ADMSPSP103VA: Parameter A4 value " << A4 << " out of range [ 0.0, (+inf) [";
16165  }
16166 
16167  // Parameter GCO : [ (-10.0), 10.0 ]
16168  if ( (!((GCO >=(-10.0) && GCO <=10.0 ))) )
16169  {
16170  UserError0(*this) << "ADMSPSP103VA: Parameter GCO value " << GCO << " out of range [ (-10.0), 10.0 ]";
16171  }
16172 
16173  // Parameter IGINV : [ 0.0, (+inf) [
16174  if ( (!((IGINV >=0.0))) )
16175  {
16176  UserError0(*this) << "ADMSPSP103VA: Parameter IGINV value " << IGINV << " out of range [ 0.0, (+inf) [";
16177  }
16178 
16179  // Parameter IGOV : [ 0.0, (+inf) [
16180  if ( (!((IGOV >=0.0))) )
16181  {
16182  UserError0(*this) << "ADMSPSP103VA: Parameter IGOV value " << IGOV << " out of range [ 0.0, (+inf) [";
16183  }
16184 
16185  // Parameter IGOVD : [ 0.0, (+inf) [
16186  if ( (!((IGOVD >=0.0))) )
16187  {
16188  UserError0(*this) << "ADMSPSP103VA: Parameter IGOVD value " << IGOVD << " out of range [ 0.0, (+inf) [";
16189  }
16190 
16191  // Parameter GC2 : [ 0.0, 10.0 ]
16192  if ( (!((GC2 >=0.0 && GC2 <=10.0 ))) )
16193  {
16194  UserError0(*this) << "ADMSPSP103VA: Parameter GC2 value " << GC2 << " out of range [ 0.0, 10.0 ]";
16195  }
16196 
16197  // Parameter GC3 : [ (-2.0), 2.0 ]
16198  if ( (!((GC3 >=(-2.0) && GC3 <=2.0 ))) )
16199  {
16200  UserError0(*this) << "ADMSPSP103VA: Parameter GC3 value " << GC3 << " out of range [ (-2.0), 2.0 ]";
16201  }
16202 
16203  // Parameter CHIB : [ 1.0, (+inf) [
16204  if ( (!((CHIB >=1.0))) )
16205  {
16206  UserError0(*this) << "ADMSPSP103VA: Parameter CHIB value " << CHIB << " out of range [ 1.0, (+inf) [";
16207  }
16208 
16209  // Parameter AGIDL : [ 0.0, (+inf) [
16210  if ( (!((AGIDL >=0.0))) )
16211  {
16212  UserError0(*this) << "ADMSPSP103VA: Parameter AGIDL value " << AGIDL << " out of range [ 0.0, (+inf) [";
16213  }
16214 
16215  // Parameter AGIDLD : [ 0.0, (+inf) [
16216  if ( (!((AGIDLD >=0.0))) )
16217  {
16218  UserError0(*this) << "ADMSPSP103VA: Parameter AGIDLD value " << AGIDLD << " out of range [ 0.0, (+inf) [";
16219  }
16220 
16221  // Parameter BGIDL : [ 0.0, (+inf) [
16222  if ( (!((BGIDL >=0.0))) )
16223  {
16224  UserError0(*this) << "ADMSPSP103VA: Parameter BGIDL value " << BGIDL << " out of range [ 0.0, (+inf) [";
16225  }
16226 
16227  // Parameter BGIDLD : [ 0.0, (+inf) [
16228  if ( (!((BGIDLD >=0.0))) )
16229  {
16230  UserError0(*this) << "ADMSPSP103VA: Parameter BGIDLD value " << BGIDLD << " out of range [ 0.0, (+inf) [";
16231  }
16232 
16233  // Parameter COX : [ 0.0, (+inf) [
16234  if ( (!((COX >=0.0))) )
16235  {
16236  UserError0(*this) << "ADMSPSP103VA: Parameter COX value " << COX << " out of range [ 0.0, (+inf) [";
16237  }
16238 
16239  // Parameter CGOV : [ 0.0, (+inf) [
16240  if ( (!((CGOV >=0.0))) )
16241  {
16242  UserError0(*this) << "ADMSPSP103VA: Parameter CGOV value " << CGOV << " out of range [ 0.0, (+inf) [";
16243  }
16244 
16245  // Parameter CGOVD : [ 0.0, (+inf) [
16246  if ( (!((CGOVD >=0.0))) )
16247  {
16248  UserError0(*this) << "ADMSPSP103VA: Parameter CGOVD value " << CGOVD << " out of range [ 0.0, (+inf) [";
16249  }
16250 
16251  // Parameter CGBOV : [ 0.0, (+inf) [
16252  if ( (!((CGBOV >=0.0))) )
16253  {
16254  UserError0(*this) << "ADMSPSP103VA: Parameter CGBOV value " << CGBOV << " out of range [ 0.0, (+inf) [";
16255  }
16256 
16257  // Parameter CFR : [ 0.0, (+inf) [
16258  if ( (!((CFR >=0.0))) )
16259  {
16260  UserError0(*this) << "ADMSPSP103VA: Parameter CFR value " << CFR << " out of range [ 0.0, (+inf) [";
16261  }
16262 
16263  // Parameter CFRD : [ 0.0, (+inf) [
16264  if ( (!((CFRD >=0.0))) )
16265  {
16266  UserError0(*this) << "ADMSPSP103VA: Parameter CFRD value " << CFRD << " out of range [ 0.0, (+inf) [";
16267  }
16268 
16269  // Parameter FNT : [ 0.0, (+inf) [
16270  if ( (!((FNT >=0.0))) )
16271  {
16272  UserError0(*this) << "ADMSPSP103VA: Parameter FNT value " << FNT << " out of range [ 0.0, (+inf) [";
16273  }
16274 
16275  // Parameter NFA : [ 0.0, (+inf) [
16276  if ( (!((NFA >=0.0))) )
16277  {
16278  UserError0(*this) << "ADMSPSP103VA: Parameter NFA value " << NFA << " out of range [ 0.0, (+inf) [";
16279  }
16280 
16281  // Parameter NFB : [ 0.0, (+inf) [
16282  if ( (!((NFB >=0.0))) )
16283  {
16284  UserError0(*this) << "ADMSPSP103VA: Parameter NFB value " << NFB << " out of range [ 0.0, (+inf) [";
16285  }
16286 
16287  // Parameter NFC : [ 0.0, (+inf) [
16288  if ( (!((NFC >=0.0))) )
16289  {
16290  UserError0(*this) << "ADMSPSP103VA: Parameter NFC value " << NFC << " out of range [ 0.0, (+inf) [";
16291  }
16292 
16293  // Parameter EF : [ 0.0, (+inf) [
16294  if ( (!((EF >=0.0))) )
16295  {
16296  UserError0(*this) << "ADMSPSP103VA: Parameter EF value " << EF << " out of range [ 0.0, (+inf) [";
16297  }
16298 
16299  // Parameter RG : [ 0.0, (+inf) [
16300  if ( (!((RG >=0.0))) )
16301  {
16302  UserError0(*this) << "ADMSPSP103VA: Parameter RG value " << RG << " out of range [ 0.0, (+inf) [";
16303  }
16304 
16305  // Parameter RSE : [ 0.0, (+inf) [
16306  if ( (!((RSE >=0.0))) )
16307  {
16308  UserError0(*this) << "ADMSPSP103VA: Parameter RSE value " << RSE << " out of range [ 0.0, (+inf) [";
16309  }
16310 
16311  // Parameter RDE : [ 0.0, (+inf) [
16312  if ( (!((RDE >=0.0))) )
16313  {
16314  UserError0(*this) << "ADMSPSP103VA: Parameter RDE value " << RDE << " out of range [ 0.0, (+inf) [";
16315  }
16316 
16317  // Parameter RBULK : [ 0.0, (+inf) [
16318  if ( (!((RBULK >=0.0))) )
16319  {
16320  UserError0(*this) << "ADMSPSP103VA: Parameter RBULK value " << RBULK << " out of range [ 0.0, (+inf) [";
16321  }
16322 
16323  // Parameter RWELL : [ 0.0, (+inf) [
16324  if ( (!((RWELL >=0.0))) )
16325  {
16326  UserError0(*this) << "ADMSPSP103VA: Parameter RWELL value " << RWELL << " out of range [ 0.0, (+inf) [";
16327  }
16328 
16329  // Parameter RJUNS : [ 0.0, (+inf) [
16330  if ( (!((RJUNS >=0.0))) )
16331  {
16332  UserError0(*this) << "ADMSPSP103VA: Parameter RJUNS value " << RJUNS << " out of range [ 0.0, (+inf) [";
16333  }
16334 
16335  // Parameter RJUND : [ 0.0, (+inf) [
16336  if ( (!((RJUND >=0.0))) )
16337  {
16338  UserError0(*this) << "ADMSPSP103VA: Parameter RJUND value " << RJUND << " out of range [ 0.0, (+inf) [";
16339  }
16340 
16341  // Parameter TOXO : [ 1e-10, (+inf) [
16342  if ( (!((TOXO >=1e-10))) )
16343  {
16344  UserError0(*this) << "ADMSPSP103VA: Parameter TOXO value " << TOXO << " out of range [ 1e-10, (+inf) [";
16345  }
16346 
16347  // Parameter EPSROXO : [ 1.0, (+inf) [
16348  if ( (!((EPSROXO >=1.0))) )
16349  {
16350  UserError0(*this) << "ADMSPSP103VA: Parameter EPSROXO value " << EPSROXO << " out of range [ 1.0, (+inf) [";
16351  }
16352 
16353  // Parameter NSUBO : [ 1e20, (+inf) [
16354  if ( (!((NSUBO >=1e20))) )
16355  {
16356  UserError0(*this) << "ADMSPSP103VA: Parameter NSUBO value " << NSUBO << " out of range [ 1e20, (+inf) [";
16357  }
16358 
16359  // Parameter WSEG : [ 1e-10, (+inf) [
16360  if ( (!((WSEG >=1e-10))) )
16361  {
16362  UserError0(*this) << "ADMSPSP103VA: Parameter WSEG value " << WSEG << " out of range [ 1e-10, (+inf) [";
16363  }
16364 
16365  // Parameter NPCK : [ 0.0, (+inf) [
16366  if ( (!((NPCK >=0.0))) )
16367  {
16368  UserError0(*this) << "ADMSPSP103VA: Parameter NPCK value " << NPCK << " out of range [ 0.0, (+inf) [";
16369  }
16370 
16371  // Parameter WSEGP : [ 1e-10, (+inf) [
16372  if ( (!((WSEGP >=1e-10))) )
16373  {
16374  UserError0(*this) << "ADMSPSP103VA: Parameter WSEGP value " << WSEGP << " out of range [ 1e-10, (+inf) [";
16375  }
16376 
16377  // Parameter LPCK : [ 1e-10, (+inf) [
16378  if ( (!((LPCK >=1e-10))) )
16379  {
16380  UserError0(*this) << "ADMSPSP103VA: Parameter LPCK value " << LPCK << " out of range [ 1e-10, (+inf) [";
16381  }
16382 
16383  // Parameter TOXOVO : [ 1e-10, (+inf) [
16384  if ( (!((TOXOVO >=1e-10))) )
16385  {
16386  UserError0(*this) << "ADMSPSP103VA: Parameter TOXOVO value " << TOXOVO << " out of range [ 1e-10, (+inf) [";
16387  }
16388 
16389  // Parameter TOXOVDO : [ 1e-10, (+inf) [
16390  if ( (!((TOXOVDO >=1e-10))) )
16391  {
16392  UserError0(*this) << "ADMSPSP103VA: Parameter TOXOVDO value " << TOXOVDO << " out of range [ 1e-10, (+inf) [";
16393  }
16394 
16395  // Parameter LOV : [ 0.0, (+inf) [
16396  if ( (!((LOV >=0.0))) )
16397  {
16398  UserError0(*this) << "ADMSPSP103VA: Parameter LOV value " << LOV << " out of range [ 0.0, (+inf) [";
16399  }
16400 
16401  // Parameter LOVD : [ 0.0, (+inf) [
16402  if ( (!((LOVD >=0.0))) )
16403  {
16404  UserError0(*this) << "ADMSPSP103VA: Parameter LOVD value " << LOVD << " out of range [ 0.0, (+inf) [";
16405  }
16406 
16407  // Parameter LP1 : [ 1e-10, (+inf) [
16408  if ( (!((LP1 >=1e-10))) )
16409  {
16410  UserError0(*this) << "ADMSPSP103VA: Parameter LP1 value " << LP1 << " out of range [ 1e-10, (+inf) [";
16411  }
16412 
16413  // Parameter LP2 : [ 1e-10, (+inf) [
16414  if ( (!((LP2 >=1e-10))) )
16415  {
16416  UserError0(*this) << "ADMSPSP103VA: Parameter LP2 value " << LP2 << " out of range [ 1e-10, (+inf) [";
16417  }
16418 
16419  // Parameter WBET : [ 1e-10, (+inf) [
16420  if ( (!((WBET >=1e-10))) )
16421  {
16422  UserError0(*this) << "ADMSPSP103VA: Parameter WBET value " << WBET << " out of range [ 1e-10, (+inf) [";
16423  }
16424 
16425  // Parameter AXL : [ 0.0, (+inf) [
16426  if ( (!((AXL >=0.0))) )
16427  {
16428  UserError0(*this) << "ADMSPSP103VA: Parameter AXL value " << AXL << " out of range [ 0.0, (+inf) [";
16429  }
16430 
16431  // Parameter ALP1L2 : [ 0.0, (+inf) [
16432  if ( (!((ALP1L2 >=0.0))) )
16433  {
16434  UserError0(*this) << "ADMSPSP103VA: Parameter ALP1L2 value " << ALP1L2 << " out of range [ 0.0, (+inf) [";
16435  }
16436 
16437  // Parameter ALP2L2 : [ 0.0, (+inf) [
16438  if ( (!((ALP2L2 >=0.0))) )
16439  {
16440  UserError0(*this) << "ADMSPSP103VA: Parameter ALP2L2 value " << ALP2L2 << " out of range [ 0.0, (+inf) [";
16441  }
16442 
16443  // Parameter RINT : [ 0.0, (+inf) [
16444  if ( (!((RINT >=0.0))) )
16445  {
16446  UserError0(*this) << "ADMSPSP103VA: Parameter RINT value " << RINT << " out of range [ 0.0, (+inf) [";
16447  }
16448 
16449  // Parameter RVPOLY : [ 0.0, (+inf) [
16450  if ( (!((RVPOLY >=0.0))) )
16451  {
16452  UserError0(*this) << "ADMSPSP103VA: Parameter RVPOLY value " << RVPOLY << " out of range [ 0.0, (+inf) [";
16453  }
16454 
16455  // Parameter RSHG : [ 0.0, (+inf) [
16456  if ( (!((RSHG >=0.0))) )
16457  {
16458  UserError0(*this) << "ADMSPSP103VA: Parameter RSHG value " << RSHG << " out of range [ 0.0, (+inf) [";
16459  }
16460 
16461  // Parameter SAREF : [ 1e-9, (+inf) [
16462  if ( (!((SAREF >=1e-9))) )
16463  {
16464  UserError0(*this) << "ADMSPSP103VA: Parameter SAREF value " << SAREF << " out of range [ 1e-9, (+inf) [";
16465  }
16466 
16467  // Parameter SBREF : [ 1e-9, (+inf) [
16468  if ( (!((SBREF >=1e-9))) )
16469  {
16470  UserError0(*this) << "ADMSPSP103VA: Parameter SBREF value " << SBREF << " out of range [ 1e-9, (+inf) [";
16471  }
16472 
16473  // Parameter KVSAT : [ (-1.0), 1.0 ]
16474  if ( (!((KVSAT >=(-1.0) && KVSAT <=1.0 ))) )
16475  {
16476  UserError0(*this) << "ADMSPSP103VA: Parameter KVSAT value " << KVSAT << " out of range [ (-1.0), 1.0 ]";
16477  }
16478 
16479  // Parameter LLODKUO : [ 0.0, (+inf) [
16480  if ( (!((LLODKUO >=0.0))) )
16481  {
16482  UserError0(*this) << "ADMSPSP103VA: Parameter LLODKUO value " << LLODKUO << " out of range [ 0.0, (+inf) [";
16483  }
16484 
16485  // Parameter WLODKUO : [ 0.0, (+inf) [
16486  if ( (!((WLODKUO >=0.0))) )
16487  {
16488  UserError0(*this) << "ADMSPSP103VA: Parameter WLODKUO value " << WLODKUO << " out of range [ 0.0, (+inf) [";
16489  }
16490 
16491  // Parameter LLODVTH : [ 0.0, (+inf) [
16492  if ( (!((LLODVTH >=0.0))) )
16493  {
16494  UserError0(*this) << "ADMSPSP103VA: Parameter LLODVTH value " << LLODVTH << " out of range [ 0.0, (+inf) [";
16495  }
16496 
16497  // Parameter WLODVTH : [ 0.0, (+inf) [
16498  if ( (!((WLODVTH >=0.0))) )
16499  {
16500  UserError0(*this) << "ADMSPSP103VA: Parameter WLODVTH value " << WLODVTH << " out of range [ 0.0, (+inf) [";
16501  }
16502 
16503  // Parameter LODETAO : [ 0.0, (+inf) [
16504  if ( (!((LODETAO >=0.0))) )
16505  {
16506  UserError0(*this) << "ADMSPSP103VA: Parameter LODETAO value " << LODETAO << " out of range [ 0.0, (+inf) [";
16507  }
16508 
16509  // Parameter SCREF : [ 0.0, (+inf) [
16510  if ( (!((SCREF >=0.0))) )
16511  {
16512  UserError0(*this) << "ADMSPSP103VA: Parameter SCREF value " << SCREF << " out of range [ 0.0, (+inf) [";
16513  }
16514 
16515  // Parameter IMAX : [ 1E-12, (+inf) [
16516  if ( (!((IMAX >=1E-12))) )
16517  {
16518  UserError0(*this) << "ADMSPSP103VA: Parameter IMAX value " << IMAX << " out of range [ 1E-12, (+inf) [";
16519  }
16520 
16521  // Parameter TRJ : [ (-250), (+inf) [
16522  if ( (!((TRJ >=(-250)))) )
16523  {
16524  UserError0(*this) << "ADMSPSP103VA: Parameter TRJ value " << TRJ << " out of range [ (-250), (+inf) [";
16525  }
16526 
16527  // Parameter CJORBOT : [ 1E-12, (+inf) [
16528  if ( (!((CJORBOT >=1E-12))) )
16529  {
16530  UserError0(*this) << "ADMSPSP103VA: Parameter CJORBOT value " << CJORBOT << " out of range [ 1E-12, (+inf) [";
16531  }
16532 
16533  // Parameter CJORSTI : [ 1E-18, (+inf) [
16534  if ( (!((CJORSTI >=1E-18))) )
16535  {
16536  UserError0(*this) << "ADMSPSP103VA: Parameter CJORSTI value " << CJORSTI << " out of range [ 1E-18, (+inf) [";
16537  }
16538 
16539  // Parameter CJORGAT : [ 1E-18, (+inf) [
16540  if ( (!((CJORGAT >=1E-18))) )
16541  {
16542  UserError0(*this) << "ADMSPSP103VA: Parameter CJORGAT value " << CJORGAT << " out of range [ 1E-18, (+inf) [";
16543  }
16544 
16545  // Parameter VBIRBOT : [ 0.050, (+inf) [
16546  if ( (!((VBIRBOT >=0.050))) )
16547  {
16548  UserError0(*this) << "ADMSPSP103VA: Parameter VBIRBOT value " << VBIRBOT << " out of range [ 0.050, (+inf) [";
16549  }
16550 
16551  // Parameter VBIRSTI : [ 0.050, (+inf) [
16552  if ( (!((VBIRSTI >=0.050))) )
16553  {
16554  UserError0(*this) << "ADMSPSP103VA: Parameter VBIRSTI value " << VBIRSTI << " out of range [ 0.050, (+inf) [";
16555  }
16556 
16557  // Parameter VBIRGAT : [ 0.050, (+inf) [
16558  if ( (!((VBIRGAT >=0.050))) )
16559  {
16560  UserError0(*this) << "ADMSPSP103VA: Parameter VBIRGAT value " << VBIRGAT << " out of range [ 0.050, (+inf) [";
16561  }
16562 
16563  // Parameter PBOT : [ 0.05, 0.95 ]
16564  if ( (!((PBOT >=0.05 && PBOT <=0.95 ))) )
16565  {
16566  UserError0(*this) << "ADMSPSP103VA: Parameter PBOT value " << PBOT << " out of range [ 0.05, 0.95 ]";
16567  }
16568 
16569  // Parameter PSTI : [ 0.05, 0.95 ]
16570  if ( (!((PSTI >=0.05 && PSTI <=0.95 ))) )
16571  {
16572  UserError0(*this) << "ADMSPSP103VA: Parameter PSTI value " << PSTI << " out of range [ 0.05, 0.95 ]";
16573  }
16574 
16575  // Parameter PGAT : [ 0.05, 0.95 ]
16576  if ( (!((PGAT >=0.05 && PGAT <=0.95 ))) )
16577  {
16578  UserError0(*this) << "ADMSPSP103VA: Parameter PGAT value " << PGAT << " out of range [ 0.05, 0.95 ]";
16579  }
16580 
16581  // Parameter IDSATRBOT : [ 0, (+inf) [
16582  if ( (!((IDSATRBOT >=0))) )
16583  {
16584  UserError0(*this) << "ADMSPSP103VA: Parameter IDSATRBOT value " << IDSATRBOT << " out of range [ 0, (+inf) [";
16585  }
16586 
16587  // Parameter IDSATRSTI : [ 0, (+inf) [
16588  if ( (!((IDSATRSTI >=0))) )
16589  {
16590  UserError0(*this) << "ADMSPSP103VA: Parameter IDSATRSTI value " << IDSATRSTI << " out of range [ 0, (+inf) [";
16591  }
16592 
16593  // Parameter IDSATRGAT : [ 0, (+inf) [
16594  if ( (!((IDSATRGAT >=0))) )
16595  {
16596  UserError0(*this) << "ADMSPSP103VA: Parameter IDSATRGAT value " << IDSATRGAT << " out of range [ 0, (+inf) [";
16597  }
16598 
16599  // Parameter CSRHBOT : [ 0, (+inf) [
16600  if ( (!((CSRHBOT >=0))) )
16601  {
16602  UserError0(*this) << "ADMSPSP103VA: Parameter CSRHBOT value " << CSRHBOT << " out of range [ 0, (+inf) [";
16603  }
16604 
16605  // Parameter CSRHSTI : [ 0, (+inf) [
16606  if ( (!((CSRHSTI >=0))) )
16607  {
16608  UserError0(*this) << "ADMSPSP103VA: Parameter CSRHSTI value " << CSRHSTI << " out of range [ 0, (+inf) [";
16609  }
16610 
16611  // Parameter CSRHGAT : [ 0, (+inf) [
16612  if ( (!((CSRHGAT >=0))) )
16613  {
16614  UserError0(*this) << "ADMSPSP103VA: Parameter CSRHGAT value " << CSRHGAT << " out of range [ 0, (+inf) [";
16615  }
16616 
16617  // Parameter XJUNSTI : [ 1E-9, (+inf) [
16618  if ( (!((XJUNSTI >=1E-9))) )
16619  {
16620  UserError0(*this) << "ADMSPSP103VA: Parameter XJUNSTI value " << XJUNSTI << " out of range [ 1E-9, (+inf) [";
16621  }
16622 
16623  // Parameter XJUNGAT : [ 1E-9, (+inf) [
16624  if ( (!((XJUNGAT >=1E-9))) )
16625  {
16626  UserError0(*this) << "ADMSPSP103VA: Parameter XJUNGAT value " << XJUNGAT << " out of range [ 1E-9, (+inf) [";
16627  }
16628 
16629  // Parameter CTATBOT : [ 0, (+inf) [
16630  if ( (!((CTATBOT >=0))) )
16631  {
16632  UserError0(*this) << "ADMSPSP103VA: Parameter CTATBOT value " << CTATBOT << " out of range [ 0, (+inf) [";
16633  }
16634 
16635  // Parameter CTATSTI : [ 0, (+inf) [
16636  if ( (!((CTATSTI >=0))) )
16637  {
16638  UserError0(*this) << "ADMSPSP103VA: Parameter CTATSTI value " << CTATSTI << " out of range [ 0, (+inf) [";
16639  }
16640 
16641  // Parameter CTATGAT : [ 0, (+inf) [
16642  if ( (!((CTATGAT >=0))) )
16643  {
16644  UserError0(*this) << "ADMSPSP103VA: Parameter CTATGAT value " << CTATGAT << " out of range [ 0, (+inf) [";
16645  }
16646 
16647  // Parameter MEFFTATBOT : [ 0.01, (+inf) [
16648  if ( (!((MEFFTATBOT >=0.01))) )
16649  {
16650  UserError0(*this) << "ADMSPSP103VA: Parameter MEFFTATBOT value " << MEFFTATBOT << " out of range [ 0.01, (+inf) [";
16651  }
16652 
16653  // Parameter MEFFTATSTI : [ 0.01, (+inf) [
16654  if ( (!((MEFFTATSTI >=0.01))) )
16655  {
16656  UserError0(*this) << "ADMSPSP103VA: Parameter MEFFTATSTI value " << MEFFTATSTI << " out of range [ 0.01, (+inf) [";
16657  }
16658 
16659  // Parameter MEFFTATGAT : [ 0.01, (+inf) [
16660  if ( (!((MEFFTATGAT >=0.01))) )
16661  {
16662  UserError0(*this) << "ADMSPSP103VA: Parameter MEFFTATGAT value " << MEFFTATGAT << " out of range [ 0.01, (+inf) [";
16663  }
16664 
16665  // Parameter CBBTBOT : [ 0, (+inf) [
16666  if ( (!((CBBTBOT >=0))) )
16667  {
16668  UserError0(*this) << "ADMSPSP103VA: Parameter CBBTBOT value " << CBBTBOT << " out of range [ 0, (+inf) [";
16669  }
16670 
16671  // Parameter CBBTSTI : [ 0, (+inf) [
16672  if ( (!((CBBTSTI >=0))) )
16673  {
16674  UserError0(*this) << "ADMSPSP103VA: Parameter CBBTSTI value " << CBBTSTI << " out of range [ 0, (+inf) [";
16675  }
16676 
16677  // Parameter CBBTGAT : [ 0, (+inf) [
16678  if ( (!((CBBTGAT >=0))) )
16679  {
16680  UserError0(*this) << "ADMSPSP103VA: Parameter CBBTGAT value " << CBBTGAT << " out of range [ 0, (+inf) [";
16681  }
16682 
16683  // Parameter VBRBOT : [ 0.1, (+inf) [
16684  if ( (!((VBRBOT >=0.1))) )
16685  {
16686  UserError0(*this) << "ADMSPSP103VA: Parameter VBRBOT value " << VBRBOT << " out of range [ 0.1, (+inf) [";
16687  }
16688 
16689  // Parameter VBRSTI : [ 0.1, (+inf) [
16690  if ( (!((VBRSTI >=0.1))) )
16691  {
16692  UserError0(*this) << "ADMSPSP103VA: Parameter VBRSTI value " << VBRSTI << " out of range [ 0.1, (+inf) [";
16693  }
16694 
16695  // Parameter VBRGAT : [ 0.1, (+inf) [
16696  if ( (!((VBRGAT >=0.1))) )
16697  {
16698  UserError0(*this) << "ADMSPSP103VA: Parameter VBRGAT value " << VBRGAT << " out of range [ 0.1, (+inf) [";
16699  }
16700 
16701  // Parameter PBRBOT : [ 0.1, (+inf) [
16702  if ( (!((PBRBOT >=0.1))) )
16703  {
16704  UserError0(*this) << "ADMSPSP103VA: Parameter PBRBOT value " << PBRBOT << " out of range [ 0.1, (+inf) [";
16705  }
16706 
16707  // Parameter PBRSTI : [ 0.1, (+inf) [
16708  if ( (!((PBRSTI >=0.1))) )
16709  {
16710  UserError0(*this) << "ADMSPSP103VA: Parameter PBRSTI value " << PBRSTI << " out of range [ 0.1, (+inf) [";
16711  }
16712 
16713  // Parameter PBRGAT : [ 0.1, (+inf) [
16714  if ( (!((PBRGAT >=0.1))) )
16715  {
16716  UserError0(*this) << "ADMSPSP103VA: Parameter PBRGAT value " << PBRGAT << " out of range [ 0.1, (+inf) [";
16717  }
16718 
16719  // Parameter CJORBOTD : [ 1E-12, (+inf) [
16720  if ( (!((CJORBOTD >=1E-12))) )
16721  {
16722  UserError0(*this) << "ADMSPSP103VA: Parameter CJORBOTD value " << CJORBOTD << " out of range [ 1E-12, (+inf) [";
16723  }
16724 
16725  // Parameter CJORSTID : [ 1E-18, (+inf) [
16726  if ( (!((CJORSTID >=1E-18))) )
16727  {
16728  UserError0(*this) << "ADMSPSP103VA: Parameter CJORSTID value " << CJORSTID << " out of range [ 1E-18, (+inf) [";
16729  }
16730 
16731  // Parameter CJORGATD : [ 1E-18, (+inf) [
16732  if ( (!((CJORGATD >=1E-18))) )
16733  {
16734  UserError0(*this) << "ADMSPSP103VA: Parameter CJORGATD value " << CJORGATD << " out of range [ 1E-18, (+inf) [";
16735  }
16736 
16737  // Parameter VBIRBOTD : [ 0.050, (+inf) [
16738  if ( (!((VBIRBOTD >=0.050))) )
16739  {
16740  UserError0(*this) << "ADMSPSP103VA: Parameter VBIRBOTD value " << VBIRBOTD << " out of range [ 0.050, (+inf) [";
16741  }
16742 
16743  // Parameter VBIRSTID : [ 0.050, (+inf) [
16744  if ( (!((VBIRSTID >=0.050))) )
16745  {
16746  UserError0(*this) << "ADMSPSP103VA: Parameter VBIRSTID value " << VBIRSTID << " out of range [ 0.050, (+inf) [";
16747  }
16748 
16749  // Parameter VBIRGATD : [ 0.050, (+inf) [
16750  if ( (!((VBIRGATD >=0.050))) )
16751  {
16752  UserError0(*this) << "ADMSPSP103VA: Parameter VBIRGATD value " << VBIRGATD << " out of range [ 0.050, (+inf) [";
16753  }
16754 
16755  // Parameter PBOTD : [ 0.05, 0.95 ]
16756  if ( (!((PBOTD >=0.05 && PBOTD <=0.95 ))) )
16757  {
16758  UserError0(*this) << "ADMSPSP103VA: Parameter PBOTD value " << PBOTD << " out of range [ 0.05, 0.95 ]";
16759  }
16760 
16761  // Parameter PSTID : [ 0.05, 0.95 ]
16762  if ( (!((PSTID >=0.05 && PSTID <=0.95 ))) )
16763  {
16764  UserError0(*this) << "ADMSPSP103VA: Parameter PSTID value " << PSTID << " out of range [ 0.05, 0.95 ]";
16765  }
16766 
16767  // Parameter PGATD : [ 0.05, 0.95 ]
16768  if ( (!((PGATD >=0.05 && PGATD <=0.95 ))) )
16769  {
16770  UserError0(*this) << "ADMSPSP103VA: Parameter PGATD value " << PGATD << " out of range [ 0.05, 0.95 ]";
16771  }
16772 
16773  // Parameter IDSATRBOTD : [ 0, (+inf) [
16774  if ( (!((IDSATRBOTD >=0))) )
16775  {
16776  UserError0(*this) << "ADMSPSP103VA: Parameter IDSATRBOTD value " << IDSATRBOTD << " out of range [ 0, (+inf) [";
16777  }
16778 
16779  // Parameter IDSATRSTID : [ 0, (+inf) [
16780  if ( (!((IDSATRSTID >=0))) )
16781  {
16782  UserError0(*this) << "ADMSPSP103VA: Parameter IDSATRSTID value " << IDSATRSTID << " out of range [ 0, (+inf) [";
16783  }
16784 
16785  // Parameter IDSATRGATD : [ 0, (+inf) [
16786  if ( (!((IDSATRGATD >=0))) )
16787  {
16788  UserError0(*this) << "ADMSPSP103VA: Parameter IDSATRGATD value " << IDSATRGATD << " out of range [ 0, (+inf) [";
16789  }
16790 
16791  // Parameter CSRHBOTD : [ 0, (+inf) [
16792  if ( (!((CSRHBOTD >=0))) )
16793  {
16794  UserError0(*this) << "ADMSPSP103VA: Parameter CSRHBOTD value " << CSRHBOTD << " out of range [ 0, (+inf) [";
16795  }
16796 
16797  // Parameter CSRHSTID : [ 0, (+inf) [
16798  if ( (!((CSRHSTID >=0))) )
16799  {
16800  UserError0(*this) << "ADMSPSP103VA: Parameter CSRHSTID value " << CSRHSTID << " out of range [ 0, (+inf) [";
16801  }
16802 
16803  // Parameter CSRHGATD : [ 0, (+inf) [
16804  if ( (!((CSRHGATD >=0))) )
16805  {
16806  UserError0(*this) << "ADMSPSP103VA: Parameter CSRHGATD value " << CSRHGATD << " out of range [ 0, (+inf) [";
16807  }
16808 
16809  // Parameter XJUNSTID : [ 1E-9, (+inf) [
16810  if ( (!((XJUNSTID >=1E-9))) )
16811  {
16812  UserError0(*this) << "ADMSPSP103VA: Parameter XJUNSTID value " << XJUNSTID << " out of range [ 1E-9, (+inf) [";
16813  }
16814 
16815  // Parameter XJUNGATD : [ 1E-9, (+inf) [
16816  if ( (!((XJUNGATD >=1E-9))) )
16817  {
16818  UserError0(*this) << "ADMSPSP103VA: Parameter XJUNGATD value " << XJUNGATD << " out of range [ 1E-9, (+inf) [";
16819  }
16820 
16821  // Parameter CTATBOTD : [ 0, (+inf) [
16822  if ( (!((CTATBOTD >=0))) )
16823  {
16824  UserError0(*this) << "ADMSPSP103VA: Parameter CTATBOTD value " << CTATBOTD << " out of range [ 0, (+inf) [";
16825  }
16826 
16827  // Parameter CTATSTID : [ 0, (+inf) [
16828  if ( (!((CTATSTID >=0))) )
16829  {
16830  UserError0(*this) << "ADMSPSP103VA: Parameter CTATSTID value " << CTATSTID << " out of range [ 0, (+inf) [";
16831  }
16832 
16833  // Parameter CTATGATD : [ 0, (+inf) [
16834  if ( (!((CTATGATD >=0))) )
16835  {
16836  UserError0(*this) << "ADMSPSP103VA: Parameter CTATGATD value " << CTATGATD << " out of range [ 0, (+inf) [";
16837  }
16838 
16839  // Parameter MEFFTATBOTD : [ 0.01, (+inf) [
16840  if ( (!((MEFFTATBOTD >=0.01))) )
16841  {
16842  UserError0(*this) << "ADMSPSP103VA: Parameter MEFFTATBOTD value " << MEFFTATBOTD << " out of range [ 0.01, (+inf) [";
16843  }
16844 
16845  // Parameter MEFFTATSTID : [ 0.01, (+inf) [
16846  if ( (!((MEFFTATSTID >=0.01))) )
16847  {
16848  UserError0(*this) << "ADMSPSP103VA: Parameter MEFFTATSTID value " << MEFFTATSTID << " out of range [ 0.01, (+inf) [";
16849  }
16850 
16851  // Parameter MEFFTATGATD : [ 0.01, (+inf) [
16852  if ( (!((MEFFTATGATD >=0.01))) )
16853  {
16854  UserError0(*this) << "ADMSPSP103VA: Parameter MEFFTATGATD value " << MEFFTATGATD << " out of range [ 0.01, (+inf) [";
16855  }
16856 
16857  // Parameter CBBTBOTD : [ 0, (+inf) [
16858  if ( (!((CBBTBOTD >=0))) )
16859  {
16860  UserError0(*this) << "ADMSPSP103VA: Parameter CBBTBOTD value " << CBBTBOTD << " out of range [ 0, (+inf) [";
16861  }
16862 
16863  // Parameter CBBTSTID : [ 0, (+inf) [
16864  if ( (!((CBBTSTID >=0))) )
16865  {
16866  UserError0(*this) << "ADMSPSP103VA: Parameter CBBTSTID value " << CBBTSTID << " out of range [ 0, (+inf) [";
16867  }
16868 
16869  // Parameter CBBTGATD : [ 0, (+inf) [
16870  if ( (!((CBBTGATD >=0))) )
16871  {
16872  UserError0(*this) << "ADMSPSP103VA: Parameter CBBTGATD value " << CBBTGATD << " out of range [ 0, (+inf) [";
16873  }
16874 
16875  // Parameter VBRBOTD : [ 0.1, (+inf) [
16876  if ( (!((VBRBOTD >=0.1))) )
16877  {
16878  UserError0(*this) << "ADMSPSP103VA: Parameter VBRBOTD value " << VBRBOTD << " out of range [ 0.1, (+inf) [";
16879  }
16880 
16881  // Parameter VBRSTID : [ 0.1, (+inf) [
16882  if ( (!((VBRSTID >=0.1))) )
16883  {
16884  UserError0(*this) << "ADMSPSP103VA: Parameter VBRSTID value " << VBRSTID << " out of range [ 0.1, (+inf) [";
16885  }
16886 
16887  // Parameter VBRGATD : [ 0.1, (+inf) [
16888  if ( (!((VBRGATD >=0.1))) )
16889  {
16890  UserError0(*this) << "ADMSPSP103VA: Parameter VBRGATD value " << VBRGATD << " out of range [ 0.1, (+inf) [";
16891  }
16892 
16893  // Parameter PBRBOTD : [ 0.1, (+inf) [
16894  if ( (!((PBRBOTD >=0.1))) )
16895  {
16896  UserError0(*this) << "ADMSPSP103VA: Parameter PBRBOTD value " << PBRBOTD << " out of range [ 0.1, (+inf) [";
16897  }
16898 
16899  // Parameter PBRSTID : [ 0.1, (+inf) [
16900  if ( (!((PBRSTID >=0.1))) )
16901  {
16902  UserError0(*this) << "ADMSPSP103VA: Parameter PBRSTID value " << PBRSTID << " out of range [ 0.1, (+inf) [";
16903  }
16904 
16905  // Parameter PBRGATD : [ 0.1, (+inf) [
16906  if ( (!((PBRGATD >=0.1))) )
16907  {
16908  UserError0(*this) << "ADMSPSP103VA: Parameter PBRGATD value " << PBRGATD << " out of range [ 0.1, (+inf) [";
16909  }
16910 
16911  // Parameter SWJUNEXP : [ 0.0, 1.0 ]
16912  if ( (!((SWJUNEXP >=0.0 && SWJUNEXP <=1.0 ))) )
16913  {
16914  UserError0(*this) << "ADMSPSP103VA: Parameter SWJUNEXP value " << SWJUNEXP << " out of range [ 0.0, 1.0 ]";
16915  }
16916 
16917  // Parameter VJUNREF : [ 0.5, (+inf) [
16918  if ( (!((VJUNREF >=0.5))) )
16919  {
16920  UserError0(*this) << "ADMSPSP103VA: Parameter VJUNREF value " << VJUNREF << " out of range [ 0.5, (+inf) [";
16921  }
16922 
16923  // Parameter FJUNQ : [ 0.0, (+inf) [
16924  if ( (!((FJUNQ >=0.0))) )
16925  {
16926  UserError0(*this) << "ADMSPSP103VA: Parameter FJUNQ value " << FJUNQ << " out of range [ 0.0, (+inf) [";
16927  }
16928 
16929  // Parameter VJUNREFD : [ 0.5, (+inf) [
16930  if ( (!((VJUNREFD >=0.5))) )
16931  {
16932  UserError0(*this) << "ADMSPSP103VA: Parameter VJUNREFD value " << VJUNREFD << " out of range [ 0.5, (+inf) [";
16933  }
16934 
16935  // Parameter FJUNQD : [ 0.0, (+inf) [
16936  if ( (!((FJUNQD >=0.0))) )
16937  {
16938  UserError0(*this) << "ADMSPSP103VA: Parameter FJUNQD value " << FJUNQD << " out of range [ 0.0, (+inf) [";
16939  }
16940 
16941 
16942  // and of course, this routine is where we should put the initial_model
16943  // stuff
16944  double deltaphigd;
16945  double deltaphigr;
16946  double phitrinv;
16947  double KBOL_over_QELE;
16948  double auxt;
16949  double tkd;
16950  double tkr;
16951  double TRJ_i;
16952  double TKD_sq;
16953  double TKR;
16954  double TR_i;
16955  //Begin block initial_model
16956  {
16957  if ((TYPE>=0))
16958  {
16959  CHNL_TYPE = (+1);
16960  }
16961  else
16962  {
16963  CHNL_TYPE = (-1);
16964  }
16965  SWGEO_i = floor((((SWGEO>0.0)?((SWGEO<2.0)?SWGEO:2.0):0.0)+0.5));
16966  SWIGATE_i = floor((((SWIGATE>0.0)?((SWIGATE<1.0)?SWIGATE:1.0):0.0)+0.5));
16967  SWIMPACT_i = floor((((SWIMPACT>0.0)?((SWIMPACT<1.0)?SWIMPACT:1.0):0.0)+0.5));
16968  SWGIDL_i = floor((((SWGIDL>0.0)?((SWGIDL<1.0)?SWGIDL:1.0):0.0)+0.5));
16969  SWJUNCAP_i = floor((((SWJUNCAP>0.0)?((SWJUNCAP<3.0)?SWJUNCAP:3.0):0.0)+0.5));
16970  SWJUNASYM_i = floor((((SWJUNASYM>0.0)?((SWJUNASYM<1.0)?SWJUNASYM:1.0):0.0)+0.5));
16971  SWNUD_i = floor((((SWNUD>0.0)?((SWNUD<2.0)?SWNUD:2.0):0.0)+0.5));
16972  SWDELVTAC_i = floor((((SWDELVTAC>0.0)?((SWDELVTAC<1.0)?SWDELVTAC:1.0):0.0)+0.5));
16973  QMC_i = ((QMC>0.0)?QMC:0.0);
16974  TOXO_i = ((TOXO>1e-10)?TOXO:1e-10);
16975  EPSROXO_i = ((EPSROXO>1.0)?EPSROXO:1.0);
16976  NSUBO_i = ((NSUBO>1e20)?NSUBO:1e20);
16977  WSEG_i = ((WSEG>1e-10)?WSEG:1e-10);
16978  NPCK_i = ((NPCK>0.0)?NPCK:0.0);
16979  WSEGP_i = ((WSEGP>1e-10)?WSEGP:1e-10);
16980  LPCK_i = ((LPCK>1e-10)?LPCK:1e-10);
16981  TOXOVO_i = ((TOXOVO>1e-10)?TOXOVO:1e-10);
16982  TOXOVDO_i = ((TOXOVDO>1e-10)?TOXOVDO:1e-10);
16983  LOV_i = ((LOV>0.0)?LOV:0.0);
16984  LOVD_i = ((LOVD>0.0)?LOVD:0.0);
16985  LP1_i = ((LP1>1e-10)?LP1:1e-10);
16986  LP2_i = ((LP2>1e-10)?LP2:1e-10);
16987  WBET_i = ((WBET>1e-10)?WBET:1e-10);
16988  AXL_i = ((AXL>0.0)?AXL:0.0);
16989  ALP1L2_i = ((ALP1L2>0.0)?ALP1L2:0.0);
16990  ALP2L2_i = ((ALP2L2>0.0)?ALP2L2:0.0);
16991  SAREF_i = ((SAREF>1e-9)?SAREF:1e-9);
16992  SBREF_i = ((SBREF>1e-9)?SBREF:1e-9);
16993  KVSAT_i = ((KVSAT>(-1.0))?((KVSAT<1.0)?KVSAT:1.0):(-1.0));
16994  LLODKUO_i = ((LLODKUO>0.0)?LLODKUO:0.0);
16995  WLODKUO_i = ((WLODKUO>0.0)?WLODKUO:0.0);
16996  LLODVTH_i = ((LLODVTH>0.0)?LLODVTH:0.0);
16997  WLODVTH_i = ((WLODVTH>0.0)?WLODVTH:0.0);
16998  LODETAO_i = ((LODETAO>0.0)?LODETAO:0.0);
16999  SCREF_i = ((SCREF>0.0)?SCREF:0.0);
17000  WEB_i = WEB;
17001  WEC_i = WEC;
17002  RSHG_i = ((RSHG>0.0)?RSHG:0.0);
17003  RSH_i = ((RSH>0.0)?RSH:0.0);
17004  RSHD_i = ((RSHD>0.0)?RSHD:0.0);
17005  RINT_i = ((RINT>0.0)?RINT:0.0);
17006  RVPOLY_i = ((RVPOLY>0.0)?RVPOLY:0.0);
17007  TR_i = ((TR>(-273))?TR:(-273));
17008  TKR = (273.15+TR_i);
17009  TKD = (admsModTemp+DTA);
17010  TKD_sq = (TKD*TKD);
17011  dT = (TKD-TKR);
17012  rT = (TKD/TKR);
17013  rTn = (TKR/TKD);
17014  phit = ((TKD*1.3806505E-23)/1.6021918E-19);
17015  inv_phit = (1.0/phit);
17016  Eg = ((1.179-(9.025e-5*TKD))-(3.05e-7*TKD_sq));
17017  phibFac = ((((1.045+(4.5e-4*TKD))*((0.523+(1.4e-3*TKD))-(1.48e-6*TKD_sq)))*TKD_sq)/9.0E4);
17018  phibFac = ((phibFac>1.0E-3)?phibFac:1.0E-3);
17019  EPSSI = (8.8541878176E-12*11.8);
17020  nt0 = ((4*1.3806505E-23)*TKD);
17021  TRJ_i = ((TRJ>(-250))?TRJ:(-250));
17022  IMAX_i = ((IMAX>1E-12)?IMAX:1E-12);
17023  CJORBOT_i = ((CJORBOT>1E-12)?CJORBOT:1E-12);
17024  CJORSTI_i = ((CJORSTI>1E-18)?CJORSTI:1E-18);
17025  CJORGAT_i = ((CJORGAT>1E-18)?CJORGAT:1E-18);
17026  VBIRBOT_i = ((VBIRBOT>0.050)?VBIRBOT:0.050);
17027  VBIRSTI_i = ((VBIRSTI>0.050)?VBIRSTI:0.050);
17028  VBIRGAT_i = ((VBIRGAT>0.050)?VBIRGAT:0.050);
17029  PBOT_i = ((PBOT>0.05)?((PBOT<0.95)?PBOT:0.95):0.05);
17030  PSTI_i = ((PSTI>0.05)?((PSTI<0.95)?PSTI:0.95):0.05);
17031  PGAT_i = ((PGAT>0.05)?((PGAT<0.95)?PGAT:0.95):0.05);
17032  PHIGBOT_i = PHIGBOT;
17033  PHIGSTI_i = PHIGSTI;
17034  PHIGGAT_i = PHIGGAT;
17035  IDSATRBOT_i = ((IDSATRBOT>0)?IDSATRBOT:0);
17036  IDSATRSTI_i = ((IDSATRSTI>0)?IDSATRSTI:0);
17037  IDSATRGAT_i = ((IDSATRGAT>0)?IDSATRGAT:0);
17038  CSRHBOT_i = ((CSRHBOT>0)?CSRHBOT:0);
17039  CSRHSTI_i = ((CSRHSTI>0)?CSRHSTI:0);
17040  CSRHGAT_i = ((CSRHGAT>0)?CSRHGAT:0);
17041  XJUNSTI_i = ((XJUNSTI>1E-9)?XJUNSTI:1E-9);
17042  XJUNGAT_i = ((XJUNGAT>1E-9)?XJUNGAT:1E-9);
17043  CTATBOT_i = ((CTATBOT>0)?CTATBOT:0);
17044  CTATSTI_i = ((CTATSTI>0)?CTATSTI:0);
17045  CTATGAT_i = ((CTATGAT>0)?CTATGAT:0);
17046  MEFFTATBOT_i = ((MEFFTATBOT>0.01)?MEFFTATBOT:0.01);
17047  MEFFTATSTI_i = ((MEFFTATSTI>0.01)?MEFFTATSTI:0.01);
17048  MEFFTATGAT_i = ((MEFFTATGAT>0.01)?MEFFTATGAT:0.01);
17049  CBBTBOT_i = ((CBBTBOT>0)?CBBTBOT:0);
17050  CBBTSTI_i = ((CBBTSTI>0)?CBBTSTI:0);
17051  CBBTGAT_i = ((CBBTGAT>0)?CBBTGAT:0);
17052  FBBTRBOT_i = FBBTRBOT;
17053  FBBTRSTI_i = FBBTRSTI;
17054  FBBTRGAT_i = FBBTRGAT;
17058  VBRBOT_i = ((VBRBOT>0.1)?VBRBOT:0.1);
17059  VBRSTI_i = ((VBRSTI>0.1)?VBRSTI:0.1);
17060  VBRGAT_i = ((VBRGAT>0.1)?VBRGAT:0.1);
17061  PBRBOT_i = ((PBRBOT>0.1)?PBRBOT:0.1);
17062  PBRSTI_i = ((PBRSTI>0.1)?PBRSTI:0.1);
17063  PBRGAT_i = ((PBRGAT>0.1)?PBRGAT:0.1);
17064  SWJUNEXP_i = 0.0;
17065  if ((SWJUNEXP>0.5))
17066  {
17067  SWJUNEXP_i = 1.0;
17068  }
17069  else
17070  {
17071  SWJUNEXP_i = 0.0;
17072  }
17073  VJUNREF_i = ((VJUNREF>0.5)?VJUNREF:0.5);
17074  FJUNQ_i = ((FJUNQ>0.0)?FJUNQ:0.0);
17081  PBOTS_i = PBOT_i;
17082  PSTIS_i = PSTI_i;
17083  PGATS_i = PGAT_i;
17110  VBRBOTS_i = VBRBOT_i;
17111  VBRSTIS_i = VBRSTI_i;
17112  VBRGATS_i = VBRGAT_i;
17113  PBRBOTS_i = PBRBOT_i;
17114  PBRSTIS_i = PBRSTI_i;
17115  PBRGATS_i = PBRGAT_i;
17117  FJUNQS_i = FJUNQ_i;
17118  if ((SWJUNASYM==0.0))
17119  {
17126  PBOTD_i = PBOTS_i;
17127  PSTID_i = PSTIS_i;
17128  PGATD_i = PGATS_i;
17155  VBRBOTD_i = VBRBOTS_i;
17156  VBRSTID_i = VBRSTIS_i;
17157  VBRGATD_i = VBRGATS_i;
17158  PBRBOTD_i = PBRBOTS_i;
17159  PBRSTID_i = PBRSTIS_i;
17160  PBRGATD_i = PBRGATS_i;
17162  FJUNQD_i = FJUNQS_i;
17163  }
17164  else
17165  {
17166  CJORBOTD_i = ((CJORBOTD>1E-12)?CJORBOTD:1E-12);
17167  CJORSTID_i = ((CJORSTID>1E-18)?CJORSTID:1E-18);
17168  CJORGATD_i = ((CJORGATD>1E-18)?CJORGATD:1E-18);
17169  VBIRBOTD_i = ((VBIRBOTD>0.050)?VBIRBOTD:0.050);
17170  VBIRSTID_i = ((VBIRSTID>0.050)?VBIRSTID:0.050);
17171  VBIRGATD_i = ((VBIRGATD>0.050)?VBIRGATD:0.050);
17172  PBOTD_i = ((PBOTD>0.05)?((PBOTD<0.95)?PBOTD:0.95):0.05);
17173  PSTID_i = ((PSTID>0.05)?((PSTID<0.95)?PSTID:0.95):0.05);
17174  PGATD_i = ((PGATD>0.05)?((PGATD<0.95)?PGATD:0.95):0.05);
17175  PHIGBOTD_i = PHIGBOTD;
17176  PHIGSTID_i = PHIGSTID;
17177  PHIGGATD_i = PHIGGATD;
17181  CSRHBOTD_i = ((CSRHBOTD>0)?CSRHBOTD:0);
17182  CSRHSTID_i = ((CSRHSTID>0)?CSRHSTID:0);
17183  CSRHGATD_i = ((CSRHGATD>0)?CSRHGATD:0);
17184  XJUNSTID_i = ((XJUNSTID>1E-9)?XJUNSTID:1E-9);
17185  XJUNGATD_i = ((XJUNGATD>1E-9)?XJUNGATD:1E-9);
17186  CTATBOTD_i = ((CTATBOTD>0)?CTATBOTD:0);
17187  CTATSTID_i = ((CTATSTID>0)?CTATSTID:0);
17188  CTATGATD_i = ((CTATGATD>0)?CTATGATD:0);
17189  MEFFTATBOTD_i = ((MEFFTATBOTD>0.01)?MEFFTATBOTD:0.01);
17190  MEFFTATSTID_i = ((MEFFTATSTID>0.01)?MEFFTATSTID:0.01);
17191  MEFFTATGATD_i = ((MEFFTATGATD>0.01)?MEFFTATGATD:0.01);
17192  CBBTBOTD_i = ((CBBTBOTD>0)?CBBTBOTD:0);
17193  CBBTSTID_i = ((CBBTSTID>0)?CBBTSTID:0);
17194  CBBTGATD_i = ((CBBTGATD>0)?CBBTGATD:0);
17201  VBRBOTD_i = ((VBRBOTD>0.1)?VBRBOTD:0.1);
17202  VBRSTID_i = ((VBRSTID>0.1)?VBRSTID:0.1);
17203  VBRGATD_i = ((VBRGATD>0.1)?VBRGATD:0.1);
17204  PBRBOTD_i = ((PBRBOTD>0.1)?PBRBOTD:0.1);
17205  PBRSTID_i = ((PBRSTID>0.1)?PBRSTID:0.1);
17206  PBRGATD_i = ((PBRGATD>0.1)?PBRGATD:0.1);
17207  VJUNREFD_i = ((VJUNREFD>0.5)?VJUNREFD:0.5);
17208  FJUNQD_i = ((FJUNQD>0.0)?FJUNQD:0.0);
17209  }
17210  tkr = (273.15+TRJ_i);
17211  tkd = std::max((admsModTemp+DTA),(273.15+(-250)));
17212  auxt = (tkd/tkr);
17213  KBOL_over_QELE = (1.3806505E-23/1.6021918E-19);
17214  phitr = (KBOL_over_QELE*tkr);
17215  phitrinv = (1.0/phitr);
17216  phitd = (KBOL_over_QELE*tkd);
17217  phitdinv = (1.0/phitd);
17218  deltaphigr = ((-((7.02e-4*tkr)*tkr))/(1108.0+tkr));
17219  phigrbot = (PHIGBOT_i+deltaphigr);
17220  phigrsti = (PHIGSTI_i+deltaphigr);
17221  phigrgat = (PHIGGAT_i+deltaphigr);
17222  deltaphigd = ((-((7.02e-4*tkd)*tkd))/(1108.0+tkd));
17223  phigdbot = (PHIGBOT_i+deltaphigd);
17224  phigdsti = (PHIGSTI_i+deltaphigd);
17225  phigdgat = (PHIGGAT_i+deltaphigd);
17226  ftdbot = (pow(auxt,1.5)*exp((0.5*((phigrbot*phitrinv)-(phigdbot*phitdinv)))));
17227  ftdsti = (pow(auxt,1.5)*exp((0.5*((phigrsti*phitrinv)-(phigdsti*phitdinv)))));
17228  ftdgat = (pow(auxt,1.5)*exp((0.5*((phigrgat*phitrinv)-(phigdgat*phitdinv)))));
17232  ubibot = ((VBIRBOT_i*auxt)-((2*phitd)*log(ftdbot)));
17233  ubisti = ((VBIRSTI_i*auxt)-((2*phitd)*log(ftdsti)));
17234  ubigat = ((VBIRGAT_i*auxt)-((2*phitd)*log(ftdgat)));
17235  vbibot = (ubibot+(phitd*log((1+exp(((0.050-ubibot)*phitdinv))))));
17236  vbisti = (ubisti+(phitd*log((1+exp(((0.050-ubisti)*phitdinv))))));
17237  vbigat = (ubigat+(phitd*log((1+exp(((0.050-ubigat)*phitdinv))))));
17238  vbiinvbot = (1.0/vbibot);
17239  vbiinvsti = (1.0/vbisti);
17240  vbiinvgat = (1.0/vbigat);
17241  one_minus_PBOT = (1-PBOT_i);
17242  one_minus_PSTI = (1-PSTI_i);
17243  one_minus_PGAT = (1-PGAT_i);
17253  qpref2bot = (2*cjobot);
17254  qpref2sti = (2*cjosti);
17255  qpref2gat = (2*cjogat);
17262  VBIRBOTinv = (1/VBIRBOT_i);
17263  VBIRSTIinv = (1/VBIRSTI_i);
17264  VBIRGATinv = (1/VBIRGAT_i);
17265  perfc = (1.77245385090551603*0.29214664);
17266  berfc = (((((-5)*0.29214664)+6)-pow(perfc,(-2)))/3);
17267  cerfc = ((1.0-0.29214664)-berfc);
17268  deltaEbot = std::max((0.5*phigdbot),phitd);
17269  deltaEsti = std::max((0.5*phigdsti),phitd);
17270  deltaEgat = std::max((0.5*phigdgat),phitd);
17274  btatpartbot = (sqrt(((((32*MEFFTATBOT_i)*9.1093826E-31)*1.6021918E-19)*((deltaEbot*deltaEbot)*deltaEbot)))/(3*1.05457168E-34));
17275  btatpartsti = (sqrt(((((32*MEFFTATSTI_i)*9.1093826E-31)*1.6021918E-19)*((deltaEsti*deltaEsti)*deltaEsti)))/(3*1.05457168E-34));
17276  btatpartgat = (sqrt(((((32*MEFFTATGAT_i)*9.1093826E-31)*1.6021918E-19)*((deltaEgat*deltaEgat)*deltaEgat)))/(3*1.05457168E-34));
17277  fbbtbot = (FBBTRBOT_i*(1+(STFBBTBOT_i*(tkd-tkr))));
17278  fbbtsti = (FBBTRSTI_i*(1+(STFBBTSTI_i*(tkd-tkr))));
17279  fbbtgat = (FBBTRGAT_i*(1+(STFBBTGAT_i*(tkd-tkr))));
17280  fbbtbot = ((fbbtbot>0)?fbbtbot:0);
17281  fbbtsti = ((fbbtsti>0)?fbbtsti:0);
17282  fbbtgat = ((fbbtgat>0)?fbbtgat:0);
17283  fstopbot = (1/(1-pow(0.999,PBRBOT_i)));
17284  fstopsti = (1/(1-pow(0.999,PBRSTI_i)));
17285  fstopgat = (1/(1-pow(0.999,PBRGAT_i)));
17286  VBRinvbot = (1/VBRBOT_i);
17287  VBRinvsti = (1/VBRSTI_i);
17288  VBRinvgat = (1/VBRGAT_i);
17289  slopebot = (((-((fstopbot*fstopbot)*pow(0.999,(PBRBOT_i-1))))*PBRBOT_i)*VBRinvbot);
17290  slopesti = (((-((fstopsti*fstopsti)*pow(0.999,(PBRSTI_i-1))))*PBRSTI_i)*VBRinvsti);
17291  slopegat = (((-((fstopgat*fstopgat)*pow(0.999,(PBRGAT_i-1))))*PBRGAT_i)*VBRinvgat);
17292  phigrbot_s = phigrbot;
17293  phigrsti_s = phigrsti;
17294  phigrgat_s = phigrgat;
17295  phigdbot_s = phigdbot;
17296  phigdsti_s = phigdsti;
17297  phigdgat_s = phigdgat;
17298  ftdbot_s = ftdbot;
17299  ftdsti_s = ftdsti;
17300  ftdgat_s = ftdgat;
17301  idsatbot_s = idsatbot;
17302  idsatsti_s = idsatsti;
17303  idsatgat_s = idsatgat;
17304  ubibot_s = ubibot;
17305  ubisti_s = ubisti;
17306  ubigat_s = ubigat;
17307  vbibot_s = vbibot;
17308  vbisti_s = vbisti;
17309  vbigat_s = vbigat;
17319  cjobot_s = cjobot;
17320  cjosti_s = cjosti;
17321  cjogat_s = cjogat;
17322  qprefbot_s = qprefbot;
17323  qprefsti_s = qprefsti;
17324  qprefgat_s = qprefgat;
17340  atatbot_s = atatbot;
17341  atatsti_s = atatsti;
17342  atatgat_s = atatgat;
17346  fbbtbot_s = fbbtbot;
17347  fbbtsti_s = fbbtsti;
17348  fbbtgat_s = fbbtgat;
17349  fbbtbot_s = fbbtbot;
17350  fbbtsti_s = fbbtsti;
17351  fbbtgat_s = fbbtgat;
17352  fstopbot_s = fstopbot;
17353  fstopsti_s = fstopsti;
17354  fstopgat_s = fstopgat;
17358  slopebot_s = slopebot;
17359  slopesti_s = slopesti;
17360  slopegat_s = slopegat;
17361  phigrbot_d = (PHIGBOTD_i+deltaphigr);
17362  phigrsti_d = (PHIGSTID_i+deltaphigr);
17363  phigrgat_d = (PHIGGATD_i+deltaphigr);
17364  phigdbot_d = (PHIGBOTD_i+deltaphigd);
17365  phigdsti_d = (PHIGSTID_i+deltaphigd);
17366  phigdgat_d = (PHIGGATD_i+deltaphigd);
17367  ftdbot_d = (pow(auxt,1.5)*exp((0.5*((phigrbot_d*phitrinv)-(phigdbot_d*phitdinv)))));
17368  ftdsti_d = (pow(auxt,1.5)*exp((0.5*((phigrsti_d*phitrinv)-(phigdsti_d*phitdinv)))));
17369  ftdgat_d = (pow(auxt,1.5)*exp((0.5*((phigrgat_d*phitrinv)-(phigdgat_d*phitdinv)))));
17373  ubibot_d = ((VBIRBOTD_i*auxt)-((2*phitd)*log(ftdbot_d)));
17374  ubisti_d = ((VBIRSTID_i*auxt)-((2*phitd)*log(ftdsti_d)));
17375  ubigat_d = ((VBIRGATD_i*auxt)-((2*phitd)*log(ftdgat_d)));
17376  vbibot_d = (ubibot_d+(phitd*log((1+exp(((0.050-ubibot_d)*phitdinv))))));
17377  vbisti_d = (ubisti_d+(phitd*log((1+exp(((0.050-ubisti_d)*phitdinv))))));
17378  vbigat_d = (ubigat_d+(phitd*log((1+exp(((0.050-ubigat_d)*phitdinv))))));
17379  vbiinvbot_d = (1.0/vbibot_d);
17380  vbiinvsti_d = (1.0/vbisti_d);
17381  vbiinvgat_d = (1.0/vbigat_d);
17382  one_minus_PBOT_d = (1-PBOTD_i);
17383  one_minus_PSTI_d = (1-PSTID_i);
17384  one_minus_PGAT_d = (1-PGATD_i);
17394  qpref2bot_d = (2*cjobot_d);
17395  qpref2sti_d = (2*cjosti_d);
17396  qpref2gat_d = (2*cjogat_d);
17403  VBIRBOTinv_d = (1/VBIRBOTD_i);
17404  VBIRSTIinv_d = (1/VBIRSTID_i);
17405  VBIRGATinv_d = (1/VBIRGATD_i);
17406  deltaEbot_d = std::max((0.5*phigdbot_d),phitd);
17407  deltaEsti_d = std::max((0.5*phigdsti_d),phitd);
17408  deltaEgat_d = std::max((0.5*phigdgat_d),phitd);
17412  btatpartbot_d = (sqrt(((((32*MEFFTATBOTD_i)*9.1093826E-31)*1.6021918E-19)*((deltaEbot_d*deltaEbot_d)*deltaEbot_d)))/(3*1.05457168E-34));
17413  btatpartsti_d = (sqrt(((((32*MEFFTATSTID_i)*9.1093826E-31)*1.6021918E-19)*((deltaEsti_d*deltaEsti_d)*deltaEsti_d)))/(3*1.05457168E-34));
17414  btatpartgat_d = (sqrt(((((32*MEFFTATGATD_i)*9.1093826E-31)*1.6021918E-19)*((deltaEgat_d*deltaEgat_d)*deltaEgat_d)))/(3*1.05457168E-34));
17415  fbbtbot_d = (FBBTRBOTD_i*(1+(STFBBTBOTD_i*(tkd-tkr))));
17416  fbbtsti_d = (FBBTRSTID_i*(1+(STFBBTSTID_i*(tkd-tkr))));
17417  fbbtgat_d = (FBBTRGATD_i*(1+(STFBBTGATD_i*(tkd-tkr))));
17418  fbbtbot_d = ((fbbtbot_d>0)?fbbtbot_d:0);
17419  fbbtsti_d = ((fbbtsti_d>0)?fbbtsti_d:0);
17420  fbbtgat_d = ((fbbtgat_d>0)?fbbtgat_d:0);
17421  fstopbot_d = (1/(1-pow(0.999,PBRBOTD_i)));
17422  fstopsti_d = (1/(1-pow(0.999,PBRSTID_i)));
17423  fstopgat_d = (1/(1-pow(0.999,PBRGATD_i)));
17424  VBRinvbot_d = (1/VBRBOTD_i);
17425  VBRinvsti_d = (1/VBRSTID_i);
17426  VBRinvgat_d = (1/VBRGATD_i);
17427  slopebot_d = (((-((fstopbot_d*fstopbot_d)*pow(0.999,(PBRBOTD_i-1))))*PBRBOTD_i)*VBRinvbot_d);
17428  slopesti_d = (((-((fstopsti_d*fstopsti_d)*pow(0.999,(PBRSTID_i-1))))*PBRSTID_i)*VBRinvsti_d);
17429  slopegat_d = (((-((fstopgat_d*fstopgat_d)*pow(0.999,(PBRGATD_i-1))))*PBRGATD_i)*VBRinvgat_d);
17430  }
17431  // End block initial_model
17432 
17433 
17434  return true;
17435 }
17436 //----------------------------------------------------------------------------
17437 // Function : Model::processInstanceParams
17438 // Purpose :
17439 // Special Notes :
17440 // Scope : public
17441 // Creator :
17442 // Creation Date :
17443 //----------------------------------------------------------------------------
17445 {
17446 
17447  std::vector<Instance*>::iterator iter;
17448  std::vector<Instance*>::iterator first = instanceContainer.begin();
17449  std::vector<Instance*>::iterator last = instanceContainer.end();
17450 
17451  for (iter=first; iter!=last; ++iter)
17452  {
17453  (*iter)->processParams();
17454  }
17455 
17456  return true;
17457 }
17458 
17459 //-----------------------------------------------------------------------------
17460 // Function : Model::Model
17461 // Purpose : model block constructor
17462 // Special Notes :
17463 // Scope : public
17464 // Creator :
17465 // Creation Date :
17466 //-----------------------------------------------------------------------------
17468  const Configuration & configuration,
17469  const ModelBlock & model_block,
17470  const FactoryBlock & factory_block)
17471  : DeviceModel(model_block, configuration.getModelParameters(), factory_block),
17472  LEVEL(103),
17473  TYPE(1.0),
17474  TR(21.0),
17475  SWGEO(1.0),
17476  SWIGATE(0.0),
17477  SWIMPACT(0.0),
17478  SWGIDL(0.0),
17479  SWJUNCAP(0.0),
17480  SWJUNASYM(0.0),
17481  SWNUD(0.0),
17482  SWDELVTAC(0.0),
17483  QMC(1.0),
17484  VFB((-1.0)),
17485  STVFB(5.0e-4),
17486  TOX(2.0e-09),
17487  EPSROX(3.9),
17488  NEFF(5.0e+23),
17489  FACNEFFAC(1.0),
17490  GFACNUD(1.0),
17491  VSBNUD(0.0),
17492  DVSBNUD(1.0),
17493  VNSUB(0.0),
17494  NSLP(0.05),
17495  DNSUB(0.0),
17496  DPHIB(0.0),
17497  DELVTAC(0.0),
17498  NP(1.0e+26),
17499  CT(0.0),
17500  TOXOV(2.0e-09),
17501  TOXOVD(2.0e-09),
17502  NOV(5.0e+25),
17503  NOVD(5.0e+25),
17504  CF(0.0),
17505  CFB(0.0),
17506  BETN(7e-2),
17507  STBET(1.0),
17508  MUE(0.5),
17509  STMUE(0.0),
17510  THEMU(1.5),
17511  STTHEMU(1.5),
17512  CS(0.0),
17513  STCS(0.0),
17514  XCOR(0.0),
17515  STXCOR(0.0),
17516  FETA(1.0),
17517  RS(30),
17518  STRS(1.0),
17519  RSB(0.0),
17520  RSG(0.0),
17521  THESAT(1.0),
17522  STTHESAT(1.0),
17523  THESATB(0.0),
17524  THESATG(0.0),
17525  AX(3.0),
17526  ALP(0.01),
17527  ALP1(0.00),
17528  ALP2(0.00),
17529  VP(0.05),
17530  A1(1.0),
17531  A2(10.0),
17532  STA2(0.0),
17533  A3(1.0),
17534  A4(0.0),
17535  GCO(0.0),
17536  IGINV(0.0),
17537  IGOV(0.0),
17538  IGOVD(0.0),
17539  STIG(2.0),
17540  GC2(0.375),
17541  GC3(0.063),
17542  CHIB(3.1),
17543  AGIDL(0.0),
17544  AGIDLD(0.0),
17545  BGIDL(41.0),
17546  BGIDLD(41.0),
17547  STBGIDL(0.0),
17548  STBGIDLD(0.0),
17549  CGIDL(0.0),
17550  CGIDLD(0.0),
17551  COX(1.0e-14),
17552  CGOV(1.0e-15),
17553  CGOVD(1.0e-15),
17554  CGBOV(0.0),
17555  CFR(0.0),
17556  CFRD(0.0),
17557  FNT(1.0),
17558  NFA(8.0e+22),
17559  NFB(3.0e+07),
17560  NFC(0.0),
17561  EF(1.0),
17562  RG(0.0),
17563  RSE(0.0),
17564  RDE(0.0),
17565  RBULK(0.0),
17566  RWELL(0.0),
17567  RJUNS(0.0),
17568  RJUND(0.0),
17569  POVFB((-1)),
17570  PLVFB(0.0),
17571  PWVFB(0.0),
17572  PLWVFB(0.0),
17573  POSTVFB(0.0005),
17574  PLSTVFB(0.0),
17575  PWSTVFB(0.0),
17576  PLWSTVFB(0.0),
17577  POTOX(2E-09),
17578  POEPSROX(3.9),
17579  PONEFF(5E+23),
17580  PLNEFF(0.0),
17581  PWNEFF(0.0),
17582  PLWNEFF(0.0),
17583  POFACNEFFAC(1.0),
17584  PLFACNEFFAC(0.0),
17585  PWFACNEFFAC(0.0),
17586  PLWFACNEFFAC(0.0),
17587  POGFACNUD(1.0),
17588  PLGFACNUD(0.0),
17589  PWGFACNUD(0.0),
17590  PLWGFACNUD(0.0),
17591  POVSBNUD(0.0),
17592  PODVSBNUD(1.0),
17593  POVNSUB(0),
17594  PONSLP(0.05),
17595  PODNSUB(0),
17596  PODPHIB(0),
17597  PLDPHIB(0.0),
17598  PWDPHIB(0.0),
17599  PLWDPHIB(0.0),
17600  PODELVTAC(0),
17601  PLDELVTAC(0.0),
17602  PWDELVTAC(0.0),
17603  PLWDELVTAC(0.0),
17604  PONP(1E+26),
17605  PLNP(0.0),
17606  PWNP(0.0),
17607  PLWNP(0.0),
17608  POCT(0),
17609  PLCT(0.0),
17610  PWCT(0.0),
17611  PLWCT(0.0),
17612  POTOXOV(2E-09),
17613  POTOXOVD(2E-09),
17614  PONOV(5E+25),
17615  PLNOV(0.0),
17616  PWNOV(0.0),
17617  PLWNOV(0.0),
17618  PONOVD(5E+25),
17619  PLNOVD(0.0),
17620  PWNOVD(0.0),
17621  PLWNOVD(0.0),
17622  POCF(0),
17623  PLCF(0.0),
17624  PWCF(0.0),
17625  PLWCF(0.0),
17626  POCFB(0),
17627  POBETN(0.07),
17628  PLBETN(0.0),
17629  PWBETN(0.0),
17630  PLWBETN(0.0),
17631  POSTBET(1),
17632  PLSTBET(0.0),
17633  PWSTBET(0.0),
17634  PLWSTBET(0.0),
17635  POMUE(0.5),
17636  PLMUE(0.0),
17637  PWMUE(0.0),
17638  PLWMUE(0.0),
17639  POSTMUE(0),
17640  POTHEMU(1.5),
17641  POSTTHEMU(1.5),
17642  POCS(0),
17643  PLCS(0.0),
17644  PWCS(0.0),
17645  PLWCS(0.0),
17646  POSTCS(0),
17647  POXCOR(0),
17648  PLXCOR(0.0),
17649  PWXCOR(0.0),
17650  PLWXCOR(0.0),
17651  POSTXCOR(0),
17652  POFETA(1),
17653  PORS(30),
17654  PLRS(0.0),
17655  PWRS(0.0),
17656  PLWRS(0.0),
17657  POSTRS(1),
17658  PORSB(0),
17659  PORSG(0),
17660  POTHESAT(1),
17661  PLTHESAT(0.0),
17662  PWTHESAT(0.0),
17663  PLWTHESAT(0.0),
17664  POSTTHESAT(1),
17665  PLSTTHESAT(0.0),
17666  PWSTTHESAT(0.0),
17667  PLWSTTHESAT(0.0),
17668  POTHESATB(0),
17669  PLTHESATB(0.0),
17670  PWTHESATB(0.0),
17671  PLWTHESATB(0.0),
17672  POTHESATG(0),
17673  PLTHESATG(0.0),
17674  PWTHESATG(0.0),
17675  PLWTHESATG(0.0),
17676  POAX(3),
17677  PLAX(0.0),
17678  PWAX(0.0),
17679  PLWAX(0.0),
17680  POALP(0.01),
17681  PLALP(0.0),
17682  PWALP(0.0),
17683  PLWALP(0.0),
17684  POALP1(0),
17685  PLALP1(0.0),
17686  PWALP1(0.0),
17687  PLWALP1(0.0),
17688  POALP2(0),
17689  PLALP2(0.0),
17690  PWALP2(0.0),
17691  PLWALP2(0.0),
17692  POVP(0.05),
17693  POA1(1),
17694  PLA1(0.0),
17695  PWA1(0.0),
17696  PLWA1(0.0),
17697  POA2(10),
17698  POSTA2(0),
17699  POA3(1),
17700  PLA3(0.0),
17701  PWA3(0.0),
17702  PLWA3(0.0),
17703  POA4(0),
17704  PLA4(0.0),
17705  PWA4(0.0),
17706  PLWA4(0.0),
17707  POGCO(0),
17708  POIGINV(0),
17709  PLIGINV(0.0),
17710  PWIGINV(0.0),
17711  PLWIGINV(0.0),
17712  POIGOV(0),
17713  PLIGOV(0.0),
17714  PWIGOV(0.0),
17715  PLWIGOV(0.0),
17716  POIGOVD(0),
17717  PLIGOVD(0.0),
17718  PWIGOVD(0.0),
17719  PLWIGOVD(0.0),
17720  POSTIG(2),
17721  POGC2(0.375),
17722  POGC3(0.063),
17723  POCHIB(3.1),
17724  POAGIDL(0),
17725  PLAGIDL(0.0),
17726  PWAGIDL(0.0),
17727  PLWAGIDL(0.0),
17728  POAGIDLD(0),
17729  PLAGIDLD(0.0),
17730  PWAGIDLD(0.0),
17731  PLWAGIDLD(0.0),
17732  POBGIDL(41),
17733  POBGIDLD(41),
17734  POSTBGIDL(0),
17735  POSTBGIDLD(0),
17736  POCGIDL(0),
17737  POCGIDLD(0),
17738  POCOX(1E-14),
17739  PLCOX(0.0),
17740  PWCOX(0.0),
17741  PLWCOX(0.0),
17742  POCGOV(1E-15),
17743  PLCGOV(0.0),
17744  PWCGOV(0.0),
17745  PLWCGOV(0.0),
17746  POCGOVD(1E-15),
17747  PLCGOVD(0.0),
17748  PWCGOVD(0.0),
17749  PLWCGOVD(0.0),
17750  POCGBOV(0),
17751  PLCGBOV(0.0),
17752  PWCGBOV(0.0),
17753  PLWCGBOV(0.0),
17754  POCFR(0),
17755  PLCFR(0.0),
17756  PWCFR(0.0),
17757  PLWCFR(0.0),
17758  POCFRD(0),
17759  PLCFRD(0.0),
17760  PWCFRD(0.0),
17761  PLWCFRD(0.0),
17762  POFNT(1),
17763  PONFA(8E+22),
17764  PLNFA(0.0),
17765  PWNFA(0.0),
17766  PLWNFA(0.0),
17767  PONFB(3E+07),
17768  PLNFB(0.0),
17769  PWNFB(0.0),
17770  PLWNFB(0.0),
17771  PONFC(0),
17772  PLNFC(0.0),
17773  PWNFC(0.0),
17774  PLWNFC(0.0),
17775  POEF(1.0),
17776  POKVTHOWE(0),
17777  PLKVTHOWE(0),
17778  PWKVTHOWE(0),
17779  PLWKVTHOWE(0),
17780  POKUOWE(0),
17781  PLKUOWE(0),
17782  PWKUOWE(0),
17783  PLWKUOWE(0),
17784  LMIN(0),
17785  LMAX(1.0),
17786  WMIN(0),
17787  WMAX(1.0),
17788  LVARO(0.0),
17789  LVARL(0.0),
17790  LVARW(0.0),
17791  LAP(0.0),
17792  WVARO(0.0),
17793  WVARL(0.0),
17794  WVARW(0.0),
17795  WOT(0.0),
17796  DLQ(0.0),
17797  DWQ(0.0),
17798  VFBO((-1.0)),
17799  VFBL(0.0),
17800  VFBW(0.0),
17801  VFBLW(0.0),
17802  STVFBO(5e-4),
17803  STVFBL(0.0),
17804  STVFBW(0.0),
17805  STVFBLW(0.0),
17806  TOXO(2e-9),
17807  EPSROXO(3.9),
17808  NSUBO(3e23),
17809  NSUBW(0.0),
17810  WSEG(1e-8),
17811  NPCK(1e24),
17812  NPCKW(0.0),
17813  WSEGP(1e-8),
17814  LPCK(1e-8),
17815  LPCKW(0.0),
17816  FOL1(0.0),
17817  FOL2(0.0),
17818  FACNEFFACO(1.0),
17819  FACNEFFACL(0.0),
17820  FACNEFFACW(0.0),
17821  FACNEFFACLW(0.0),
17822  GFACNUDO(1.0),
17823  GFACNUDL(0.0),
17824  GFACNUDLEXP(1.0),
17825  GFACNUDW(0.0),
17826  GFACNUDLW(0.0),
17827  VSBNUDO(0.0),
17828  DVSBNUDO(1.0),
17829  VNSUBO(0.0),
17830  NSLPO(0.05),
17831  DNSUBO(0.0),
17832  DPHIBO(0.0),
17833  DPHIBL(0.0),
17834  DPHIBLEXP(1.0),
17835  DPHIBW(0.0),
17836  DPHIBLW(0.0),
17837  DELVTACO(0.0),
17838  DELVTACL(0.0),
17839  DELVTACLEXP(1.0),
17840  DELVTACW(0.0),
17841  DELVTACLW(0.0),
17842  NPO(1e26),
17843  NPL(0.0),
17844  CTO(0.0),
17845  CTL(0.0),
17846  CTLEXP(1.0),
17847  CTW(0.0),
17848  CTLW(0.0),
17849  TOXOVO(2e-9),
17850  TOXOVDO(2e-9),
17851  LOV(0),
17852  LOVD(0),
17853  NOVO(5e25),
17854  NOVDO(5e25),
17855  CFL(0.0),
17856  CFLEXP(2.0),
17857  CFW(0.0),
17858  CFBO(0.0),
17859  UO(5e-2),
17860  FBET1(0.0),
17861  FBET1W(0.0),
17862  LP1(1e-8),
17863  LP1W(0.0),
17864  FBET2(0.0),
17865  LP2(1e-8),
17866  BETW1(0.0),
17867  BETW2(0.0),
17868  WBET(1e-9),
17869  STBETO(1.0),
17870  STBETL(0.0),
17871  STBETW(0.0),
17872  STBETLW(0.0),
17873  MUEO(0.5),
17874  MUEW(0.0),
17875  STMUEO(0.0),
17876  THEMUO(1.5),
17877  STTHEMUO(1.5),
17878  CSO(0.0),
17879  CSL(0.0),
17880  CSLEXP(1.0),
17881  CSW(0.0),
17882  CSLW(0.0),
17883  STCSO(0.0),
17884  XCORO(0.0),
17885  XCORL(0.0),
17886  XCORW(0.0),
17887  XCORLW(0.0),
17888  STXCORO(0.0),
17889  FETAO(1.0),
17890  RSW1(50.0),
17891  RSW2(0.0),
17892  STRSO(1.0),
17893  RSBO(0.0),
17894  RSGO(0.0),
17895  THESATO(0.0),
17896  THESATL(0.05),
17897  THESATLEXP(1.0),
17898  THESATW(0.0),
17899  THESATLW(0.0),
17900  STTHESATO(1.0),
17901  STTHESATL(0.0),
17902  STTHESATW(0.0),
17903  STTHESATLW(0.0),
17904  THESATBO(0.0),
17905  THESATGO(0.0),
17906  AXO(18),
17907  AXL(0.4),
17908  ALPL(5e-4),
17909  ALPLEXP(1.0),
17910  ALPW(0.0),
17911  ALP1L1(0.0),
17912  ALP1LEXP(0.5),
17913  ALP1L2(0.0),
17914  ALP1W(0.0),
17915  ALP2L1(0.0),
17916  ALP2LEXP(0.5),
17917  ALP2L2(0.0),
17918  ALP2W(0.0),
17919  VPO(0.05),
17920  A1O(1.0),
17921  A1L(0.0),
17922  A1W(0.0),
17923  A2O(10),
17924  STA2O(0.0),
17925  A3O(1.0),
17926  A3L(0.0),
17927  A3W(0.0),
17928  A4O(0.0),
17929  A4L(0.0),
17930  A4W(0.0),
17931  GCOO(0.0),
17932  IGINVLW(0.0),
17933  IGOVW(0.0),
17934  IGOVDW(0.0),
17935  STIGO(2.0),
17936  GC2O(0.375),
17937  GC3O(0.063),
17938  CHIBO(3.1),
17939  AGIDLW(0.0),
17940  AGIDLDW(0.0),
17941  BGIDLO(41),
17942  BGIDLDO(41),
17943  STBGIDLO(0.0),
17944  STBGIDLDO(0.0),
17945  CGIDLO(0.0),
17946  CGIDLDO(0.0),
17947  CGBOVL(0.0),
17948  CFRW(0.0),
17949  CFRDW(0.0),
17950  FNTO(1.0),
17951  NFALW(8e22),
17952  NFBLW(3e7),
17953  NFCLW(0.0),
17954  EFO(1.0),
17955  LINTNOI(0.0),
17956  ALPNOI(2.0),
17957  KVTHOWEO(0),
17958  KVTHOWEL(0),
17959  KVTHOWEW(0),
17960  KVTHOWELW(0),
17961  KUOWEO(0),
17962  KUOWEL(0),
17963  KUOWEW(0),
17964  KUOWELW(0),
17965  RGO(0.0),
17966  RINT(0.0),
17967  RVPOLY(0.0),
17968  RSHG(0.0),
17969  DLSIL(0.0),
17970  RSH(0.0),
17971  RSHD(0.0),
17972  RBULKO(0.0),
17973  RWELLO(0.0),
17974  RJUNSO(0.0),
17975  RJUNDO(0.0),
17976  SAREF(1.0e-6),
17977  SBREF(1.0e-6),
17978  WLOD(0),
17979  KUO(0),
17980  KVSAT(0),
17981  TKUO(0),
17982  LKUO(0),
17983  WKUO(0),
17984  PKUO(0),
17985  LLODKUO(0),
17986  WLODKUO(0),
17987  KVTHO(0),
17988  LKVTHO(0),
17989  WKVTHO(0),
17990  PKVTHO(0),
17991  LLODVTH(0),
17992  WLODVTH(0),
17993  STETAO(0),
17994  LODETAO(1.0),
17995  SCREF(1.0e-6),
17996  WEB(0),
17997  WEC(0),
17998  IMAX(1000),
17999  TRJ(21),
18000  CJORBOT(1E-3),
18001  CJORSTI(1E-9),
18002  CJORGAT(1E-9),
18003  VBIRBOT(1),
18004  VBIRSTI(1),
18005  VBIRGAT(1),
18006  PBOT(0.5),
18007  PSTI(0.5),
18008  PGAT(0.5),
18009  PHIGBOT(1.16),
18010  PHIGSTI(1.16),
18011  PHIGGAT(1.16),
18012  IDSATRBOT(1E-12),
18013  IDSATRSTI(1E-18),
18014  IDSATRGAT(1E-18),
18015  CSRHBOT(1E2),
18016  CSRHSTI(1E-4),
18017  CSRHGAT(1E-4),
18018  XJUNSTI(100E-9),
18019  XJUNGAT(100E-9),
18020  CTATBOT(1E2),
18021  CTATSTI(1E-4),
18022  CTATGAT(1E-4),
18023  MEFFTATBOT(0.25),
18024  MEFFTATSTI(0.25),
18025  MEFFTATGAT(0.25),
18026  CBBTBOT(1E-12),
18027  CBBTSTI(1E-18),
18028  CBBTGAT(1E-18),
18029  FBBTRBOT(1E9),
18030  FBBTRSTI(1E9),
18031  FBBTRGAT(1E9),
18032  STFBBTBOT((-1E-3)),
18033  STFBBTSTI((-1E-3)),
18034  STFBBTGAT((-1E-3)),
18035  VBRBOT(10),
18036  VBRSTI(10),
18037  VBRGAT(10),
18038  PBRBOT(4),
18039  PBRSTI(4),
18040  PBRGAT(4),
18041  CJORBOTD(1E-3),
18042  CJORSTID(1E-9),
18043  CJORGATD(1E-9),
18044  VBIRBOTD(1),
18045  VBIRSTID(1),
18046  VBIRGATD(1),
18047  PBOTD(0.5),
18048  PSTID(0.5),
18049  PGATD(0.5),
18050  PHIGBOTD(1.16),
18051  PHIGSTID(1.16),
18052  PHIGGATD(1.16),
18053  IDSATRBOTD(1E-12),
18054  IDSATRSTID(1E-18),
18055  IDSATRGATD(1E-18),
18056  CSRHBOTD(1E2),
18057  CSRHSTID(1E-4),
18058  CSRHGATD(1E-4),
18059  XJUNSTID(100E-9),
18060  XJUNGATD(100E-9),
18061  CTATBOTD(1E2),
18062  CTATSTID(1E-4),
18063  CTATGATD(1E-4),
18064  MEFFTATBOTD(0.25),
18065  MEFFTATSTID(0.25),
18066  MEFFTATGATD(0.25),
18067  CBBTBOTD(1E-12),
18068  CBBTSTID(1E-18),
18069  CBBTGATD(1E-18),
18070  FBBTRBOTD(1E9),
18071  FBBTRSTID(1E9),
18072  FBBTRGATD(1E9),
18073  STFBBTBOTD((-1E-3)),
18074  STFBBTSTID((-1E-3)),
18075  STFBBTGATD((-1E-3)),
18076  VBRBOTD(10),
18077  VBRSTID(10),
18078  VBRGATD(10),
18079  PBRBOTD(4),
18080  PBRSTID(4),
18081  PBRGATD(4),
18082  SWJUNEXP(0.0),
18083  VJUNREF(2.5),
18084  FJUNQ(0.03),
18085  VJUNREFD(2.5),
18086  FJUNQD(0.03),
18087  DTA(0.0),
18088  NSUBO_i(0.0),
18089  WSEG_i(0.0),
18090  NPCK_i(0.0),
18091  WSEGP_i(0.0),
18092  LPCK_i(0.0),
18093  LOV_i(0.0),
18094  LOVD_i(0.0),
18095  LP1_i(0.0),
18096  LP2_i(0.0),
18097  WBET_i(0.0),
18098  AXL_i(0.0),
18099  ALP1L2_i(0.0),
18100  ALP2L2_i(0.0),
18101  TOXO_i(0.0),
18102  TOXOVO_i(0.0),
18103  TOXOVDO_i(0.0),
18104  EPSROXO_i(0.0),
18105  RINT_i(0.0),
18106  RVPOLY_i(0.0),
18107  RSHG_i(0.0),
18108  RSH_i(0.0),
18109  RSHD_i(0.0),
18110  SAREF_i(0.0),
18111  SBREF_i(0.0),
18112  KVSAT_i(0.0),
18113  LLODKUO_i(0.0),
18114  WLODKUO_i(0.0),
18115  LLODVTH_i(0.0),
18116  WLODVTH_i(0.0),
18117  LODETAO_i(0.0),
18118  SCREF_i(0.0),
18119  WEB_i(0.0),
18120  WEC_i(0.0),
18121  QMC_i(0.0),
18122  TKD(0.0),
18123  dT(0.0),
18124  rT(0.0),
18125  rTn(0.0),
18126  EPSSI(0.0),
18127  phit(0.0),
18128  inv_phit(0.0),
18129  Eg(0.0),
18130  phibFac(0.0),
18131  nt0(0.0),
18132  CHNL_TYPE(0),
18133  SWGEO_i(0),
18134  SWIGATE_i(0),
18135  SWIMPACT_i(0),
18136  SWGIDL_i(0),
18137  SWJUNCAP_i(0),
18138  SWJUNASYM_i(0),
18139  SWNUD_i(0),
18140  SWDELVTAC_i(0),
18141  IMAX_i(0.0),
18142  CJORBOT_i(0.0),
18143  CJORSTI_i(0.0),
18144  CJORGAT_i(0.0),
18145  VBIRBOT_i(0.0),
18146  VBIRSTI_i(0.0),
18147  VBIRGAT_i(0.0),
18148  PBOT_i(0.0),
18149  PSTI_i(0.0),
18150  PGAT_i(0.0),
18151  PHIGBOT_i(0.0),
18152  PHIGSTI_i(0.0),
18153  PHIGGAT_i(0.0),
18154  IDSATRBOT_i(0.0),
18155  IDSATRSTI_i(0.0),
18156  IDSATRGAT_i(0.0),
18157  XJUNSTI_i(0.0),
18158  XJUNGAT_i(0.0),
18159  CSRHBOT_i(0.0),
18160  CSRHSTI_i(0.0),
18161  CSRHGAT_i(0.0),
18162  CTATBOT_i(0.0),
18163  CTATSTI_i(0.0),
18164  CTATGAT_i(0.0),
18165  MEFFTATBOT_i(0.0),
18166  MEFFTATSTI_i(0.0),
18167  MEFFTATGAT_i(0.0),
18168  CBBTBOT_i(0.0),
18169  CBBTSTI_i(0.0),
18170  CBBTGAT_i(0.0),
18171  FBBTRBOT_i(0.0),
18172  FBBTRSTI_i(0.0),
18173  FBBTRGAT_i(0.0),
18174  STFBBTBOT_i(0.0),
18175  STFBBTSTI_i(0.0),
18176  STFBBTGAT_i(0.0),
18177  VBRBOT_i(0.0),
18178  VBRSTI_i(0.0),
18179  VBRGAT_i(0.0),
18180  PBRBOT_i(0.0),
18181  PBRSTI_i(0.0),
18182  PBRGAT_i(0.0),
18183  SWJUNEXP_i(0.0),
18184  VJUNREF_i(0.0),
18185  FJUNQ_i(0.0),
18186  phitr(0.0),
18187  phitd(0.0),
18188  phitdinv(0.0),
18189  perfc(0.0),
18190  berfc(0.0),
18191  cerfc(0.0),
18192  phigrbot(0.0),
18193  phigrsti(0.0),
18194  phigrgat(0.0),
18195  phigdbot(0.0),
18196  phigdsti(0.0),
18197  phigdgat(0.0),
18198  ftdbot(0.0),
18199  ftdsti(0.0),
18200  ftdgat(0.0),
18201  idsatbot(0.0),
18202  idsatsti(0.0),
18203  idsatgat(0.0),
18204  ubibot(0.0),
18205  ubisti(0.0),
18206  ubigat(0.0),
18207  vbibot(0.0),
18208  vbisti(0.0),
18209  vbigat(0.0),
18210  vbiinvbot(0.0),
18211  vbiinvsti(0.0),
18212  vbiinvgat(0.0),
18213  one_minus_PBOT(0.0),
18214  one_minus_PSTI(0.0),
18215  one_minus_PGAT(0.0),
18216  one_over_one_minus_PBOT(0.0),
18217  one_over_one_minus_PSTI(0.0),
18218  one_over_one_minus_PGAT(0.0),
18219  cjobot(0.0),
18220  cjosti(0.0),
18221  cjogat(0.0),
18222  qprefbot(0.0),
18223  qprefsti(0.0),
18224  qprefgat(0.0),
18225  qpref2bot(0.0),
18226  qpref2sti(0.0),
18227  qpref2gat(0.0),
18228  wdepnulrbot(0.0),
18229  wdepnulrsti(0.0),
18230  wdepnulrgat(0.0),
18231  wdepnulrinvbot(0.0),
18232  wdepnulrinvsti(0.0),
18233  wdepnulrinvgat(0.0),
18234  VBIRBOTinv(0.0),
18235  VBIRSTIinv(0.0),
18236  VBIRGATinv(0.0),
18237  deltaEbot(0.0),
18238  deltaEsti(0.0),
18239  deltaEgat(0.0),
18240  atatbot(0.0),
18241  atatsti(0.0),
18242  atatgat(0.0),
18243  btatpartbot(0.0),
18244  btatpartsti(0.0),
18245  btatpartgat(0.0),
18246  fbbtbot(0.0),
18247  fbbtsti(0.0),
18248  fbbtgat(0.0),
18249  fstopbot(0.0),
18250  fstopsti(0.0),
18251  fstopgat(0.0),
18252  VBRinvbot(0.0),
18253  VBRinvsti(0.0),
18254  VBRinvgat(0.0),
18255  slopebot(0.0),
18256  slopesti(0.0),
18257  slopegat(0.0),
18258  CJORBOTS_i(0.0),
18259  CJORSTIS_i(0.0),
18260  CJORGATS_i(0.0),
18261  VBIRBOTS_i(0.0),
18262  VBIRSTIS_i(0.0),
18263  VBIRGATS_i(0.0),
18264  PBOTS_i(0.0),
18265  PSTIS_i(0.0),
18266  PGATS_i(0.0),
18267  PHIGBOTS_i(0.0),
18268  PHIGSTIS_i(0.0),
18269  PHIGGATS_i(0.0),
18270  IDSATRBOTS_i(0.0),
18271  IDSATRSTIS_i(0.0),
18272  IDSATRGATS_i(0.0),
18273  XJUNSTIS_i(0.0),
18274  XJUNGATS_i(0.0),
18275  CSRHBOTS_i(0.0),
18276  CSRHSTIS_i(0.0),
18277  CSRHGATS_i(0.0),
18278  CTATBOTS_i(0.0),
18279  CTATSTIS_i(0.0),
18280  CTATGATS_i(0.0),
18281  MEFFTATBOTS_i(0.0),
18282  MEFFTATSTIS_i(0.0),
18283  MEFFTATGATS_i(0.0),
18284  CBBTBOTS_i(0.0),
18285  CBBTSTIS_i(0.0),
18286  CBBTGATS_i(0.0),
18287  FBBTRBOTS_i(0.0),
18288  FBBTRSTIS_i(0.0),
18289  FBBTRGATS_i(0.0),
18290  STFBBTBOTS_i(0.0),
18291  STFBBTSTIS_i(0.0),
18292  STFBBTGATS_i(0.0),
18293  VBRBOTS_i(0.0),
18294  VBRSTIS_i(0.0),
18295  VBRGATS_i(0.0),
18296  PBRBOTS_i(0.0),
18297  PBRSTIS_i(0.0),
18298  PBRGATS_i(0.0),
18299  CJORBOTD_i(0.0),
18300  CJORSTID_i(0.0),
18301  CJORGATD_i(0.0),
18302  VBIRBOTD_i(0.0),
18303  VBIRSTID_i(0.0),
18304  VBIRGATD_i(0.0),
18305  PBOTD_i(0.0),
18306  PSTID_i(0.0),
18307  PGATD_i(0.0),
18308  PHIGBOTD_i(0.0),
18309  PHIGSTID_i(0.0),
18310  PHIGGATD_i(0.0),
18311  IDSATRBOTD_i(0.0),
18312  IDSATRSTID_i(0.0),
18313  IDSATRGATD_i(0.0),
18314  XJUNSTID_i(0.0),
18315  XJUNGATD_i(0.0),
18316  CSRHBOTD_i(0.0),
18317  CSRHSTID_i(0.0),
18318  CSRHGATD_i(0.0),
18319  CTATBOTD_i(0.0),
18320  CTATSTID_i(0.0),
18321  CTATGATD_i(0.0),
18322  MEFFTATBOTD_i(0.0),
18323  MEFFTATSTID_i(0.0),
18324  MEFFTATGATD_i(0.0),
18325  CBBTBOTD_i(0.0),
18326  CBBTSTID_i(0.0),
18327  CBBTGATD_i(0.0),
18328  FBBTRBOTD_i(0.0),
18329  FBBTRSTID_i(0.0),
18330  FBBTRGATD_i(0.0),
18331  STFBBTBOTD_i(0.0),
18332  STFBBTSTID_i(0.0),
18333  STFBBTGATD_i(0.0),
18334  VBRBOTD_i(0.0),
18335  VBRSTID_i(0.0),
18336  VBRGATD_i(0.0),
18337  PBRBOTD_i(0.0),
18338  PBRSTID_i(0.0),
18339  PBRGATD_i(0.0),
18340  VJUNREFS_i(0.0),
18341  FJUNQS_i(0.0),
18342  VJUNREFD_i(0.0),
18343  FJUNQD_i(0.0),
18344  phigrbot_s(0.0),
18345  phigrsti_s(0.0),
18346  phigrgat_s(0.0),
18347  phigdbot_s(0.0),
18348  phigdsti_s(0.0),
18349  phigdgat_s(0.0),
18350  ftdbot_s(0.0),
18351  ftdsti_s(0.0),
18352  ftdgat_s(0.0),
18353  idsatbot_s(0.0),
18354  idsatsti_s(0.0),
18355  idsatgat_s(0.0),
18356  ubibot_s(0.0),
18357  ubisti_s(0.0),
18358  ubigat_s(0.0),
18359  vbibot_s(0.0),
18360  vbisti_s(0.0),
18361  vbigat_s(0.0),
18362  vbiinvbot_s(0.0),
18363  vbiinvsti_s(0.0),
18364  vbiinvgat_s(0.0),
18365  one_minus_PBOT_s(0.0),
18366  one_minus_PSTI_s(0.0),
18367  one_minus_PGAT_s(0.0),
18368  one_over_one_minus_PBOT_s(0.0),
18369  one_over_one_minus_PSTI_s(0.0),
18370  one_over_one_minus_PGAT_s(0.0),
18371  cjobot_s(0.0),
18372  cjosti_s(0.0),
18373  cjogat_s(0.0),
18374  qprefbot_s(0.0),
18375  qprefsti_s(0.0),
18376  qprefgat_s(0.0),
18377  qpref2bot_s(0.0),
18378  qpref2sti_s(0.0),
18379  qpref2gat_s(0.0),
18380  wdepnulrbot_s(0.0),
18381  wdepnulrsti_s(0.0),
18382  wdepnulrgat_s(0.0),
18383  wdepnulrinvbot_s(0.0),
18384  wdepnulrinvsti_s(0.0),
18385  wdepnulrinvgat_s(0.0),
18386  VBIRBOTinv_s(0.0),
18387  VBIRSTIinv_s(0.0),
18388  VBIRGATinv_s(0.0),
18389  deltaEbot_s(0.0),
18390  deltaEsti_s(0.0),
18391  deltaEgat_s(0.0),
18392  atatbot_s(0.0),
18393  atatsti_s(0.0),
18394  atatgat_s(0.0),
18395  btatpartbot_s(0.0),
18396  btatpartsti_s(0.0),
18397  btatpartgat_s(0.0),
18398  fbbtbot_s(0.0),
18399  fbbtsti_s(0.0),
18400  fbbtgat_s(0.0),
18401  fstopbot_s(0.0),
18402  fstopsti_s(0.0),
18403  fstopgat_s(0.0),
18404  VBRinvbot_s(0.0),
18405  VBRinvsti_s(0.0),
18406  VBRinvgat_s(0.0),
18407  slopebot_s(0.0),
18408  slopesti_s(0.0),
18409  slopegat_s(0.0),
18410  phigrbot_d(0.0),
18411  phigrsti_d(0.0),
18412  phigrgat_d(0.0),
18413  phigdbot_d(0.0),
18414  phigdsti_d(0.0),
18415  phigdgat_d(0.0),
18416  ftdbot_d(0.0),
18417  ftdsti_d(0.0),
18418  ftdgat_d(0.0),
18419  idsatbot_d(0.0),
18420  idsatsti_d(0.0),
18421  idsatgat_d(0.0),
18422  ubibot_d(0.0),
18423  ubisti_d(0.0),
18424  ubigat_d(0.0),
18425  vbibot_d(0.0),
18426  vbisti_d(0.0),
18427  vbigat_d(0.0),
18428  vbiinvbot_d(0.0),
18429  vbiinvsti_d(0.0),
18430  vbiinvgat_d(0.0),
18431  one_minus_PBOT_d(0.0),
18432  one_minus_PSTI_d(0.0),
18433  one_minus_PGAT_d(0.0),
18434  one_over_one_minus_PBOT_d(0.0),
18435  one_over_one_minus_PSTI_d(0.0),
18436  one_over_one_minus_PGAT_d(0.0),
18437  cjobot_d(0.0),
18438  cjosti_d(0.0),
18439  cjogat_d(0.0),
18440  qprefbot_d(0.0),
18441  qprefsti_d(0.0),
18442  qprefgat_d(0.0),
18443  qpref2bot_d(0.0),
18444  qpref2sti_d(0.0),
18445  qpref2gat_d(0.0),
18446  wdepnulrbot_d(0.0),
18447  wdepnulrsti_d(0.0),
18448  wdepnulrgat_d(0.0),
18449  wdepnulrinvbot_d(0.0),
18450  wdepnulrinvsti_d(0.0),
18451  wdepnulrinvgat_d(0.0),
18452  VBIRBOTinv_d(0.0),
18453  VBIRSTIinv_d(0.0),
18454  VBIRGATinv_d(0.0),
18455  deltaEbot_d(0.0),
18456  deltaEsti_d(0.0),
18457  deltaEgat_d(0.0),
18458  atatbot_d(0.0),
18459  atatsti_d(0.0),
18460  atatgat_d(0.0),
18461  btatpartbot_d(0.0),
18462  btatpartsti_d(0.0),
18463  btatpartgat_d(0.0),
18464  fbbtbot_d(0.0),
18465  fbbtsti_d(0.0),
18466  fbbtgat_d(0.0),
18467  fstopbot_d(0.0),
18468  fstopsti_d(0.0),
18469  fstopgat_d(0.0),
18470  VBRinvbot_d(0.0),
18471  VBRinvsti_d(0.0),
18472  VBRinvgat_d(0.0),
18473  slopebot_d(0.0),
18474  slopesti_d(0.0),
18475  slopegat_d(0.0)
18476 {
18477  // Set params to constant default values (from parTable):
18478  setDefaultParams();
18479 
18480  // Set params according to .model line and constant defaults from metadata:
18481  setModParams(model_block.params);
18482 
18483  // Set any non-constant parameter defaults:
18484  // Set any parameters that were not given and whose defaults depend on other
18485  // parameters:
18486 
18487 
18488  if (!given("XYCEADMSMODTEMP"))
18489  admsModTemp=getDeviceOptions().temp.getImmutableValue<double>();
18490 
18491  // Calculate any parameters specified as expressions:
18492 
18494 
18495  // Manually added code:
18496  if (getType() == "pmos" || getType() == "PMOS")
18497  TYPE = -1;
18498 
18499 
18500  // calculate dependent (ie computed) params and check for errors:
18501  processParams();
18502 }
18503 
18504 //-----------------------------------------------------------------------------
18505 // Function : Model::~Model
18506 // Purpose : destructor
18507 // Special Notes :
18508 // Scope : public
18509 // Creator :
18510 // Creation Date :
18511 //-----------------------------------------------------------------------------
18513 {
18514  std::vector<Instance*>::iterator iterI;
18515  std::vector<Instance*>::iterator firstI = instanceContainer.begin ();
18516  std::vector<Instance*>::iterator lastI = instanceContainer.end ();
18517 
18518  // loop over instances:
18519  for (iterI = firstI; iterI != lastI; ++iterI)
18520  {
18521  delete (*iterI);
18522  }
18523 }
18524 
18525 //-----------------------------------------------------------------------------
18526 // Function : Model::printOutInstances
18527 // Purpose : debugging tool.
18528 // Special Notes :
18529 // Scope : public
18530 // Creator :
18531 // Creation Date :
18532 //-----------------------------------------------------------------------------
18533 std::ostream &Model::printOutInstances(std::ostream &os) const
18534 {
18535  std::vector<Instance*>::const_iterator iter;
18536  std::vector<Instance*>::const_iterator first = instanceContainer.begin();
18537  std::vector<Instance*>::const_iterator last = instanceContainer.end();
18538 
18539  int i;
18540  os << std::endl;
18541  os << " name model name Parameters" << std::endl;
18542  for (i=0, iter=first; iter!=last; ++iter, ++i)
18543  {
18544  os << " " << i << ": " << (*iter)->getName() << " ";
18545  os << getName();
18546 
18547  os << std::endl;
18548  os << "L = " << (*iter)->L << std::endl;
18549  os << "W = " << (*iter)->W << std::endl;
18550  os << "SA = " << (*iter)->SA << std::endl;
18551  os << "SB = " << (*iter)->SB << std::endl;
18552  os << "SD = " << (*iter)->SD << std::endl;
18553  os << "SCA = " << (*iter)->SCA << std::endl;
18554  os << "SCB = " << (*iter)->SCB << std::endl;
18555  os << "SCC = " << (*iter)->SCC << std::endl;
18556  os << "SC = " << (*iter)->SC << std::endl;
18557  os << "NF = " << (*iter)->NF << std::endl;
18558  os << "NGCON = " << (*iter)->NGCON << std::endl;
18559  os << "XGW = " << (*iter)->XGW << std::endl;
18560  os << "NRS = " << (*iter)->NRS << std::endl;
18561  os << "NRD = " << (*iter)->NRD << std::endl;
18562  os << "JW = " << (*iter)->JW << std::endl;
18563  os << "DELVTO = " << (*iter)->DELVTO << std::endl;
18564  os << "FACTUO = " << (*iter)->FACTUO << std::endl;
18565  os << "ABSOURCE = " << (*iter)->ABSOURCE << std::endl;
18566  os << "LSSOURCE = " << (*iter)->LSSOURCE << std::endl;
18567  os << "LGSOURCE = " << (*iter)->LGSOURCE << std::endl;
18568  os << "ABDRAIN = " << (*iter)->ABDRAIN << std::endl;
18569  os << "LSDRAIN = " << (*iter)->LSDRAIN << std::endl;
18570  os << "LGDRAIN = " << (*iter)->LGDRAIN << std::endl;
18571  os << "AS = " << (*iter)->AS << std::endl;
18572  os << "PS = " << (*iter)->PS << std::endl;
18573  os << "AD = " << (*iter)->AD << std::endl;
18574  os << "PD = " << (*iter)->PD << std::endl;
18575  os << "MULT = " << (*iter)->MULT << std::endl;
18576  os << std::endl;
18577  }
18578 
18579  os << std::endl;
18580 
18581  return os;
18582 }
18583 
18584 //-----------------------------------------------------------------------------
18585 // Function : Model::forEachInstance
18586 // Purpose :
18587 // Special Notes :
18588 // Scope : public
18589 // Creator : David Baur
18590 // Creation Date : 2/4/2014
18591 //-----------------------------------------------------------------------------
18592 /// Apply a device instance "op" to all instances associated with this
18593 /// model
18594 ///
18595 /// @param[in] op Operator to apply to all instances.
18596 ///
18597 ///
18598 void Model::forEachInstance(DeviceInstanceOp &op) const /* override */
18599 {
18600  for (std::vector<Instance *>::const_iterator it = instanceContainer.begin(); it != instanceContainer.end(); ++it)
18601  op(*it);
18602 }
18603 
18604 Device *Traits::factory(const Configuration &configuration, const FactoryBlock &factory_block)
18605 {
18606  return new DeviceMaster<Traits>(configuration, factory_block, factory_block.solverState_, factory_block.deviceOptions_);
18607 }
18608 
18610 {
18612  .registerDevice("m", 103)
18613  .registerModelType("nmos", 103)
18614  .registerModelType("pmos", 103);
18615 }
18616 
18617 
18618 
18619 } // namespace ADMSPSP103VA
18620 } // namespace Device
18621 } // namespace Xyce