LCOV - code coverage report
Current view: top level - src/components/verilog - bsim3v34nMOS.core.cpp (source / functions) Hit Total Coverage
Test: qucs-core-0.0.19 Code Coverage Lines: 0 4143 0.0 %
Date: 2015-01-05 16:01:02 Functions: 0 28 0.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 1100 0.0 %

           Branch data     Line data    Source code
       1                 :            : /*
       2                 :            :  * bsim3v34nMOS.core.cpp - device implementations for bsim3v34nMOS module
       3                 :            :  *
       4                 :            :  * This is free software; you can redistribute it and/or modify
       5                 :            :  * it under the terms of the GNU General Public License as published by
       6                 :            :  * the Free Software Foundation; either version 2, or (at your option)
       7                 :            :  * any later version.
       8                 :            :  *
       9                 :            :  */
      10                 :            : 
      11                 :            : #if HAVE_CONFIG_H
      12                 :            : #include <config.h>
      13                 :            : #endif
      14                 :            : 
      15                 :            : #include "bsim3v34nMOS.analogfunction.h"
      16                 :            : #include "component.h"
      17                 :            : #include "device.h"
      18                 :            : #include "bsim3v34nMOS.core.h"
      19                 :            : 
      20                 :            : #ifndef CIR_bsim3v34nMOS
      21                 :            : #define CIR_bsim3v34nMOS -1
      22                 :            : #endif
      23                 :            : 
      24                 :            : // external nodes
      25                 :            : #define drain 0
      26                 :            : #define gate 1
      27                 :            : #define source 2
      28                 :            : #define bulk 3
      29                 :            : // internal nodes
      30                 :            : #define drainp 4
      31                 :            : #define sourcep 5
      32                 :            : 
      33                 :            : // useful macro definitions
      34                 :            : #define NP(node) real (getV (node))
      35                 :            : #define BP(pnode,nnode) (NP(pnode) - NP(nnode))
      36                 :            : #define _load_static_residual2(pnode,nnode,current)\
      37                 :            :         _rhs[pnode] -= current;\
      38                 :            :         _rhs[nnode] += current;
      39                 :            : #define _load_static_augmented_residual2(pnode,nnode,current)\
      40                 :            :         _rhs[pnode] -= current;\
      41                 :            :         _rhs[nnode] += current;
      42                 :            : #define _load_static_residual1(node,current)\
      43                 :            :         _rhs[node] -= current;
      44                 :            : #define _load_static_augmented_residual1(node,current)\
      45                 :            :         _rhs[node] -= current;
      46                 :            : #define _load_static_jacobian4(pnode,nnode,vpnode,vnnode,conductance)\
      47                 :            :         _jstat[pnode][vpnode] += conductance;\
      48                 :            :         _jstat[nnode][vnnode] += conductance;\
      49                 :            :         _jstat[pnode][vnnode] -= conductance;\
      50                 :            :         _jstat[nnode][vpnode] -= conductance;\
      51                 :            :         if (doHB) {\
      52                 :            :         _ghs[pnode] += conductance * BP(vpnode,vnnode);\
      53                 :            :         _ghs[nnode] -= conductance * BP(vpnode,vnnode);\
      54                 :            :         } else {\
      55                 :            :         _rhs[pnode] += conductance * BP(vpnode,vnnode);\
      56                 :            :         _rhs[nnode] -= conductance * BP(vpnode,vnnode);\
      57                 :            :         }
      58                 :            : #define _load_static_jacobian2p(node,vpnode,vnnode,conductance)\
      59                 :            :         _jstat[node][vpnode] += conductance;\
      60                 :            :         _jstat[node][vnnode] -= conductance;\
      61                 :            :         if (doHB) {\
      62                 :            :         _ghs[node] += conductance * BP(vpnode,vnnode);\
      63                 :            :         } else {\
      64                 :            :         _rhs[node] += conductance * BP(vpnode,vnnode);\
      65                 :            :         }
      66                 :            : #define _load_static_jacobian2s(pnode,nnode,node,conductance)\
      67                 :            :         _jstat[pnode][node] += conductance;\
      68                 :            :         _jstat[nnode][node] -= conductance;\
      69                 :            :         if (doHB) {\
      70                 :            :         _ghs[pnode] += conductance * NP(node);\
      71                 :            :         _ghs[nnode] -= conductance * NP(node);\
      72                 :            :         } else {\
      73                 :            :         _rhs[pnode] += conductance * NP(node);\
      74                 :            :         _rhs[nnode] -= conductance * NP(node);\
      75                 :            :         }
      76                 :            : #define _load_static_jacobian1(node,vnode,conductance)\
      77                 :            :         _jstat[node][vnode] += conductance;\
      78                 :            :         if (doHB) {\
      79                 :            :         _ghs[node] += conductance * NP(vnode);\
      80                 :            :         } else {\
      81                 :            :         _rhs[node] += conductance * NP(vnode);\
      82                 :            :         }
      83                 :            : #define _load_dynamic_residual2(pnode,nnode,charge)\
      84                 :            :         if (doTR) _charges[pnode][nnode] += charge;\
      85                 :            :         if (doHB) {\
      86                 :            :         _qhs[pnode] -= charge;\
      87                 :            :         _qhs[nnode] += charge;\
      88                 :            :         }
      89                 :            : #define _load_dynamic_residual1(node,charge)\
      90                 :            :         if (doTR) _charges[node][node] += charge;\
      91                 :            :         if (doHB) {\
      92                 :            :         _qhs[node] -= charge;\
      93                 :            :         }
      94                 :            : #define _load_dynamic_jacobian4(pnode,nnode,vpnode,vnnode,capacitance)\
      95                 :            :         if (doAC) {\
      96                 :            :         _jdyna[pnode][vpnode] += capacitance;\
      97                 :            :         _jdyna[nnode][vnnode] += capacitance;\
      98                 :            :         _jdyna[pnode][vnnode] -= capacitance;\
      99                 :            :         _jdyna[nnode][vpnode] -= capacitance;\
     100                 :            :         }\
     101                 :            :         if (doTR) {\
     102                 :            :         _caps[pnode][nnode][vpnode][vnnode] += capacitance;\
     103                 :            :         }\
     104                 :            :         if (doHB) {\
     105                 :            :         _chs[pnode] += capacitance * BP(vpnode,vnnode);\
     106                 :            :         _chs[nnode] -= capacitance * BP(vpnode,vnnode);\
     107                 :            :         }
     108                 :            : #define _load_dynamic_jacobian2s(pnode,nnode,vnode,capacitance)\
     109                 :            :         if (doAC) {\
     110                 :            :         _jdyna[pnode][vnode] += capacitance;\
     111                 :            :         _jdyna[nnode][vnode] -= capacitance;\
     112                 :            :         }\
     113                 :            :         if (doTR) {\
     114                 :            :         _caps[pnode][nnode][vnode][vnode] += capacitance;\
     115                 :            :         }\
     116                 :            :         if (doHB) {\
     117                 :            :         _chs[pnode] += capacitance * NP(vnode);\
     118                 :            :         _chs[nnode] -= capacitance * NP(vnode);\
     119                 :            :         }
     120                 :            : #define _load_dynamic_jacobian2p(node,vpnode,vnnode,capacitance)\
     121                 :            :         if (doAC) {\
     122                 :            :         _jdyna[node][vpnode] += capacitance;\
     123                 :            :         _jdyna[node][vnnode] -= capacitance;\
     124                 :            :         }\
     125                 :            :         if (doTR) {\
     126                 :            :         _caps[node][node][vpnode][vnnode] += capacitance;\
     127                 :            :         }\
     128                 :            :         if (doHB) {\
     129                 :            :         _chs[node] += capacitance * BP(vpnode,vnnode);\
     130                 :            :         }
     131                 :            : #define _load_dynamic_jacobian1(node,vnode,capacitance)\
     132                 :            :         if (doAC) {\
     133                 :            :         _jdyna[node][vnode] += capacitance;\
     134                 :            :         }\
     135                 :            :         if (doTR) {\
     136                 :            :         _caps[node][node][vnode][vnode] += capacitance;\
     137                 :            :         }\
     138                 :            :         if (doHB) {\
     139                 :            :         _chs[node] += capacitance * NP(vnode);\
     140                 :            :         }
     141                 :            : 
     142                 :            : #define _save_whitenoise1(n1,pwr,type)\
     143                 :            :         _white_pwr[n1][n1] += pwr;
     144                 :            : #define _save_whitenoise2(n1,n2,pwr,type)\
     145                 :            :         _white_pwr[n1][n2] += pwr;
     146                 :            : #define _save_flickernoise1(n1,pwr,exp,type)\
     147                 :            :         _flicker_pwr[n1][n1] += pwr;\
     148                 :            :         _flicker_exp[n1][n1] += exp;
     149                 :            : #define _save_flickernoise2(n1,n2,pwr,exp,type)\
     150                 :            :         _flicker_pwr[n1][n2] += pwr;\
     151                 :            :         _flicker_exp[n1][n2] += exp;
     152                 :            : #define _load_whitenoise2(n1,n2,pwr)\
     153                 :            :         cy (n1,n2) -= pwr/kB/T0; cy (n2,n1) -= pwr/kB/T0;\
     154                 :            :         cy (n1,n1) += pwr/kB/T0; cy (n2,n2) += pwr/kB/T0;
     155                 :            : #define _load_whitenoise1(n1,pwr)\
     156                 :            :         cy (n1,n1) += pwr/kB/T0;
     157                 :            : #define _load_flickernoise2(n1,n2,pwr,exp)\
     158                 :            :         cy (n1,n2) -= pwr*pow(_freq,-exp)/kB/T0;\
     159                 :            :         cy (n2,n1) -= pwr*pow(_freq,-exp)/kB/T0;\
     160                 :            :         cy (n1,n1) += pwr*pow(_freq,-exp)/kB/T0;\
     161                 :            :         cy (n2,n2) += pwr*pow(_freq,-exp)/kB/T0;
     162                 :            : #define _load_flickernoise1(n1,pwr,exp)\
     163                 :            :         cy (n1,n1) += pwr*pow(_freq,-exp)/kB/T0;
     164                 :            : 
     165                 :            : // derivative helper macros
     166                 :            : // transcendental LRM p. 59
     167                 :            : #define m00_cos(v00,x)          v00 = cos(x);
     168                 :            : #define m10_cos(v10,v00,x)      v10 = (-sin(x));
     169                 :            : #define m00_sin(v00,x)          v00 = sin(x);
     170                 :            : #define m10_sin(v10,v00,x)      v10 = (cos(x));
     171                 :            : #define m00_tan(v00,x)          v00 = tan(x);
     172                 :            : #define m10_tan(v10,v00,x)      v10 = (1.0/cos(x)/cos(x));
     173                 :            : #define m00_cosh(v00,x)         v00 = cosh(x);
     174                 :            : #define m10_cosh(v10,v00,x)     v10 = (sinh(x));
     175                 :            : #define m00_sinh(v00,x)         v00 = sinh(x);
     176                 :            : #define m10_sinh(v10,v00,x)     v10 = (cosh(x));
     177                 :            : #define m00_tanh(v00,x)         v00 = tanh(x);
     178                 :            : #define m10_tanh(v10,v00,x)     v10 = (1.0/cosh(x)/cosh(x));
     179                 :            : #define m00_acos(v00,x)         v00 = acos(x);
     180                 :            : #define m10_acos(v10,v00,x)     v10 = (-1.0/sqrt(1-x*x));
     181                 :            : #define m00_asin(v00,x)         v00 = asin(x);
     182                 :            : #define m10_asin(v10,v00,x)     v10 = (+1.0/sqrt(1-x*x));
     183                 :            : #define m00_atan(v00,x)         v00 = atan(x);
     184                 :            : #define m10_atan(v10,v00,x)     v10 = (+1.0/(1+x*x));
     185                 :            : #define m00_hypot(v00,x,y)      v00 = sqrt((x)*(x)+(y)*(y));
     186                 :            : #define m10_hypot(v10,v00,x,y)  v10 = (x)/(v00);
     187                 :            : #define m11_hypot(v11,v00,x,y)  v11 = (y)/(v00);
     188                 :            : #define m00_atan2(v00,x,y)      v00 = atan2(x,y);
     189                 :            : // TODO atan2 derivatives ?
     190                 :            : #define m00_acosh(v00,x)        v00 = acosh(x);
     191                 :            : #define m10_acosh(v10,v00,x)    v10 = (1.0/(sqrt(x-1)*sqrt(x+1)));
     192                 :            : #define m00_asinh(v00,x)        v00 = asinh(x);
     193                 :            : #define m10_asinh(v10,v00,x)    v10 = (1.0/(sqrt(x*x+1)));
     194                 :            : #define m00_atanh(v00,x)        v00 = atanh(x);
     195                 :            : #define m10_atanh(v10,v00,x)    v10 = (1.0/(1-x*x));
     196                 :            : 
     197                 :            : 
     198                 :            : // standard functions LRM p.58
     199                 :            : #define m00_logE(v00,x)         v00 = log(x);
     200                 :            : #define m10_logE(v10,v00,x)     v10 = (1.0/x);
     201                 :            : #define m00_log10(v00,x)        v00 = log10(x);
     202                 :            : #define m10_log10(v10,v00,x)    v10 = (1.0/x/M_LN10);
     203                 :            : #define m00_exp(v00,x)          v00 = exp(x);
     204                 :            : #define m10_exp(v10,v00,x)      v10 = v00;
     205                 :            : #define m00_sqrt(v00,x)         v00 = sqrt(x);
     206                 :            : #define m10_sqrt(v10,v00,x)     v10 = (0.5/v00);
     207                 :            : #define m00_min(v00,x,y)        v00 = ((x)<(y))?(x):(y);
     208                 :            : #define m10_min(v10,v00,x,y)    v10 = ((x)<(y))?1.0:0.0;
     209                 :            : #define m11_min(v11,v00,x,y)    v11 = ((x)<(y))?0.0:1.0;
     210                 :            : #define m00_max(v00,x,y)        v00 = ((x)>(y))?(x):(y);
     211                 :            : #define m10_max(v10,v00,x,y)    v10 = ((x)>(y))?1.0:0.0;
     212                 :            : #define m11_max(v11,v00,x,y)    v11 = ((x)>(y))?0.0:1.0;
     213                 :            : #define m00_pow(v00,x,y)        v00 = pow(x,y);
     214                 :            : #define m10_pow(v10,v00,x,y)    v10 = (x==0.0)?0.0:(v00)*(y)/(x);
     215                 :            : #define m11_pow(v11,v00,x,y)    v11 = (x==0.0)?0.0:(log(x)*(v00));
     216                 :            : #define m00_abs(v00,x)          v00 = ((x)<(0)?(-(x)):(x));
     217                 :            : #define m10_abs(v10,v00,x)      v10 = (((x)>=0)?(+1.0):(-1.0));
     218                 :            : #define m00_floor(v00,x)        v00 = floor(x);
     219                 :            : #define m10_floor(v10,v00,x)    v10 = 1.0;
     220                 :            : 
     221                 :            : #define m00_ceil(v00,x)         v00 = ceil(x);
     222                 :            : // TODO ceil derivative, needed?
     223                 :            : 
     224                 :            : // analog operator, LRM p.61
     225                 :            : #define m00_limexp(v00,x)       v00 = ((x)<80.0?exp(x):exp(80.0)*(x-79.0));
     226                 :            : #define m10_limexp(v10,v00,x)   v10 = ((x)<80.0?(v00):exp(80.0));
     227                 :            : 
     228                 :            : // analog kernel parameter system functions, LRM p.215
     229                 :            : #define m00_vt(x)               (kBoverQ*(x))
     230                 :            : #define m10_vt(x)               (kBoverQ)
     231                 :            : 
     232                 :            : // extra functions (?)
     233                 :            : #define m00_div(v00,v10,x,y)    double v10=1/(y); double v00=(x)*v10;
     234                 :            : #define m10_div(v10,v00,vv,x,y)
     235                 :            : #define m11_div(v11,v00,vv,x,y) double v11 = -v00*vv;
     236                 :            : #define m00_mult(v00,v10,v11,x,y) double v10=(x); double v11=(y); double v00=v10*v11;
     237                 :            : #define m00_add(v00,x,y)        double v00=(x)+(y);
     238                 :            : 
     239                 :            : // second derivatives
     240                 :            : #define m20_logE(v00)           (-1.0/v00/v00)
     241                 :            : #define m20_exp(v00)            exp(v00)
     242                 :            : #define m20_limexp(v00)         ((v00)<80.0?exp(v00):0.0)
     243                 :            : #define m20_sqrt(v00)           (-0.25/(v00)/sqrt(v00))
     244                 :            : #define m20_abs(v00)           0.0
     245                 :            : #define m20_pow(x,y)            ((y)*((y)-1.0)*pow(x,y)/(x)/(x))
     246                 :            : 
     247                 :            : 
     248                 :            : // simulator specific definitions
     249                 :            : #define _modelname              "bsim3v34nMOS"
     250                 :            : #define _instancename           getName()
     251                 :            : #define _circuit_temp           (getPropertyDouble("Temp")+273.15)
     252                 :            : #define _param_given(p)         (isPropertyGiven(p)?1:0)
     253                 :            : 
     254                 :            : 
     255                 :            : // $vt and $vt() functions
     256                 :            : #define _vt_nom                 (kBoverQ*_circuit_temp)
     257                 :            : 
     258                 :            : using namespace qucs::device;
     259                 :            : using qucs::matrix;
     260                 :            : 
     261                 :            : /* Device constructor. */
     262                 :          0 : bsim3v34nMOS::bsim3v34nMOS() : circuit (6)
     263                 :            : {
     264                 :          0 :   type = CIR_bsim3v34nMOS;
     265                 :          0 : }
     266                 :            : 
     267                 :            : /* Initialization of model. */
     268                 :          0 : void bsim3v34nMOS::initModel (void)
     269                 :            : {
     270                 :            :   // create internal nodes
     271                 :          0 :   setInternalNode (drainp, "drainp");
     272                 :          0 :   setInternalNode (sourcep, "sourcep");
     273                 :            : 
     274                 :            :   // get device model parameters
     275                 :          0 :   loadVariables ();
     276                 :            :   // evaluate global model equations
     277                 :          0 :   initializeModel ();
     278                 :            :   // evaluate initial step equations
     279                 :          0 :   initialStep ();
     280                 :            :   // evaluate global instance equations
     281                 :          0 :   initializeInstance ();
     282                 :          0 : }
     283                 :            : 
     284                 :            : /* Initialization of DC analysis. */
     285                 :          0 : void bsim3v34nMOS::initDC (void)
     286                 :            : {
     287                 :          0 :   allocMatrixMNA ();
     288                 :          0 :   initModel ();
     289                 :          0 :   pol = 1;
     290                 :          0 :   restartDC ();
     291                 :          0 :   doAC = 1;
     292                 :          0 :   doTR = 0;
     293                 :          0 :   doHB = 0;
     294                 :          0 : }
     295                 :            : 
     296                 :            : /* Run when DC is restarted (fallback algorithms). */
     297                 :          0 : void bsim3v34nMOS::restartDC (void)
     298                 :            : {
     299                 :          0 : }
     300                 :            : 
     301                 :            : /* Initialize Verilog-AMS code. */
     302                 :          0 : void bsim3v34nMOS::initVerilog (void)
     303                 :            : {
     304                 :            :   // initialization of noise variables
     305                 :          0 :   _white_pwr[sourcep][source] = 0.0;
     306                 :          0 :   _white_pwr[drain][drainp] = 0.0;
     307                 :          0 :   _white_pwr[drainp][sourcep] = 0.0;
     308                 :          0 :   _flicker_pwr[drainp][sourcep] = 0.0;
     309                 :          0 :   _flicker_exp[drainp][sourcep] = 0.0;
     310                 :            : 
     311                 :            :   int i1, i2, i3, i4;
     312                 :            : 
     313                 :            :   // zero charges
     314         [ #  # ]:          0 :   for (i1 = 0; i1 < 6; i1++) {
     315         [ #  # ]:          0 :   for (i2 = 0; i2 < 6; i2++) {
     316                 :          0 :     _charges[i1][i2] = 0.0;
     317                 :            :   } }
     318                 :            : 
     319                 :            :   // zero capacitances
     320         [ #  # ]:          0 :   for (i1 = 0; i1 < 6; i1++) {
     321         [ #  # ]:          0 :   for (i2 = 0; i2 < 6; i2++) {
     322         [ #  # ]:          0 :   for (i3 = 0; i3 < 6; i3++) {
     323         [ #  # ]:          0 :   for (i4 = 0; i4 < 6; i4++) {
     324                 :          0 :     _caps[i1][i2][i3][i4] = 0.0;
     325                 :            :   } } } }
     326                 :            : 
     327                 :            :   // zero right hand side, static and dynamic jacobian
     328         [ #  # ]:          0 :   for (i1 = 0; i1 < 6; i1++) {
     329                 :          0 :     _rhs[i1] = 0.0;
     330                 :          0 :     _qhs[i1] = 0.0;
     331                 :          0 :     _chs[i1] = 0.0;
     332                 :          0 :     _ghs[i1] = 0.0;
     333         [ #  # ]:          0 :     for (i2 = 0; i2 < 6; i2++) {
     334                 :          0 :       _jstat[i1][i2] = 0.0;
     335                 :          0 :       _jdyna[i1][i2] = 0.0;
     336                 :            :     }
     337                 :            :   }
     338                 :          0 : }
     339                 :            : 
     340                 :            : /* Load device model input parameters. */
     341                 :          0 : void bsim3v34nMOS::loadVariables (void)
     342                 :            : {
     343                 :          0 :   L = getPropertyDouble ("L");
     344                 :          0 :   W = getPropertyDouble ("W");
     345                 :          0 :   PS = getPropertyDouble ("PS");
     346                 :          0 :   PD = getPropertyDouble ("PD");
     347                 :          0 :   AS = getPropertyDouble ("AS");
     348                 :          0 :   AD = getPropertyDouble ("AD");
     349                 :          0 :   NRS = getPropertyDouble ("NRS");
     350                 :          0 :   NRD = getPropertyDouble ("NRD");
     351                 :          0 :   NQSMOD = getPropertyDouble ("NQSMOD");
     352                 :          0 :   GMIN = getPropertyDouble ("GMIN");
     353                 :          0 :   VERSION = getPropertyDouble ("VERSION");
     354                 :          0 :   PARAMCHK = getPropertyDouble ("PARAMCHK");
     355                 :          0 :   MOBMOD = getPropertyDouble ("MOBMOD");
     356                 :          0 :   CAPMOD = getPropertyDouble ("CAPMOD");
     357                 :          0 :   NOIMOD = getPropertyDouble ("NOIMOD");
     358                 :          0 :   BINUNIT = getPropertyDouble ("BINUNIT");
     359                 :          0 :   TOX = getPropertyDouble ("TOX");
     360                 :          0 :   TOXM = getPropertyDouble ("TOXM");
     361                 :          0 :   CDSC = getPropertyDouble ("CDSC");
     362                 :          0 :   CDSCB = getPropertyDouble ("CDSCB");
     363                 :          0 :   CDSCD = getPropertyDouble ("CDSCD");
     364                 :          0 :   CIT = getPropertyDouble ("CIT");
     365                 :          0 :   NFACTOR = getPropertyDouble ("NFACTOR");
     366                 :          0 :   XJ = getPropertyDouble ("XJ");
     367                 :          0 :   VSAT = getPropertyDouble ("VSAT");
     368                 :          0 :   AT = getPropertyDouble ("AT");
     369                 :          0 :   A0 = getPropertyDouble ("A0");
     370                 :          0 :   AGS = getPropertyDouble ("AGS");
     371                 :          0 :   A1 = getPropertyDouble ("A1");
     372                 :          0 :   A2 = getPropertyDouble ("A2");
     373                 :          0 :   KETA = getPropertyDouble ("KETA");
     374                 :          0 :   NSUB = getPropertyDouble ("NSUB");
     375                 :          0 :   NCH = getPropertyDouble ("NCH");
     376                 :          0 :   NGATE = getPropertyDouble ("NGATE");
     377                 :          0 :   GAMMA1 = getPropertyDouble ("GAMMA1");
     378                 :          0 :   GAMMA2 = getPropertyDouble ("GAMMA2");
     379                 :          0 :   VBX = getPropertyDouble ("VBX");
     380                 :          0 :   VBM = getPropertyDouble ("VBM");
     381                 :          0 :   XT = getPropertyDouble ("XT");
     382                 :          0 :   K1 = getPropertyDouble ("K1");
     383                 :          0 :   KT1 = getPropertyDouble ("KT1");
     384                 :          0 :   KT1L = getPropertyDouble ("KT1L");
     385                 :          0 :   KT2 = getPropertyDouble ("KT2");
     386                 :          0 :   K2 = getPropertyDouble ("K2");
     387                 :          0 :   K3 = getPropertyDouble ("K3");
     388                 :          0 :   K3B = getPropertyDouble ("K3B");
     389                 :          0 :   W0 = getPropertyDouble ("W0");
     390                 :          0 :   NLX = getPropertyDouble ("NLX");
     391                 :          0 :   DVT0 = getPropertyDouble ("DVT0");
     392                 :          0 :   DVT1 = getPropertyDouble ("DVT1");
     393                 :          0 :   DVT2 = getPropertyDouble ("DVT2");
     394                 :          0 :   DVT0W = getPropertyDouble ("DVT0W");
     395                 :          0 :   DVT1W = getPropertyDouble ("DVT1W");
     396                 :          0 :   DVT2W = getPropertyDouble ("DVT2W");
     397                 :          0 :   DROUT = getPropertyDouble ("DROUT");
     398                 :          0 :   DSUB = getPropertyDouble ("DSUB");
     399                 :          0 :   VTHO = getPropertyDouble ("VTHO");
     400                 :          0 :   VTH0 = getPropertyDouble ("VTH0");
     401                 :          0 :   UA = getPropertyDouble ("UA");
     402                 :          0 :   UA1 = getPropertyDouble ("UA1");
     403                 :          0 :   UB = getPropertyDouble ("UB");
     404                 :          0 :   UB1 = getPropertyDouble ("UB1");
     405                 :          0 :   UC = getPropertyDouble ("UC");
     406                 :          0 :   UC1 = getPropertyDouble ("UC1");
     407                 :          0 :   U0 = getPropertyDouble ("U0");
     408                 :          0 :   UTE = getPropertyDouble ("UTE");
     409                 :          0 :   VOFF = getPropertyDouble ("VOFF");
     410                 :          0 :   TNOM = getPropertyDouble ("TNOM");
     411                 :          0 :   CGSO = getPropertyDouble ("CGSO");
     412                 :          0 :   CGDO = getPropertyDouble ("CGDO");
     413                 :          0 :   CGBO = getPropertyDouble ("CGBO");
     414                 :          0 :   XPART = getPropertyDouble ("XPART");
     415                 :          0 :   ELM = getPropertyDouble ("ELM");
     416                 :          0 :   DELTA = getPropertyDouble ("DELTA");
     417                 :          0 :   RSH = getPropertyDouble ("RSH");
     418                 :          0 :   RDSW = getPropertyDouble ("RDSW");
     419                 :          0 :   PRWG = getPropertyDouble ("PRWG");
     420                 :          0 :   PRWB = getPropertyDouble ("PRWB");
     421                 :          0 :   PRT = getPropertyDouble ("PRT");
     422                 :          0 :   ETA0 = getPropertyDouble ("ETA0");
     423                 :          0 :   ETAB = getPropertyDouble ("ETAB");
     424                 :          0 :   PCLM = getPropertyDouble ("PCLM");
     425                 :          0 :   PDIBLC1 = getPropertyDouble ("PDIBLC1");
     426                 :          0 :   PDIBLC2 = getPropertyDouble ("PDIBLC2");
     427                 :          0 :   PDIBLCB = getPropertyDouble ("PDIBLCB");
     428                 :          0 :   PSCBE1 = getPropertyDouble ("PSCBE1");
     429                 :          0 :   PSCBE2 = getPropertyDouble ("PSCBE2");
     430                 :          0 :   PVAG = getPropertyDouble ("PVAG");
     431                 :          0 :   JS = getPropertyDouble ("JS");
     432                 :          0 :   JSW = getPropertyDouble ("JSW");
     433                 :          0 :   PB = getPropertyDouble ("PB");
     434                 :          0 :   NJ = getPropertyDouble ("NJ");
     435                 :          0 :   XTI = getPropertyDouble ("XTI");
     436                 :          0 :   MJ = getPropertyDouble ("MJ");
     437                 :          0 :   PBSW = getPropertyDouble ("PBSW");
     438                 :          0 :   MJSW = getPropertyDouble ("MJSW");
     439                 :          0 :   PBSWG = getPropertyDouble ("PBSWG");
     440                 :          0 :   MJSWG = getPropertyDouble ("MJSWG");
     441                 :          0 :   CJ = getPropertyDouble ("CJ");
     442                 :          0 :   VFBCV = getPropertyDouble ("VFBCV");
     443                 :          0 :   VFB = getPropertyDouble ("VFB");
     444                 :          0 :   CJSW = getPropertyDouble ("CJSW");
     445                 :          0 :   CJSWG = getPropertyDouble ("CJSWG");
     446                 :          0 :   TPB = getPropertyDouble ("TPB");
     447                 :          0 :   TCJ = getPropertyDouble ("TCJ");
     448                 :          0 :   TPBSW = getPropertyDouble ("TPBSW");
     449                 :          0 :   TCJSW = getPropertyDouble ("TCJSW");
     450                 :          0 :   TPBSWG = getPropertyDouble ("TPBSWG");
     451                 :          0 :   TCJSWG = getPropertyDouble ("TCJSWG");
     452                 :          0 :   ACDE = getPropertyDouble ("ACDE");
     453                 :          0 :   MOIN = getPropertyDouble ("MOIN");
     454                 :          0 :   NOFF = getPropertyDouble ("NOFF");
     455                 :          0 :   VOFFCV = getPropertyDouble ("VOFFCV");
     456                 :          0 :   LINT = getPropertyDouble ("LINT");
     457                 :          0 :   LL = getPropertyDouble ("LL");
     458                 :          0 :   LLC = getPropertyDouble ("LLC");
     459                 :          0 :   LLN = getPropertyDouble ("LLN");
     460                 :          0 :   LW = getPropertyDouble ("LW");
     461                 :          0 :   LWC = getPropertyDouble ("LWC");
     462                 :          0 :   LWN = getPropertyDouble ("LWN");
     463                 :          0 :   LWL = getPropertyDouble ("LWL");
     464                 :          0 :   LWLC = getPropertyDouble ("LWLC");
     465                 :          0 :   LMIN = getPropertyDouble ("LMIN");
     466                 :          0 :   LMAX = getPropertyDouble ("LMAX");
     467                 :          0 :   WR = getPropertyDouble ("WR");
     468                 :          0 :   WINT = getPropertyDouble ("WINT");
     469                 :          0 :   DWG = getPropertyDouble ("DWG");
     470                 :          0 :   DWB = getPropertyDouble ("DWB");
     471                 :          0 :   WL = getPropertyDouble ("WL");
     472                 :          0 :   WLC = getPropertyDouble ("WLC");
     473                 :          0 :   WLN = getPropertyDouble ("WLN");
     474                 :          0 :   WW = getPropertyDouble ("WW");
     475                 :          0 :   WWC = getPropertyDouble ("WWC");
     476                 :          0 :   WWN = getPropertyDouble ("WWN");
     477                 :          0 :   WWL = getPropertyDouble ("WWL");
     478                 :          0 :   WWLC = getPropertyDouble ("WWLC");
     479                 :          0 :   WMIN = getPropertyDouble ("WMIN");
     480                 :          0 :   WMAX = getPropertyDouble ("WMAX");
     481                 :          0 :   B0 = getPropertyDouble ("B0");
     482                 :          0 :   B1 = getPropertyDouble ("B1");
     483                 :          0 :   CGSL = getPropertyDouble ("CGSL");
     484                 :          0 :   CGDL = getPropertyDouble ("CGDL");
     485                 :          0 :   CKAPPA = getPropertyDouble ("CKAPPA");
     486                 :          0 :   CF = getPropertyDouble ("CF");
     487                 :          0 :   CLC = getPropertyDouble ("CLC");
     488                 :          0 :   CLE = getPropertyDouble ("CLE");
     489                 :          0 :   DWC = getPropertyDouble ("DWC");
     490                 :          0 :   DLC = getPropertyDouble ("DLC");
     491                 :          0 :   ALPHA0 = getPropertyDouble ("ALPHA0");
     492                 :          0 :   ALPHA1 = getPropertyDouble ("ALPHA1");
     493                 :          0 :   BETA0 = getPropertyDouble ("BETA0");
     494                 :          0 :   IJTH = getPropertyDouble ("IJTH");
     495                 :          0 :   LCDSC = getPropertyDouble ("LCDSC");
     496                 :          0 :   LCDSCB = getPropertyDouble ("LCDSCB");
     497                 :          0 :   LCDSCD = getPropertyDouble ("LCDSCD");
     498                 :          0 :   LCIT = getPropertyDouble ("LCIT");
     499                 :          0 :   LNFACTOR = getPropertyDouble ("LNFACTOR");
     500                 :          0 :   LXJ = getPropertyDouble ("LXJ");
     501                 :          0 :   LVSAT = getPropertyDouble ("LVSAT");
     502                 :          0 :   LAT = getPropertyDouble ("LAT");
     503                 :          0 :   LA0 = getPropertyDouble ("LA0");
     504                 :          0 :   LAGS = getPropertyDouble ("LAGS");
     505                 :          0 :   LA1 = getPropertyDouble ("LA1");
     506                 :          0 :   LA2 = getPropertyDouble ("LA2");
     507                 :          0 :   LKETA = getPropertyDouble ("LKETA");
     508                 :          0 :   LNSUB = getPropertyDouble ("LNSUB");
     509                 :          0 :   LNCH = getPropertyDouble ("LNCH");
     510                 :          0 :   LNGATE = getPropertyDouble ("LNGATE");
     511                 :          0 :   LGAMMA1 = getPropertyDouble ("LGAMMA1");
     512                 :          0 :   LGAMMA2 = getPropertyDouble ("LGAMMA2");
     513                 :          0 :   LVBX = getPropertyDouble ("LVBX");
     514                 :          0 :   LVBM = getPropertyDouble ("LVBM");
     515                 :          0 :   LXT = getPropertyDouble ("LXT");
     516                 :          0 :   LK1 = getPropertyDouble ("LK1");
     517                 :          0 :   LKT1 = getPropertyDouble ("LKT1");
     518                 :          0 :   LKT1L = getPropertyDouble ("LKT1L");
     519                 :          0 :   LKT2 = getPropertyDouble ("LKT2");
     520                 :          0 :   LK2 = getPropertyDouble ("LK2");
     521                 :          0 :   LK3 = getPropertyDouble ("LK3");
     522                 :          0 :   LK3B = getPropertyDouble ("LK3B");
     523                 :          0 :   LW0 = getPropertyDouble ("LW0");
     524                 :          0 :   LNLX = getPropertyDouble ("LNLX");
     525                 :          0 :   LDVT0 = getPropertyDouble ("LDVT0");
     526                 :          0 :   LDVT1 = getPropertyDouble ("LDVT1");
     527                 :          0 :   LDVT2 = getPropertyDouble ("LDVT2");
     528                 :          0 :   LDVT0W = getPropertyDouble ("LDVT0W");
     529                 :          0 :   LDVT1W = getPropertyDouble ("LDVT1W");
     530                 :          0 :   LDVT2W = getPropertyDouble ("LDVT2W");
     531                 :          0 :   LDROUT = getPropertyDouble ("LDROUT");
     532                 :          0 :   LDSUB = getPropertyDouble ("LDSUB");
     533                 :          0 :   LVTH0 = getPropertyDouble ("LVTH0");
     534                 :          0 :   LVTHO = getPropertyDouble ("LVTHO");
     535                 :          0 :   LUA = getPropertyDouble ("LUA");
     536                 :          0 :   LUA1 = getPropertyDouble ("LUA1");
     537                 :          0 :   LUB = getPropertyDouble ("LUB");
     538                 :          0 :   LUB1 = getPropertyDouble ("LUB1");
     539                 :          0 :   LUC = getPropertyDouble ("LUC");
     540                 :          0 :   LUC1 = getPropertyDouble ("LUC1");
     541                 :          0 :   LU0 = getPropertyDouble ("LU0");
     542                 :          0 :   LUTE = getPropertyDouble ("LUTE");
     543                 :          0 :   LVOFF = getPropertyDouble ("LVOFF");
     544                 :          0 :   LELM = getPropertyDouble ("LELM");
     545                 :          0 :   LDELTA = getPropertyDouble ("LDELTA");
     546                 :          0 :   LRDSW = getPropertyDouble ("LRDSW");
     547                 :          0 :   LPRWG = getPropertyDouble ("LPRWG");
     548                 :          0 :   LPRWB = getPropertyDouble ("LPRWB");
     549                 :          0 :   LPRT = getPropertyDouble ("LPRT");
     550                 :          0 :   LETA0 = getPropertyDouble ("LETA0");
     551                 :          0 :   LETAB = getPropertyDouble ("LETAB");
     552                 :          0 :   LPCLM = getPropertyDouble ("LPCLM");
     553                 :          0 :   LPDIBLC1 = getPropertyDouble ("LPDIBLC1");
     554                 :          0 :   LPDIBLC2 = getPropertyDouble ("LPDIBLC2");
     555                 :          0 :   LPDIBLCB = getPropertyDouble ("LPDIBLCB");
     556                 :          0 :   LPSCBE1 = getPropertyDouble ("LPSCBE1");
     557                 :          0 :   LPSCBE2 = getPropertyDouble ("LPSCBE2");
     558                 :          0 :   LPVAG = getPropertyDouble ("LPVAG");
     559                 :          0 :   LWR = getPropertyDouble ("LWR");
     560                 :          0 :   LDWG = getPropertyDouble ("LDWG");
     561                 :          0 :   LDWB = getPropertyDouble ("LDWB");
     562                 :          0 :   LB0 = getPropertyDouble ("LB0");
     563                 :          0 :   LB1 = getPropertyDouble ("LB1");
     564                 :          0 :   LCGSL = getPropertyDouble ("LCGSL");
     565                 :          0 :   LCGDL = getPropertyDouble ("LCGDL");
     566                 :          0 :   LCKAPPA = getPropertyDouble ("LCKAPPA");
     567                 :          0 :   LCF = getPropertyDouble ("LCF");
     568                 :          0 :   LCLC = getPropertyDouble ("LCLC");
     569                 :          0 :   LCLE = getPropertyDouble ("LCLE");
     570                 :          0 :   LALPHA0 = getPropertyDouble ("LALPHA0");
     571                 :          0 :   LALPHA1 = getPropertyDouble ("LALPHA1");
     572                 :          0 :   LBETA0 = getPropertyDouble ("LBETA0");
     573                 :          0 :   LVFBCV = getPropertyDouble ("LVFBCV");
     574                 :          0 :   LVFB = getPropertyDouble ("LVFB");
     575                 :          0 :   LACDE = getPropertyDouble ("LACDE");
     576                 :          0 :   LMOIN = getPropertyDouble ("LMOIN");
     577                 :          0 :   LNOFF = getPropertyDouble ("LNOFF");
     578                 :          0 :   LVOFFCV = getPropertyDouble ("LVOFFCV");
     579                 :          0 :   WCDSC = getPropertyDouble ("WCDSC");
     580                 :          0 :   WCDSCB = getPropertyDouble ("WCDSCB");
     581                 :          0 :   WCDSCD = getPropertyDouble ("WCDSCD");
     582                 :          0 :   WCIT = getPropertyDouble ("WCIT");
     583                 :          0 :   WNFACTOR = getPropertyDouble ("WNFACTOR");
     584                 :          0 :   WXJ = getPropertyDouble ("WXJ");
     585                 :          0 :   WVSAT = getPropertyDouble ("WVSAT");
     586                 :          0 :   WAT = getPropertyDouble ("WAT");
     587                 :          0 :   WA0 = getPropertyDouble ("WA0");
     588                 :          0 :   WAGS = getPropertyDouble ("WAGS");
     589                 :          0 :   WA1 = getPropertyDouble ("WA1");
     590                 :          0 :   WA2 = getPropertyDouble ("WA2");
     591                 :          0 :   WKETA = getPropertyDouble ("WKETA");
     592                 :          0 :   WNSUB = getPropertyDouble ("WNSUB");
     593                 :          0 :   WNCH = getPropertyDouble ("WNCH");
     594                 :          0 :   WNGATE = getPropertyDouble ("WNGATE");
     595                 :          0 :   WGAMMA1 = getPropertyDouble ("WGAMMA1");
     596                 :          0 :   WGAMMA2 = getPropertyDouble ("WGAMMA2");
     597                 :          0 :   WVBX = getPropertyDouble ("WVBX");
     598                 :          0 :   WVBM = getPropertyDouble ("WVBM");
     599                 :          0 :   WXT = getPropertyDouble ("WXT");
     600                 :          0 :   WK1 = getPropertyDouble ("WK1");
     601                 :          0 :   WKT1 = getPropertyDouble ("WKT1");
     602                 :          0 :   WKT1L = getPropertyDouble ("WKT1L");
     603                 :          0 :   WKT2 = getPropertyDouble ("WKT2");
     604                 :          0 :   WK2 = getPropertyDouble ("WK2");
     605                 :          0 :   WK3 = getPropertyDouble ("WK3");
     606                 :          0 :   WK3B = getPropertyDouble ("WK3B");
     607                 :          0 :   WW0 = getPropertyDouble ("WW0");
     608                 :          0 :   WNLX = getPropertyDouble ("WNLX");
     609                 :          0 :   WDVT0 = getPropertyDouble ("WDVT0");
     610                 :          0 :   WDVT1 = getPropertyDouble ("WDVT1");
     611                 :          0 :   WDVT2 = getPropertyDouble ("WDVT2");
     612                 :          0 :   WDVT0W = getPropertyDouble ("WDVT0W");
     613                 :          0 :   WDVT1W = getPropertyDouble ("WDVT1W");
     614                 :          0 :   WDVT2W = getPropertyDouble ("WDVT2W");
     615                 :          0 :   WDROUT = getPropertyDouble ("WDROUT");
     616                 :          0 :   WDSUB = getPropertyDouble ("WDSUB");
     617                 :          0 :   WVTH0 = getPropertyDouble ("WVTH0");
     618                 :          0 :   WVTHO = getPropertyDouble ("WVTHO");
     619                 :          0 :   WUA = getPropertyDouble ("WUA");
     620                 :          0 :   WUA1 = getPropertyDouble ("WUA1");
     621                 :          0 :   WUB = getPropertyDouble ("WUB");
     622                 :          0 :   WUB1 = getPropertyDouble ("WUB1");
     623                 :          0 :   WUC = getPropertyDouble ("WUC");
     624                 :          0 :   WUC1 = getPropertyDouble ("WUC1");
     625                 :          0 :   WU0 = getPropertyDouble ("WU0");
     626                 :          0 :   WUTE = getPropertyDouble ("WUTE");
     627                 :          0 :   WVOFF = getPropertyDouble ("WVOFF");
     628                 :          0 :   WELM = getPropertyDouble ("WELM");
     629                 :          0 :   WDELTA = getPropertyDouble ("WDELTA");
     630                 :          0 :   WRDSW = getPropertyDouble ("WRDSW");
     631                 :          0 :   WPRWG = getPropertyDouble ("WPRWG");
     632                 :          0 :   WPRWB = getPropertyDouble ("WPRWB");
     633                 :          0 :   WPRT = getPropertyDouble ("WPRT");
     634                 :          0 :   WETA0 = getPropertyDouble ("WETA0");
     635                 :          0 :   WETAB = getPropertyDouble ("WETAB");
     636                 :          0 :   WPCLM = getPropertyDouble ("WPCLM");
     637                 :          0 :   WPDIBLC1 = getPropertyDouble ("WPDIBLC1");
     638                 :          0 :   WPDIBLC2 = getPropertyDouble ("WPDIBLC2");
     639                 :          0 :   WPDIBLCB = getPropertyDouble ("WPDIBLCB");
     640                 :          0 :   WPSCBE1 = getPropertyDouble ("WPSCBE1");
     641                 :          0 :   WPSCBE2 = getPropertyDouble ("WPSCBE2");
     642                 :          0 :   WPVAG = getPropertyDouble ("WPVAG");
     643                 :          0 :   WWR = getPropertyDouble ("WWR");
     644                 :          0 :   WDWG = getPropertyDouble ("WDWG");
     645                 :          0 :   WDWB = getPropertyDouble ("WDWB");
     646                 :          0 :   WB0 = getPropertyDouble ("WB0");
     647                 :          0 :   WB1 = getPropertyDouble ("WB1");
     648                 :          0 :   WCGSL = getPropertyDouble ("WCGSL");
     649                 :          0 :   WCGDL = getPropertyDouble ("WCGDL");
     650                 :          0 :   WCKAPPA = getPropertyDouble ("WCKAPPA");
     651                 :          0 :   WCF = getPropertyDouble ("WCF");
     652                 :          0 :   WCLC = getPropertyDouble ("WCLC");
     653                 :          0 :   WCLE = getPropertyDouble ("WCLE");
     654                 :          0 :   WALPHA0 = getPropertyDouble ("WALPHA0");
     655                 :          0 :   WALPHA1 = getPropertyDouble ("WALPHA1");
     656                 :          0 :   WBETA0 = getPropertyDouble ("WBETA0");
     657                 :          0 :   WVFBCV = getPropertyDouble ("WVFBCV");
     658                 :          0 :   WVFB = getPropertyDouble ("WVFB");
     659                 :          0 :   WACDE = getPropertyDouble ("WACDE");
     660                 :          0 :   WMOIN = getPropertyDouble ("WMOIN");
     661                 :          0 :   WNOFF = getPropertyDouble ("WNOFF");
     662                 :          0 :   WVOFFCV = getPropertyDouble ("WVOFFCV");
     663                 :          0 :   PCDSC = getPropertyDouble ("PCDSC");
     664                 :          0 :   PCDSCB = getPropertyDouble ("PCDSCB");
     665                 :          0 :   PCDSCD = getPropertyDouble ("PCDSCD");
     666                 :          0 :   PCIT = getPropertyDouble ("PCIT");
     667                 :          0 :   PNFACTOR = getPropertyDouble ("PNFACTOR");
     668                 :          0 :   PXJ = getPropertyDouble ("PXJ");
     669                 :          0 :   PVSAT = getPropertyDouble ("PVSAT");
     670                 :          0 :   PAT = getPropertyDouble ("PAT");
     671                 :          0 :   PA0 = getPropertyDouble ("PA0");
     672                 :          0 :   PAGS = getPropertyDouble ("PAGS");
     673                 :          0 :   PA1 = getPropertyDouble ("PA1");
     674                 :          0 :   PA2 = getPropertyDouble ("PA2");
     675                 :          0 :   PKETA = getPropertyDouble ("PKETA");
     676                 :          0 :   PNSUB = getPropertyDouble ("PNSUB");
     677                 :          0 :   PNCH = getPropertyDouble ("PNCH");
     678                 :          0 :   PNGATE = getPropertyDouble ("PNGATE");
     679                 :          0 :   PGAMMA1 = getPropertyDouble ("PGAMMA1");
     680                 :          0 :   PGAMMA2 = getPropertyDouble ("PGAMMA2");
     681                 :          0 :   PVBX = getPropertyDouble ("PVBX");
     682                 :          0 :   PVBM = getPropertyDouble ("PVBM");
     683                 :          0 :   PXT = getPropertyDouble ("PXT");
     684                 :          0 :   PK1 = getPropertyDouble ("PK1");
     685                 :          0 :   PKT1 = getPropertyDouble ("PKT1");
     686                 :          0 :   PKT1L = getPropertyDouble ("PKT1L");
     687                 :          0 :   PKT2 = getPropertyDouble ("PKT2");
     688                 :          0 :   PK2 = getPropertyDouble ("PK2");
     689                 :          0 :   PK3 = getPropertyDouble ("PK3");
     690                 :          0 :   PK3B = getPropertyDouble ("PK3B");
     691                 :          0 :   PW0 = getPropertyDouble ("PW0");
     692                 :          0 :   PNLX = getPropertyDouble ("PNLX");
     693                 :          0 :   PDVT0 = getPropertyDouble ("PDVT0");
     694                 :          0 :   PDVT1 = getPropertyDouble ("PDVT1");
     695                 :          0 :   PDVT2 = getPropertyDouble ("PDVT2");
     696                 :          0 :   PDVT0W = getPropertyDouble ("PDVT0W");
     697                 :          0 :   PDVT1W = getPropertyDouble ("PDVT1W");
     698                 :          0 :   PDVT2W = getPropertyDouble ("PDVT2W");
     699                 :          0 :   PDROUT = getPropertyDouble ("PDROUT");
     700                 :          0 :   PDSUB = getPropertyDouble ("PDSUB");
     701                 :          0 :   PVTH0 = getPropertyDouble ("PVTH0");
     702                 :          0 :   PVTHO = getPropertyDouble ("PVTHO");
     703                 :          0 :   PUA = getPropertyDouble ("PUA");
     704                 :          0 :   PUA1 = getPropertyDouble ("PUA1");
     705                 :          0 :   PUB = getPropertyDouble ("PUB");
     706                 :          0 :   PUB1 = getPropertyDouble ("PUB1");
     707                 :          0 :   PUC = getPropertyDouble ("PUC");
     708                 :          0 :   PUC1 = getPropertyDouble ("PUC1");
     709                 :          0 :   PU0 = getPropertyDouble ("PU0");
     710                 :          0 :   PUTE = getPropertyDouble ("PUTE");
     711                 :          0 :   PVOFF = getPropertyDouble ("PVOFF");
     712                 :          0 :   PELM = getPropertyDouble ("PELM");
     713                 :          0 :   PDELTA = getPropertyDouble ("PDELTA");
     714                 :          0 :   PRDSW = getPropertyDouble ("PRDSW");
     715                 :          0 :   PPRWG = getPropertyDouble ("PPRWG");
     716                 :          0 :   PPRWB = getPropertyDouble ("PPRWB");
     717                 :          0 :   PPRT = getPropertyDouble ("PPRT");
     718                 :          0 :   PETA0 = getPropertyDouble ("PETA0");
     719                 :          0 :   PETAB = getPropertyDouble ("PETAB");
     720                 :          0 :   PPCLM = getPropertyDouble ("PPCLM");
     721                 :          0 :   PPDIBLC1 = getPropertyDouble ("PPDIBLC1");
     722                 :          0 :   PPDIBLC2 = getPropertyDouble ("PPDIBLC2");
     723                 :          0 :   PPDIBLCB = getPropertyDouble ("PPDIBLCB");
     724                 :          0 :   PPSCBE1 = getPropertyDouble ("PPSCBE1");
     725                 :          0 :   PPSCBE2 = getPropertyDouble ("PPSCBE2");
     726                 :          0 :   PPVAG = getPropertyDouble ("PPVAG");
     727                 :          0 :   PWR = getPropertyDouble ("PWR");
     728                 :          0 :   PDWG = getPropertyDouble ("PDWG");
     729                 :          0 :   PDWB = getPropertyDouble ("PDWB");
     730                 :          0 :   PB0 = getPropertyDouble ("PB0");
     731                 :          0 :   PB1 = getPropertyDouble ("PB1");
     732                 :          0 :   PCGSL = getPropertyDouble ("PCGSL");
     733                 :          0 :   PCGDL = getPropertyDouble ("PCGDL");
     734                 :          0 :   PCKAPPA = getPropertyDouble ("PCKAPPA");
     735                 :          0 :   PCF = getPropertyDouble ("PCF");
     736                 :          0 :   PCLC = getPropertyDouble ("PCLC");
     737                 :          0 :   PCLE = getPropertyDouble ("PCLE");
     738                 :          0 :   PALPHA0 = getPropertyDouble ("PALPHA0");
     739                 :          0 :   PALPHA1 = getPropertyDouble ("PALPHA1");
     740                 :          0 :   PBETA0 = getPropertyDouble ("PBETA0");
     741                 :          0 :   PVFBCV = getPropertyDouble ("PVFBCV");
     742                 :          0 :   PVFB = getPropertyDouble ("PVFB");
     743                 :          0 :   PACDE = getPropertyDouble ("PACDE");
     744                 :          0 :   PMOIN = getPropertyDouble ("PMOIN");
     745                 :          0 :   PNOFF = getPropertyDouble ("PNOFF");
     746                 :          0 :   PVOFFCV = getPropertyDouble ("PVOFFCV");
     747                 :          0 :   KF = getPropertyDouble ("KF");
     748                 :          0 :   AF = getPropertyDouble ("AF");
     749                 :          0 :   EF = getPropertyDouble ("EF");
     750                 :          0 : }
     751                 :            : 
     752                 :            : /* #define's for translated code */
     753                 :            : #undef  _DDT
     754                 :            : #define _DDT(q) q
     755                 :            : #define _DYNAMIC
     756                 :            : #define _DERIVATE
     757                 :            : #define _DDX
     758                 :            : #define _DERIVATEFORDDX
     759                 :            : 
     760                 :            : /* Evaluate Verilog-AMS equations in model initialization. */
     761                 :          0 : void bsim3v34nMOS::initializeModel (void)
     762                 :            : {
     763                 :          0 : }
     764                 :            : 
     765                 :            : /* Evaluate Verilog-AMS equations in instance initialization. */
     766                 :          0 : void bsim3v34nMOS::initializeInstance (void)
     767                 :            : {
     768                 :          0 : }
     769                 :            : 
     770                 :            : /* Evaluate Verilog-AMS equations in initial step. */
     771                 :          0 : void bsim3v34nMOS::initialStep (void)
     772                 :            : {
     773                 :            : #if defined(_DERIVATE)
     774                 :            : double tmp3_Vdrainp_sourcep;
     775                 :            : double tmp3_Vbulk_sourcep;
     776                 :            : #endif
     777                 :            : #if defined(_DERIVATE)
     778                 :            : double T5_Vgate_sourcep;
     779                 :            : double T5_Vdrainp_sourcep;
     780                 :            : double T5_Vbulk_sourcep;
     781                 :            : #endif
     782                 :            : #if defined(_DERIVATE)
     783                 :            : double T4_Vgate_sourcep;
     784                 :            : double T4_Vdrainp_sourcep;
     785                 :            : double T4_Vbulk_sourcep;
     786                 :            : #endif
     787                 :            : #if defined(_DERIVATE)
     788                 :            : double tmp_Vgate_sourcep;
     789                 :            : double tmp_Vdrainp_sourcep;
     790                 :            : double tmp_Vbulk_sourcep;
     791                 :            : #endif
     792                 :            : double tconst;
     793                 :            : int Fatal_Flag;
     794                 :            : double cle;
     795                 :            : double clc;
     796                 :            : #if defined(_DYNAMIC)
     797                 :            : #endif
     798                 :            : #if defined(_DYNAMIC)
     799                 :            : #endif
     800                 :            : #if defined(_DYNAMIC)
     801                 :            : #endif
     802                 :            : double elm;
     803                 :            : double wr;
     804                 :            : double prt;
     805                 :            : double rdsw;
     806                 :            : double ute;
     807                 :            : double ub1;
     808                 :            : double ua1;
     809                 :            : double dsub;
     810                 :            : double drout;
     811                 :            : double vbm;
     812                 :            : double at;
     813                 :            : double vsat;
     814                 :            : double Inv_LW;
     815                 :            : double Inv_W;
     816                 :            : double Inv_L;
     817                 :            : double dwc;
     818                 :            : double dw;
     819                 :            : #if defined(_DERIVATE)
     820                 :            : double T3_Vgate_sourcep;
     821                 :            : double T3_Vdrainp_sourcep;
     822                 :            : double T3_Vbulk_sourcep;
     823                 :            : #endif
     824                 :            : #if defined(_DERIVATE)
     825                 :            : double T2_Vgate_sourcep;
     826                 :            : double T2_Vdrainp_sourcep;
     827                 :            : double T2_Vbulk_sourcep;
     828                 :            : #endif
     829                 :            : #if defined(_DERIVATE)
     830                 :            : double tmp2_Vgate_sourcep;
     831                 :            : double tmp2_Vdrainp_sourcep;
     832                 :            : double tmp2_Vbulk_sourcep;
     833                 :            : #endif
     834                 :            : double dl;
     835                 :            : #if defined(_DERIVATE)
     836                 :            : double tmp1_Vdrainp_sourcep;
     837                 :            : double tmp1_Vbulk_sourcep;
     838                 :            : #endif
     839                 :            : double Wdrn;
     840                 :            : double Ldrn;
     841                 :            : double delTemp;
     842                 :            : double jctSidewallTempSatCurDensity;
     843                 :            : double jctTempSatCurDensity;
     844                 :            : #if defined(_DERIVATE)
     845                 :            : double T1_Vgate_sourcep;
     846                 :            : double T1_Vdrainp_sourcep;
     847                 :            : double T1_Vbulk_sourcep;
     848                 :            : #endif
     849                 :            : #if defined(_DERIVATE)
     850                 :            : double T_0_Vgate_sourcep;
     851                 :            : double T_0_Vdrainp_sourcep;
     852                 :            : double T_0_Vbulk_sourcep;
     853                 :            : #endif
     854                 :            : double Eg;
     855                 :            : double ni;
     856                 :            : double Eg0;
     857                 :            : double Vtm0;
     858                 :            : double TRatio;
     859                 :            : double Tnom;
     860                 :            : double ppdiblb;
     861                 :            : double ppdibl2;
     862                 :            : double ppdibl1;
     863                 :            : double pvth0;
     864                 :            : double pngate;
     865                 :            : double pnpeak;
     866                 :            : double wpdiblb;
     867                 :            : double wpdibl2;
     868                 :            : double wpdibl1;
     869                 :            : double wvth0;
     870                 :            : double wngate;
     871                 :            : double wnpeak;
     872                 :            : double lpdiblb;
     873                 :            : double lpdibl2;
     874                 :            : double lpdibl1;
     875                 :            : double lvth0;
     876                 :            : double lngate;
     877                 :            : double lnpeak;
     878                 :            : #if defined(_DYNAMIC)
     879                 :            : double cf;
     880                 :            : #endif
     881                 :            : double sourceSquares;
     882                 :            : double drainSquares;
     883                 :            : double sheetResistance;
     884                 :            : double GatesidewallJctPotential;
     885                 :            : double sidewallJctPotential;
     886                 :            : double jctTempExponent;
     887                 :            : double jctEmissionCoeff;
     888                 :            : double bulkJctPotential;
     889                 :            : double jctSidewallSatCurDensity;
     890                 :            : double jctSatCurDensity;
     891                 :            : double pdibl2;
     892                 :            : double pdibl1;
     893                 :            : double dlc;
     894                 :            : double dlcGiven;
     895                 :            : double u0;
     896                 :            : double uc1;
     897                 :            : double vth0Given;
     898                 :            : double pk2;
     899                 :            : double wk2;
     900                 :            : double lk2;
     901                 :            : double k2Given;
     902                 :            : double k2;
     903                 :            : double pk1;
     904                 :            : double wk1;
     905                 :            : double lk1;
     906                 :            : double k1Given;
     907                 :            : double vfbGiven;
     908                 :            : double pvbx;
     909                 :            : double wvbx;
     910                 :            : double lvbx;
     911                 :            : double vbxGiven;
     912                 :            : double vbx;
     913                 :            : double pgamma2;
     914                 :            : double wgamma2;
     915                 :            : double lgamma2;
     916                 :            : double gamma2Given;
     917                 :            : double gamma2;
     918                 :            : double pgamma1;
     919                 :            : double wgamma1;
     920                 :            : double lgamma1;
     921                 :            : double gamma1Given;
     922                 :            : double gamma1;
     923                 :            : double npeakGiven;
     924                 :            : double npeak;
     925                 :            : double xtGiven;
     926                 :            : double xt;
     927                 :            : double nsubGiven;
     928                 :            : double nsub;
     929                 :            : {
     930                 :          0 : tox=TOX;
     931                 :          0 : cox=(3.453133e-11/tox);
     932                 :          0 : TYPE=1.0;
     933         [ #  # ]:          0 : if
     934                 :            : (NSUB==(-99.0))
     935                 :            : {
     936                 :          0 : nsub=6.0e16;
     937                 :          0 : nsubGiven=0;
     938                 :            : }
     939                 :            : else
     940                 :            : {
     941                 :          0 : nsub=NSUB;
     942                 :          0 : nsubGiven=1;
     943                 :            : }
     944         [ #  # ]:          0 : if
     945                 :            : (XT==(-99.0))
     946                 :            : {
     947                 :          0 : xt=1.55e-7;
     948                 :          0 : xtGiven=0;
     949                 :            : }
     950                 :            : else
     951                 :            : {
     952                 :          0 : xt=XT;
     953                 :          0 : xtGiven=1;
     954                 :            : }
     955         [ #  # ]:          0 : if
     956                 :            : (NCH==(-99.0))
     957                 :            : {
     958                 :          0 : npeak=1.7e17;
     959                 :          0 : npeakGiven=0;
     960                 :            : }
     961                 :            : else
     962                 :            : {
     963                 :          0 : npeak=NCH;
     964                 :          0 : npeakGiven=1;
     965                 :            : }
     966         [ #  # ]:          0 : if
     967                 :            : (GAMMA1==(-99.0))
     968                 :            : {
     969                 :          0 : gamma1=0.0;
     970                 :          0 : gamma1Given=0;
     971                 :            : }
     972                 :            : else
     973                 :            : {
     974                 :          0 : gamma1=GAMMA1;
     975                 :          0 : gamma1Given=1;
     976                 :            : }
     977         [ #  # ]:          0 : if
     978                 :            : (LGAMMA1==(-99.0))
     979                 :            : {
     980                 :          0 : lgamma1=0.0;
     981                 :            : }
     982                 :            : else
     983                 :            : {
     984                 :          0 : lgamma1=LGAMMA1;
     985                 :            : }
     986         [ #  # ]:          0 : if
     987                 :            : (WGAMMA1==(-99.0))
     988                 :            : {
     989                 :          0 : wgamma1=0.0;
     990                 :            : }
     991                 :            : else
     992                 :            : {
     993                 :          0 : wgamma1=WGAMMA1;
     994                 :            : }
     995         [ #  # ]:          0 : if
     996                 :            : (PGAMMA1==(-99.0))
     997                 :            : {
     998                 :          0 : pgamma1=0.0;
     999                 :            : }
    1000                 :            : else
    1001                 :            : {
    1002                 :          0 : pgamma1=PGAMMA1;
    1003                 :            : }
    1004         [ #  # ]:          0 : if
    1005                 :            : (GAMMA2==(-99.0))
    1006                 :            : {
    1007                 :          0 : gamma2=0.0;
    1008                 :          0 : gamma2Given=0;
    1009                 :            : }
    1010                 :            : else
    1011                 :            : {
    1012                 :          0 : gamma2=GAMMA2;
    1013                 :          0 : gamma2Given=1;
    1014                 :            : }
    1015         [ #  # ]:          0 : if
    1016                 :            : (LGAMMA2==(-99.0))
    1017                 :            : {
    1018                 :          0 : lgamma2=0.0;
    1019                 :            : }
    1020                 :            : else
    1021                 :            : {
    1022                 :          0 : lgamma2=LGAMMA2;
    1023                 :            : }
    1024         [ #  # ]:          0 : if
    1025                 :            : (WGAMMA2==(-99.0))
    1026                 :            : {
    1027                 :          0 : wgamma2=0.0;
    1028                 :            : }
    1029                 :            : else
    1030                 :            : {
    1031                 :          0 : wgamma2=WGAMMA2;
    1032                 :            : }
    1033         [ #  # ]:          0 : if
    1034                 :            : (PGAMMA2==(-99.0))
    1035                 :            : {
    1036                 :          0 : pgamma2=0.0;
    1037                 :            : }
    1038                 :            : else
    1039                 :            : {
    1040                 :          0 : pgamma2=PGAMMA2;
    1041                 :            : }
    1042         [ #  # ]:          0 : if
    1043                 :            : (VBX==(-99.0))
    1044                 :            : {
    1045                 :          0 : vbx=0.0;
    1046                 :          0 : vbxGiven=0.0;
    1047                 :            : }
    1048                 :            : else
    1049                 :            : {
    1050                 :          0 : vbx=VBX;
    1051                 :          0 : vbxGiven=1;
    1052                 :            : }
    1053         [ #  # ]:          0 : if
    1054                 :            : (LVBX==(-99.0))
    1055                 :            : {
    1056                 :          0 : lvbx=0.0;
    1057                 :            : }
    1058                 :            : else
    1059                 :            : {
    1060                 :          0 : lvbx=LVBX;
    1061                 :            : }
    1062         [ #  # ]:          0 : if
    1063                 :            : (WVBX==(-99.0))
    1064                 :            : {
    1065                 :          0 : wvbx=0.0;
    1066                 :            : }
    1067                 :            : else
    1068                 :            : {
    1069                 :          0 : wvbx=WVBX;
    1070                 :            : }
    1071         [ #  # ]:          0 : if
    1072                 :            : (PVBX==(-99.0))
    1073                 :            : {
    1074                 :          0 : pvbx=0.0;
    1075                 :            : }
    1076                 :            : else
    1077                 :            : {
    1078                 :          0 : pvbx=PVBX;
    1079                 :            : }
    1080         [ #  # ]:          0 : if
    1081                 :            : (VFB==(-99.0))
    1082                 :            : {
    1083                 :          0 : vfb=0.0;
    1084                 :          0 : vfbGiven=0.0;
    1085                 :            : }
    1086                 :            : else
    1087                 :            : {
    1088                 :          0 : vfb=VFB;
    1089                 :          0 : vfbGiven=1.0;
    1090                 :            : }
    1091         [ #  # ]:          0 : if
    1092                 :            : (K1==(-99.0))
    1093                 :            : {
    1094                 :          0 : k1=0.0;
    1095                 :          0 : k1Given=0.0;
    1096                 :            : }
    1097                 :            : else
    1098                 :            : {
    1099                 :          0 : k1=K1;
    1100                 :          0 : k1Given=1.0;
    1101                 :            : }
    1102         [ #  # ]:          0 : if
    1103                 :            : (LK1==(-99.0))
    1104                 :            : {
    1105                 :          0 : lk1=0.0;
    1106                 :            : }
    1107                 :            : else
    1108                 :            : {
    1109                 :          0 : lk1=LK1;
    1110                 :            : }
    1111         [ #  # ]:          0 : if
    1112                 :            : (WK1==(-99.0))
    1113                 :            : {
    1114                 :          0 : wk1=0.0;
    1115                 :            : }
    1116                 :            : else
    1117                 :            : {
    1118                 :          0 : wk1=WK1;
    1119                 :            : }
    1120         [ #  # ]:          0 : if
    1121                 :            : (PK1==(-99.0))
    1122                 :            : {
    1123                 :          0 : pk1=0.0;
    1124                 :            : }
    1125                 :            : else
    1126                 :            : {
    1127                 :          0 : pk1=PK1;
    1128                 :            : }
    1129         [ #  # ]:          0 : if
    1130                 :            : (K2==(-99.0))
    1131                 :            : {
    1132                 :          0 : k2=0.0;
    1133                 :          0 : k2Given=0.0;
    1134                 :            : }
    1135                 :            : else
    1136                 :            : {
    1137                 :          0 : k2=K2;
    1138                 :          0 : k2Given=1.0;
    1139                 :            : }
    1140         [ #  # ]:          0 : if
    1141                 :            : (LK2==(-99.0))
    1142                 :            : {
    1143                 :          0 : lk2=0.0;
    1144                 :            : }
    1145                 :            : else
    1146                 :            : {
    1147                 :          0 : lk2=LK2;
    1148                 :            : }
    1149         [ #  # ]:          0 : if
    1150                 :            : (WK2==(-99.0))
    1151                 :            : {
    1152                 :          0 : wk2=0.0;
    1153                 :            : }
    1154                 :            : else
    1155                 :            : {
    1156                 :          0 : wk2=WK2;
    1157                 :            : }
    1158         [ #  # ]:          0 : if
    1159                 :            : (PK2==(-99.0))
    1160                 :            : {
    1161                 :          0 : pk2=0.0;
    1162                 :            : }
    1163                 :            : else
    1164                 :            : {
    1165                 :          0 : pk2=PK2;
    1166                 :            : }
    1167         [ #  # ]:          0 : if
    1168                 :            : (NCH>1.0e20)
    1169                 :            : {
    1170                 :          0 : npeak=(npeak*1.0e-6);
    1171                 :            : }
    1172                 :            : else
    1173                 :            : {
    1174                 :          0 : npeak=npeak;
    1175                 :            : }
    1176         [ #  # ]:          0 : if
    1177                 :            : (NGATE>1.0e23)
    1178                 :            : {
    1179                 :          0 : ngate=(NGATE*1.0e-6);
    1180                 :            : }
    1181                 :            : else
    1182                 :            : {
    1183                 :          0 : ngate=NGATE;
    1184                 :            : }
    1185 [ #  # ][ #  # ]:          0 : if
    1186                 :            : ((VTHO==(-99.0))&&(VTH0==(-99.0)))
    1187                 :            : {
    1188         [ #  # ]:          0 : vth0=((TYPE>0.0)?0.7:(-0.7));
    1189                 :          0 : vth0Given=0;
    1190                 :            : }
    1191                 :            : else
    1192                 :            : {
    1193                 :          0 : vth0Given=1;
    1194         [ #  # ]:          0 : if
    1195                 :            : (VTH0!=(-99))
    1196                 :            : {
    1197                 :          0 : vth0=VTHO;
    1198                 :            : }
    1199         [ #  # ]:          0 : if
    1200                 :            : (VTHO!=(-99))
    1201                 :            : {
    1202                 :          0 : vth0=VTH0;
    1203                 :            : }
    1204                 :            : }
    1205         [ #  # ]:          0 : if
    1206                 :            : (UC==(-99.0))
    1207                 :            : {
    1208         [ #  # ]:          0 : uc=((MOBMOD==3)?(-0.0465):(-0.0465e-9));
    1209                 :            : }
    1210                 :            : else
    1211                 :            : {
    1212                 :          0 : uc=UC;
    1213                 :            : }
    1214         [ #  # ]:          0 : if
    1215                 :            : (UC1==(-99.0))
    1216                 :            : {
    1217         [ #  # ]:          0 : uc1=((MOBMOD==3)?(-0.056):(-0.056e-9));
    1218                 :            : }
    1219                 :            : else
    1220                 :            : {
    1221                 :          0 : uc1=UC1;
    1222                 :            : }
    1223         [ #  # ]:          0 : if
    1224                 :            : (U0==(-99.0))
    1225                 :            : {
    1226         [ #  # ]:          0 : u0=((TYPE==1)?0.067:0.025);
    1227                 :            : }
    1228                 :            : else
    1229                 :            : {
    1230                 :          0 : u0=U0;
    1231                 :            : }
    1232         [ #  # ]:          0 : if
    1233                 :            : (TNOM==(-99.0))
    1234                 :            : {
    1235                 :          0 : tnom=300.15;
    1236                 :            : }
    1237                 :            : else
    1238                 :            : {
    1239                 :          0 : tnom=(TNOM+273.15);
    1240                 :            : }
    1241         [ #  # ]:          0 : if
    1242                 :            : (DLC==(-99.0))
    1243                 :            : {
    1244                 :          0 : dlcGiven=0;
    1245                 :          0 : dlc=LINT;
    1246                 :            : }
    1247                 :            : else
    1248                 :            : {
    1249                 :          0 : dlcGiven=1;
    1250                 :          0 : dlc=DLC;
    1251                 :            : }
    1252         [ #  # ]:          0 : if
    1253                 :            : (CGSO==(-99.0))
    1254                 :            : {
    1255 [ #  # ][ #  # ]:          0 : if
    1256                 :            : (dlcGiven&&(dlc>0.0))
    1257                 :            : {
    1258                 :          0 : cgso_param=((dlc*cox)-CGSL);
    1259                 :            : }
    1260                 :            : else
    1261                 :            : {
    1262                 :          0 : cgso_param=((0.6*XJ)*cox);
    1263                 :            : }
    1264                 :            : }
    1265                 :            : else
    1266                 :            : {
    1267                 :          0 : cgso_param=CGSO;
    1268                 :            : }
    1269         [ #  # ]:          0 : if
    1270                 :            : (CGDO==(-99.0))
    1271                 :            : {
    1272 [ #  # ][ #  # ]:          0 : if
    1273                 :            : (dlcGiven&&(dlc>0.0))
    1274                 :            : {
    1275                 :          0 : cgdo_param=((dlc*cox)-CGDL);
    1276                 :            : }
    1277                 :            : else
    1278                 :            : {
    1279                 :          0 : cgdo_param=((0.6*XJ)*cox);
    1280                 :            : }
    1281                 :            : }
    1282                 :            : else
    1283                 :            : {
    1284                 :          0 : cgdo_param=CGDO;
    1285                 :            : }
    1286         [ #  # ]:          0 : if
    1287                 :            : (CGBO==(-99.0))
    1288                 :            : {
    1289                 :          0 : cgbo_param=((2.0*DWC)*cox);
    1290                 :            : }
    1291                 :            : else
    1292                 :            : {
    1293                 :          0 : cgbo_param=CGBO;
    1294                 :            : }
    1295                 :          0 : pdibl1=PDIBLC1;
    1296                 :          0 : pdibl2=PDIBLC2;
    1297                 :          0 : pdiblb=PDIBLCB;
    1298                 :          0 : jctSatCurDensity=JS;
    1299                 :          0 : jctSidewallSatCurDensity=JSW;
    1300                 :          0 : bulkJctPotential=PB;
    1301                 :          0 : jctEmissionCoeff=NJ;
    1302                 :          0 : jctTempExponent=XTI;
    1303                 :          0 : bulkJctBotGradingCoeff=MJ;
    1304                 :          0 : sidewallJctPotential=PBSW;
    1305                 :          0 : bulkJctSideGradingCoeff=MJSW;
    1306                 :          0 : GatesidewallJctPotential=PBSWG;
    1307                 :          0 : bulkJctGateSideGradingCoeff=MJSWG;
    1308                 :          0 : unitAreaJctCap=CJ;
    1309                 :          0 : unitLengthSidewallJctCap=CJSW;
    1310                 :          0 : unitLengthGateSidewallJctCap=CJSWG;
    1311                 :          0 : sheetResistance=RSH;
    1312                 :          0 : drainSquares=NRD;
    1313                 :          0 : sourceSquares=NRS;
    1314                 :          0 : drainArea=AD;
    1315                 :          0 : sourceArea=AS;
    1316                 :          0 : drainPerimeter=PD;
    1317                 :          0 : sourcePerimeter=PS;
    1318                 :            : #ifdef _DYNAMIC
    1319         [ #  # ]:          0 : if
    1320                 :            : (CF==(-99.0))
    1321                 :            : {
    1322                 :            : #if defined(_DYNAMIC)
    1323                 :            : {
    1324                 :          0 : double m00_logE(d00_logE0,(1.0+(0.4e-6/tox)))
    1325                 :          0 : cf=(((2.0*3.453133e-11)/3.141592654)*d00_logE0);
    1326                 :            : }
    1327                 :            : #endif
    1328                 :            : }
    1329                 :            : else
    1330                 :            : {
    1331                 :            : #if defined(_DYNAMIC)
    1332                 :          0 : cf=CF;
    1333                 :            : #endif
    1334                 :            : }
    1335                 :            : #endif /* if (...) */
    1336         [ #  # ]:          0 : if
    1337                 :            : (LNCH>1.0e20)
    1338                 :            : {
    1339                 :          0 : lnpeak=(LNCH*1.0e-6);
    1340                 :            : }
    1341                 :            : else
    1342                 :            : {
    1343                 :          0 : lnpeak=LNCH;
    1344                 :            : }
    1345         [ #  # ]:          0 : if
    1346                 :            : (LNGATE>1.0e23)
    1347                 :            : {
    1348                 :          0 : lngate=(LNGATE*1.0e-6);
    1349                 :            : }
    1350                 :            : else
    1351                 :            : {
    1352                 :          0 : lngate=LNGATE;
    1353                 :            : }
    1354         [ #  # ]:          0 : if
    1355                 :            : (LVTH0!=0.0)
    1356                 :            : {
    1357                 :          0 : lvth0=LVTH0;
    1358                 :            : }
    1359         [ #  # ]:          0 : if
    1360                 :            : (LVTHO!=0.0)
    1361                 :            : {
    1362                 :          0 : lvth0=LVTHO;
    1363                 :            : }
    1364                 :          0 : lpdibl1=LPDIBLC1;
    1365                 :          0 : lpdibl2=LPDIBLC2;
    1366                 :          0 : lpdiblb=LPDIBLCB;
    1367         [ #  # ]:          0 : if
    1368                 :            : (WNCH>1.0e20)
    1369                 :            : {
    1370                 :          0 : wnpeak=(WNCH*1.0e-6);
    1371                 :            : }
    1372                 :            : else
    1373                 :            : {
    1374                 :          0 : wnpeak=WNCH;
    1375                 :            : }
    1376         [ #  # ]:          0 : if
    1377                 :            : (WNGATE>1.0e23)
    1378                 :            : {
    1379                 :          0 : wngate=(WNGATE*1.0e-6);
    1380                 :            : }
    1381                 :            : else
    1382                 :            : {
    1383                 :          0 : wngate=WNGATE;
    1384                 :            : }
    1385         [ #  # ]:          0 : if
    1386                 :            : (WVTH0!=0.0)
    1387                 :            : {
    1388                 :          0 : wvth0=WVTH0;
    1389                 :            : }
    1390         [ #  # ]:          0 : if
    1391                 :            : (WVTHO!=0.0)
    1392                 :            : {
    1393                 :          0 : wvth0=WVTHO;
    1394                 :            : }
    1395                 :          0 : wpdibl1=WPDIBLC1;
    1396                 :          0 : wpdibl2=WPDIBLC2;
    1397                 :          0 : wpdiblb=WPDIBLCB;
    1398         [ #  # ]:          0 : if
    1399                 :            : (PNCH>1.0e20)
    1400                 :            : {
    1401                 :          0 : pnpeak=(PNCH*1.0e-6);
    1402                 :            : }
    1403                 :            : else
    1404                 :            : {
    1405                 :          0 : pnpeak=PNCH;
    1406                 :            : }
    1407         [ #  # ]:          0 : if
    1408                 :            : (PNGATE>1.0e20)
    1409                 :            : {
    1410                 :          0 : pngate=(PNGATE*1.0e-6);
    1411                 :            : }
    1412                 :            : else
    1413                 :            : {
    1414                 :          0 : pngate=PNGATE;
    1415                 :            : }
    1416         [ #  # ]:          0 : if
    1417                 :            : (PVTH0!=0.0)
    1418                 :            : {
    1419                 :          0 : pvth0=PVTH0;
    1420                 :            : }
    1421         [ #  # ]:          0 : if
    1422                 :            : (PVTHO!=0.0)
    1423                 :            : {
    1424                 :          0 : pvth0=PVTHO;
    1425                 :            : }
    1426                 :          0 : ppdibl1=PPDIBLC1;
    1427                 :          0 : ppdibl2=PPDIBLC2;
    1428                 :          0 : ppdiblb=PPDIBLCB;
    1429         [ #  # ]:          0 : if
    1430                 :            : (bulkJctPotential<0.1)
    1431                 :            : {
    1432                 :          0 : bulkJctPotential=0.1;
    1433                 :          0 : logprint(LOG_ERROR,"Given pb is less than 0.1. Pb is set to 0.1.");
    1434                 :          0 : logprint(LOG_ERROR,"\n");
    1435                 :            : }
    1436         [ #  # ]:          0 : if
    1437                 :            : (sidewallJctPotential<0.1)
    1438                 :            : {
    1439                 :          0 : sidewallJctPotential=0.1;
    1440                 :          0 : logprint(LOG_ERROR,"Given pbsw is less than 0.1. Pbsw is set to 0.1.");
    1441                 :          0 : logprint(LOG_ERROR,"\n");
    1442                 :            : }
    1443         [ #  # ]:          0 : if
    1444                 :            : (GatesidewallJctPotential<0.1)
    1445                 :            : {
    1446                 :          0 : GatesidewallJctPotential=0.1;
    1447                 :          0 : logprint(LOG_ERROR,"Given pbswg is less than 0.1. Pbswg is set to 0.1.");
    1448                 :          0 : logprint(LOG_ERROR,"\n");
    1449                 :            : }
    1450                 :          0 : Temp=_circuit_temp;
    1451                 :          0 : Tnom=tnom;
    1452                 :          0 : TRatio=(Temp/Tnom);
    1453                 :            : {
    1454                 :          0 : double m00_sqrt(d00_sqrt0,((1.03594e-10/3.453133e-11)*tox))
    1455                 :          0 : factor1=d00_sqrt0;
    1456                 :            : }
    1457                 :          0 : Vtm0=(8.617087e-5*Tnom);
    1458                 :          0 : Eg0=(1.16-(((7.02e-4*Tnom)*Tnom)/(Tnom+1108.0)));
    1459                 :            : {
    1460                 :          0 : double m00_sqrt(d00_sqrt0,(Tnom/300.15))
    1461                 :          0 : double m00_exp(d00_exp1,(21.5565981-(Eg0/(2.0*Vtm0))))
    1462                 :          0 : ni=(((1.45e10*(Tnom/300.15))*d00_sqrt0)*d00_exp1);
    1463                 :            : }
    1464                 :          0 : vtm=(8.617087e-5*Temp);
    1465                 :          0 : Eg=(1.16-(((7.02e-4*Temp)*Temp)/(Temp+1108.0)));
    1466         [ #  # ]:          0 : if
    1467                 :            : (Temp!=Tnom)
    1468                 :            : {
    1469                 :            : {
    1470                 :          0 : double m00_logE(d00_logE0,(Temp/Tnom))
    1471                 :            : #if defined(_DERIVATE)
    1472                 :          0 : T_0_Vgate_sourcep=0.0;
    1473                 :          0 : T_0_Vdrainp_sourcep=0.0;
    1474                 :          0 : T_0_Vbulk_sourcep=0.0;
    1475                 :            : #endif
    1476                 :          0 : T_0=(((Eg0/Vtm0)-(Eg/vtm))+(jctTempExponent*d00_logE0));
    1477                 :            : }
    1478                 :            : {
    1479                 :          0 : double m00_exp(d00_exp0,(T_0/jctEmissionCoeff))
    1480                 :            : #if defined(_DERIVATE)
    1481                 :          0 : T1_Vgate_sourcep=0.0;
    1482                 :          0 : T1_Vdrainp_sourcep=0.0;
    1483                 :          0 : T1_Vbulk_sourcep=0.0;
    1484                 :            : #endif
    1485                 :          0 : T1=d00_exp0;
    1486                 :            : }
    1487                 :          0 : jctTempSatCurDensity=(jctSatCurDensity*T1);
    1488                 :          0 : jctSidewallTempSatCurDensity=(jctSidewallSatCurDensity*T1);
    1489                 :            : }
    1490                 :            : else
    1491                 :            : {
    1492                 :          0 : jctTempSatCurDensity=jctSatCurDensity;
    1493                 :          0 : jctSidewallTempSatCurDensity=jctSidewallSatCurDensity;
    1494                 :            : }
    1495         [ #  # ]:          0 : if
    1496                 :            : (jctTempSatCurDensity<0.0)
    1497                 :            : {
    1498                 :          0 : jctTempSatCurDensity=0.0;
    1499                 :            : }
    1500         [ #  # ]:          0 : if
    1501                 :            : (jctSidewallTempSatCurDensity<0.0)
    1502                 :            : {
    1503                 :          0 : jctSidewallTempSatCurDensity=0.0;
    1504                 :            : }
    1505                 :          0 : delTemp=(_circuit_temp-tnom);
    1506                 :            : #if defined(_DERIVATE)
    1507                 :          0 : T_0_Vgate_sourcep=0.0;
    1508                 :          0 : T_0_Vdrainp_sourcep=0.0;
    1509                 :          0 : T_0_Vbulk_sourcep=0.0;
    1510                 :            : #endif
    1511                 :          0 : T_0=(TCJ*delTemp);
    1512         [ #  # ]:          0 : if
    1513                 :            : (T_0>=(-1.0))
    1514                 :            : {
    1515         [ #  # ]:          0 : if
    1516                 :            : (VERSION==3.24)
    1517                 :            : {
    1518                 :          0 : unitAreaTempJctCap=(unitAreaJctCap*(1.0+T_0));
    1519                 :            : }
    1520                 :            : else
    1521                 :            : {
    1522                 :          0 : unitAreaJctCap=(unitAreaJctCap*(1.0+T_0));
    1523                 :            : }
    1524                 :            : }
    1525                 :            : else
    1526                 :            : {
    1527         [ #  # ]:          0 : if
    1528                 :            : (unitAreaJctCap>0.0)
    1529                 :            : {
    1530         [ #  # ]:          0 : if
    1531                 :            : (VERSION==3.24)
    1532                 :            : {
    1533                 :          0 : unitAreaTempJctCap=0.0;
    1534                 :            : }
    1535                 :            : else
    1536                 :            : {
    1537                 :          0 : unitAreaJctCap=0.0;
    1538                 :            : }
    1539                 :          0 : logprint(LOG_ERROR,"Temperature effect has caused cj to be negative. Cj is clamped to zero.");
    1540                 :          0 : logprint(LOG_ERROR,"\n");
    1541                 :            : }
    1542                 :            : }
    1543                 :            : #if defined(_DERIVATE)
    1544                 :          0 : T_0_Vgate_sourcep=0.0;
    1545                 :          0 : T_0_Vdrainp_sourcep=0.0;
    1546                 :          0 : T_0_Vbulk_sourcep=0.0;
    1547                 :            : #endif
    1548                 :          0 : T_0=(TCJSW*delTemp);
    1549         [ #  # ]:          0 : if
    1550                 :            : (T_0>=(-1.0))
    1551                 :            : {
    1552         [ #  # ]:          0 : if
    1553                 :            : (VERSION==3.24)
    1554                 :            : {
    1555                 :          0 : unitLengthSidewallTempJctCap=(unitLengthSidewallJctCap*(1.0+T_0));
    1556                 :            : }
    1557                 :            : else
    1558                 :            : {
    1559                 :          0 : unitLengthSidewallJctCap=(unitLengthSidewallJctCap*(1.0+T_0));
    1560                 :            : }
    1561                 :            : }
    1562                 :            : else
    1563                 :            : {
    1564         [ #  # ]:          0 : if
    1565                 :            : (unitLengthSidewallJctCap>0.0)
    1566                 :            : {
    1567         [ #  # ]:          0 : if
    1568                 :            : (VERSION==3.24)
    1569                 :            : {
    1570                 :          0 : unitLengthSidewallTempJctCap=0.0;
    1571                 :            : }
    1572                 :            : else
    1573                 :            : {
    1574                 :          0 : unitLengthSidewallJctCap=0.0;
    1575                 :            : }
    1576                 :          0 : logprint(LOG_ERROR,"Temperature effect has caused cjsw to be negative. Cjsw is clamped to zero.");
    1577                 :          0 : logprint(LOG_ERROR,"\n");
    1578                 :            : }
    1579                 :            : }
    1580                 :            : #if defined(_DERIVATE)
    1581                 :          0 : T_0_Vgate_sourcep=0.0;
    1582                 :          0 : T_0_Vdrainp_sourcep=0.0;
    1583                 :          0 : T_0_Vbulk_sourcep=0.0;
    1584                 :            : #endif
    1585                 :          0 : T_0=(TCJSWG*delTemp);
    1586         [ #  # ]:          0 : if
    1587                 :            : (T_0>=(-1.0))
    1588                 :            : {
    1589         [ #  # ]:          0 : if
    1590                 :            : (VERSION==3.24)
    1591                 :            : {
    1592                 :          0 : unitLengthGateSidewallTempJctCap=(unitLengthGateSidewallJctCap*(1.0+T_0));
    1593                 :            : }
    1594                 :            : else
    1595                 :            : {
    1596                 :          0 : unitLengthGateSidewallJctCap=(unitLengthGateSidewallJctCap*(1.0+T_0));
    1597                 :            : }
    1598                 :            : }
    1599                 :            : else
    1600                 :            : {
    1601         [ #  # ]:          0 : if
    1602                 :            : (unitLengthGateSidewallJctCap>0.0)
    1603                 :            : {
    1604         [ #  # ]:          0 : if
    1605                 :            : (VERSION==3.24)
    1606                 :            : {
    1607                 :          0 : unitLengthGateSidewallTempJctCap=0.0;
    1608                 :            : }
    1609                 :            : else
    1610                 :            : {
    1611                 :          0 : unitLengthGateSidewallJctCap=0.0;
    1612                 :            : }
    1613                 :          0 : logprint(LOG_ERROR,"Temperature effect has caused cjswg to be negative. Cjswg is clamped to zero.");
    1614                 :          0 : logprint(LOG_ERROR,"\n");
    1615                 :            : }
    1616                 :            : }
    1617                 :          0 : PhiB=(bulkJctPotential-(TPB*delTemp));
    1618         [ #  # ]:          0 : if
    1619                 :            : (PhiB<0.01)
    1620                 :            : {
    1621                 :          0 : PhiB=0.01;
    1622                 :          0 : logprint(LOG_ERROR,"Temperature effect has caused pb to be less than 0.01. Pb is clamped to 0.01.");
    1623                 :          0 : logprint(LOG_ERROR,"\n");
    1624                 :            : }
    1625                 :          0 : PhiBSW=(sidewallJctPotential-(TPBSW*delTemp));
    1626         [ #  # ]:          0 : if
    1627                 :            : (PhiBSW<=0.01)
    1628                 :            : {
    1629                 :          0 : PhiBSW=0.01;
    1630                 :          0 : logprint(LOG_ERROR,"Temperature effect has caused pbsw to be less than 0.01. Pbsw is clamped to 0.01.");
    1631                 :          0 : logprint(LOG_ERROR,"\n");
    1632                 :            : }
    1633                 :          0 : PhiBSWG=(GatesidewallJctPotential-(TPBSWG*delTemp));
    1634         [ #  # ]:          0 : if
    1635                 :            : (PhiBSWG<=0.01)
    1636                 :            : {
    1637                 :          0 : PhiBSWG=0.01;
    1638                 :          0 : logprint(LOG_ERROR,"Temperature effect has caused pbswg to be less than 0.01. Pbswg is clamped to 0.01.");
    1639                 :          0 : logprint(LOG_ERROR,"\n");
    1640                 :            : }
    1641                 :          0 : Ldrn=L;
    1642                 :          0 : Wdrn=W;
    1643                 :            : {
    1644                 :          0 : double m00_pow(d00_pow0,Ldrn,LLN)
    1645                 :            : #if defined(_DERIVATE)
    1646                 :          0 : T_0_Vgate_sourcep=0.0;
    1647                 :          0 : T_0_Vdrainp_sourcep=0.0;
    1648                 :          0 : T_0_Vbulk_sourcep=0.0;
    1649                 :            : #endif
    1650                 :          0 : T_0=d00_pow0;
    1651                 :            : }
    1652                 :            : {
    1653                 :          0 : double m00_pow(d00_pow0,Wdrn,LWN)
    1654                 :            : #if defined(_DERIVATE)
    1655                 :          0 : T1_Vgate_sourcep=0.0;
    1656                 :          0 : T1_Vdrainp_sourcep=0.0;
    1657                 :          0 : T1_Vbulk_sourcep=0.0;
    1658                 :            : #endif
    1659                 :          0 : T1=d00_pow0;
    1660                 :            : }
    1661                 :            : #if defined(_DERIVATE)
    1662                 :          0 : tmp1_Vdrainp_sourcep=0.0;
    1663                 :          0 : tmp1_Vbulk_sourcep=0.0;
    1664                 :            : #endif
    1665                 :          0 : tmp1=(((LL/T_0)+(LW/T1))+(LWL/(T_0*T1)));
    1666                 :          0 : dl=(LINT+tmp1);
    1667                 :            : #if defined(_DERIVATE)
    1668                 :          0 : tmp2_Vgate_sourcep=0.0;
    1669                 :          0 : tmp2_Vdrainp_sourcep=0.0;
    1670                 :          0 : tmp2_Vbulk_sourcep=0.0;
    1671                 :            : #endif
    1672                 :          0 : tmp2=(((LLC/T_0)+(LWC/T1))+(LWLC/(T_0*T1)));
    1673                 :          0 : dlc=(dlc+tmp2);
    1674                 :            : {
    1675                 :          0 : double m00_pow(d00_pow0,Ldrn,WLN)
    1676                 :            : #if defined(_DERIVATE)
    1677                 :          0 : T2_Vgate_sourcep=0.0;
    1678                 :          0 : T2_Vdrainp_sourcep=0.0;
    1679                 :          0 : T2_Vbulk_sourcep=0.0;
    1680                 :            : #endif
    1681                 :          0 : T2=d00_pow0;
    1682                 :            : }
    1683                 :            : {
    1684                 :          0 : double m00_pow(d00_pow0,Wdrn,WWN)
    1685                 :            : #if defined(_DERIVATE)
    1686                 :          0 : T3_Vgate_sourcep=0.0;
    1687                 :          0 : T3_Vdrainp_sourcep=0.0;
    1688                 :          0 : T3_Vbulk_sourcep=0.0;
    1689                 :            : #endif
    1690                 :          0 : T3=d00_pow0;
    1691                 :            : }
    1692                 :            : #if defined(_DERIVATE)
    1693                 :          0 : tmp1_Vdrainp_sourcep=0.0;
    1694                 :          0 : tmp1_Vbulk_sourcep=0.0;
    1695                 :            : #endif
    1696                 :          0 : tmp1=(((WL/T2)+(WW/T3))+(WWL/(T2*T3)));
    1697                 :          0 : dw=(WINT+tmp1);
    1698                 :            : #if defined(_DERIVATE)
    1699                 :          0 : tmp2_Vgate_sourcep=0.0;
    1700                 :          0 : tmp2_Vdrainp_sourcep=0.0;
    1701                 :          0 : tmp2_Vbulk_sourcep=0.0;
    1702                 :            : #endif
    1703                 :          0 : tmp2=(((WLC/T2)+(WWC/T3))+(WWLC/(T2*T3)));
    1704                 :          0 : dwc=(DWC+tmp2);
    1705                 :          0 : leff=(L-(2.0*dl));
    1706         [ #  # ]:          0 : if
    1707                 :            : (leff<=0.0)
    1708                 :            : {
    1709                 :          0 : logprint(LOG_ERROR,"BSIM3: device %m: Effective channel length <= 0");
    1710                 :          0 : logprint(LOG_ERROR,"\n");
    1711                 :          0 : exit(1);
    1712                 :            : }
    1713                 :          0 : weff=(W-(2.0*dw));
    1714         [ #  # ]:          0 : if
    1715                 :            : (leff<=0.0)
    1716                 :            : {
    1717                 :          0 : logprint(LOG_ERROR,"BSIM3: device %m: Effective channel width <= 0");
    1718                 :          0 : logprint(LOG_ERROR,"\n");
    1719                 :          0 : exit(1);
    1720                 :            : }
    1721                 :          0 : leffCV=(L-(2.0*dlc));
    1722         [ #  # ]:          0 : if
    1723                 :            : (leffCV<=0.0)
    1724                 :            : {
    1725                 :          0 : logprint(LOG_ERROR,"BSIM3: device %m: Effective channel length for C-V <= 0");
    1726                 :          0 : logprint(LOG_ERROR,"\n");
    1727                 :          0 : exit(1);
    1728                 :            : }
    1729                 :          0 : weffCV=(W-(2.0*dwc));
    1730         [ #  # ]:          0 : if
    1731                 :            : (weffCV<=0.0)
    1732                 :            : {
    1733                 :          0 : logprint(LOG_ERROR,"BSIM3: device %m: Effective channel width for C-V <= 0");
    1734                 :          0 : logprint(LOG_ERROR,"\n");
    1735                 :          0 : exit(1);
    1736                 :            : }
    1737         [ #  # ]:          0 : if
    1738                 :            : (BINUNIT==1)
    1739                 :            : {
    1740                 :          0 : Inv_L=(1.0e-6/leff);
    1741                 :          0 : Inv_W=(1.0e-6/weff);
    1742                 :          0 : Inv_LW=(1.0e-12/(leff*weff));
    1743                 :            : }
    1744                 :            : else
    1745                 :            : {
    1746                 :          0 : Inv_L=(1.0/leff);
    1747                 :          0 : Inv_W=(1.0/weff);
    1748                 :          0 : Inv_LW=(1.0/(leff*weff));
    1749                 :            : }
    1750                 :          0 : cdsc=(((CDSC+(LCDSC*Inv_L))+(WCDSC*Inv_W))+(PCDSC*Inv_LW));
    1751                 :          0 : cdscb=(((CDSCB+(LCDSCB*Inv_L))+(WCDSCB*Inv_W))+(PCDSCB*Inv_LW));
    1752                 :          0 : cdscd=(((CDSCD+(LCDSCD*Inv_L))+(WCDSCD*Inv_W))+(PCDSCD*Inv_LW));
    1753                 :          0 : cit=(((CIT+(LCIT*Inv_L))+(WCIT*Inv_W))+(PCIT*Inv_LW));
    1754                 :          0 : nfactor=(((NFACTOR+(LNFACTOR*Inv_L))+(WNFACTOR*Inv_W))+(PNFACTOR*Inv_LW));
    1755                 :          0 : xj=(((XJ+(LXJ*Inv_L))+(WXJ*Inv_W))+(PXJ*Inv_LW));
    1756                 :          0 : vsat=(((VSAT+(LVSAT*Inv_L))+(WVSAT*Inv_W))+(PVSAT*Inv_LW));
    1757                 :          0 : at=(((AT+(LAT*Inv_L))+(WAT*Inv_W))+(PAT*Inv_LW));
    1758                 :          0 : a0=(((A0+(LA0*Inv_L))+(WA0*Inv_W))+(PA0*Inv_LW));
    1759                 :          0 : ags=(((AGS+(LAGS*Inv_L))+(WAGS*Inv_W))+(PAGS*Inv_LW));
    1760                 :          0 : a1=(((A1+(LA1*Inv_L))+(WA1*Inv_W))+(PA1*Inv_LW));
    1761                 :          0 : a2=(((A2+(LA2*Inv_L))+(WA2*Inv_W))+(PA2*Inv_LW));
    1762                 :          0 : keta=(((KETA+(LKETA*Inv_L))+(WKETA*Inv_W))+(PKETA*Inv_LW));
    1763                 :          0 : nsub=(((nsub+(LNSUB*Inv_L))+(WNSUB*Inv_W))+(PNSUB*Inv_LW));
    1764                 :          0 : npeak=(((npeak+(lnpeak*Inv_L))+(wnpeak*Inv_W))+(pnpeak*Inv_LW));
    1765                 :          0 : ngate=(((ngate+(lngate*Inv_L))+(wngate*Inv_W))+(pngate*Inv_LW));
    1766                 :          0 : gamma1=(((gamma1+(lgamma1*Inv_L))+(wgamma1*Inv_W))+(pgamma1*Inv_LW));
    1767                 :          0 : gamma2=(((gamma2+(lgamma2*Inv_L))+(wgamma2*Inv_W))+(pgamma2*Inv_LW));
    1768                 :          0 : vbx=(((vbx+(lvbx*Inv_L))+(wvbx*Inv_W))+(pvbx*Inv_LW));
    1769                 :          0 : vbm=(((VBM+(LVBM*Inv_L))+(WVBM*Inv_W))+(PVBM*Inv_LW));
    1770                 :          0 : xt=(((xt+(LXT*Inv_L))+(WXT*Inv_W))+(PXT*Inv_LW));
    1771                 :          0 : vfb=(((vfb+(LVFB*Inv_L))+(WVFB*Inv_W))+(PVFB*Inv_LW));
    1772                 :          0 : k1=(((k1+(lk1*Inv_L))+(wk1*Inv_W))+(pk1*Inv_LW));
    1773                 :          0 : kt1=(((KT1+(LKT1*Inv_L))+(WKT1*Inv_W))+(PKT1*Inv_LW));
    1774                 :          0 : kt1l=(((KT1L+(LKT1L*Inv_L))+(WKT1L*Inv_W))+(PKT1L*Inv_LW));
    1775                 :          0 : k2=(((k2+(lk2*Inv_L))+(wk2*Inv_W))+(pk2*Inv_LW));
    1776                 :          0 : kt2=(((KT2+(LKT2*Inv_L))+(WKT2*Inv_W))+(PKT2*Inv_LW));
    1777                 :          0 : k3=(((K3+(LK3*Inv_L))+(WK3*Inv_W))+(PK3*Inv_LW));
    1778                 :          0 : k3b=(((K3B+(LK3B*Inv_L))+(WK3B*Inv_W))+(PK3B*Inv_LW));
    1779                 :          0 : w0=(((W0+(LW0*Inv_L))+(WW0*Inv_W))+(PW0*Inv_LW));
    1780                 :          0 : nlx=(((NLX+(LNLX*Inv_L))+(WNLX*Inv_W))+(PNLX*Inv_LW));
    1781                 :          0 : dvt0=(((DVT0+(LDVT0*Inv_L))+(WDVT0*Inv_W))+(PDVT0*Inv_LW));
    1782                 :          0 : dvt1=(((DVT1+(LDVT1*Inv_L))+(WDVT1*Inv_W))+(PDVT1*Inv_LW));
    1783                 :          0 : dvt2=(((DVT2+(LDVT2*Inv_L))+(WDVT2*Inv_W))+(PDVT2*Inv_LW));
    1784                 :          0 : dvt0w=(((DVT0W+(LDVT0W*Inv_L))+(WDVT0W*Inv_W))+(PDVT0W*Inv_LW));
    1785                 :          0 : dvt1w=(((DVT1W+(LDVT1W*Inv_L))+(WDVT1W*Inv_W))+(PDVT1W*Inv_LW));
    1786                 :          0 : dvt2w=(((DVT2W+(LDVT2W*Inv_L))+(WDVT2W*Inv_W))+(PDVT2W*Inv_LW));
    1787                 :          0 : drout=(((DROUT+(LDROUT*Inv_L))+(WDROUT*Inv_W))+(PDROUT*Inv_LW));
    1788                 :          0 : dsub=(((DSUB+(LDSUB*Inv_L))+(WDSUB*Inv_W))+(PDSUB*Inv_LW));
    1789                 :          0 : vth0=(((vth0+(lvth0*Inv_L))+(wvth0*Inv_W))+(pvth0*Inv_LW));
    1790                 :          0 : ua=(((UA+(LUA*Inv_L))+(WUA*Inv_W))+(PUA*Inv_LW));
    1791                 :          0 : ua1=(((UA1+(LUA1*Inv_L))+(WUA1*Inv_W))+(PUA1*Inv_LW));
    1792                 :          0 : ub=(((UB+(LUB*Inv_L))+(WUB*Inv_W))+(PUB*Inv_LW));
    1793                 :          0 : ub1=(((UB1+(LUB1*Inv_L))+(WUB1*Inv_W))+(PUB1*Inv_LW));
    1794                 :          0 : uc=(((uc+(LUC*Inv_L))+(WUC*Inv_W))+(PUC*Inv_LW));
    1795                 :          0 : uc1=(((uc1+(LUC1*Inv_L))+(WUC1*Inv_W))+(PUC1*Inv_LW));
    1796                 :          0 : u0=(((u0+(LU0*Inv_L))+(WU0*Inv_W))+(PU0*Inv_LW));
    1797                 :          0 : ute=(((UTE+(LUTE*Inv_L))+(WUTE*Inv_W))+(PUTE*Inv_LW));
    1798                 :          0 : voff=(((VOFF+(LVOFF*Inv_L))+(WVOFF*Inv_W))+(PVOFF*Inv_LW));
    1799                 :          0 : delta=(((DELTA+(LDELTA*Inv_L))+(WDELTA*Inv_W))+(PDELTA*Inv_LW));
    1800                 :          0 : rdsw=(((RDSW+(LRDSW*Inv_L))+(WRDSW*Inv_W))+(PRDSW*Inv_LW));
    1801                 :          0 : prwg=(((PRWG+(LPRWG*Inv_L))+(WPRWG*Inv_W))+(PPRWG*Inv_LW));
    1802                 :          0 : prwb=(((PRWB+(LPRWB*Inv_L))+(WPRWB*Inv_W))+(PPRWB*Inv_LW));
    1803                 :          0 : prt=(((PRT+(LPRT*Inv_L))+(WPRT*Inv_W))+(PPRT*Inv_LW));
    1804                 :          0 : eta0=(((ETA0+(LETA0*Inv_L))+(WETA0*Inv_W))+(PETA0*Inv_LW));
    1805                 :          0 : etab=(((ETAB+(LETAB*Inv_L))+(WETAB*Inv_W))+(PETAB*Inv_LW));
    1806                 :          0 : pclm=(((PCLM+(LPCLM*Inv_L))+(WPCLM*Inv_W))+(PPCLM*Inv_LW));
    1807                 :          0 : pdibl1=(((pdibl1+(lpdibl1*Inv_L))+(wpdibl1*Inv_W))+(ppdibl1*Inv_LW));
    1808                 :          0 : pdibl2=(((pdibl2+(lpdibl2*Inv_L))+(wpdibl2*Inv_W))+(ppdibl2*Inv_LW));
    1809                 :          0 : pdiblb=(((pdiblb+(lpdiblb*Inv_L))+(wpdiblb*Inv_W))+(ppdiblb*Inv_LW));
    1810                 :          0 : pscbe1=(((PSCBE1+(LPSCBE1*Inv_L))+(WPSCBE1*Inv_W))+(PPSCBE1*Inv_LW));
    1811                 :          0 : pscbe2=(((PSCBE2+(LPSCBE2*Inv_L))+(WPSCBE2*Inv_W))+(PPSCBE2*Inv_LW));
    1812                 :          0 : pvag=(((PVAG+(LPVAG*Inv_L))+(WPVAG*Inv_W))+(PPVAG*Inv_LW));
    1813                 :          0 : wr=(((WR+(LWR*Inv_L))+(WWR*Inv_W))+(PWR*Inv_LW));
    1814                 :          0 : dwg=(((DWG+(LDWG*Inv_L))+(WDWG*Inv_W))+(PDWG*Inv_LW));
    1815                 :          0 : dwb=(((DWB+(LDWB*Inv_L))+(WDWB*Inv_W))+(PDWB*Inv_LW));
    1816                 :          0 : b0=(((B0+(LB0*Inv_L))+(WB0*Inv_W))+(PB0*Inv_LW));
    1817                 :          0 : b1=(((B1+(LB1*Inv_L))+(WB1*Inv_W))+(PB1*Inv_LW));
    1818                 :          0 : alpha0=(((ALPHA0+(LALPHA0*Inv_L))+(WALPHA0*Inv_W))+(PALPHA0*Inv_LW));
    1819                 :          0 : alpha1=(((ALPHA1+(LALPHA1*Inv_L))+(WALPHA1*Inv_W))+(PALPHA1*Inv_LW));
    1820                 :          0 : beta0=(((BETA0+(LBETA0*Inv_L))+(WBETA0*Inv_W))+(PBETA0*Inv_LW));
    1821                 :            : #if defined(_DYNAMIC)
    1822                 :          0 : elm=(((ELM+(LELM*Inv_L))+(WELM*Inv_W))+(PELM*Inv_LW));
    1823                 :            : #endif
    1824                 :            : #if defined(_DYNAMIC)
    1825                 :          0 : cgsl=(((CGSL+(LCGSL*Inv_L))+(WCGSL*Inv_W))+(PCGSL*Inv_LW));
    1826                 :            : #endif
    1827                 :            : #if defined(_DYNAMIC)
    1828                 :          0 : cgdl=(((CGDL+(LCGDL*Inv_L))+(WCGDL*Inv_W))+(PCGDL*Inv_LW));
    1829                 :            : #endif
    1830                 :            : #if defined(_DYNAMIC)
    1831                 :          0 : ckappa=(((CKAPPA+(LCKAPPA*Inv_L))+(WCKAPPA*Inv_W))+(PCKAPPA*Inv_LW));
    1832                 :            : #endif
    1833                 :            : #if defined(_DYNAMIC)
    1834                 :          0 : cf=(((cf+(LCF*Inv_L))+(WCF*Inv_W))+(PCF*Inv_LW));
    1835                 :            : #endif
    1836                 :          0 : clc=(((CLC+(LCLC*Inv_L))+(WCLC*Inv_W))+(PCLC*Inv_LW));
    1837                 :          0 : cle=(((CLE+(LCLE*Inv_L))+(WCLE*Inv_W))+(PCLE*Inv_LW));
    1838                 :          0 : vfbcv=(((VFBCV+(LVFBCV*Inv_L))+(WVFBCV*Inv_W))+(PVFBCV*Inv_LW));
    1839                 :          0 : acde=(((ACDE+(LACDE*Inv_L))+(WACDE*Inv_W))+(PACDE*Inv_LW));
    1840                 :          0 : moin=(((MOIN+(LMOIN*Inv_L))+(WMOIN*Inv_W))+(PMOIN*Inv_LW));
    1841                 :          0 : noff_param=(((NOFF+(LNOFF*Inv_L))+(WNOFF*Inv_W))+(PNOFF*Inv_LW));
    1842                 :          0 : voffcv_param=(((VOFFCV+(LVOFFCV*Inv_L))+(WVOFFCV*Inv_W))+(PVOFFCV*Inv_LW));
    1843                 :            : {
    1844                 :          0 : double m00_pow(d00_pow0,(clc/leffCV),cle)
    1845                 :          0 : abulkCVfactor=(1.0+d00_pow0);
    1846                 :            : }
    1847                 :            : #if defined(_DERIVATE)
    1848                 :          0 : T_0_Vgate_sourcep=0.0;
    1849                 :          0 : T_0_Vdrainp_sourcep=0.0;
    1850                 :          0 : T_0_Vbulk_sourcep=0.0;
    1851                 :            : #endif
    1852                 :          0 : T_0=(TRatio-1.0);
    1853                 :          0 : ua=(ua+(ua1*T_0));
    1854                 :          0 : ub=(ub+(ub1*T_0));
    1855                 :          0 : uc=(uc+(uc1*T_0));
    1856         [ #  # ]:          0 : if
    1857                 :            : (u0>1.0)
    1858                 :            : {
    1859                 :          0 : u0=(u0/1.0e4);
    1860                 :            : }
    1861                 :            : {
    1862                 :          0 : double m00_pow(d00_pow0,TRatio,ute)
    1863                 :          0 : u0temp=(u0*d00_pow0);
    1864                 :            : }
    1865                 :          0 : vsattemp=(vsat-(at*T_0));
    1866                 :            : {
    1867                 :          0 : double m00_pow(d00_pow0,(weff*1E6),wr)
    1868                 :          0 : rds0=((rdsw+(prt*T_0))/d00_pow0);
    1869                 :            : }
    1870                 :          0 : Fatal_Flag=0;
    1871         [ #  # ]:          0 : if
    1872                 :            : (nlx<(-leff))
    1873                 :            : {
    1874                 :          0 : logprint(LOG_ERROR,"Fatal: Nlx = %g is less than -Leff.",nlx);
    1875                 :          0 : logprint(LOG_ERROR,"\n");
    1876                 :          0 : Fatal_Flag=1;
    1877                 :            : }
    1878         [ #  # ]:          0 : if
    1879                 :            : (tox<=0.0)
    1880                 :            : {
    1881                 :          0 : logprint(LOG_ERROR,"Fatal: Tox = %g is not positive.",tox);
    1882                 :          0 : logprint(LOG_ERROR,"\n");
    1883                 :          0 : Fatal_Flag=1;
    1884                 :            : }
    1885         [ #  # ]:          0 : if
    1886                 :            : (TOXM<=0.0)
    1887                 :            : {
    1888                 :          0 : logprint(LOG_ERROR,"Fatal: Toxm = %g is not positive.",TOXM);
    1889                 :          0 : logprint(LOG_ERROR,"\n");
    1890                 :          0 : Fatal_Flag=1;
    1891                 :            : }
    1892         [ #  # ]:          0 : if
    1893                 :            : (npeak<=0.0)
    1894                 :            : {
    1895                 :          0 : logprint(LOG_ERROR,"Fatal: Nch = %g is not positive.",npeak);
    1896                 :          0 : logprint(LOG_ERROR,"\n");
    1897                 :          0 : Fatal_Flag=1;
    1898                 :            : }
    1899         [ #  # ]:          0 : if
    1900                 :            : (nsub<=0.0)
    1901                 :            : {
    1902                 :          0 : logprint(LOG_ERROR,"Fatal: Nsub = %g is not positive.",nsub);
    1903                 :          0 : logprint(LOG_ERROR,"\n");
    1904                 :          0 : Fatal_Flag=1;
    1905                 :            : }
    1906         [ #  # ]:          0 : if
    1907                 :            : (ngate<0.0)
    1908                 :            : {
    1909                 :          0 : logprint(LOG_ERROR,"Fatal: Ngate = %g Ngate is not positive.",ngate);
    1910                 :          0 : logprint(LOG_ERROR,"\n");
    1911                 :          0 : Fatal_Flag=1;
    1912                 :            : }
    1913         [ #  # ]:          0 : if
    1914                 :            : (ngate>1.0e25)
    1915                 :            : {
    1916                 :          0 : logprint(LOG_ERROR,"Fatal: Ngate = %g Ngate is too high",ngate);
    1917                 :          0 : logprint(LOG_ERROR,"\n");
    1918                 :          0 : Fatal_Flag=1;
    1919                 :            : }
    1920         [ #  # ]:          0 : if
    1921                 :            : (xj<=0.0)
    1922                 :            : {
    1923                 :          0 : logprint(LOG_ERROR,"Fatal: Xj = %g is not positive.",xj);
    1924                 :          0 : logprint(LOG_ERROR,"\n");
    1925                 :          0 : Fatal_Flag=1;
    1926                 :            : }
    1927         [ #  # ]:          0 : if
    1928                 :            : (dvt1<0.0)
    1929                 :            : {
    1930                 :          0 : logprint(LOG_ERROR,"Fatal: Dvt1 = %g is negative.",dvt1);
    1931                 :          0 : logprint(LOG_ERROR,"\n");
    1932                 :          0 : Fatal_Flag=1;
    1933                 :            : }
    1934         [ #  # ]:          0 : if
    1935                 :            : (dvt1w<0.0)
    1936                 :            : {
    1937                 :          0 : logprint(LOG_ERROR,"Fatal: Dvt1w = %g is negative.",dvt1w);
    1938                 :          0 : logprint(LOG_ERROR,"\n");
    1939                 :          0 : Fatal_Flag=1;
    1940                 :            : }
    1941         [ #  # ]:          0 : if
    1942                 :            : (w0==(-weff))
    1943                 :            : {
    1944                 :          0 : logprint(LOG_ERROR,"Fatal: (W0 + Weff) = 0 causing divided-by-zero.");
    1945                 :          0 : logprint(LOG_ERROR,"\n");
    1946                 :          0 : Fatal_Flag=1;
    1947                 :            : }
    1948         [ #  # ]:          0 : if
    1949                 :            : (dsub<0.0)
    1950                 :            : {
    1951                 :          0 : logprint(LOG_ERROR,"Fatal: Dsub = %g is negative.",dsub);
    1952                 :          0 : logprint(LOG_ERROR,"\n");
    1953                 :          0 : Fatal_Flag=1;
    1954                 :            : }
    1955         [ #  # ]:          0 : if
    1956                 :            : (b1==(-weff))
    1957                 :            : {
    1958                 :          0 : logprint(LOG_ERROR,"Fatal: (B1 + Weff) = 0 causing divided-by-zero.");
    1959                 :          0 : logprint(LOG_ERROR,"\n");
    1960                 :          0 : Fatal_Flag=1;
    1961                 :            : }
    1962         [ #  # ]:          0 : if
    1963                 :            : (u0temp<=0.0)
    1964                 :            : {
    1965                 :          0 : logprint(LOG_ERROR,"Fatal: u0 at current temperature = %g is not positive.",u0temp);
    1966                 :          0 : logprint(LOG_ERROR,"\n");
    1967                 :          0 : Fatal_Flag=1;
    1968                 :            : }
    1969         [ #  # ]:          0 : if
    1970                 :            : (delta<0.0)
    1971                 :            : {
    1972                 :          0 : logprint(LOG_ERROR,"Fatal: Delta = %g is less than zero.",delta);
    1973                 :          0 : logprint(LOG_ERROR,"\n");
    1974                 :          0 : Fatal_Flag=1;
    1975                 :            : }
    1976         [ #  # ]:          0 : if
    1977                 :            : (vsattemp<=0.0)
    1978                 :            : {
    1979                 :          0 : logprint(LOG_ERROR,"Fatal: Vsat at current temperature = %g is not positive.",vsattemp);
    1980                 :          0 : logprint(LOG_ERROR,"\n");
    1981                 :          0 : Fatal_Flag=1;
    1982                 :            : }
    1983         [ #  # ]:          0 : if
    1984                 :            : (pclm<=0.0)
    1985                 :            : {
    1986                 :          0 : logprint(LOG_ERROR,"Fatal: Pclm = %g is not positive.",pclm);
    1987                 :          0 : logprint(LOG_ERROR,"\n");
    1988                 :          0 : Fatal_Flag=1;
    1989                 :            : }
    1990         [ #  # ]:          0 : if
    1991                 :            : (drout<0.0)
    1992                 :            : {
    1993                 :          0 : logprint(LOG_ERROR,"Fatal: Drout = %g is negative.",drout);
    1994                 :          0 : logprint(LOG_ERROR,"\n");
    1995                 :          0 : Fatal_Flag=1;
    1996                 :            : }
    1997         [ #  # ]:          0 : if
    1998                 :            : (pscbe2<=0.0)
    1999                 :            : {
    2000                 :          0 : logprint(LOG_ERROR,"Warning: Pscbe2 = %g is not positive.",pscbe2);
    2001                 :          0 : logprint(LOG_ERROR,"\n");
    2002                 :            : }
    2003 [ #  # ][ #  # ]:          0 : if
    2004                 :            : ((unitLengthSidewallJctCap>0.0)||(unitLengthGateSidewallJctCap>0.0))
    2005                 :            : {
    2006         [ #  # ]:          0 : if
    2007                 :            : (drainPerimeter<weff)
    2008                 :            : {
    2009                 :          0 : logprint(LOG_ERROR,"Warning: Pd = %g is less than W.",drainPerimeter);
    2010                 :          0 : logprint(LOG_ERROR,"\n");
    2011                 :            : }
    2012         [ #  # ]:          0 : if
    2013                 :            : (sourcePerimeter<weff)
    2014                 :            : {
    2015                 :          0 : logprint(LOG_ERROR,"Warning: Ps = %g is less than W.",sourcePerimeter);
    2016                 :          0 : logprint(LOG_ERROR,"\n");
    2017                 :            : }
    2018                 :            : }
    2019         [ #  # ]:          0 : if
    2020                 :            : (noff_param<0.1)
    2021                 :            : {
    2022                 :          0 : logprint(LOG_ERROR,"Warning: Noff = %g is too small.",noff_param);
    2023                 :          0 : logprint(LOG_ERROR,"\n");
    2024                 :            : }
    2025         [ #  # ]:          0 : if
    2026                 :            : (noff_param>4.0)
    2027                 :            : {
    2028                 :          0 : logprint(LOG_ERROR,"Warning: Noff = %g is too large.",noff_param);
    2029                 :          0 : logprint(LOG_ERROR,"\n");
    2030                 :            : }
    2031         [ #  # ]:          0 : if
    2032                 :            : (voffcv_param<(-0.5))
    2033                 :            : {
    2034                 :          0 : logprint(LOG_ERROR,"Warning: Voffcv = %g is too small.",voffcv_param);
    2035                 :          0 : logprint(LOG_ERROR,"\n");
    2036                 :            : }
    2037         [ #  # ]:          0 : if
    2038                 :            : (voffcv_param>0.5)
    2039                 :            : {
    2040                 :          0 : logprint(LOG_ERROR,"Warning: Voffcv = %g is too large.",voffcv_param);
    2041                 :          0 : logprint(LOG_ERROR,"\n");
    2042                 :            : }
    2043         [ #  # ]:          0 : if
    2044                 :            : (IJTH<0.0)
    2045                 :            : {
    2046                 :          0 : logprint(LOG_ERROR,"Fatal: Ijth = %g cannot be negative.",IJTH);
    2047                 :          0 : logprint(LOG_ERROR,"\n");
    2048                 :          0 : Fatal_Flag=1;
    2049                 :            : }
    2050         [ #  # ]:          0 : if
    2051                 :            : (clc<0.0)
    2052                 :            : {
    2053                 :          0 : logprint(LOG_ERROR,"Fatal: Clc = %g is negative.",clc);
    2054                 :          0 : logprint(LOG_ERROR,"\n");
    2055                 :          0 : Fatal_Flag=1;
    2056                 :            : }
    2057         [ #  # ]:          0 : if
    2058                 :            : (moin<5.0)
    2059                 :            : {
    2060                 :          0 : logprint(LOG_ERROR,"Warning: Moin = %g is too small.",moin);
    2061                 :          0 : logprint(LOG_ERROR,"\n");
    2062                 :            : }
    2063         [ #  # ]:          0 : if
    2064                 :            : (moin>25.0)
    2065                 :            : {
    2066                 :          0 : logprint(LOG_ERROR,"Warning: Moin = %g is too large.",moin);
    2067                 :          0 : logprint(LOG_ERROR,"\n");
    2068                 :            : }
    2069 [ #  # ][ #  # ]:          0 : if
         [ #  # ][ #  # ]
                 [ #  # ]
    2070                 :          0 : (((acde<0.4)&&(!(VERSION==3.24)))||(((acde<0.4)&&(VERSION==3.24))&&(CAPMOD==3.0)))
    2071                 :            : {
    2072                 :          0 : logprint(LOG_ERROR,"Warning: Acde = %g is too small.",acde);
    2073                 :          0 : logprint(LOG_ERROR,"\n");
    2074                 :            : }
    2075 [ #  # ][ #  # ]:          0 : if
         [ #  # ][ #  # ]
                 [ #  # ]
    2076                 :          0 : (((acde>1.6)&&(!(VERSION==3.24)))||(((acde>1.6)&&(VERSION==3.24))&&(CAPMOD==3.0)))
    2077                 :            : {
    2078                 :          0 : logprint(LOG_ERROR,"Warning: Acde = %g is too large.",acde);
    2079                 :          0 : logprint(LOG_ERROR,"\n");
    2080                 :            : }
    2081         [ #  # ]:          0 : if
    2082                 :            : (PARAMCHK==1)
    2083                 :            : {
    2084         [ #  # ]:          0 : if
    2085                 :            : (leff<=5.0e-8)
    2086                 :            : {
    2087                 :          0 : logprint(LOG_ERROR,"Warning: Leff = %g may be too small.",leff);
    2088                 :          0 : logprint(LOG_ERROR,"\n");
    2089                 :            : }
    2090         [ #  # ]:          0 : if
    2091                 :            : (leffCV<=5.0e-8)
    2092                 :            : {
    2093                 :          0 : logprint(LOG_ERROR,"Warning: Leff for CV = %g may be too small.",leffCV);
    2094                 :          0 : logprint(LOG_ERROR,"\n");
    2095                 :            : }
    2096         [ #  # ]:          0 : if
    2097                 :            : (weff<=1.0e-7)
    2098                 :            : {
    2099                 :          0 : logprint(LOG_ERROR,"Warning: Weff = %g may be too small.",weff);
    2100                 :          0 : logprint(LOG_ERROR,"\n");
    2101                 :            : }
    2102         [ #  # ]:          0 : if
    2103                 :            : (weffCV<=1.0e-7)
    2104                 :            : {
    2105                 :          0 : logprint(LOG_ERROR,"Warning: Weff for CV = %g may be too small.",weffCV);
    2106                 :          0 : logprint(LOG_ERROR,"\n");
    2107                 :            : }
    2108         [ #  # ]:          0 : if
    2109                 :            : (nlx<0.0)
    2110                 :            : {
    2111                 :          0 : logprint(LOG_ERROR,"Warning: Nlx = %g is negative.",nlx);
    2112                 :          0 : logprint(LOG_ERROR,"\n");
    2113                 :            : }
    2114         [ #  # ]:          0 : if
    2115                 :            : (tox<1.0e-9)
    2116                 :            : {
    2117                 :          0 : logprint(LOG_ERROR,"Warning: Tox = %g is less than 10A.",tox);
    2118                 :          0 : logprint(LOG_ERROR,"\n");
    2119                 :            : }
    2120         [ #  # ]:          0 : if
    2121                 :            : (npeak<=1.0e15)
    2122                 :            : {
    2123                 :          0 : logprint(LOG_ERROR,"Warning: Nch = %g may be too small.",npeak);
    2124                 :          0 : logprint(LOG_ERROR,"\n");
    2125                 :            : }
    2126                 :            : else
    2127                 :            : {
    2128         [ #  # ]:          0 : if
    2129                 :            : (npeak>=1.0e21)
    2130                 :            : {
    2131                 :          0 : logprint(LOG_ERROR,"Warning: Nch = %g may be too large.",npeak);
    2132                 :          0 : logprint(LOG_ERROR,"\n");
    2133                 :            : }
    2134                 :            : }
    2135         [ #  # ]:          0 : if
    2136                 :            : (nsub<=1.0e14)
    2137                 :            : {
    2138                 :          0 : logprint(LOG_ERROR,"Warning: Nsub = %g may be too small.",nsub);
    2139                 :          0 : logprint(LOG_ERROR,"\n");
    2140                 :            : }
    2141                 :            : else
    2142                 :            : {
    2143         [ #  # ]:          0 : if
    2144                 :            : (nsub>=1.0e21)
    2145                 :            : {
    2146                 :          0 : logprint(LOG_ERROR,"Warning: Nsub = %g may be too large.",nsub);
    2147                 :          0 : logprint(LOG_ERROR,"\n");
    2148                 :            : }
    2149                 :            : }
    2150 [ #  # ][ #  # ]:          0 : if
    2151                 :            : ((ngate>0.0)&&(ngate<=1.0e18))
    2152                 :            : {
    2153                 :          0 : logprint(LOG_ERROR,"Warning: Ngate = %g is less than 1.E18cm^-3.",ngate);
    2154                 :          0 : logprint(LOG_ERROR,"\n");
    2155                 :            : }
    2156         [ #  # ]:          0 : if
    2157                 :            : (dvt0<0.0)
    2158                 :            : {
    2159                 :          0 : logprint(LOG_ERROR,"Warning: Dvt0 = %g is negative.",dvt0);
    2160                 :          0 : logprint(LOG_ERROR,"\n");
    2161                 :            : }
    2162                 :            : {
    2163         [ #  # ]:          0 : double m00_abs(d00_abs0,(1.0e-6/(w0+weff)))
    2164         [ #  # ]:          0 : if
    2165                 :            : (d00_abs0>10.0)
    2166                 :            : {
    2167                 :          0 : logprint(LOG_ERROR,"Warning: (W0 + Weff) may be too small.");
    2168                 :          0 : logprint(LOG_ERROR,"\n");
    2169                 :            : }
    2170                 :            : }
    2171         [ #  # ]:          0 : if
    2172                 :            : (nfactor<0.0)
    2173                 :            : {
    2174                 :          0 : logprint(LOG_ERROR,"Warning: Nfactor = %g is negative.",nfactor);
    2175                 :          0 : logprint(LOG_ERROR,"\n");
    2176                 :            : }
    2177         [ #  # ]:          0 : if
    2178                 :            : (cdsc<0.0)
    2179                 :            : {
    2180                 :          0 : logprint(LOG_ERROR,"Warning: Cdsc = %g is negative.",cdsc);
    2181                 :          0 : logprint(LOG_ERROR,"\n");
    2182                 :            : }
    2183         [ #  # ]:          0 : if
    2184                 :            : (cdscd<0.0)
    2185                 :            : {
    2186                 :          0 : logprint(LOG_ERROR,"Warning: Cdscd = %g is negative.",cdscd);
    2187                 :          0 : logprint(LOG_ERROR,"\n");
    2188                 :            : }
    2189         [ #  # ]:          0 : if
    2190                 :            : (eta0<0.0)
    2191                 :            : {
    2192                 :          0 : logprint(LOG_ERROR,"Warning: Eta0 = %g is negative.",eta0);
    2193                 :          0 : logprint(LOG_ERROR,"\n");
    2194                 :            : }
    2195                 :            : {
    2196         [ #  # ]:          0 : double m00_abs(d00_abs0,(1.0e-6/(b1+weff)))
    2197         [ #  # ]:          0 : if
    2198                 :            : (d00_abs0>10.0)
    2199                 :            : {
    2200                 :          0 : logprint(LOG_ERROR,"Warning: (B1 + Weff) may be too small.");
    2201                 :          0 : logprint(LOG_ERROR,"\n");
    2202                 :            : }
    2203                 :            : }
    2204         [ #  # ]:          0 : if
    2205                 :            : (a2<0.01)
    2206                 :            : {
    2207                 :          0 : logprint(LOG_ERROR,"Warning: A2 = %g is too small. Set to 0.01.",a2);
    2208                 :          0 : logprint(LOG_ERROR,"\n");
    2209                 :          0 : a2=0.01;
    2210                 :            : }
    2211                 :            : else
    2212                 :            : {
    2213         [ #  # ]:          0 : if
    2214                 :            : (a2>1.0)
    2215                 :            : {
    2216                 :          0 : logprint(LOG_ERROR,"Warning: A2 = %g is larger than 1. A2 is set to 1 and A1 is set to 0.",a2);
    2217                 :          0 : logprint(LOG_ERROR,"\n");
    2218                 :          0 : a2=1.0;
    2219                 :          0 : a1=0.0;
    2220                 :            : }
    2221                 :            : }
    2222         [ #  # ]:          0 : if
    2223                 :            : (rdsw<0.0)
    2224                 :            : {
    2225                 :          0 : logprint(LOG_ERROR,"Warning: Rdsw = %g is negative. Set to zero.",rdsw);
    2226                 :          0 : logprint(LOG_ERROR,"\n");
    2227                 :            : #if defined(_DYNAMIC)
    2228                 :          0 : rdsw=0.0;
    2229                 :            : #endif
    2230                 :          0 : rds0=0.0;
    2231                 :            : }
    2232                 :            : else
    2233                 :            : {
    2234 [ #  # ][ #  # ]:          0 : if
    2235                 :            : ((rds0>0.0)&&(rds0<0.001))
    2236                 :            : {
    2237                 :          0 : logprint(LOG_ERROR,"Warning: Rds at current temperature = %g is less than 0.001 ohm. Set to zero.",rds0);
    2238                 :          0 : logprint(LOG_ERROR,"\n");
    2239                 :          0 : rds0=0.0;
    2240                 :            : }
    2241                 :            : }
    2242         [ #  # ]:          0 : if
    2243                 :            : (vsattemp<1.0e3)
    2244                 :            : {
    2245                 :          0 : logprint(LOG_ERROR,"Warning: Vsat at current temperature = %g may be too small.",vsattemp);
    2246                 :          0 : logprint(LOG_ERROR,"\n");
    2247                 :            : }
    2248         [ #  # ]:          0 : if
    2249                 :            : (pdibl1<0.0)
    2250                 :            : {
    2251                 :          0 : logprint(LOG_ERROR,"Warning: Pdibl1 = %g is negative.",pdibl1);
    2252                 :          0 : logprint(LOG_ERROR,"\n");
    2253                 :            : }
    2254         [ #  # ]:          0 : if
    2255                 :            : (pdibl2<0.0)
    2256                 :            : {
    2257                 :          0 : logprint(LOG_ERROR,"Warning: Pdibl2 = %g is negative.",pdibl2);
    2258                 :          0 : logprint(LOG_ERROR,"\n");
    2259                 :            : }
    2260         [ #  # ]:          0 : if
    2261                 :            : (cgdo_param<0.0)
    2262                 :            : {
    2263                 :          0 : logprint(LOG_ERROR,"Warning: cgdo = %g is negative. Set to zero.",cgdo_param);
    2264                 :          0 : logprint(LOG_ERROR,"\n");
    2265                 :            : #if defined(_DYNAMIC)
    2266                 :          0 : cgdo_param=0.0;
    2267                 :            : #endif
    2268                 :            : }
    2269         [ #  # ]:          0 : if
    2270                 :            : (cgso_param<0.0)
    2271                 :            : {
    2272                 :          0 : logprint(LOG_ERROR,"Warning: cgso = %g is negative. Set to zero.",cgso_param);
    2273                 :          0 : logprint(LOG_ERROR,"\n");
    2274                 :            : #if defined(_DYNAMIC)
    2275                 :          0 : cgso_param=0.0;
    2276                 :            : #endif
    2277                 :            : }
    2278         [ #  # ]:          0 : if
    2279                 :            : (cgbo_param<0.0)
    2280                 :            : {
    2281                 :          0 : logprint(LOG_ERROR,"Warning: cgbo = %g is negative. Set to zero.",cgbo_param);
    2282                 :          0 : logprint(LOG_ERROR,"\n");
    2283                 :            : #if defined(_DYNAMIC)
    2284                 :          0 : cgbo_param=0.0;
    2285                 :            : #endif
    2286                 :            : }
    2287                 :            : }
    2288         [ #  # ]:          0 : if
    2289                 :            : (Fatal_Flag)
    2290                 :            : {
    2291                 :          0 : exit(1);
    2292                 :            : }
    2293                 :            : #if defined(_DYNAMIC)
    2294                 :          0 : cgdo_param=((cgdo_param+cf)*weffCV);
    2295                 :            : #endif
    2296                 :            : #if defined(_DYNAMIC)
    2297                 :          0 : cgso_param=((cgso_param+cf)*weffCV);
    2298                 :            : #endif
    2299                 :            : #if defined(_DYNAMIC)
    2300                 :          0 : cgbo_param=(cgbo_param*leffCV);
    2301                 :            : #endif
    2302                 :            : #if defined(_DERIVATE)
    2303                 :          0 : T_0_Vgate_sourcep=0.0;
    2304                 :          0 : T_0_Vdrainp_sourcep=0.0;
    2305                 :          0 : T_0_Vbulk_sourcep=0.0;
    2306                 :            : #endif
    2307                 :          0 : T_0=(leffCV*leffCV);
    2308                 :            : #if defined(_DYNAMIC)
    2309                 :          0 : tconst=((u0temp*elm)/(((cox*weffCV)*leffCV)*T_0));
    2310                 :            : #endif
    2311 [ #  # ][ #  # ]:          0 : if
    2312                 :            : ((!npeakGiven)&&gamma1Given)
    2313                 :            : {
    2314                 :            : #if defined(_DERIVATE)
    2315                 :          0 : T_0_Vgate_sourcep=0.0;
    2316                 :          0 : T_0_Vdrainp_sourcep=0.0;
    2317                 :          0 : T_0_Vbulk_sourcep=0.0;
    2318                 :            : #endif
    2319                 :          0 : T_0=(gamma1*cox);
    2320                 :          0 : npeak=((3.021E22*T_0)*T_0);
    2321                 :            : }
    2322                 :            : {
    2323                 :          0 : double m00_logE(d00_logE0,(npeak/ni))
    2324                 :          0 : phi=((2.0*Vtm0)*d00_logE0);
    2325                 :            : }
    2326                 :            : {
    2327                 :          0 : double m00_sqrt(d00_sqrt0,phi)
    2328                 :          0 : sqrtPhi=d00_sqrt0;
    2329                 :            : }
    2330                 :          0 : phis3=(sqrtPhi*phi);
    2331                 :            : {
    2332                 :          0 : double m00_sqrt(d00_sqrt0,((2.0*1.03594e-10)/((1.60219e-19*npeak)*1.0e6)))
    2333                 :          0 : Xdep0=(d00_sqrt0*sqrtPhi);
    2334                 :            : }
    2335                 :            : {
    2336                 :          0 : double m00_sqrt(d00_sqrt0,((3.0*xj)*tox))
    2337                 :          0 : litl=d00_sqrt0;
    2338                 :            : }
    2339                 :            : {
    2340                 :          0 : double m00_logE(d00_logE0,((1.0e20*npeak)/(ni*ni)))
    2341                 :          0 : vbi=(Vtm0*d00_logE0);
    2342                 :            : }
    2343                 :            : {
    2344                 :          0 : double m00_sqrt(d00_sqrt0,(((((1.60219e-19*1.03594e-10)*npeak)*1.0e6)/2.0)/phi))
    2345                 :          0 : cdep0=d00_sqrt0;
    2346                 :            : }
    2347                 :            : {
    2348                 :          0 : double m00_sqrt(d00_sqrt0,((1.03594e-10*Vtm0)/((1.60219e-19*npeak)*1.0e6)))
    2349                 :          0 : ldeb=(d00_sqrt0/3.0);
    2350                 :            : }
    2351                 :            : {
    2352                 :          0 : double m00_pow(d00_pow0,(npeak/2.0e16),(-0.25))
    2353                 :          0 : acde=(acde*d00_pow0);
    2354                 :            : }
    2355 [ #  # ][ #  # ]:          0 : if
    2356                 :            : (k1Given||k2Given)
    2357                 :            : {
    2358         [ #  # ]:          0 : if
    2359                 :            : (!k1Given)
    2360                 :            : {
    2361                 :          0 : logprint(LOG_ERROR,"Warning: k1 should be specified with k2.");
    2362                 :          0 : logprint(LOG_ERROR,"\n");
    2363                 :          0 : k1=0.53;
    2364                 :            : }
    2365         [ #  # ]:          0 : if
    2366                 :            : (!k2Given)
    2367                 :            : {
    2368                 :          0 : logprint(LOG_ERROR,"Warning: k2 should be specified with k1.");
    2369                 :          0 : logprint(LOG_ERROR,"\n");
    2370                 :          0 : k2=(-0.0186);
    2371                 :            : }
    2372         [ #  # ]:          0 : if
    2373                 :            : (nsubGiven)
    2374                 :            : {
    2375                 :          0 : logprint(LOG_ERROR,"Warning: nsub is ignored because k1 or k2 is given.");
    2376                 :          0 : logprint(LOG_ERROR,"\n");
    2377                 :            : }
    2378         [ #  # ]:          0 : if
    2379                 :            : (xtGiven)
    2380                 :            : {
    2381                 :          0 : logprint(LOG_ERROR,"Warning: xt is ignored because k1 or k2 is given.");
    2382                 :          0 : logprint(LOG_ERROR,"\n");
    2383                 :            : }
    2384         [ #  # ]:          0 : if
    2385                 :            : (vbxGiven)
    2386                 :            : {
    2387                 :          0 : logprint(LOG_ERROR,"Warning: vbx is ignored because k1 or k2 is given.");
    2388                 :          0 : logprint(LOG_ERROR,"\n");
    2389                 :            : }
    2390         [ #  # ]:          0 : if
    2391                 :            : (gamma1Given)
    2392                 :            : {
    2393                 :          0 : logprint(LOG_ERROR,"Warning: gamma1 is ignored because k1 or k2 is given.");
    2394                 :          0 : logprint(LOG_ERROR,"\n");
    2395                 :            : }
    2396         [ #  # ]:          0 : if
    2397                 :            : (gamma2Given)
    2398                 :            : {
    2399                 :          0 : logprint(LOG_ERROR,"Warning: gamma2 is ignored because k1 or k2 is given.");
    2400                 :          0 : logprint(LOG_ERROR,"\n");
    2401                 :            : }
    2402                 :            : }
    2403                 :            : else
    2404                 :            : {
    2405         [ #  # ]:          0 : if
    2406                 :            : (!vbxGiven)
    2407                 :            : {
    2408                 :          0 : vbx=(phi-(((7.7348e-4*npeak)*xt)*xt));
    2409                 :            : }
    2410         [ #  # ]:          0 : if
    2411                 :            : (vbx>0.0)
    2412                 :            : {
    2413                 :          0 : vbx=(-vbx);
    2414                 :            : }
    2415         [ #  # ]:          0 : if
    2416                 :            : (vbm>0.0)
    2417                 :            : {
    2418                 :          0 : vbm=(-vbm);
    2419                 :            : }
    2420         [ #  # ]:          0 : if
    2421                 :            : (!gamma1Given)
    2422                 :            : {
    2423                 :            : {
    2424                 :          0 : double m00_sqrt(d00_sqrt0,npeak)
    2425                 :          0 : gamma1=((5.753e-12*d00_sqrt0)/cox);
    2426                 :            : }
    2427                 :            : }
    2428         [ #  # ]:          0 : if
    2429                 :            : (!gamma2Given)
    2430                 :            : {
    2431                 :            : {
    2432                 :          0 : double m00_sqrt(d00_sqrt0,nsub)
    2433                 :          0 : gamma2=((5.753e-12*d00_sqrt0)/cox);
    2434                 :            : }
    2435                 :            : }
    2436                 :            : #if defined(_DERIVATE)
    2437                 :          0 : T_0_Vgate_sourcep=0.0;
    2438                 :          0 : T_0_Vdrainp_sourcep=0.0;
    2439                 :          0 : T_0_Vbulk_sourcep=0.0;
    2440                 :            : #endif
    2441                 :          0 : T_0=(gamma1-gamma2);
    2442                 :            : {
    2443                 :          0 : double m00_sqrt(d00_sqrt0,(phi-vbx))
    2444                 :            : #if defined(_DERIVATE)
    2445                 :          0 : T1_Vgate_sourcep=0.0;
    2446                 :          0 : T1_Vdrainp_sourcep=0.0;
    2447                 :          0 : T1_Vbulk_sourcep=0.0;
    2448                 :            : #endif
    2449                 :          0 : T1=(d00_sqrt0-sqrtPhi);
    2450                 :            : }
    2451                 :            : {
    2452                 :          0 : double m00_sqrt(d00_sqrt0,(phi*(phi-vbm)))
    2453                 :            : #if defined(_DERIVATE)
    2454                 :          0 : T2_Vgate_sourcep=0.0;
    2455                 :          0 : T2_Vdrainp_sourcep=0.0;
    2456                 :          0 : T2_Vbulk_sourcep=0.0;
    2457                 :            : #endif
    2458                 :          0 : T2=(d00_sqrt0-phi);
    2459                 :            : }
    2460                 :          0 : k2=((T_0*T1)/((2.0*T2)+vbm));
    2461                 :            : {
    2462                 :          0 : double m00_sqrt(d00_sqrt0,(phi-vbm))
    2463                 :          0 : k1=(gamma2-((2.0*k2)*d00_sqrt0));
    2464                 :            : }
    2465                 :            : }
    2466         [ #  # ]:          0 : if
    2467                 :            : (k2<0.0)
    2468                 :            : {
    2469                 :            : #if defined(_DERIVATE)
    2470                 :          0 : T_0_Vgate_sourcep=0.0;
    2471                 :          0 : T_0_Vdrainp_sourcep=0.0;
    2472                 :          0 : T_0_Vbulk_sourcep=0.0;
    2473                 :            : #endif
    2474                 :          0 : T_0=((0.5*k1)/k2);
    2475                 :          0 : vbsc=(0.9*(phi-(T_0*T_0)));
    2476         [ #  # ]:          0 : if
    2477                 :            : (vbsc>(-3.0))
    2478                 :            : {
    2479                 :          0 : vbsc=(-3.0);
    2480                 :            : }
    2481                 :            : else
    2482                 :            : {
    2483         [ #  # ]:          0 : if
    2484                 :            : (vbsc<(-30.0))
    2485                 :            : {
    2486                 :          0 : vbsc=(-30.0);
    2487                 :            : }
    2488                 :            : }
    2489                 :            : }
    2490                 :            : else
    2491                 :            : {
    2492                 :          0 : vbsc=(-30.0);
    2493                 :            : }
    2494         [ #  # ]:          0 : if
    2495                 :            : (vbsc>vbm)
    2496                 :            : {
    2497                 :          0 : vbsc=vbm;
    2498                 :            : }
    2499         [ #  # ]:          0 : if
    2500                 :            : (!vfbGiven)
    2501                 :            : {
    2502         [ #  # ]:          0 : if
    2503                 :            : (vth0Given)
    2504                 :            : {
    2505                 :          0 : vfb=(((TYPE*vth0)-phi)-(k1*sqrtPhi));
    2506                 :            : }
    2507                 :            : else
    2508                 :            : {
    2509                 :          0 : vfb=(-1.0);
    2510                 :            : }
    2511                 :            : }
    2512         [ #  # ]:          0 : if
    2513                 :            : (!vth0Given)
    2514                 :            : {
    2515                 :          0 : vth0=(TYPE*((vfb+phi)+(k1*sqrtPhi)));
    2516                 :            : }
    2517                 :          0 : k1ox=((k1*tox)/TOXM);
    2518                 :          0 : k2ox=((k2*tox)/TOXM);
    2519                 :            : {
    2520                 :          0 : double m00_sqrt(d00_sqrt0,(((1.03594e-10/3.453133e-11)*tox)*Xdep0))
    2521                 :            : #if defined(_DERIVATE)
    2522                 :          0 : T1_Vgate_sourcep=0.0;
    2523                 :          0 : T1_Vdrainp_sourcep=0.0;
    2524                 :          0 : T1_Vbulk_sourcep=0.0;
    2525                 :            : #endif
    2526                 :          0 : T1=d00_sqrt0;
    2527                 :            : }
    2528                 :            : {
    2529                 :          0 : double m00_exp(d00_exp0,((((-0.5)*dsub)*leff)/T1))
    2530                 :            : #if defined(_DERIVATE)
    2531                 :          0 : T_0_Vgate_sourcep=0.0;
    2532                 :          0 : T_0_Vdrainp_sourcep=0.0;
    2533                 :          0 : T_0_Vbulk_sourcep=0.0;
    2534                 :            : #endif
    2535                 :          0 : T_0=d00_exp0;
    2536                 :            : }
    2537                 :          0 : theta0vb0=(T_0+((2.0*T_0)*T_0));
    2538                 :            : {
    2539                 :          0 : double m00_exp(d00_exp0,((((-0.5)*drout)*leff)/T1))
    2540                 :            : #if defined(_DERIVATE)
    2541                 :          0 : T_0_Vgate_sourcep=0.0;
    2542                 :          0 : T_0_Vdrainp_sourcep=0.0;
    2543                 :          0 : T_0_Vbulk_sourcep=0.0;
    2544                 :            : #endif
    2545                 :          0 : T_0=d00_exp0;
    2546                 :            : }
    2547                 :            : #if defined(_DERIVATE)
    2548                 :          0 : T2_Vgate_sourcep=0.0;
    2549                 :          0 : T2_Vdrainp_sourcep=0.0;
    2550                 :          0 : T2_Vbulk_sourcep=0.0;
    2551                 :            : #endif
    2552                 :          0 : T2=(T_0+((2.0*T_0)*T_0));
    2553                 :          0 : thetaRout=((pdibl1*T2)+pdibl2);
    2554                 :            : {
    2555                 :          0 : double m00_sqrt(d00_sqrt0,Xdep0)
    2556                 :            : #if defined(_DERIVATE)
    2557                 :          0 : tmp_Vgate_sourcep=0.0;
    2558                 :          0 : tmp_Vdrainp_sourcep=0.0;
    2559                 :          0 : tmp_Vbulk_sourcep=0.0;
    2560                 :            : #endif
    2561                 :          0 : tmp=d00_sqrt0;
    2562                 :            : }
    2563                 :            : #if defined(_DERIVATE)
    2564                 :          0 : tmp1_Vdrainp_sourcep=0.0;
    2565                 :          0 : tmp1_Vbulk_sourcep=0.0;
    2566                 :            : #endif
    2567                 :          0 : tmp1=(vbi-phi);
    2568                 :            : #if defined(_DERIVATE)
    2569                 :          0 : tmp2_Vgate_sourcep=0.0;
    2570                 :          0 : tmp2_Vdrainp_sourcep=0.0;
    2571                 :          0 : tmp2_Vbulk_sourcep=0.0;
    2572                 :            : #endif
    2573                 :          0 : tmp2=(factor1*tmp);
    2574                 :            : #if defined(_DERIVATE)
    2575                 :          0 : T_0_Vgate_sourcep=0.0;
    2576                 :          0 : T_0_Vdrainp_sourcep=0.0;
    2577                 :          0 : T_0_Vbulk_sourcep=0.0;
    2578                 :            : #endif
    2579                 :          0 : T_0=(((((-0.5)*dvt1w)*weff)*leff)/tmp2);
    2580         [ #  # ]:          0 : if
    2581                 :            : (T_0>(-34.0))
    2582                 :            : {
    2583                 :            : {
    2584                 :          0 : double m00_exp(d00_exp0,T_0)
    2585                 :            : #if defined(_DERIVATE)
    2586                 :          0 : T1_Vgate_sourcep=0.0;
    2587                 :          0 : T1_Vdrainp_sourcep=0.0;
    2588                 :          0 : T1_Vbulk_sourcep=0.0;
    2589                 :            : #endif
    2590                 :          0 : T1=d00_exp0;
    2591                 :            : }
    2592                 :            : #if defined(_DERIVATE)
    2593                 :          0 : T2_Vgate_sourcep=0.0;
    2594                 :          0 : T2_Vdrainp_sourcep=0.0;
    2595                 :          0 : T2_Vbulk_sourcep=0.0;
    2596                 :            : #endif
    2597                 :          0 : T2=(T1*(1.0+(2.0*T1)));
    2598                 :            : }
    2599                 :            : else
    2600                 :            : {
    2601                 :            : #if defined(_DERIVATE)
    2602                 :          0 : T1_Vgate_sourcep=0.0;
    2603                 :          0 : T1_Vdrainp_sourcep=0.0;
    2604                 :          0 : T1_Vbulk_sourcep=0.0;
    2605                 :            : #endif
    2606                 :          0 : T1=1.713908431e-15;
    2607                 :            : #if defined(_DERIVATE)
    2608                 :          0 : T2_Vgate_sourcep=0.0;
    2609                 :          0 : T2_Vdrainp_sourcep=0.0;
    2610                 :          0 : T2_Vbulk_sourcep=0.0;
    2611                 :            : #endif
    2612                 :          0 : T2=(T1*(1.0+(2.0*T1)));
    2613                 :            : }
    2614                 :            : #if defined(_DERIVATE)
    2615                 :          0 : T_0_Vgate_sourcep=0.0;
    2616                 :          0 : T_0_Vdrainp_sourcep=0.0;
    2617                 :          0 : T_0_Vbulk_sourcep=0.0;
    2618                 :            : #endif
    2619                 :          0 : T_0=(dvt0w*T2);
    2620                 :            : #if defined(_DERIVATE)
    2621                 :          0 : T2_Vgate_sourcep=0.0;
    2622                 :          0 : T2_Vdrainp_sourcep=0.0;
    2623                 :          0 : T2_Vbulk_sourcep=0.0;
    2624                 :            : #endif
    2625                 :          0 : T2=(T_0*tmp1);
    2626                 :            : #if defined(_DERIVATE)
    2627                 :          0 : T_0_Vgate_sourcep=0.0;
    2628                 :          0 : T_0_Vdrainp_sourcep=0.0;
    2629                 :          0 : T_0_Vbulk_sourcep=0.0;
    2630                 :            : #endif
    2631                 :          0 : T_0=((((-0.5)*dvt1)*leff)/tmp2);
    2632         [ #  # ]:          0 : if
    2633                 :            : (T_0>(-34.0))
    2634                 :            : {
    2635                 :            : {
    2636                 :          0 : double m00_exp(d00_exp0,T_0)
    2637                 :            : #if defined(_DERIVATE)
    2638                 :          0 : T1_Vgate_sourcep=0.0;
    2639                 :          0 : T1_Vdrainp_sourcep=0.0;
    2640                 :          0 : T1_Vbulk_sourcep=0.0;
    2641                 :            : #endif
    2642                 :          0 : T1=d00_exp0;
    2643                 :            : }
    2644                 :            : #if defined(_DERIVATE)
    2645                 :          0 : T3_Vgate_sourcep=0.0;
    2646                 :          0 : T3_Vdrainp_sourcep=0.0;
    2647                 :          0 : T3_Vbulk_sourcep=0.0;
    2648                 :            : #endif
    2649                 :          0 : T3=(T1*(1.0+(2.0*T1)));
    2650                 :            : }
    2651                 :            : else
    2652                 :            : {
    2653                 :            : #if defined(_DERIVATE)
    2654                 :          0 : T1_Vgate_sourcep=0.0;
    2655                 :          0 : T1_Vdrainp_sourcep=0.0;
    2656                 :          0 : T1_Vbulk_sourcep=0.0;
    2657                 :            : #endif
    2658                 :          0 : T1=1.713908431e-15;
    2659                 :            : #if defined(_DERIVATE)
    2660                 :          0 : T3_Vgate_sourcep=0.0;
    2661                 :          0 : T3_Vdrainp_sourcep=0.0;
    2662                 :          0 : T3_Vbulk_sourcep=0.0;
    2663                 :            : #endif
    2664                 :          0 : T3=(T1*(1.0+(2.0*T1)));
    2665                 :            : }
    2666                 :            : #if defined(_DERIVATE)
    2667                 :          0 : T3_Vgate_sourcep=0.0;
    2668                 :          0 : T3_Vdrainp_sourcep=0.0;
    2669                 :          0 : T3_Vbulk_sourcep=0.0;
    2670                 :            : #endif
    2671                 :          0 : T3=((dvt0*T3)*tmp1);
    2672                 :            : #if defined(_DERIVATE)
    2673                 :          0 : T4_Vgate_sourcep=0.0;
    2674                 :          0 : T4_Vdrainp_sourcep=0.0;
    2675                 :          0 : T4_Vbulk_sourcep=0.0;
    2676                 :            : #endif
    2677                 :          0 : T4=((tox*phi)/(weff+w0));
    2678                 :            : {
    2679                 :          0 : double m00_sqrt(d00_sqrt0,(1.0+(nlx/leff)))
    2680                 :            : #if defined(_DERIVATE)
    2681                 :          0 : T_0_Vgate_sourcep=0.0;
    2682                 :          0 : T_0_Vdrainp_sourcep=0.0;
    2683                 :          0 : T_0_Vbulk_sourcep=0.0;
    2684                 :            : #endif
    2685                 :          0 : T_0=d00_sqrt0;
    2686                 :            : }
    2687                 :            : #if defined(_DERIVATE)
    2688                 :          0 : T5_Vgate_sourcep=0.0;
    2689                 :          0 : T5_Vdrainp_sourcep=0.0;
    2690                 :          0 : T5_Vbulk_sourcep=0.0;
    2691                 :            : #endif
    2692                 :          0 : T5=(((k1ox*(T_0-1.0))*sqrtPhi)+((kt1+(kt1l/leff))*(TRatio-1.0)));
    2693                 :            : #if defined(_DERIVATE)
    2694                 :          0 : tmp3_Vdrainp_sourcep=0.0;
    2695                 :          0 : tmp3_Vbulk_sourcep=0.0;
    2696                 :            : #endif
    2697                 :          0 : tmp3=(((((TYPE*vth0)-T2)-T3)+(k3*T4))+T5);
    2698                 :          0 : vfbzb=((tmp3-phi)-(k1*sqrtPhi));
    2699                 :          0 : drainConductance=(sheetResistance*drainSquares);
    2700         [ #  # ]:          0 : if
    2701                 :            : (drainConductance>0.0)
    2702                 :            : {
    2703                 :          0 : drainConductance=(1.0/drainConductance);
    2704                 :            : }
    2705                 :            : else
    2706                 :            : {
    2707                 :          0 : drainConductance=0.0;
    2708                 :            : }
    2709                 :          0 : sourceConductance=(sheetResistance*sourceSquares);
    2710         [ #  # ]:          0 : if
    2711                 :            : (sourceConductance>0.0)
    2712                 :            : {
    2713                 :          0 : sourceConductance=(1.0/sourceConductance);
    2714                 :            : }
    2715                 :            : else
    2716                 :            : {
    2717                 :          0 : sourceConductance=0.0;
    2718                 :            : }
    2719                 :          0 : Nvtm=(vtm*jctEmissionCoeff);
    2720 [ #  # ][ #  # ]:          0 : if
    2721                 :            : ((sourceArea<=0.0)&&(sourcePerimeter<=0.0))
    2722                 :            : {
    2723                 :          0 : SourceSatCurrent=1.0e-14;
    2724                 :            : }
    2725                 :            : else
    2726                 :            : {
    2727                 :          0 : SourceSatCurrent=((sourceArea*jctTempSatCurDensity)+(sourcePerimeter*jctSidewallTempSatCurDensity));
    2728                 :            : }
    2729 [ #  # ][ #  # ]:          0 : if
    2730                 :            : ((SourceSatCurrent>0.0)&&(IJTH>0.0))
    2731                 :            : {
    2732                 :            : {
    2733                 :          0 : double m00_logE(d00_logE0,((IJTH/SourceSatCurrent)+1.0))
    2734                 :          0 : vjsm=(Nvtm*d00_logE0);
    2735                 :            : }
    2736         [ #  # ]:          0 : if
    2737                 :            : (VERSION==3.24)
    2738                 :            : {
    2739                 :            : {
    2740                 :          0 : double m00_exp(d00_exp0,(vjsm/Nvtm))
    2741                 :          0 : IsEvjsm=(SourceSatCurrent*d00_exp0);
    2742                 :            : }
    2743                 :            : }
    2744                 :            : }
    2745 [ #  # ][ #  # ]:          0 : if
    2746                 :            : ((drainArea<=0.0)&&(drainPerimeter<=0.0))
    2747                 :            : {
    2748                 :          0 : DrainSatCurrent=1.0e-14;
    2749                 :            : }
    2750                 :            : else
    2751                 :            : {
    2752                 :          0 : DrainSatCurrent=((drainArea*jctTempSatCurDensity)+(drainPerimeter*jctSidewallTempSatCurDensity));
    2753                 :            : }
    2754 [ #  # ][ #  # ]:          0 : if
    2755                 :            : ((DrainSatCurrent>0.0)&&(IJTH>0.0))
    2756                 :            : {
    2757                 :            : {
    2758                 :          0 : double m00_logE(d00_logE0,((IJTH/DrainSatCurrent)+1.0))
    2759                 :          0 : vjdm=(Nvtm*d00_logE0);
    2760                 :            : }
    2761         [ #  # ]:          0 : if
    2762                 :            : (VERSION==3.24)
    2763                 :            : {
    2764                 :            : {
    2765                 :          0 : double m00_exp(d00_exp0,(vjdm/Nvtm))
    2766                 :          0 : IsEvjdm=(DrainSatCurrent*d00_exp0);
    2767                 :            : }
    2768                 :            : }
    2769                 :            : }
    2770                 :            : }
    2771                 :          0 : }
    2772                 :            : 
    2773                 :            : /* Evaluate Verilog-AMS equations in final step. */
    2774                 :          0 : void bsim3v34nMOS::finalStep (void)
    2775                 :            : {
    2776                 :          0 : }
    2777                 :            : 
    2778                 :            : /* Evaluate Verilog-AMS equations in analog block. */
    2779                 :          0 : void bsim3v34nMOS::calcVerilog (void)
    2780                 :            : {
    2781                 :            : 
    2782                 :            : /* ----------------- evaluate verilog analog equations -------------------- */
    2783                 :            : double leffx2;
    2784                 :            : double fourkt;
    2785                 :            : double cqbulk;
    2786                 :            : double cqdrn;
    2787                 :            : double cqgate;
    2788                 :            : #if defined(_DYNAMIC)
    2789                 :            : double Qgate;
    2790                 :            : #if defined(_DERIVATE)
    2791                 :            : double Qgate_Vdrainp_sourcep;
    2792                 :            : double Qgate_Vgate_sourcep;
    2793                 :            : double Qgate_Vbulk_sourcep;
    2794                 :            : #endif
    2795                 :            : #endif
    2796                 :            : #if defined(_DYNAMIC)
    2797                 :            : double Qbulk;
    2798                 :            : #if defined(_DERIVATE)
    2799                 :            : double Qbulk_Vdrainp_sourcep;
    2800                 :            : double Qbulk_Vgate_sourcep;
    2801                 :            : double Qbulk_Vbulk_sourcep;
    2802                 :            : #endif
    2803                 :            : #endif
    2804                 :            : double Qsrc;
    2805                 :            : #if defined(_DYNAMIC)
    2806                 :            : double Qdrn;
    2807                 :            : #if defined(_DERIVATE)
    2808                 :            : double Qdrn_Vgate_sourcep;
    2809                 :            : double Qdrn_Vdrainp_sourcep;
    2810                 :            : double Qdrn_Vbulk_sourcep;
    2811                 :            : #endif
    2812                 :            : #endif
    2813                 :            : #if defined(_DYNAMIC)
    2814                 :            : double qgb;
    2815                 :            : #if defined(_DERIVATE)
    2816                 :            : double qgb_Vgate_sourcep;
    2817                 :            : double qgb_Vbulk_sourcep;
    2818                 :            : #endif
    2819                 :            : #endif
    2820                 :            : #if defined(_DYNAMIC)
    2821                 :            : double qgs;
    2822                 :            : #if defined(_DERIVATE)
    2823                 :            : double qgs_Vdrainp_sourcep;
    2824                 :            : double qgs_Vbulk_sourcep;
    2825                 :            : double qgs_Vgate_sourcep;
    2826                 :            : #endif
    2827                 :            : #endif
    2828                 :            : #if defined(_DYNAMIC)
    2829                 :            : double qgd;
    2830                 :            : #if defined(_DERIVATE)
    2831                 :            : double qgd_Vbulk_sourcep;
    2832                 :            : double qgd_Vgate_sourcep;
    2833                 :            : double qgd_Vdrainp_sourcep;
    2834                 :            : #endif
    2835                 :            : #endif
    2836                 :            : #if defined(_DYNAMIC)
    2837                 :            : double qgso;
    2838                 :            : #if defined(_DERIVATE)
    2839                 :            : double qgso_Vdrainp_sourcep;
    2840                 :            : double qgso_Vbulk_sourcep;
    2841                 :            : double qgso_Vgate_sourcep;
    2842                 :            : #endif
    2843                 :            : #endif
    2844                 :            : #if defined(_DYNAMIC)
    2845                 :            : double qgdo;
    2846                 :            : #if defined(_DERIVATE)
    2847                 :            : double qgdo_Vbulk_sourcep;
    2848                 :            : double qgdo_Vgate_sourcep;
    2849                 :            : double qgdo_Vdrainp_sourcep;
    2850                 :            : #endif
    2851                 :            : #endif
    2852                 :            : double Tox2;
    2853                 :            : double DeltaPhi;
    2854                 :            : #if defined(_DERIVATE)
    2855                 :            : double DeltaPhi_Vgate_sourcep;
    2856                 :            : double DeltaPhi_Vdrainp_sourcep;
    2857                 :            : double DeltaPhi_Vbulk_sourcep;
    2858                 :            : #endif
    2859                 :            : double CoxWLcen;
    2860                 :            : #if defined(_DERIVATE)
    2861                 :            : double CoxWLcen_Vgate_sourcep;
    2862                 :            : double CoxWLcen_Vdrainp_sourcep;
    2863                 :            : double CoxWLcen_Vbulk_sourcep;
    2864                 :            : #endif
    2865                 :            : double Coxeff;
    2866                 :            : #if defined(_DERIVATE)
    2867                 :            : double Coxeff_Vgate_sourcep;
    2868                 :            : double Coxeff_Vdrainp_sourcep;
    2869                 :            : double Coxeff_Vbulk_sourcep;
    2870                 :            : #endif
    2871                 :            : double Ccen;
    2872                 :            : #if defined(_DERIVATE)
    2873                 :            : double Ccen_Vgate_sourcep;
    2874                 :            : double Ccen_Vdrainp_sourcep;
    2875                 :            : double Ccen_Vbulk_sourcep;
    2876                 :            : #endif
    2877                 :            : double LINK;
    2878                 :            : double Tcen;
    2879                 :            : #if defined(_DERIVATE)
    2880                 :            : double Tcen_Vgate_sourcep;
    2881                 :            : double Tcen_Vdrainp_sourcep;
    2882                 :            : double Tcen_Vbulk_sourcep;
    2883                 :            : #endif
    2884                 :            : double Tox;
    2885                 :            : double Cox;
    2886                 :            : double qinoi;
    2887                 :            : #if defined(_DERIVATE)
    2888                 :            : double qinoi_Vdrainp_sourcep;
    2889                 :            : double qinoi_Vgate_sourcep;
    2890                 :            : double qinoi_Vbulk_sourcep;
    2891                 :            : #endif
    2892                 :            : double VdseffCV;
    2893                 :            : #if defined(_DERIVATE)
    2894                 :            : double VdseffCV_Vdrainp_sourcep;
    2895                 :            : double VdseffCV_Vgate_sourcep;
    2896                 :            : double VdseffCV_Vbulk_sourcep;
    2897                 :            : #endif
    2898                 :            : double V4;
    2899                 :            : #if defined(_DERIVATE)
    2900                 :            : double V4_Vdrainp_sourcep;
    2901                 :            : double V4_Vgate_sourcep;
    2902                 :            : double V4_Vbulk_sourcep;
    2903                 :            : #endif
    2904                 :            : #if defined(_DYNAMIC)
    2905                 :            : double Qsub0;
    2906                 :            : #if defined(_DERIVATE)
    2907                 :            : double Qsub0_Vgate_sourcep;
    2908                 :            : double Qsub0_Vdrainp_sourcep;
    2909                 :            : double Qsub0_Vbulk_sourcep;
    2910                 :            : #endif
    2911                 :            : #endif
    2912                 :            : #if defined(_DYNAMIC)
    2913                 :            : double Qac0;
    2914                 :            : #if defined(_DERIVATE)
    2915                 :            : double Qac0_Vdrainp_sourcep;
    2916                 :            : double Qac0_Vbulk_sourcep;
    2917                 :            : double Qac0_Vgate_sourcep;
    2918                 :            : #endif
    2919                 :            : #endif
    2920                 :            : double Vfbeff;
    2921                 :            : #if defined(_DERIVATE)
    2922                 :            : double Vfbeff_Vdrainp_sourcep;
    2923                 :            : double Vfbeff_Vbulk_sourcep;
    2924                 :            : double Vfbeff_Vgate_sourcep;
    2925                 :            : #endif
    2926                 :            : double V3;
    2927                 :            : #if defined(_DERIVATE)
    2928                 :            : double V3_Vdrainp_sourcep;
    2929                 :            : double V3_Vbulk_sourcep;
    2930                 :            : double V3_Vgate_sourcep;
    2931                 :            : #endif
    2932                 :            : double VdsatCV;
    2933                 :            : #if defined(_DERIVATE)
    2934                 :            : double VdsatCV_Vdrainp_sourcep;
    2935                 :            : double VdsatCV_Vgate_sourcep;
    2936                 :            : double VdsatCV_Vbulk_sourcep;
    2937                 :            : #endif
    2938                 :            : double Noff2;
    2939                 :            : #if defined(_DERIVATE)
    2940                 :            : double Noff2_Vdrainp_sourcep;
    2941                 :            : double Noff2_Vbulk_sourcep;
    2942                 :            : #endif
    2943                 :            : double VbseffCV;
    2944                 :            : #if defined(_DERIVATE)
    2945                 :            : double VbseffCV_Vdrainp_sourcep;
    2946                 :            : double VbseffCV_Vbulk_sourcep;
    2947                 :            : #endif
    2948                 :            : double Alphaz;
    2949                 :            : #if defined(_DERIVATE)
    2950                 :            : double Alphaz_Vdrainp_sourcep;
    2951                 :            : double Alphaz_Vgate_sourcep;
    2952                 :            : double Alphaz_Vbulk_sourcep;
    2953                 :            : #endif
    2954                 :            : double AbulkCV;
    2955                 :            : #if defined(_DERIVATE)
    2956                 :            : double AbulkCV_Vgate_sourcep;
    2957                 :            : double AbulkCV_Vdrainp_sourcep;
    2958                 :            : double AbulkCV_Vbulk_sourcep;
    2959                 :            : #endif
    2960                 :            : double Two_Third_CoxWL;
    2961                 :            : double One_Third_CoxWL;
    2962                 :            : double qinv;
    2963                 :            : #if defined(_DERIVATE)
    2964                 :            : double qinv_Vdrainp_sourcep;
    2965                 :            : double qinv_Vgate_sourcep;
    2966                 :            : double qinv_Vbulk_sourcep;
    2967                 :            : #endif
    2968                 :            : double Arg1;
    2969                 :            : #if defined(_DERIVATE)
    2970                 :            : double Arg1_Vdrainp_sourcep;
    2971                 :            : double Arg1_Vgate_sourcep;
    2972                 :            : double Arg1_Vbulk_sourcep;
    2973                 :            : #endif
    2974                 :            : double CoxWL;
    2975                 :            : double Vfb;
    2976                 :            : #if defined(_DERIVATE)
    2977                 :            : double Vfb_Vdrainp_sourcep;
    2978                 :            : double Vfb_Vbulk_sourcep;
    2979                 :            : #endif
    2980                 :            : double qbulk;
    2981                 :            : #if defined(_DERIVATE)
    2982                 :            : double qbulk_Vdrainp_sourcep;
    2983                 :            : double qbulk_Vgate_sourcep;
    2984                 :            : double qbulk_Vbulk_sourcep;
    2985                 :            : #endif
    2986                 :            : #if defined(_DYNAMIC)
    2987                 :            : double qsrc;
    2988                 :            : #if defined(_DERIVATE)
    2989                 :            : double qsrc_Vgate_sourcep;
    2990                 :            : double qsrc_Vdrainp_sourcep;
    2991                 :            : double qsrc_Vbulk_sourcep;
    2992                 :            : #endif
    2993                 :            : #endif
    2994                 :            : double qdrn;
    2995                 :            : #if defined(_DERIVATE)
    2996                 :            : double qdrn_Vgate_sourcep;
    2997                 :            : double qdrn_Vdrainp_sourcep;
    2998                 :            : double qdrn_Vbulk_sourcep;
    2999                 :            : #endif
    3000                 :            : double qgate;
    3001                 :            : #if defined(_DERIVATE)
    3002                 :            : double qgate_Vdrainp_sourcep;
    3003                 :            : double qgate_Vgate_sourcep;
    3004                 :            : double qgate_Vbulk_sourcep;
    3005                 :            : #endif
    3006                 :            : double capbd;
    3007                 :            : #if defined(_DYNAMIC)
    3008                 :            : double sarg;
    3009                 :            : #if defined(_DERIVATE)
    3010                 :            : double sarg_Vdrainp_sourcep;
    3011                 :            : double sarg_Vbulk_sourcep;
    3012                 :            : #endif
    3013                 :            : #endif
    3014                 :            : #if defined(_DYNAMIC)
    3015                 :            : double arg;
    3016                 :            : #if defined(_DERIVATE)
    3017                 :            : double arg_Vdrainp_sourcep;
    3018                 :            : double arg_Vbulk_sourcep;
    3019                 :            : #endif
    3020                 :            : #endif
    3021                 :            : double capbs;
    3022                 :            : #if defined(_DYNAMIC)
    3023                 :            : double qbd;
    3024                 :            : #if defined(_DERIVATE)
    3025                 :            : double qbd_Vgate_sourcep;
    3026                 :            : double qbd_Vdrainp_sourcep;
    3027                 :            : double qbd_Vbulk_sourcep;
    3028                 :            : #endif
    3029                 :            : #endif
    3030                 :            : #if defined(_DYNAMIC)
    3031                 :            : double qbs;
    3032                 :            : #if defined(_DERIVATE)
    3033                 :            : double qbs_Vgate_sourcep;
    3034                 :            : double qbs_Vdrainp_sourcep;
    3035                 :            : double qbs_Vbulk_sourcep;
    3036                 :            : #endif
    3037                 :            : #endif
    3038                 :            : double mjswg;
    3039                 :            : double mjsw;
    3040                 :            : double mj;
    3041                 :            : double czbsswg;
    3042                 :            : double czbssw;
    3043                 :            : double czbdsw;
    3044                 :            : double czbdswg;
    3045                 :            : double czbs;
    3046                 :            : double czbd;
    3047                 :            : double csub;
    3048                 :            : #if defined(_DERIVATE)
    3049                 :            : double csub_Vgate_sourcep;
    3050                 :            : double csub_Vdrainp_sourcep;
    3051                 :            : double csub_Vbulk_sourcep;
    3052                 :            : #endif
    3053                 :            : double cdrain;
    3054                 :            : #if defined(_DERIVATE)
    3055                 :            : double cdrain_Vgate_sourcep;
    3056                 :            : double cdrain_Vdrainp_sourcep;
    3057                 :            : double cdrain_Vbulk_sourcep;
    3058                 :            : #endif
    3059                 :            : double Isub;
    3060                 :            : #if defined(_DERIVATE)
    3061                 :            : double Isub_Vgate_sourcep;
    3062                 :            : double Isub_Vdrainp_sourcep;
    3063                 :            : double Isub_Vbulk_sourcep;
    3064                 :            : #endif
    3065                 :            : #if defined(_DERIVATE)
    3066                 :            : double tmp_Vgate_sourcep;
    3067                 :            : double tmp_Vdrainp_sourcep;
    3068                 :            : double tmp_Vbulk_sourcep;
    3069                 :            : #endif
    3070                 :            : double Ids;
    3071                 :            : #if defined(_DERIVATE)
    3072                 :            : double Ids_Vgate_sourcep;
    3073                 :            : double Ids_Vdrainp_sourcep;
    3074                 :            : double Ids_Vbulk_sourcep;
    3075                 :            : #endif
    3076                 :            : double Idsa;
    3077                 :            : #if defined(_DERIVATE)
    3078                 :            : double Idsa_Vgate_sourcep;
    3079                 :            : double Idsa_Vdrainp_sourcep;
    3080                 :            : double Idsa_Vbulk_sourcep;
    3081                 :            : #endif
    3082                 :            : double Idl;
    3083                 :            : #if defined(_DERIVATE)
    3084                 :            : double Idl_Vgate_sourcep;
    3085                 :            : double Idl_Vdrainp_sourcep;
    3086                 :            : double Idl_Vbulk_sourcep;
    3087                 :            : #endif
    3088                 :            : double gche;
    3089                 :            : #if defined(_DERIVATE)
    3090                 :            : double gche_Vgate_sourcep;
    3091                 :            : double gche_Vdrainp_sourcep;
    3092                 :            : double gche_Vbulk_sourcep;
    3093                 :            : #endif
    3094                 :            : double fgche2;
    3095                 :            : #if defined(_DERIVATE)
    3096                 :            : double fgche2_Vgate_sourcep;
    3097                 :            : double fgche2_Vdrainp_sourcep;
    3098                 :            : double fgche2_Vbulk_sourcep;
    3099                 :            : #endif
    3100                 :            : double fgche1;
    3101                 :            : #if defined(_DERIVATE)
    3102                 :            : double fgche1_Vdrainp_sourcep;
    3103                 :            : double fgche1_Vgate_sourcep;
    3104                 :            : double fgche1_Vbulk_sourcep;
    3105                 :            : #endif
    3106                 :            : double beta;
    3107                 :            : #if defined(_DERIVATE)
    3108                 :            : double beta_Vgate_sourcep;
    3109                 :            : double beta_Vdrainp_sourcep;
    3110                 :            : double beta_Vbulk_sourcep;
    3111                 :            : #endif
    3112                 :            : double CoxWovL;
    3113                 :            : #if defined(_DERIVATE)
    3114                 :            : double CoxWovL_Vdrainp_sourcep;
    3115                 :            : double CoxWovL_Vgate_sourcep;
    3116                 :            : double CoxWovL_Vbulk_sourcep;
    3117                 :            : #endif
    3118                 :            : double VASCBE;
    3119                 :            : #if defined(_DERIVATE)
    3120                 :            : double VASCBE_Vdrainp_sourcep;
    3121                 :            : double VASCBE_Vgate_sourcep;
    3122                 :            : double VASCBE_Vbulk_sourcep;
    3123                 :            : #endif
    3124                 :            : double Va;
    3125                 :            : #if defined(_DERIVATE)
    3126                 :            : double Va_Vgate_sourcep;
    3127                 :            : double Va_Vdrainp_sourcep;
    3128                 :            : double Va_Vbulk_sourcep;
    3129                 :            : #endif
    3130                 :            : double VADIBL;
    3131                 :            : #if defined(_DERIVATE)
    3132                 :            : double VADIBL_Vdrainp_sourcep;
    3133                 :            : double VADIBL_Vgate_sourcep;
    3134                 :            : double VADIBL_Vbulk_sourcep;
    3135                 :            : #endif
    3136                 :            : double VACLM;
    3137                 :            : #if defined(_DERIVATE)
    3138                 :            : double VACLM_Vgate_sourcep;
    3139                 :            : double VACLM_Vdrainp_sourcep;
    3140                 :            : double VACLM_Vbulk_sourcep;
    3141                 :            : #endif
    3142                 :            : double diffVds;
    3143                 :            : #if defined(_DERIVATE)
    3144                 :            : double diffVds_Vdrainp_sourcep;
    3145                 :            : double diffVds_Vgate_sourcep;
    3146                 :            : double diffVds_Vbulk_sourcep;
    3147                 :            : #endif
    3148                 :            : double Vasat;
    3149                 :            : #if defined(_DERIVATE)
    3150                 :            : double Vasat_Vgate_sourcep;
    3151                 :            : double Vasat_Vdrainp_sourcep;
    3152                 :            : double Vasat_Vbulk_sourcep;
    3153                 :            : #endif
    3154                 :            : double Vdseff;
    3155                 :            : #if defined(_DERIVATE)
    3156                 :            : double Vdseff_Vgate_sourcep;
    3157                 :            : double Vdseff_Vdrainp_sourcep;
    3158                 :            : double Vdseff_Vbulk_sourcep;
    3159                 :            : #endif
    3160                 :            : double vdsat;
    3161                 :            : double Vdsat;
    3162                 :            : #if defined(_DERIVATE)
    3163                 :            : double Vdsat_Vgate_sourcep;
    3164                 :            : double Vdsat_Vdrainp_sourcep;
    3165                 :            : double Vdsat_Vbulk_sourcep;
    3166                 :            : #endif
    3167                 :            : double Vgst2Vtm;
    3168                 :            : #if defined(_DERIVATE)
    3169                 :            : double Vgst2Vtm_Vdrainp_sourcep;
    3170                 :            : double Vgst2Vtm_Vgate_sourcep;
    3171                 :            : double Vgst2Vtm_Vbulk_sourcep;
    3172                 :            : #endif
    3173                 :            : double Lambda;
    3174                 :            : #if defined(_DERIVATE)
    3175                 :            : double Lambda_Vgate_sourcep;
    3176                 :            : double Lambda_Vdrainp_sourcep;
    3177                 :            : double Lambda_Vbulk_sourcep;
    3178                 :            : #endif
    3179                 :            : double EsatL;
    3180                 :            : #if defined(_DERIVATE)
    3181                 :            : double EsatL_Vgate_sourcep;
    3182                 :            : double EsatL_Vdrainp_sourcep;
    3183                 :            : double EsatL_Vbulk_sourcep;
    3184                 :            : #endif
    3185                 :            : double Esat;
    3186                 :            : #if defined(_DERIVATE)
    3187                 :            : double Esat_Vgate_sourcep;
    3188                 :            : double Esat_Vdrainp_sourcep;
    3189                 :            : double Esat_Vbulk_sourcep;
    3190                 :            : #endif
    3191                 :            : double WVCoxRds;
    3192                 :            : #if defined(_DERIVATE)
    3193                 :            : double WVCoxRds_Vdrainp_sourcep;
    3194                 :            : double WVCoxRds_Vgate_sourcep;
    3195                 :            : double WVCoxRds_Vbulk_sourcep;
    3196                 :            : #endif
    3197                 :            : double WVCox;
    3198                 :            : #if defined(_DERIVATE)
    3199                 :            : double WVCox_Vdrainp_sourcep;
    3200                 :            : double WVCox_Vgate_sourcep;
    3201                 :            : double WVCox_Vbulk_sourcep;
    3202                 :            : #endif
    3203                 :            : double ueff;
    3204                 :            : #if defined(_DERIVATE)
    3205                 :            : double ueff_Vgate_sourcep;
    3206                 :            : double ueff_Vdrainp_sourcep;
    3207                 :            : double ueff_Vbulk_sourcep;
    3208                 :            : #endif
    3209                 :            : double Denomi;
    3210                 :            : #if defined(_DERIVATE)
    3211                 :            : double Denomi_Vgate_sourcep;
    3212                 :            : double Denomi_Vdrainp_sourcep;
    3213                 :            : double Denomi_Vbulk_sourcep;
    3214                 :            : #endif
    3215                 :            : double Abulk;
    3216                 :            : #if defined(_DERIVATE)
    3217                 :            : double Abulk_Vgate_sourcep;
    3218                 :            : double Abulk_Vdrainp_sourcep;
    3219                 :            : double Abulk_Vbulk_sourcep;
    3220                 :            : #endif
    3221                 :            : double T8;
    3222                 :            : #if defined(_DERIVATE)
    3223                 :            : double T8_Vgate_sourcep;
    3224                 :            : double T8_Vdrainp_sourcep;
    3225                 :            : double T8_Vbulk_sourcep;
    3226                 :            : #endif
    3227                 :            : double Abulk0;
    3228                 :            : #if defined(_DERIVATE)
    3229                 :            : double Abulk0_Vgate_sourcep;
    3230                 :            : double Abulk0_Vdrainp_sourcep;
    3231                 :            : double Abulk0_Vbulk_sourcep;
    3232                 :            : #endif
    3233                 :            : #if defined(_DERIVATE)
    3234                 :            : double tmp1_Vdrainp_sourcep;
    3235                 :            : double tmp1_Vbulk_sourcep;
    3236                 :            : #endif
    3237                 :            : double Rds;
    3238                 :            : #if defined(_DERIVATE)
    3239                 :            : double Rds_Vgate_sourcep;
    3240                 :            : double Rds_Vdrainp_sourcep;
    3241                 :            : double Rds_Vbulk_sourcep;
    3242                 :            : #endif
    3243                 :            : double Weff;
    3244                 :            : #if defined(_DERIVATE)
    3245                 :            : double Weff_Vdrainp_sourcep;
    3246                 :            : double Weff_Vgate_sourcep;
    3247                 :            : double Weff_Vbulk_sourcep;
    3248                 :            : #endif
    3249                 :            : double ExpVgst;
    3250                 :            : #if defined(_DERIVATE)
    3251                 :            : double ExpVgst_Vgate_sourcep;
    3252                 :            : double ExpVgst_Vdrainp_sourcep;
    3253                 :            : double ExpVgst_Vbulk_sourcep;
    3254                 :            : #endif
    3255                 :            : double Vgsteff;
    3256                 :            : #if defined(_DERIVATE)
    3257                 :            : double Vgsteff_Vdrainp_sourcep;
    3258                 :            : double Vgsteff_Vgate_sourcep;
    3259                 :            : double Vgsteff_Vbulk_sourcep;
    3260                 :            : #endif
    3261                 :            : double ExpArg;
    3262                 :            : #if defined(_DERIVATE)
    3263                 :            : double ExpArg_Vdrainp_sourcep;
    3264                 :            : double ExpArg_Vgate_sourcep;
    3265                 :            : double ExpArg_Vbulk_sourcep;
    3266                 :            : #endif
    3267                 :            : double VgstNVt;
    3268                 :            : #if defined(_DERIVATE)
    3269                 :            : double VgstNVt_Vdrainp_sourcep;
    3270                 :            : double VgstNVt_Vgate_sourcep;
    3271                 :            : double VgstNVt_Vbulk_sourcep;
    3272                 :            : #endif
    3273                 :            : double T10;
    3274                 :            : #if defined(_DERIVATE)
    3275                 :            : double T10_Vgate_sourcep;
    3276                 :            : double T10_Vdrainp_sourcep;
    3277                 :            : double T10_Vbulk_sourcep;
    3278                 :            : #endif
    3279                 :            : double Vgst;
    3280                 :            : #if defined(_DERIVATE)
    3281                 :            : double Vgst_Vdrainp_sourcep;
    3282                 :            : double Vgst_Vgate_sourcep;
    3283                 :            : double Vgst_Vbulk_sourcep;
    3284                 :            : #endif
    3285                 :            : double Vgs_eff;
    3286                 :            : #if defined(_DERIVATE)
    3287                 :            : double Vgs_eff_Vdrainp_sourcep;
    3288                 :            : double Vgs_eff_Vgate_sourcep;
    3289                 :            : double Vgs_eff_Vbulk_sourcep;
    3290                 :            : #endif
    3291                 :            : #if defined(_DERIVATE)
    3292                 :            : double T5_Vgate_sourcep;
    3293                 :            : double T5_Vdrainp_sourcep;
    3294                 :            : double T5_Vbulk_sourcep;
    3295                 :            : #endif
    3296                 :            : double T6;
    3297                 :            : #if defined(_DERIVATE)
    3298                 :            : double T6_Vgate_sourcep;
    3299                 :            : double T6_Vdrainp_sourcep;
    3300                 :            : double T6_Vbulk_sourcep;
    3301                 :            : #endif
    3302                 :            : double T7;
    3303                 :            : #if defined(_DERIVATE)
    3304                 :            : double T7_Vgate_sourcep;
    3305                 :            : double T7_Vdrainp_sourcep;
    3306                 :            : double T7_Vbulk_sourcep;
    3307                 :            : #endif
    3308                 :            : double n;
    3309                 :            : #if defined(_DERIVATE)
    3310                 :            : double n_Vdrainp_sourcep;
    3311                 :            : double n_Vbulk_sourcep;
    3312                 :            : #endif
    3313                 :            : double tmp4;
    3314                 :            : #if defined(_DERIVATE)
    3315                 :            : double tmp4_Vgate_sourcep;
    3316                 :            : double tmp4_Vdrainp_sourcep;
    3317                 :            : double tmp4_Vbulk_sourcep;
    3318                 :            : #endif
    3319                 :            : #if defined(_DERIVATE)
    3320                 :            : double tmp3_Vdrainp_sourcep;
    3321                 :            : double tmp3_Vbulk_sourcep;
    3322                 :            : #endif
    3323                 :            : double Vth;
    3324                 :            : #if defined(_DERIVATE)
    3325                 :            : double Vth_Vdrainp_sourcep;
    3326                 :            : double Vth_Vbulk_sourcep;
    3327                 :            : #endif
    3328                 :            : double DIBL_Sft;
    3329                 :            : #if defined(_DERIVATE)
    3330                 :            : double DIBL_Sft_Vdrainp_sourcep;
    3331                 :            : double DIBL_Sft_Vbulk_sourcep;
    3332                 :            : #endif
    3333                 :            : double dDIBL_Sft_dVd;
    3334                 :            : #if defined(_DERIVATE)
    3335                 :            : double dDIBL_Sft_dVd_Vdrainp_sourcep;
    3336                 :            : double dDIBL_Sft_dVd_Vbulk_sourcep;
    3337                 :            : #endif
    3338                 :            : double T9;
    3339                 :            : #if defined(_DERIVATE)
    3340                 :            : double T9_Vgate_sourcep;
    3341                 :            : double T9_Vdrainp_sourcep;
    3342                 :            : double T9_Vbulk_sourcep;
    3343                 :            : #endif
    3344                 :            : #if defined(_DERIVATE)
    3345                 :            : double tmp2_Vgate_sourcep;
    3346                 :            : double tmp2_Vdrainp_sourcep;
    3347                 :            : double tmp2_Vbulk_sourcep;
    3348                 :            : #endif
    3349                 :            : double TempRatio;
    3350                 :            : double Delt_vth;
    3351                 :            : #if defined(_DERIVATE)
    3352                 :            : double Delt_vth_Vdrainp_sourcep;
    3353                 :            : double Delt_vth_Vbulk_sourcep;
    3354                 :            : #endif
    3355                 :            : double thetavth;
    3356                 :            : #if defined(_DERIVATE)
    3357                 :            : double thetavth_Vdrainp_sourcep;
    3358                 :            : double thetavth_Vbulk_sourcep;
    3359                 :            : #endif
    3360                 :            : double Theta0;
    3361                 :            : #if defined(_DERIVATE)
    3362                 :            : double Theta0_Vdrainp_sourcep;
    3363                 :            : double Theta0_Vbulk_sourcep;
    3364                 :            : #endif
    3365                 :            : double ltw;
    3366                 :            : #if defined(_DERIVATE)
    3367                 :            : double ltw_Vdrainp_sourcep;
    3368                 :            : double ltw_Vbulk_sourcep;
    3369                 :            : #endif
    3370                 :            : double lt1;
    3371                 :            : #if defined(_DERIVATE)
    3372                 :            : double lt1_Vdrainp_sourcep;
    3373                 :            : double lt1_Vbulk_sourcep;
    3374                 :            : #endif
    3375                 :            : #if defined(_DERIVATE)
    3376                 :            : double T4_Vgate_sourcep;
    3377                 :            : double T4_Vdrainp_sourcep;
    3378                 :            : double T4_Vbulk_sourcep;
    3379                 :            : #endif
    3380                 :            : #if defined(_DERIVATE)
    3381                 :            : double T2_Vgate_sourcep;
    3382                 :            : double T2_Vdrainp_sourcep;
    3383                 :            : double T2_Vbulk_sourcep;
    3384                 :            : #endif
    3385                 :            : double V0;
    3386                 :            : #if defined(_DERIVATE)
    3387                 :            : double T3_Vgate_sourcep;
    3388                 :            : double T3_Vdrainp_sourcep;
    3389                 :            : double T3_Vbulk_sourcep;
    3390                 :            : #endif
    3391                 :            : double Vtm;
    3392                 :            : double Leff;
    3393                 :            : double Xdep;
    3394                 :            : #if defined(_DERIVATE)
    3395                 :            : double Xdep_Vdrainp_sourcep;
    3396                 :            : double Xdep_Vbulk_sourcep;
    3397                 :            : #endif
    3398                 :            : double sqrtPhis;
    3399                 :            : #if defined(_DERIVATE)
    3400                 :            : double sqrtPhis_Vdrainp_sourcep;
    3401                 :            : double sqrtPhis_Vbulk_sourcep;
    3402                 :            : #endif
    3403                 :            : double Phis;
    3404                 :            : #if defined(_DERIVATE)
    3405                 :            : double Phis_Vdrainp_sourcep;
    3406                 :            : double Phis_Vbulk_sourcep;
    3407                 :            : #endif
    3408                 :            : double Vbseff;
    3409                 :            : #if defined(_DERIVATE)
    3410                 :            : double Vbseff_Vdrainp_sourcep;
    3411                 :            : double Vbseff_Vbulk_sourcep;
    3412                 :            : #endif
    3413                 :            : #if defined(_DERIVATE)
    3414                 :            : double T1_Vgate_sourcep;
    3415                 :            : double T1_Vdrainp_sourcep;
    3416                 :            : double T1_Vbulk_sourcep;
    3417                 :            : #endif
    3418                 :            : double Vbs;
    3419                 :            : #if defined(_DERIVATE)
    3420                 :            : double Vbs_Vdrainp_sourcep;
    3421                 :            : double Vbs_Vbulk_sourcep;
    3422                 :            : #endif
    3423                 :            : double Vgs;
    3424                 :            : #if defined(_DERIVATE)
    3425                 :            : double Vgs_Vdrainp_sourcep;
    3426                 :            : double Vgs_Vgate_sourcep;
    3427                 :            : #endif
    3428                 :            : double Vds;
    3429                 :            : #if defined(_DERIVATE)
    3430                 :            : double Vds_Vdrainp_sourcep;
    3431                 :            : #endif
    3432                 :            : double mode;
    3433                 :            : double evbd;
    3434                 :            : #if defined(_DERIVATE)
    3435                 :            : double evbd_Vbulk_sourcep;
    3436                 :            : double evbd_Vdrainp_sourcep;
    3437                 :            : #endif
    3438                 :            : double cbd;
    3439                 :            : #if defined(_DERIVATE)
    3440                 :            : double cbd_Vbulk_sourcep;
    3441                 :            : double cbd_Vdrainp_sourcep;
    3442                 :            : #endif
    3443                 :            : double gbd;
    3444                 :            : #if defined(_DERIVATE)
    3445                 :            : double gbd_Vbulk_sourcep;
    3446                 :            : double gbd_Vdrainp_sourcep;
    3447                 :            : #endif
    3448                 :            : #if defined(_DERIVATE)
    3449                 :            : double T_0_Vgate_sourcep;
    3450                 :            : double T_0_Vdrainp_sourcep;
    3451                 :            : double T_0_Vbulk_sourcep;
    3452                 :            : #endif
    3453                 :            : double evbs;
    3454                 :            : #if defined(_DERIVATE)
    3455                 :            : double evbs_Vbulk_sourcep;
    3456                 :            : #endif
    3457                 :            : double cbs;
    3458                 :            : #if defined(_DERIVATE)
    3459                 :            : double cbs_Vbulk_sourcep;
    3460                 :            : #endif
    3461                 :            : double gbs;
    3462                 :            : #if defined(_DERIVATE)
    3463                 :            : double gbs_Vbulk_sourcep;
    3464                 :            : #endif
    3465                 :            : double temp;
    3466                 :            : #if defined(_DYNAMIC)
    3467                 :            : double vgb;
    3468                 :            : #if defined(_DERIVATE)
    3469                 :            : double vgb_Vgate_sourcep;
    3470                 :            : double vgb_Vbulk_sourcep;
    3471                 :            : #endif
    3472                 :            : #endif
    3473                 :            : double vgd;
    3474                 :            : #if defined(_DERIVATE)
    3475                 :            : double vgd_Vgate_sourcep;
    3476                 :            : double vgd_Vdrainp_sourcep;
    3477                 :            : #endif
    3478                 :            : double vbd;
    3479                 :            : #if defined(_DERIVATE)
    3480                 :            : double vbd_Vbulk_sourcep;
    3481                 :            : double vbd_Vdrainp_sourcep;
    3482                 :            : #endif
    3483                 :            : double vds;
    3484                 :            : #if defined(_DERIVATE)
    3485                 :            : double vds_Vdrainp_sourcep;
    3486                 :            : #endif
    3487                 :            : double vgs;
    3488                 :            : #if defined(_DERIVATE)
    3489                 :            : double vgs_Vgate_sourcep;
    3490                 :            : #endif
    3491                 :            : double vbs;
    3492                 :            : #if defined(_DERIVATE)
    3493                 :            : double vbs_Vbulk_sourcep;
    3494                 :            : #endif
    3495                 :            : #if defined(_DERIVATE)
    3496                 :          0 : vbs_Vbulk_sourcep=(TYPE);
    3497                 :            : #endif
    3498         [ #  # ]:          0 : vbs=(TYPE*BP(bulk,sourcep));
    3499                 :            : #if defined(_DERIVATE)
    3500                 :          0 : vgs_Vgate_sourcep=(TYPE);
    3501                 :            : #endif
    3502         [ #  # ]:          0 : vgs=(TYPE*BP(gate,sourcep));
    3503                 :            : #if defined(_DERIVATE)
    3504                 :          0 : vds_Vdrainp_sourcep=(TYPE);
    3505                 :            : #endif
    3506         [ #  # ]:          0 : vds=(TYPE*BP(drainp,sourcep));
    3507                 :            : #if defined(_DERIVATE)
    3508                 :          0 : vbd_Vbulk_sourcep=vbs_Vbulk_sourcep;
    3509                 :          0 : vbd_Vdrainp_sourcep=(-vds_Vdrainp_sourcep);
    3510                 :            : #endif
    3511                 :          0 : vbd=(vbs-vds);
    3512                 :            : #if defined(_DERIVATE)
    3513                 :          0 : vgd_Vgate_sourcep=vgs_Vgate_sourcep;
    3514                 :          0 : vgd_Vdrainp_sourcep=(-vds_Vdrainp_sourcep);
    3515                 :            : #endif
    3516                 :          0 : vgd=(vgs-vds);
    3517                 :            : #if defined(_DYNAMIC)
    3518                 :            : #if defined(_DERIVATE)
    3519                 :          0 : vgb_Vgate_sourcep=vgs_Vgate_sourcep;
    3520                 :          0 : vgb_Vbulk_sourcep=(-vbs_Vbulk_sourcep);
    3521                 :            : #endif
    3522                 :          0 : vgb=(vgs-vbs);
    3523                 :            : #endif
    3524                 :          0 : temp=_circuit_temp;
    3525         [ #  # ]:          0 : if
    3526                 :            : (SourceSatCurrent<=0.0)
    3527                 :            : {
    3528                 :            : #if defined(_DERIVATE)
    3529                 :          0 : gbs_Vbulk_sourcep=0.0;
    3530                 :            : #endif
    3531                 :          0 : gbs=GMIN;
    3532                 :            : #if defined(_DERIVATE)
    3533                 :          0 : cbs_Vbulk_sourcep=((gbs_Vbulk_sourcep*vbs)+(gbs*vbs_Vbulk_sourcep));
    3534                 :            : #endif
    3535                 :          0 : cbs=(gbs*vbs);
    3536                 :            : }
    3537                 :            : else
    3538                 :            : {
    3539         [ #  # ]:          0 : if
    3540                 :            : (IJTH==0.0)
    3541                 :            : {
    3542                 :            : {
    3543                 :          0 : double m00_exp(d00_exp0,(vbs/Nvtm))
    3544                 :            : #if defined(_DERIVATE)
    3545                 :            : #define d10_exp0 d00_exp0
    3546                 :            : #endif
    3547                 :            : #if defined(_DERIVATE)
    3548                 :          0 : evbs_Vbulk_sourcep=(vbs_Vbulk_sourcep/Nvtm)*d10_exp0;
    3549                 :            : #endif
    3550                 :          0 : evbs=d00_exp0;
    3551                 :            : }
    3552                 :            : #if defined(_DYNAMIC)
    3553                 :            : #if defined(_DERIVATE)
    3554                 :          0 : gbs_Vbulk_sourcep=((SourceSatCurrent*evbs_Vbulk_sourcep)/Nvtm);
    3555                 :            : #endif
    3556                 :          0 : gbs=(((SourceSatCurrent*evbs)/Nvtm)+GMIN);
    3557                 :            : #endif
    3558                 :            : #if defined(_DERIVATE)
    3559                 :          0 : cbs_Vbulk_sourcep=((SourceSatCurrent*evbs_Vbulk_sourcep)+(GMIN*vbs_Vbulk_sourcep));
    3560                 :            : #endif
    3561                 :          0 : cbs=((SourceSatCurrent*(evbs-1.0))+(GMIN*vbs));
    3562                 :            : }
    3563                 :            : else
    3564                 :            : {
    3565         [ #  # ]:          0 : if
    3566                 :            : (vbs<vjsm)
    3567                 :            : {
    3568                 :            : {
    3569                 :          0 : double m00_exp(d00_exp0,(vbs/Nvtm))
    3570                 :            : #if defined(_DERIVATE)
    3571                 :            : #define d10_exp0 d00_exp0
    3572                 :            : #endif
    3573                 :            : #if defined(_DERIVATE)
    3574                 :          0 : evbs_Vbulk_sourcep=(vbs_Vbulk_sourcep/Nvtm)*d10_exp0;
    3575                 :            : #endif
    3576                 :          0 : evbs=d00_exp0;
    3577                 :            : }
    3578                 :            : #if defined(_DYNAMIC)
    3579                 :            : #if defined(_DERIVATE)
    3580                 :          0 : gbs_Vbulk_sourcep=((SourceSatCurrent*evbs_Vbulk_sourcep)/Nvtm);
    3581                 :            : #endif
    3582                 :          0 : gbs=(((SourceSatCurrent*evbs)/Nvtm)+GMIN);
    3583                 :            : #endif
    3584                 :            : #if defined(_DERIVATE)
    3585                 :          0 : cbs_Vbulk_sourcep=((SourceSatCurrent*evbs_Vbulk_sourcep)+(GMIN*vbs_Vbulk_sourcep));
    3586                 :            : #endif
    3587                 :          0 : cbs=((SourceSatCurrent*(evbs-1.0))+(GMIN*vbs));
    3588                 :            : }
    3589                 :            : else
    3590                 :            : {
    3591         [ #  # ]:          0 : if
    3592                 :            : (VERSION==3.24)
    3593                 :            : {
    3594                 :            : #if defined(_DERIVATE)
    3595                 :          0 : T_0_Vgate_sourcep=0.0;
    3596                 :          0 : T_0_Vdrainp_sourcep=0.0;
    3597                 :          0 : T_0_Vbulk_sourcep=0.0;
    3598                 :            : #endif
    3599                 :          0 : T_0=(IsEvjsm/Nvtm);
    3600                 :            : #if defined(_DERIVATE)
    3601                 :          0 : cbs_Vbulk_sourcep=((GMIN*vbs_Vbulk_sourcep)+((T_0_Vbulk_sourcep*(vbs-vjsm))+(T_0*vbs_Vbulk_sourcep)));
    3602                 :            : #endif
    3603                 :          0 : cbs=(((IsEvjsm-SourceSatCurrent)+(GMIN*vbs))+(T_0*(vbs-vjsm)));
    3604                 :            : }
    3605                 :            : else
    3606                 :            : {
    3607                 :            : #if defined(_DERIVATE)
    3608                 :          0 : T_0_Vgate_sourcep=0.0;
    3609                 :          0 : T_0_Vdrainp_sourcep=0.0;
    3610                 :          0 : T_0_Vbulk_sourcep=0.0;
    3611                 :            : #endif
    3612                 :          0 : T_0=((SourceSatCurrent+IJTH)/Nvtm);
    3613                 :            : #if defined(_DERIVATE)
    3614                 :          0 : cbs_Vbulk_sourcep=((GMIN*vbs_Vbulk_sourcep)+((T_0_Vbulk_sourcep*(vbs-vjsm))+(T_0*vbs_Vbulk_sourcep)));
    3615                 :            : #endif
    3616                 :          0 : cbs=((IJTH+(GMIN*vbs))+(T_0*(vbs-vjsm)));
    3617                 :            : }
    3618                 :            : #if defined(_DYNAMIC)
    3619                 :            : #if defined(_DERIVATE)
    3620                 :          0 : gbs_Vbulk_sourcep=0.0;
    3621                 :            : #endif
    3622                 :          0 : gbs=(T_0+GMIN);
    3623                 :            : #endif
    3624                 :            : }
    3625                 :            : }
    3626                 :            : }
    3627         [ #  # ]:          0 : if
    3628                 :            : (DrainSatCurrent<=0.0)
    3629                 :            : {
    3630                 :            : #if defined(_DERIVATE)
    3631                 :          0 : gbd_Vbulk_sourcep=0.0;
    3632                 :          0 : gbd_Vdrainp_sourcep=0.0;
    3633                 :            : #endif
    3634                 :          0 : gbd=GMIN;
    3635                 :            : #if defined(_DERIVATE)
    3636                 :          0 : cbd_Vbulk_sourcep=((gbd_Vbulk_sourcep*vbd)+(gbd*vbd_Vbulk_sourcep));
    3637                 :          0 : cbd_Vdrainp_sourcep=((gbd_Vdrainp_sourcep*vbd)+(gbd*vbd_Vdrainp_sourcep));
    3638                 :            : #endif
    3639                 :          0 : cbd=(gbd*vbd);
    3640                 :            : }
    3641                 :            : else
    3642                 :            : {
    3643         [ #  # ]:          0 : if
    3644                 :            : (IJTH==0.0)
    3645                 :            : {
    3646                 :            : {
    3647                 :          0 : double m00_exp(d00_exp0,(vbd/Nvtm))
    3648                 :            : #if defined(_DERIVATE)
    3649                 :            : #define d10_exp0 d00_exp0
    3650                 :            : #endif
    3651                 :            : #if defined(_DERIVATE)
    3652                 :          0 : evbd_Vbulk_sourcep=(vbd_Vbulk_sourcep/Nvtm)*d10_exp0;
    3653                 :          0 : evbd_Vdrainp_sourcep=(vbd_Vdrainp_sourcep/Nvtm)*d10_exp0;
    3654                 :            : #endif
    3655                 :          0 : evbd=d00_exp0;
    3656                 :            : }
    3657                 :            : #if defined(_DYNAMIC)
    3658                 :            : #if defined(_DERIVATE)
    3659                 :          0 : gbd_Vbulk_sourcep=((DrainSatCurrent*evbd_Vbulk_sourcep)/Nvtm);
    3660                 :          0 : gbd_Vdrainp_sourcep=((DrainSatCurrent*evbd_Vdrainp_sourcep)/Nvtm);
    3661                 :            : #endif
    3662                 :          0 : gbd=(((DrainSatCurrent*evbd)/Nvtm)+GMIN);
    3663                 :            : #endif
    3664                 :            : #if defined(_DERIVATE)
    3665                 :          0 : cbd_Vbulk_sourcep=((DrainSatCurrent*evbd_Vbulk_sourcep)+(GMIN*vbd_Vbulk_sourcep));
    3666                 :          0 : cbd_Vdrainp_sourcep=((DrainSatCurrent*evbd_Vdrainp_sourcep)+(GMIN*vbd_Vdrainp_sourcep));
    3667                 :            : #endif
    3668                 :          0 : cbd=((DrainSatCurrent*(evbd-1.0))+(GMIN*vbd));
    3669                 :            : }
    3670                 :            : else
    3671                 :            : {
    3672         [ #  # ]:          0 : if
    3673                 :            : (vbd<vjdm)
    3674                 :            : {
    3675                 :            : {
    3676                 :          0 : double m00_exp(d00_exp0,(vbd/Nvtm))
    3677                 :            : #if defined(_DERIVATE)
    3678                 :            : #define d10_exp0 d00_exp0
    3679                 :            : #endif
    3680                 :            : #if defined(_DERIVATE)
    3681                 :          0 : evbd_Vbulk_sourcep=(vbd_Vbulk_sourcep/Nvtm)*d10_exp0;
    3682                 :          0 : evbd_Vdrainp_sourcep=(vbd_Vdrainp_sourcep/Nvtm)*d10_exp0;
    3683                 :            : #endif
    3684                 :          0 : evbd=d00_exp0;
    3685                 :            : }
    3686                 :            : #if defined(_DYNAMIC)
    3687                 :            : #if defined(_DERIVATE)
    3688                 :          0 : gbd_Vbulk_sourcep=((DrainSatCurrent*evbd_Vbulk_sourcep)/Nvtm);
    3689                 :          0 : gbd_Vdrainp_sourcep=((DrainSatCurrent*evbd_Vdrainp_sourcep)/Nvtm);
    3690                 :            : #endif
    3691                 :          0 : gbd=(((DrainSatCurrent*evbd)/Nvtm)+GMIN);
    3692                 :            : #endif
    3693                 :            : #if defined(_DERIVATE)
    3694                 :          0 : cbd_Vbulk_sourcep=((DrainSatCurrent*evbd_Vbulk_sourcep)+(GMIN*vbd_Vbulk_sourcep));
    3695                 :          0 : cbd_Vdrainp_sourcep=((DrainSatCurrent*evbd_Vdrainp_sourcep)+(GMIN*vbd_Vdrainp_sourcep));
    3696                 :            : #endif
    3697                 :          0 : cbd=((DrainSatCurrent*(evbd-1.0))+(GMIN*vbd));
    3698                 :            : }
    3699                 :            : else
    3700                 :            : {
    3701         [ #  # ]:          0 : if
    3702                 :            : (VERSION==3.24)
    3703                 :            : {
    3704                 :            : #if defined(_DERIVATE)
    3705                 :          0 : T_0_Vgate_sourcep=0.0;
    3706                 :          0 : T_0_Vdrainp_sourcep=0.0;
    3707                 :          0 : T_0_Vbulk_sourcep=0.0;
    3708                 :            : #endif
    3709                 :          0 : T_0=(IsEvjdm/Nvtm);
    3710                 :            : #if defined(_DERIVATE)
    3711                 :          0 : cbd_Vbulk_sourcep=((GMIN*vbd_Vbulk_sourcep)+((T_0_Vbulk_sourcep*(vbd-vjdm))+(T_0*vbd_Vbulk_sourcep)));
    3712                 :          0 : cbd_Vdrainp_sourcep=((GMIN*vbd_Vdrainp_sourcep)+((T_0_Vdrainp_sourcep*(vbd-vjdm))+(T_0*vbd_Vdrainp_sourcep)));
    3713                 :            : #endif
    3714                 :          0 : cbd=(((IsEvjdm-DrainSatCurrent)+(GMIN*vbd))+(T_0*(vbd-vjdm)));
    3715                 :            : }
    3716                 :            : else
    3717                 :            : {
    3718                 :            : #if defined(_DERIVATE)
    3719                 :          0 : T_0_Vgate_sourcep=0.0;
    3720                 :          0 : T_0_Vdrainp_sourcep=0.0;
    3721                 :          0 : T_0_Vbulk_sourcep=0.0;
    3722                 :            : #endif
    3723                 :          0 : T_0=((DrainSatCurrent+IJTH)/Nvtm);
    3724                 :            : #if defined(_DERIVATE)
    3725                 :          0 : cbd_Vbulk_sourcep=((GMIN*vbd_Vbulk_sourcep)+((T_0_Vbulk_sourcep*(vbd-vjdm))+(T_0*vbd_Vbulk_sourcep)));
    3726                 :          0 : cbd_Vdrainp_sourcep=((GMIN*vbd_Vdrainp_sourcep)+((T_0_Vdrainp_sourcep*(vbd-vjdm))+(T_0*vbd_Vdrainp_sourcep)));
    3727                 :            : #endif
    3728                 :          0 : cbd=((IJTH+(GMIN*vbd))+(T_0*(vbd-vjdm)));
    3729                 :            : }
    3730                 :            : #if defined(_DYNAMIC)
    3731                 :            : #if defined(_DERIVATE)
    3732                 :          0 : gbd_Vbulk_sourcep=0.0;
    3733                 :          0 : gbd_Vdrainp_sourcep=0.0;
    3734                 :            : #endif
    3735                 :          0 : gbd=(T_0+GMIN);
    3736                 :            : #endif
    3737                 :            : }
    3738                 :            : }
    3739                 :            : }
    3740         [ #  # ]:          0 : if
    3741                 :            : (vds>=0.0)
    3742                 :            : {
    3743                 :          0 : mode=1;
    3744                 :            : #if defined(_DERIVATE)
    3745                 :          0 : Vds_Vdrainp_sourcep=vds_Vdrainp_sourcep;
    3746                 :            : #endif
    3747                 :          0 : Vds=vds;
    3748                 :            : #if defined(_DERIVATE)
    3749                 :          0 : Vgs_Vdrainp_sourcep=0.0;
    3750                 :          0 : Vgs_Vgate_sourcep=vgs_Vgate_sourcep;
    3751                 :            : #endif
    3752                 :          0 : Vgs=vgs;
    3753                 :            : #if defined(_DERIVATE)
    3754                 :          0 : Vbs_Vdrainp_sourcep=0.0;
    3755                 :          0 : Vbs_Vbulk_sourcep=vbs_Vbulk_sourcep;
    3756                 :            : #endif
    3757                 :          0 : Vbs=vbs;
    3758                 :            : }
    3759                 :            : else
    3760                 :            : {
    3761                 :          0 : mode=(-1);
    3762                 :            : #if defined(_DERIVATE)
    3763                 :          0 : Vds_Vdrainp_sourcep=(-vds_Vdrainp_sourcep);
    3764                 :            : #endif
    3765                 :          0 : Vds=(-vds);
    3766                 :            : #if defined(_DERIVATE)
    3767                 :          0 : Vgs_Vdrainp_sourcep=vgd_Vdrainp_sourcep;
    3768                 :          0 : Vgs_Vgate_sourcep=vgd_Vgate_sourcep;
    3769                 :            : #endif
    3770                 :          0 : Vgs=vgd;
    3771                 :            : #if defined(_DERIVATE)
    3772                 :          0 : Vbs_Vdrainp_sourcep=vbd_Vdrainp_sourcep;
    3773                 :          0 : Vbs_Vbulk_sourcep=vbd_Vbulk_sourcep;
    3774                 :            : #endif
    3775                 :          0 : Vbs=vbd;
    3776                 :            : }
    3777                 :            : #if defined(_DERIVATE)
    3778                 :          0 : T_0_Vgate_sourcep=0.0;
    3779                 :          0 : T_0_Vdrainp_sourcep=Vbs_Vdrainp_sourcep;
    3780                 :          0 : T_0_Vbulk_sourcep=Vbs_Vbulk_sourcep;
    3781                 :            : #endif
    3782                 :          0 : T_0=((Vbs-vbsc)-0.001);
    3783                 :            : {
    3784                 :          0 : double m00_sqrt(d00_sqrt0,((T_0*T_0)-(0.004*vbsc)))
    3785                 :            : #if defined(_DERIVATE)
    3786                 :          0 : double m10_sqrt(d10_sqrt0,d00_sqrt0,((T_0*T_0)-(0.004*vbsc)))
    3787                 :            : #endif
    3788                 :            : #if defined(_DERIVATE)
    3789                 :          0 : T1_Vgate_sourcep=0.0;
    3790                 :          0 : T1_Vdrainp_sourcep=((T_0_Vdrainp_sourcep*T_0)+(T_0*T_0_Vdrainp_sourcep))*d10_sqrt0;
    3791                 :          0 : T1_Vbulk_sourcep=((T_0_Vbulk_sourcep*T_0)+(T_0*T_0_Vbulk_sourcep))*d10_sqrt0;
    3792                 :            : #endif
    3793                 :          0 : T1=d00_sqrt0;
    3794                 :            : }
    3795                 :            : #if defined(_DERIVATE)
    3796                 :          0 : Vbseff_Vdrainp_sourcep=(0.5*(T_0_Vdrainp_sourcep+T1_Vdrainp_sourcep));
    3797                 :          0 : Vbseff_Vbulk_sourcep=(0.5*(T_0_Vbulk_sourcep+T1_Vbulk_sourcep));
    3798                 :            : #endif
    3799                 :          0 : Vbseff=(vbsc+(0.5*(T_0+T1)));
    3800         [ #  # ]:          0 : if
    3801                 :            : (Vbseff<Vbs)
    3802                 :            : {
    3803                 :            : #if defined(_DERIVATE)
    3804                 :          0 : Vbseff_Vdrainp_sourcep=Vbs_Vdrainp_sourcep;
    3805                 :          0 : Vbseff_Vbulk_sourcep=Vbs_Vbulk_sourcep;
    3806                 :            : #endif
    3807                 :          0 : Vbseff=Vbs;
    3808                 :            : }
    3809         [ #  # ]:          0 : if
    3810                 :            : (Vbseff>0.0)
    3811                 :            : {
    3812                 :            : #if defined(_DERIVATE)
    3813                 :          0 : T_0_Vgate_sourcep=0.0;
    3814                 :          0 : T_0_Vdrainp_sourcep=(-phi*Vbseff_Vdrainp_sourcep/(phi+Vbseff)/(phi+Vbseff));
    3815                 :          0 : T_0_Vbulk_sourcep=(-phi*Vbseff_Vbulk_sourcep/(phi+Vbseff)/(phi+Vbseff));
    3816                 :            : #endif
    3817                 :          0 : T_0=(phi/(phi+Vbseff));
    3818                 :            : #if defined(_DERIVATE)
    3819                 :          0 : Phis_Vdrainp_sourcep=(phi*T_0_Vdrainp_sourcep);
    3820                 :          0 : Phis_Vbulk_sourcep=(phi*T_0_Vbulk_sourcep);
    3821                 :            : #endif
    3822                 :          0 : Phis=(phi*T_0);
    3823                 :            : #if defined(_DERIVATE)
    3824                 :          0 : sqrtPhis_Vdrainp_sourcep=(-phis3*(0.5*Vbseff_Vdrainp_sourcep)/(phi+(0.5*Vbseff))/(phi+(0.5*Vbseff)));
    3825                 :          0 : sqrtPhis_Vbulk_sourcep=(-phis3*(0.5*Vbseff_Vbulk_sourcep)/(phi+(0.5*Vbseff))/(phi+(0.5*Vbseff)));
    3826                 :            : #endif
    3827                 :          0 : sqrtPhis=(phis3/(phi+(0.5*Vbseff)));
    3828                 :            : }
    3829                 :            : else
    3830                 :            : {
    3831                 :            : #if defined(_DERIVATE)
    3832                 :          0 : Phis_Vdrainp_sourcep=(-Vbseff_Vdrainp_sourcep);
    3833                 :          0 : Phis_Vbulk_sourcep=(-Vbseff_Vbulk_sourcep);
    3834                 :            : #endif
    3835                 :          0 : Phis=(phi-Vbseff);
    3836                 :            : {
    3837                 :          0 : double m00_sqrt(d00_sqrt0,Phis)
    3838                 :            : #if defined(_DERIVATE)
    3839                 :          0 : double m10_sqrt(d10_sqrt0,d00_sqrt0,Phis)
    3840                 :            : #endif
    3841                 :            : #if defined(_DERIVATE)
    3842                 :          0 : sqrtPhis_Vdrainp_sourcep=Phis_Vdrainp_sourcep*d10_sqrt0;
    3843                 :          0 : sqrtPhis_Vbulk_sourcep=Phis_Vbulk_sourcep*d10_sqrt0;
    3844                 :            : #endif
    3845                 :          0 : sqrtPhis=d00_sqrt0;
    3846                 :            : }
    3847                 :            : }
    3848                 :            : #if defined(_DERIVATE)
    3849                 :          0 : Xdep_Vdrainp_sourcep=((Xdep0*sqrtPhis_Vdrainp_sourcep)/sqrtPhi);
    3850                 :          0 : Xdep_Vbulk_sourcep=((Xdep0*sqrtPhis_Vbulk_sourcep)/sqrtPhi);
    3851                 :            : #endif
    3852                 :          0 : Xdep=((Xdep0*sqrtPhis)/sqrtPhi);
    3853                 :          0 : Leff=leff;
    3854                 :          0 : Vtm=vtm;
    3855                 :            : {
    3856                 :          0 : double m00_sqrt(d00_sqrt0,Xdep)
    3857                 :            : #if defined(_DERIVATE)
    3858                 :          0 : double m10_sqrt(d10_sqrt0,d00_sqrt0,Xdep)
    3859                 :            : #endif
    3860                 :            : #if defined(_DERIVATE)
    3861                 :          0 : T3_Vgate_sourcep=0.0;
    3862                 :          0 : T3_Vdrainp_sourcep=Xdep_Vdrainp_sourcep*d10_sqrt0;
    3863                 :          0 : T3_Vbulk_sourcep=Xdep_Vbulk_sourcep*d10_sqrt0;
    3864                 :            : #endif
    3865                 :          0 : T3=d00_sqrt0;
    3866                 :            : }
    3867                 :          0 : V0=(vbi-phi);
    3868                 :            : #if defined(_DERIVATE)
    3869                 :          0 : T_0_Vgate_sourcep=0.0;
    3870                 :          0 : T_0_Vdrainp_sourcep=(dvt2*Vbseff_Vdrainp_sourcep);
    3871                 :          0 : T_0_Vbulk_sourcep=(dvt2*Vbseff_Vbulk_sourcep);
    3872                 :            : #endif
    3873                 :          0 : T_0=(dvt2*Vbseff);
    3874         [ #  # ]:          0 : if
    3875                 :            : (T_0>=(-0.5))
    3876                 :            : {
    3877                 :            : #if defined(_DERIVATE)
    3878                 :          0 : T1_Vgate_sourcep=0.0;
    3879                 :          0 : T1_Vdrainp_sourcep=T_0_Vdrainp_sourcep;
    3880                 :          0 : T1_Vbulk_sourcep=T_0_Vbulk_sourcep;
    3881                 :            : #endif
    3882                 :          0 : T1=(1.0+T_0);
    3883                 :            : #if defined(_DERIVATE)
    3884                 :          0 : T2_Vgate_sourcep=0.0;
    3885                 :          0 : T2_Vdrainp_sourcep=0.0;
    3886                 :          0 : T2_Vbulk_sourcep=0.0;
    3887                 :            : #endif
    3888                 :          0 : T2=dvt2;
    3889                 :            : }
    3890                 :            : else
    3891                 :            : {
    3892                 :            : #if defined(_DERIVATE)
    3893                 :          0 : T4_Vgate_sourcep=0.0;
    3894                 :          0 : T4_Vdrainp_sourcep=(-(8.0*T_0_Vdrainp_sourcep)/(3.0+(8.0*T_0))/(3.0+(8.0*T_0)));
    3895                 :          0 : T4_Vbulk_sourcep=(-(8.0*T_0_Vbulk_sourcep)/(3.0+(8.0*T_0))/(3.0+(8.0*T_0)));
    3896                 :            : #endif
    3897                 :          0 : T4=(1.0/(3.0+(8.0*T_0)));
    3898                 :            : #if defined(_DERIVATE)
    3899                 :          0 : T1_Vgate_sourcep=0.0;
    3900                 :          0 : T1_Vdrainp_sourcep=(((3.0*T_0_Vdrainp_sourcep)*T4)+((1.0+(3.0*T_0))*T4_Vdrainp_sourcep));
    3901                 :          0 : T1_Vbulk_sourcep=(((3.0*T_0_Vbulk_sourcep)*T4)+((1.0+(3.0*T_0))*T4_Vbulk_sourcep));
    3902                 :            : #endif
    3903                 :          0 : T1=((1.0+(3.0*T_0))*T4);
    3904                 :            : #if defined(_DERIVATE)
    3905                 :          0 : T2_Vgate_sourcep=0.0;
    3906                 :          0 : T2_Vdrainp_sourcep=(((dvt2*T4_Vdrainp_sourcep)*T4)+((dvt2*T4)*T4_Vdrainp_sourcep));
    3907                 :          0 : T2_Vbulk_sourcep=(((dvt2*T4_Vbulk_sourcep)*T4)+((dvt2*T4)*T4_Vbulk_sourcep));
    3908                 :            : #endif
    3909                 :          0 : T2=((dvt2*T4)*T4);
    3910                 :            : }
    3911                 :            : #if defined(_DERIVATE)
    3912                 :          0 : lt1_Vdrainp_sourcep=(((factor1*T3_Vdrainp_sourcep)*T1)+((factor1*T3)*T1_Vdrainp_sourcep));
    3913                 :          0 : lt1_Vbulk_sourcep=(((factor1*T3_Vbulk_sourcep)*T1)+((factor1*T3)*T1_Vbulk_sourcep));
    3914                 :            : #endif
    3915                 :          0 : lt1=((factor1*T3)*T1);
    3916                 :            : #if defined(_DERIVATE)
    3917                 :          0 : T_0_Vgate_sourcep=0.0;
    3918                 :          0 : T_0_Vdrainp_sourcep=(dvt2w*Vbseff_Vdrainp_sourcep);
    3919                 :          0 : T_0_Vbulk_sourcep=(dvt2w*Vbseff_Vbulk_sourcep);
    3920                 :            : #endif
    3921                 :          0 : T_0=(dvt2w*Vbseff);
    3922         [ #  # ]:          0 : if
    3923                 :            : (T_0>=(-0.5))
    3924                 :            : {
    3925                 :            : #if defined(_DERIVATE)
    3926                 :          0 : T1_Vgate_sourcep=0.0;
    3927                 :          0 : T1_Vdrainp_sourcep=T_0_Vdrainp_sourcep;
    3928                 :          0 : T1_Vbulk_sourcep=T_0_Vbulk_sourcep;
    3929                 :            : #endif
    3930                 :          0 : T1=(1.0+T_0);
    3931                 :            : #if defined(_DERIVATE)
    3932                 :          0 : T2_Vgate_sourcep=0.0;
    3933                 :          0 : T2_Vdrainp_sourcep=0.0;
    3934                 :          0 : T2_Vbulk_sourcep=0.0;
    3935                 :            : #endif
    3936                 :          0 : T2=dvt2w;
    3937                 :            : }
    3938                 :            : else
    3939                 :            : {
    3940                 :            : #if defined(_DERIVATE)
    3941                 :          0 : T4_Vgate_sourcep=0.0;
    3942                 :          0 : T4_Vdrainp_sourcep=(-(8.0*T_0_Vdrainp_sourcep)/(3.0+(8.0*T_0))/(3.0+(8.0*T_0)));
    3943                 :          0 : T4_Vbulk_sourcep=(-(8.0*T_0_Vbulk_sourcep)/(3.0+(8.0*T_0))/(3.0+(8.0*T_0)));
    3944                 :            : #endif
    3945                 :          0 : T4=(1.0/(3.0+(8.0*T_0)));
    3946                 :            : #if defined(_DERIVATE)
    3947                 :          0 : T1_Vgate_sourcep=0.0;
    3948                 :          0 : T1_Vdrainp_sourcep=(((3.0*T_0_Vdrainp_sourcep)*T4)+((1.0+(3.0*T_0))*T4_Vdrainp_sourcep));
    3949                 :          0 : T1_Vbulk_sourcep=(((3.0*T_0_Vbulk_sourcep)*T4)+((1.0+(3.0*T_0))*T4_Vbulk_sourcep));
    3950                 :            : #endif
    3951                 :          0 : T1=((1.0+(3.0*T_0))*T4);
    3952                 :            : #if defined(_DERIVATE)
    3953                 :          0 : T2_Vgate_sourcep=0.0;
    3954                 :          0 : T2_Vdrainp_sourcep=(((dvt2w*T4_Vdrainp_sourcep)*T4)+((dvt2w*T4)*T4_Vdrainp_sourcep));
    3955                 :          0 : T2_Vbulk_sourcep=(((dvt2w*T4_Vbulk_sourcep)*T4)+((dvt2w*T4)*T4_Vbulk_sourcep));
    3956                 :            : #endif
    3957                 :          0 : T2=((dvt2w*T4)*T4);
    3958                 :            : }
    3959                 :            : #if defined(_DERIVATE)
    3960                 :          0 : ltw_Vdrainp_sourcep=(((factor1*T3_Vdrainp_sourcep)*T1)+((factor1*T3)*T1_Vdrainp_sourcep));
    3961                 :          0 : ltw_Vbulk_sourcep=(((factor1*T3_Vbulk_sourcep)*T1)+((factor1*T3)*T1_Vbulk_sourcep));
    3962                 :            : #endif
    3963                 :          0 : ltw=((factor1*T3)*T1);
    3964                 :            : #if defined(_DERIVATE)
    3965                 :          0 : T_0_Vgate_sourcep=0.0;
    3966                 :          0 : T_0_Vdrainp_sourcep=(-(((-0.5)*dvt1)*Leff)*lt1_Vdrainp_sourcep/lt1/lt1);
    3967                 :          0 : T_0_Vbulk_sourcep=(-(((-0.5)*dvt1)*Leff)*lt1_Vbulk_sourcep/lt1/lt1);
    3968                 :            : #endif
    3969                 :          0 : T_0=((((-0.5)*dvt1)*Leff)/lt1);
    3970         [ #  # ]:          0 : if
    3971                 :            : (T_0>(-34.0))
    3972                 :            : {
    3973                 :            : {
    3974                 :          0 : double m00_exp(d00_exp0,T_0)
    3975                 :            : #if defined(_DERIVATE)
    3976                 :            : #define d10_exp0 d00_exp0
    3977                 :            : #endif
    3978                 :            : #if defined(_DERIVATE)
    3979                 :          0 : T1_Vgate_sourcep=0.0;
    3980                 :          0 : T1_Vdrainp_sourcep=T_0_Vdrainp_sourcep*d10_exp0;
    3981                 :          0 : T1_Vbulk_sourcep=T_0_Vbulk_sourcep*d10_exp0;
    3982                 :            : #endif
    3983                 :          0 : T1=d00_exp0;
    3984                 :            : }
    3985                 :            : #if defined(_DERIVATE)
    3986                 :          0 : Theta0_Vdrainp_sourcep=((T1_Vdrainp_sourcep*(1.0+(2.0*T1)))+(T1*(2.0*T1_Vdrainp_sourcep)));
    3987                 :          0 : Theta0_Vbulk_sourcep=((T1_Vbulk_sourcep*(1.0+(2.0*T1)))+(T1*(2.0*T1_Vbulk_sourcep)));
    3988                 :            : #endif
    3989                 :          0 : Theta0=(T1*(1.0+(2.0*T1)));
    3990                 :            : }
    3991                 :            : else
    3992                 :            : {
    3993                 :            : #if defined(_DERIVATE)
    3994                 :          0 : T1_Vgate_sourcep=0.0;
    3995                 :          0 : T1_Vdrainp_sourcep=0.0;
    3996                 :          0 : T1_Vbulk_sourcep=0.0;
    3997                 :            : #endif
    3998                 :          0 : T1=1.713908431e-15;
    3999                 :            : #if defined(_DERIVATE)
    4000                 :          0 : Theta0_Vdrainp_sourcep=((T1_Vdrainp_sourcep*(1.0+(2.0*T1)))+(T1*(2.0*T1_Vdrainp_sourcep)));
    4001                 :          0 : Theta0_Vbulk_sourcep=((T1_Vbulk_sourcep*(1.0+(2.0*T1)))+(T1*(2.0*T1_Vbulk_sourcep)));
    4002                 :            : #endif
    4003                 :          0 : Theta0=(T1*(1.0+(2.0*T1)));
    4004                 :            : }
    4005                 :            : #if defined(_DERIVATE)
    4006                 :          0 : thetavth_Vdrainp_sourcep=(dvt0*Theta0_Vdrainp_sourcep);
    4007                 :          0 : thetavth_Vbulk_sourcep=(dvt0*Theta0_Vbulk_sourcep);
    4008                 :            : #endif
    4009                 :          0 : thetavth=(dvt0*Theta0);
    4010                 :            : #if defined(_DERIVATE)
    4011                 :          0 : Delt_vth_Vdrainp_sourcep=thetavth_Vdrainp_sourcep*V0;
    4012                 :          0 : Delt_vth_Vbulk_sourcep=thetavth_Vbulk_sourcep*V0;
    4013                 :            : #endif
    4014                 :          0 : Delt_vth=(thetavth*V0);
    4015                 :            : #if defined(_DERIVATE)
    4016                 :          0 : T_0_Vgate_sourcep=0.0;
    4017                 :          0 : T_0_Vdrainp_sourcep=(-((((-0.5)*dvt1w)*weff)*Leff)*ltw_Vdrainp_sourcep/ltw/ltw);
    4018                 :          0 : T_0_Vbulk_sourcep=(-((((-0.5)*dvt1w)*weff)*Leff)*ltw_Vbulk_sourcep/ltw/ltw);
    4019                 :            : #endif
    4020                 :          0 : T_0=(((((-0.5)*dvt1w)*weff)*Leff)/ltw);
    4021         [ #  # ]:          0 : if
    4022                 :            : (T_0>(-34.0))
    4023                 :            : {
    4024                 :            : {
    4025                 :          0 : double m00_exp(d00_exp0,T_0)
    4026                 :            : #if defined(_DERIVATE)
    4027                 :            : #define d10_exp0 d00_exp0
    4028                 :            : #endif
    4029                 :            : #if defined(_DERIVATE)
    4030                 :          0 : T1_Vgate_sourcep=0.0;
    4031                 :          0 : T1_Vdrainp_sourcep=T_0_Vdrainp_sourcep*d10_exp0;
    4032                 :          0 : T1_Vbulk_sourcep=T_0_Vbulk_sourcep*d10_exp0;
    4033                 :            : #endif
    4034                 :          0 : T1=d00_exp0;
    4035                 :            : }
    4036                 :            : #if defined(_DERIVATE)
    4037                 :          0 : T2_Vgate_sourcep=0.0;
    4038                 :          0 : T2_Vdrainp_sourcep=((T1_Vdrainp_sourcep*(1.0+(2.0*T1)))+(T1*(2.0*T1_Vdrainp_sourcep)));
    4039                 :          0 : T2_Vbulk_sourcep=((T1_Vbulk_sourcep*(1.0+(2.0*T1)))+(T1*(2.0*T1_Vbulk_sourcep)));
    4040                 :            : #endif
    4041                 :          0 : T2=(T1*(1.0+(2.0*T1)));
    4042                 :            : }
    4043                 :            : else
    4044                 :            : {
    4045                 :            : #if defined(_DERIVATE)
    4046                 :          0 : T1_Vgate_sourcep=0.0;
    4047                 :          0 : T1_Vdrainp_sourcep=0.0;
    4048                 :          0 : T1_Vbulk_sourcep=0.0;
    4049                 :            : #endif
    4050                 :          0 : T1=1.713908431e-15;
    4051                 :            : #if defined(_DERIVATE)
    4052                 :          0 : T2_Vgate_sourcep=0.0;
    4053                 :          0 : T2_Vdrainp_sourcep=((T1_Vdrainp_sourcep*(1.0+(2.0*T1)))+(T1*(2.0*T1_Vdrainp_sourcep)));
    4054                 :          0 : T2_Vbulk_sourcep=((T1_Vbulk_sourcep*(1.0+(2.0*T1)))+(T1*(2.0*T1_Vbulk_sourcep)));
    4055                 :            : #endif
    4056                 :          0 : T2=(T1*(1.0+(2.0*T1)));
    4057                 :            : }
    4058                 :            : #if defined(_DERIVATE)
    4059                 :          0 : T_0_Vgate_sourcep=0.0;
    4060                 :          0 : T_0_Vdrainp_sourcep=(dvt0w*T2_Vdrainp_sourcep);
    4061                 :          0 : T_0_Vbulk_sourcep=(dvt0w*T2_Vbulk_sourcep);
    4062                 :            : #endif
    4063                 :          0 : T_0=(dvt0w*T2);
    4064                 :            : #if defined(_DERIVATE)
    4065                 :          0 : T2_Vgate_sourcep=0.0;
    4066                 :          0 : T2_Vdrainp_sourcep=T_0_Vdrainp_sourcep*V0;
    4067                 :          0 : T2_Vbulk_sourcep=T_0_Vbulk_sourcep*V0;
    4068                 :            : #endif
    4069                 :          0 : T2=(T_0*V0);
    4070                 :          0 : TempRatio=((temp/tnom)-1.0);
    4071                 :            : {
    4072                 :          0 : double m00_sqrt(d00_sqrt0,(1.0+(nlx/Leff)))
    4073                 :            : #if defined(_DERIVATE)
    4074                 :          0 : T_0_Vgate_sourcep=0.0;
    4075                 :          0 : T_0_Vdrainp_sourcep=0.0;
    4076                 :          0 : T_0_Vbulk_sourcep=0.0;
    4077                 :            : #endif
    4078                 :          0 : T_0=d00_sqrt0;
    4079                 :            : }
    4080                 :            : #if defined(_DERIVATE)
    4081                 :          0 : T1_Vgate_sourcep=0.0;
    4082                 :          0 : T1_Vdrainp_sourcep=((k1ox*T_0_Vdrainp_sourcep)*sqrtPhi+(kt2*Vbseff_Vdrainp_sourcep)*TempRatio);
    4083                 :          0 : T1_Vbulk_sourcep=((k1ox*T_0_Vbulk_sourcep)*sqrtPhi+(kt2*Vbseff_Vbulk_sourcep)*TempRatio);
    4084                 :            : #endif
    4085                 :          0 : T1=(((k1ox*(T_0-1.0))*sqrtPhi)+(((kt1+(kt1l/Leff))+(kt2*Vbseff))*TempRatio));
    4086                 :            : #if defined(_DERIVATE)
    4087                 :          0 : tmp2_Vgate_sourcep=0.0;
    4088                 :          0 : tmp2_Vdrainp_sourcep=0.0;
    4089                 :          0 : tmp2_Vbulk_sourcep=0.0;
    4090                 :            : #endif
    4091                 :          0 : tmp2=((tox*phi)/(weff+w0));
    4092                 :            : #if defined(_DERIVATE)
    4093                 :          0 : T3_Vgate_sourcep=0.0;
    4094                 :          0 : T3_Vdrainp_sourcep=(etab*Vbseff_Vdrainp_sourcep);
    4095                 :          0 : T3_Vbulk_sourcep=(etab*Vbseff_Vbulk_sourcep);
    4096                 :            : #endif
    4097                 :          0 : T3=(eta0+(etab*Vbseff));
    4098         [ #  # ]:          0 : if
    4099                 :            : (T3<1.0e-4)
    4100                 :            : {
    4101                 :            : #if defined(_DERIVATE)
    4102                 :          0 : T9_Vgate_sourcep=0.0;
    4103                 :          0 : T9_Vdrainp_sourcep=(-(-(2.0e4*T3_Vdrainp_sourcep))/(3.0-(2.0e4*T3))/(3.0-(2.0e4*T3)));
    4104                 :          0 : T9_Vbulk_sourcep=(-(-(2.0e4*T3_Vbulk_sourcep))/(3.0-(2.0e4*T3))/(3.0-(2.0e4*T3)));
    4105                 :            : #endif
    4106                 :          0 : T9=(1.0/(3.0-(2.0e4*T3)));
    4107                 :            : #if defined(_DERIVATE)
    4108                 :          0 : T3_Vgate_sourcep=0.0;
    4109                 :          0 : T3_Vdrainp_sourcep=(((-T3_Vdrainp_sourcep)*T9)+((2.0e-4-T3)*T9_Vdrainp_sourcep));
    4110                 :          0 : T3_Vbulk_sourcep=(((-T3_Vbulk_sourcep)*T9)+((2.0e-4-T3)*T9_Vbulk_sourcep));
    4111                 :            : #endif
    4112                 :          0 : T3=((2.0e-4-T3)*T9);
    4113                 :            : #if defined(_DERIVATE)
    4114                 :          0 : T4_Vgate_sourcep=0.0;
    4115                 :          0 : T4_Vdrainp_sourcep=((T9_Vdrainp_sourcep*T9)+(T9*T9_Vdrainp_sourcep));
    4116                 :          0 : T4_Vbulk_sourcep=((T9_Vbulk_sourcep*T9)+(T9*T9_Vbulk_sourcep));
    4117                 :            : #endif
    4118                 :          0 : T4=(T9*T9);
    4119                 :            : }
    4120                 :            : else
    4121                 :            : {
    4122                 :            : #if defined(_DERIVATE)
    4123                 :          0 : T4_Vgate_sourcep=0.0;
    4124                 :          0 : T4_Vdrainp_sourcep=0.0;
    4125                 :          0 : T4_Vbulk_sourcep=0.0;
    4126                 :            : #endif
    4127                 :          0 : T4=1.0;
    4128                 :            : }
    4129                 :            : #if defined(_DERIVATE)
    4130                 :          0 : dDIBL_Sft_dVd_Vdrainp_sourcep=T3_Vdrainp_sourcep*theta0vb0;
    4131                 :          0 : dDIBL_Sft_dVd_Vbulk_sourcep=T3_Vbulk_sourcep*theta0vb0;
    4132                 :            : #endif
    4133                 :          0 : dDIBL_Sft_dVd=(T3*theta0vb0);
    4134                 :            : #if defined(_DERIVATE)
    4135                 :          0 : DIBL_Sft_Vdrainp_sourcep=((dDIBL_Sft_dVd_Vdrainp_sourcep*Vds)+(dDIBL_Sft_dVd*Vds_Vdrainp_sourcep));
    4136                 :          0 : DIBL_Sft_Vbulk_sourcep=dDIBL_Sft_dVd_Vbulk_sourcep*Vds;
    4137                 :            : #endif
    4138                 :          0 : DIBL_Sft=(dDIBL_Sft_dVd*Vds);
    4139                 :            : #if defined(_DERIVATE)
    4140                 :          0 : Vth_Vdrainp_sourcep=(((((((k1ox*sqrtPhis_Vdrainp_sourcep)-(k2ox*Vbseff_Vdrainp_sourcep))-Delt_vth_Vdrainp_sourcep)-T2_Vdrainp_sourcep)+(((k3b*Vbseff_Vdrainp_sourcep)*tmp2)+((k3+(k3b*Vbseff))*tmp2_Vdrainp_sourcep)))+T1_Vdrainp_sourcep)-DIBL_Sft_Vdrainp_sourcep);
    4141                 :          0 : Vth_Vbulk_sourcep=(((((((k1ox*sqrtPhis_Vbulk_sourcep)-(k2ox*Vbseff_Vbulk_sourcep))-Delt_vth_Vbulk_sourcep)-T2_Vbulk_sourcep)+(((k3b*Vbseff_Vbulk_sourcep)*tmp2)+((k3+(k3b*Vbseff))*tmp2_Vbulk_sourcep)))+T1_Vbulk_sourcep)-DIBL_Sft_Vbulk_sourcep);
    4142                 :            : #endif
    4143                 :          0 : Vth=(((((((((TYPE*vth0)-(k1*sqrtPhi))+(k1ox*sqrtPhis))-(k2ox*Vbseff))-Delt_vth)-T2)+((k3+(k3b*Vbseff))*tmp2))+T1)-DIBL_Sft);
    4144                 :            : #if defined(_DERIVATE)
    4145                 :          0 : tmp2_Vgate_sourcep=0.0;
    4146                 :          0 : tmp2_Vdrainp_sourcep=(-(nfactor*1.03594e-10)*Xdep_Vdrainp_sourcep/Xdep/Xdep);
    4147                 :          0 : tmp2_Vbulk_sourcep=(-(nfactor*1.03594e-10)*Xdep_Vbulk_sourcep/Xdep/Xdep);
    4148                 :            : #endif
    4149                 :          0 : tmp2=((nfactor*1.03594e-10)/Xdep);
    4150                 :            : #if defined(_DERIVATE)
    4151                 :          0 : tmp3_Vdrainp_sourcep=((cdscb*Vbseff_Vdrainp_sourcep)+(cdscd*Vds_Vdrainp_sourcep));
    4152                 :          0 : tmp3_Vbulk_sourcep=(cdscb*Vbseff_Vbulk_sourcep);
    4153                 :            : #endif
    4154                 :          0 : tmp3=((cdsc+(cdscb*Vbseff))+(cdscd*Vds));
    4155                 :            : #if defined(_DERIVATE)
    4156                 :          0 : tmp4_Vgate_sourcep=0.0;
    4157                 :          0 : tmp4_Vdrainp_sourcep=((tmp2_Vdrainp_sourcep+((tmp3_Vdrainp_sourcep*Theta0)+(tmp3*Theta0_Vdrainp_sourcep)))/cox);
    4158                 :          0 : tmp4_Vbulk_sourcep=((tmp2_Vbulk_sourcep+((tmp3_Vbulk_sourcep*Theta0)+(tmp3*Theta0_Vbulk_sourcep)))/cox);
    4159                 :            : #endif
    4160                 :          0 : tmp4=(((tmp2+(tmp3*Theta0))+cit)/cox);
    4161         [ #  # ]:          0 : if
    4162                 :            : (tmp4>=(-0.5))
    4163                 :            : {
    4164                 :            : #if defined(_DERIVATE)
    4165                 :          0 : n_Vdrainp_sourcep=tmp4_Vdrainp_sourcep;
    4166                 :          0 : n_Vbulk_sourcep=tmp4_Vbulk_sourcep;
    4167                 :            : #endif
    4168                 :          0 : n=(1.0+tmp4);
    4169                 :            : }
    4170                 :            : else
    4171                 :            : {
    4172                 :            : #if defined(_DERIVATE)
    4173                 :          0 : T_0_Vgate_sourcep=0.0;
    4174                 :          0 : T_0_Vdrainp_sourcep=(-(8.0*tmp4_Vdrainp_sourcep)/(3.0+(8.0*tmp4))/(3.0+(8.0*tmp4)));
    4175                 :          0 : T_0_Vbulk_sourcep=(-(8.0*tmp4_Vbulk_sourcep)/(3.0+(8.0*tmp4))/(3.0+(8.0*tmp4)));
    4176                 :            : #endif
    4177                 :          0 : T_0=(1.0/(3.0+(8.0*tmp4)));
    4178                 :            : #if defined(_DERIVATE)
    4179                 :          0 : n_Vdrainp_sourcep=(((3.0*tmp4_Vdrainp_sourcep)*T_0)+((1.0+(3.0*tmp4))*T_0_Vdrainp_sourcep));
    4180                 :          0 : n_Vbulk_sourcep=(((3.0*tmp4_Vbulk_sourcep)*T_0)+((1.0+(3.0*tmp4))*T_0_Vbulk_sourcep));
    4181                 :            : #endif
    4182                 :          0 : n=((1.0+(3.0*tmp4))*T_0);
    4183                 :            : }
    4184                 :            : #if defined(_DERIVATE)
    4185                 :          0 : T_0_Vgate_sourcep=0.0;
    4186                 :          0 : T_0_Vdrainp_sourcep=0.0;
    4187                 :          0 : T_0_Vbulk_sourcep=0.0;
    4188                 :            : #endif
    4189                 :          0 : T_0=(vfb+phi);
    4190 [ #  # ][ #  # ]:          0 : if
                 [ #  # ]
    4191                 :            : (((ngate>1.0e18)&&(ngate<1.0e25))&&(Vgs>T_0))
    4192                 :            : {
    4193                 :            : #if defined(_DERIVATE)
    4194                 :          0 : T1_Vgate_sourcep=0.0;
    4195                 :          0 : T1_Vdrainp_sourcep=0.0;
    4196                 :          0 : T1_Vbulk_sourcep=0.0;
    4197                 :            : #endif
    4198                 :          0 : T1=((((1.0e6*1.60219e-19)*1.03594e-10)*ngate)/(cox*cox));
    4199                 :            : {
    4200                 :          0 : double m00_sqrt(d00_sqrt0,(1.0+((2.0*(Vgs-T_0))/T1)))
    4201                 :            : #if defined(_DERIVATE)
    4202                 :          0 : double m10_sqrt(d10_sqrt0,d00_sqrt0,(1.0+((2.0*(Vgs-T_0))/T1)))
    4203                 :            : #endif
    4204                 :            : #if defined(_DERIVATE)
    4205                 :          0 : T4_Vgate_sourcep=(((2.0*(Vgs_Vgate_sourcep-T_0_Vgate_sourcep))*T1-(2.0*(Vgs-T_0))*T1_Vgate_sourcep)/T1/T1)*d10_sqrt0;
    4206                 :          0 : T4_Vdrainp_sourcep=(((2.0*(Vgs_Vdrainp_sourcep-T_0_Vdrainp_sourcep))*T1-(2.0*(Vgs-T_0))*T1_Vdrainp_sourcep)/T1/T1)*d10_sqrt0;
    4207                 :          0 : T4_Vbulk_sourcep=(((2.0*(-T_0_Vbulk_sourcep))*T1-(2.0*(Vgs-T_0))*T1_Vbulk_sourcep)/T1/T1)*d10_sqrt0;
    4208                 :            : #endif
    4209                 :          0 : T4=d00_sqrt0;
    4210                 :            : }
    4211                 :            : #if defined(_DERIVATE)
    4212                 :          0 : T2_Vgate_sourcep=((T1_Vgate_sourcep*(T4-1.0))+(T1*T4_Vgate_sourcep));
    4213                 :          0 : T2_Vdrainp_sourcep=((T1_Vdrainp_sourcep*(T4-1.0))+(T1*T4_Vdrainp_sourcep));
    4214                 :          0 : T2_Vbulk_sourcep=((T1_Vbulk_sourcep*(T4-1.0))+(T1*T4_Vbulk_sourcep));
    4215                 :            : #endif
    4216                 :          0 : T2=(T1*(T4-1.0));
    4217                 :            : #if defined(_DERIVATE)
    4218                 :          0 : T3_Vgate_sourcep=(((((0.5*T2_Vgate_sourcep)*T2)+((0.5*T2)*T2_Vgate_sourcep))*T1-((0.5*T2)*T2)*T1_Vgate_sourcep)/T1/T1);
    4219                 :          0 : T3_Vdrainp_sourcep=(((((0.5*T2_Vdrainp_sourcep)*T2)+((0.5*T2)*T2_Vdrainp_sourcep))*T1-((0.5*T2)*T2)*T1_Vdrainp_sourcep)/T1/T1);
    4220                 :          0 : T3_Vbulk_sourcep=(((((0.5*T2_Vbulk_sourcep)*T2)+((0.5*T2)*T2_Vbulk_sourcep))*T1-((0.5*T2)*T2)*T1_Vbulk_sourcep)/T1/T1);
    4221                 :            : #endif
    4222                 :          0 : T3=(((0.5*T2)*T2)/T1);
    4223                 :            : #if defined(_DERIVATE)
    4224                 :          0 : T7_Vgate_sourcep=(-T3_Vgate_sourcep);
    4225                 :          0 : T7_Vdrainp_sourcep=(-T3_Vdrainp_sourcep);
    4226                 :          0 : T7_Vbulk_sourcep=(-T3_Vbulk_sourcep);
    4227                 :            : #endif
    4228                 :          0 : T7=((1.12-T3)-0.05);
    4229                 :            : {
    4230                 :          0 : double m00_sqrt(d00_sqrt0,((T7*T7)+0.224))
    4231                 :            : #if defined(_DERIVATE)
    4232                 :          0 : double m10_sqrt(d10_sqrt0,d00_sqrt0,((T7*T7)+0.224))
    4233                 :            : #endif
    4234                 :            : #if defined(_DERIVATE)
    4235                 :          0 : T6_Vgate_sourcep=((T7_Vgate_sourcep*T7)+(T7*T7_Vgate_sourcep))*d10_sqrt0;
    4236                 :          0 : T6_Vdrainp_sourcep=((T7_Vdrainp_sourcep*T7)+(T7*T7_Vdrainp_sourcep))*d10_sqrt0;
    4237                 :          0 : T6_Vbulk_sourcep=((T7_Vbulk_sourcep*T7)+(T7*T7_Vbulk_sourcep))*d10_sqrt0;
    4238                 :            : #endif
    4239                 :          0 : T6=d00_sqrt0;
    4240                 :            : }
    4241                 :            : #if defined(_DERIVATE)
    4242                 :          0 : T5_Vgate_sourcep=(-(0.5*(T7_Vgate_sourcep+T6_Vgate_sourcep)));
    4243                 :          0 : T5_Vdrainp_sourcep=(-(0.5*(T7_Vdrainp_sourcep+T6_Vdrainp_sourcep)));
    4244                 :          0 : T5_Vbulk_sourcep=(-(0.5*(T7_Vbulk_sourcep+T6_Vbulk_sourcep)));
    4245                 :            : #endif
    4246                 :          0 : T5=(1.12-(0.5*(T7+T6)));
    4247                 :            : #if defined(_DERIVATE)
    4248                 :          0 : Vgs_eff_Vdrainp_sourcep=(Vgs_Vdrainp_sourcep-T5_Vdrainp_sourcep);
    4249                 :          0 : Vgs_eff_Vgate_sourcep=(Vgs_Vgate_sourcep-T5_Vgate_sourcep);
    4250                 :          0 : Vgs_eff_Vbulk_sourcep=(-T5_Vbulk_sourcep);
    4251                 :            : #endif
    4252                 :          0 : Vgs_eff=(Vgs-T5);
    4253                 :            : }
    4254                 :            : else
    4255                 :            : {
    4256                 :            : #if defined(_DERIVATE)
    4257                 :          0 : Vgs_eff_Vdrainp_sourcep=Vgs_Vdrainp_sourcep;
    4258                 :          0 : Vgs_eff_Vgate_sourcep=Vgs_Vgate_sourcep;
    4259                 :          0 : Vgs_eff_Vbulk_sourcep=0.0;
    4260                 :            : #endif
    4261                 :          0 : Vgs_eff=Vgs;
    4262                 :            : }
    4263                 :            : #if defined(_DERIVATE)
    4264                 :          0 : Vgst_Vdrainp_sourcep=(Vgs_eff_Vdrainp_sourcep-Vth_Vdrainp_sourcep);
    4265                 :          0 : Vgst_Vgate_sourcep=Vgs_eff_Vgate_sourcep;
    4266                 :          0 : Vgst_Vbulk_sourcep=(Vgs_eff_Vbulk_sourcep-Vth_Vbulk_sourcep);
    4267                 :            : #endif
    4268                 :          0 : Vgst=(Vgs_eff-Vth);
    4269                 :            : #if defined(_DERIVATE)
    4270                 :          0 : T10_Vgate_sourcep=0.0;
    4271                 :          0 : T10_Vdrainp_sourcep=(2.0*n_Vdrainp_sourcep)*Vtm;
    4272                 :          0 : T10_Vbulk_sourcep=(2.0*n_Vbulk_sourcep)*Vtm;
    4273                 :            : #endif
    4274                 :          0 : T10=((2.0*n)*Vtm);
    4275                 :            : #if defined(_DERIVATE)
    4276                 :          0 : VgstNVt_Vdrainp_sourcep=((Vgst_Vdrainp_sourcep*T10-Vgst*T10_Vdrainp_sourcep)/T10/T10);
    4277                 :          0 : VgstNVt_Vgate_sourcep=((Vgst_Vgate_sourcep*T10-Vgst*T10_Vgate_sourcep)/T10/T10);
    4278                 :          0 : VgstNVt_Vbulk_sourcep=((Vgst_Vbulk_sourcep*T10-Vgst*T10_Vbulk_sourcep)/T10/T10);
    4279                 :            : #endif
    4280                 :          0 : VgstNVt=(Vgst/T10);
    4281                 :            : #if defined(_DERIVATE)
    4282                 :          0 : ExpArg_Vdrainp_sourcep=(((-Vgst_Vdrainp_sourcep)*T10-((2.0*voff)-Vgst)*T10_Vdrainp_sourcep)/T10/T10);
    4283                 :          0 : ExpArg_Vgate_sourcep=(((-Vgst_Vgate_sourcep)*T10-((2.0*voff)-Vgst)*T10_Vgate_sourcep)/T10/T10);
    4284                 :          0 : ExpArg_Vbulk_sourcep=(((-Vgst_Vbulk_sourcep)*T10-((2.0*voff)-Vgst)*T10_Vbulk_sourcep)/T10/T10);
    4285                 :            : #endif
    4286                 :          0 : ExpArg=(((2.0*voff)-Vgst)/T10);
    4287         [ #  # ]:          0 : if
    4288                 :            : (VgstNVt>34.0)
    4289                 :            : {
    4290                 :            : #if defined(_DERIVATE)
    4291                 :          0 : Vgsteff_Vdrainp_sourcep=Vgst_Vdrainp_sourcep;
    4292                 :          0 : Vgsteff_Vgate_sourcep=Vgst_Vgate_sourcep;
    4293                 :          0 : Vgsteff_Vbulk_sourcep=Vgst_Vbulk_sourcep;
    4294                 :            : #endif
    4295                 :          0 : Vgsteff=Vgst;
    4296                 :            : }
    4297                 :            : else
    4298                 :            : {
    4299         [ #  # ]:          0 : if
    4300                 :            : (ExpArg>34.0)
    4301                 :            : {
    4302                 :            : #if defined(_DERIVATE)
    4303                 :          0 : T_0_Vgate_sourcep=(Vgst_Vgate_sourcep/(n*Vtm));
    4304                 :          0 : T_0_Vdrainp_sourcep=((Vgst_Vdrainp_sourcep*(n*Vtm)-(Vgst-voff)*n_Vdrainp_sourcep*Vtm)/(n*Vtm)/(n*Vtm));
    4305                 :          0 : T_0_Vbulk_sourcep=((Vgst_Vbulk_sourcep*(n*Vtm)-(Vgst-voff)*n_Vbulk_sourcep*Vtm)/(n*Vtm)/(n*Vtm));
    4306                 :            : #endif
    4307                 :          0 : T_0=((Vgst-voff)/(n*Vtm));
    4308                 :            : {
    4309                 :          0 : double m00_exp(d00_exp0,T_0)
    4310                 :            : #if defined(_DERIVATE)
    4311                 :            : #define d10_exp0 d00_exp0
    4312                 :            : #endif
    4313                 :            : #if defined(_DERIVATE)
    4314                 :          0 : ExpVgst_Vgate_sourcep=T_0_Vgate_sourcep*d10_exp0;
    4315                 :          0 : ExpVgst_Vdrainp_sourcep=T_0_Vdrainp_sourcep*d10_exp0;
    4316                 :          0 : ExpVgst_Vbulk_sourcep=T_0_Vbulk_sourcep*d10_exp0;
    4317                 :            : #endif
    4318                 :          0 : ExpVgst=d00_exp0;
    4319                 :            : }
    4320                 :            : #if defined(_DERIVATE)
    4321                 :          0 : Vgsteff_Vdrainp_sourcep=(((Vtm*cdep0)/cox)*ExpVgst_Vdrainp_sourcep);
    4322                 :          0 : Vgsteff_Vgate_sourcep=(((Vtm*cdep0)/cox)*ExpVgst_Vgate_sourcep);
    4323                 :          0 : Vgsteff_Vbulk_sourcep=(((Vtm*cdep0)/cox)*ExpVgst_Vbulk_sourcep);
    4324                 :            : #endif
    4325                 :          0 : Vgsteff=(((Vtm*cdep0)/cox)*ExpVgst);
    4326                 :            : }
    4327                 :            : else
    4328                 :            : {
    4329                 :            : {
    4330                 :          0 : double m00_exp(d00_exp0,VgstNVt)
    4331                 :            : #if defined(_DERIVATE)
    4332                 :            : #define d10_exp0 d00_exp0
    4333                 :            : #endif
    4334                 :            : #if defined(_DERIVATE)
    4335                 :          0 : ExpVgst_Vgate_sourcep=VgstNVt_Vgate_sourcep*d10_exp0;
    4336                 :          0 : ExpVgst_Vdrainp_sourcep=VgstNVt_Vdrainp_sourcep*d10_exp0;
    4337                 :          0 : ExpVgst_Vbulk_sourcep=VgstNVt_Vbulk_sourcep*d10_exp0;
    4338                 :            : #endif
    4339                 :          0 : ExpVgst=d00_exp0;
    4340                 :            : }
    4341                 :            : {
    4342                 :          0 : double m00_logE(d00_logE0,(1.0+ExpVgst))
    4343                 :            : #if defined(_DERIVATE)
    4344                 :          0 : double m10_logE(d10_logE0,d00_logE0,(1.0+ExpVgst))
    4345                 :            : #endif
    4346                 :            : #if defined(_DERIVATE)
    4347                 :          0 : T1_Vgate_sourcep=((T10_Vgate_sourcep*d00_logE0)+(T10*ExpVgst_Vgate_sourcep*d10_logE0));
    4348                 :          0 : T1_Vdrainp_sourcep=((T10_Vdrainp_sourcep*d00_logE0)+(T10*ExpVgst_Vdrainp_sourcep*d10_logE0));
    4349                 :          0 : T1_Vbulk_sourcep=((T10_Vbulk_sourcep*d00_logE0)+(T10*ExpVgst_Vbulk_sourcep*d10_logE0));
    4350                 :            : #endif
    4351                 :          0 : T1=(T10*d00_logE0);
    4352                 :            : }
    4353                 :            : {
    4354                 :          0 : double m00_exp(d00_exp0,ExpArg)
    4355                 :            : #if defined(_DERIVATE)
    4356                 :            : #define d10_exp0 d00_exp0
    4357                 :            : #endif
    4358                 :            : #if defined(_DERIVATE)
    4359                 :          0 : T2_Vgate_sourcep=(-((T10_Vgate_sourcep*(((-cox)/(Vtm*cdep0))*d00_exp0))+(T10*(((-cox)/(Vtm*cdep0))*ExpArg_Vgate_sourcep*d10_exp0))));
    4360                 :          0 : T2_Vdrainp_sourcep=(-((T10_Vdrainp_sourcep*(((-cox)/(Vtm*cdep0))*d00_exp0))+(T10*(((-cox)/(Vtm*cdep0))*ExpArg_Vdrainp_sourcep*d10_exp0))));
    4361                 :          0 : T2_Vbulk_sourcep=(-((T10_Vbulk_sourcep*(((-cox)/(Vtm*cdep0))*d00_exp0))+(T10*(((-cox)/(Vtm*cdep0))*ExpArg_Vbulk_sourcep*d10_exp0))));
    4362                 :            : #endif
    4363                 :          0 : T2=(1.0-(T10*(((-cox)/(Vtm*cdep0))*d00_exp0)));
    4364                 :            : }
    4365                 :            : #if defined(_DERIVATE)
    4366                 :          0 : Vgsteff_Vdrainp_sourcep=((T1_Vdrainp_sourcep*T2-T1*T2_Vdrainp_sourcep)/T2/T2);
    4367                 :          0 : Vgsteff_Vgate_sourcep=((T1_Vgate_sourcep*T2-T1*T2_Vgate_sourcep)/T2/T2);
    4368                 :          0 : Vgsteff_Vbulk_sourcep=((T1_Vbulk_sourcep*T2-T1*T2_Vbulk_sourcep)/T2/T2);
    4369                 :            : #endif
    4370                 :          0 : Vgsteff=(T1/T2);
    4371                 :            : }
    4372                 :            : }
    4373                 :            : #if defined(_DERIVATE)
    4374                 :          0 : T9_Vgate_sourcep=0.0;
    4375                 :          0 : T9_Vdrainp_sourcep=sqrtPhis_Vdrainp_sourcep;
    4376                 :          0 : T9_Vbulk_sourcep=sqrtPhis_Vbulk_sourcep;
    4377                 :            : #endif
    4378                 :          0 : T9=(sqrtPhis-sqrtPhi);
    4379                 :            : #if defined(_DERIVATE)
    4380                 :          0 : Weff_Vdrainp_sourcep=(-(2.0*((dwg*Vgsteff_Vdrainp_sourcep)+(dwb*T9_Vdrainp_sourcep))));
    4381                 :          0 : Weff_Vgate_sourcep=(-(2.0*((dwg*Vgsteff_Vgate_sourcep)+(dwb*T9_Vgate_sourcep))));
    4382                 :          0 : Weff_Vbulk_sourcep=(-(2.0*((dwg*Vgsteff_Vbulk_sourcep)+(dwb*T9_Vbulk_sourcep))));
    4383                 :            : #endif
    4384                 :          0 : Weff=(weff-(2.0*((dwg*Vgsteff)+(dwb*T9))));
    4385         [ #  # ]:          0 : if
    4386                 :            : (Weff<2.0e-8)
    4387                 :            : {
    4388                 :            : #if defined(_DERIVATE)
    4389                 :          0 : T_0_Vgate_sourcep=(-(-(2.0*Weff_Vgate_sourcep))/(6.0e-8-(2.0*Weff))/(6.0e-8-(2.0*Weff)));
    4390                 :          0 : T_0_Vdrainp_sourcep=(-(-(2.0*Weff_Vdrainp_sourcep))/(6.0e-8-(2.0*Weff))/(6.0e-8-(2.0*Weff)));
    4391                 :          0 : T_0_Vbulk_sourcep=(-(-(2.0*Weff_Vbulk_sourcep))/(6.0e-8-(2.0*Weff))/(6.0e-8-(2.0*Weff)));
    4392                 :            : #endif
    4393                 :          0 : T_0=(1.0/(6.0e-8-(2.0*Weff)));
    4394                 :            : #if defined(_DERIVATE)
    4395                 :          0 : Weff_Vdrainp_sourcep=(((2.0e-8*(-Weff_Vdrainp_sourcep))*T_0)+((2.0e-8*(4.0e-8-Weff))*T_0_Vdrainp_sourcep));
    4396                 :          0 : Weff_Vgate_sourcep=(((2.0e-8*(-Weff_Vgate_sourcep))*T_0)+((2.0e-8*(4.0e-8-Weff))*T_0_Vgate_sourcep));
    4397                 :          0 : Weff_Vbulk_sourcep=(((2.0e-8*(-Weff_Vbulk_sourcep))*T_0)+((2.0e-8*(4.0e-8-Weff))*T_0_Vbulk_sourcep));
    4398                 :            : #endif
    4399                 :          0 : Weff=((2.0e-8*(4.0e-8-Weff))*T_0);
    4400                 :            : }
    4401                 :            : #if defined(_DERIVATE)
    4402                 :          0 : T_0_Vgate_sourcep=((prwg*Vgsteff_Vgate_sourcep)+(prwb*T9_Vgate_sourcep));
    4403                 :          0 : T_0_Vdrainp_sourcep=((prwg*Vgsteff_Vdrainp_sourcep)+(prwb*T9_Vdrainp_sourcep));
    4404                 :          0 : T_0_Vbulk_sourcep=((prwg*Vgsteff_Vbulk_sourcep)+(prwb*T9_Vbulk_sourcep));
    4405                 :            : #endif
    4406                 :          0 : T_0=((prwg*Vgsteff)+(prwb*T9));
    4407         [ #  # ]:          0 : if
    4408                 :            : (T_0>=(-0.9))
    4409                 :            : {
    4410                 :            : #if defined(_DERIVATE)
    4411                 :          0 : Rds_Vgate_sourcep=(rds0*T_0_Vgate_sourcep);
    4412                 :          0 : Rds_Vdrainp_sourcep=(rds0*T_0_Vdrainp_sourcep);
    4413                 :          0 : Rds_Vbulk_sourcep=(rds0*T_0_Vbulk_sourcep);
    4414                 :            : #endif
    4415                 :          0 : Rds=(rds0*(1.0+T_0));
    4416                 :            : }
    4417                 :            : else
    4418                 :            : {
    4419                 :            : #if defined(_DERIVATE)
    4420                 :          0 : T1_Vgate_sourcep=(-(20.0*T_0_Vgate_sourcep)/(17.0+(20.0*T_0))/(17.0+(20.0*T_0)));
    4421                 :          0 : T1_Vdrainp_sourcep=(-(20.0*T_0_Vdrainp_sourcep)/(17.0+(20.0*T_0))/(17.0+(20.0*T_0)));
    4422                 :          0 : T1_Vbulk_sourcep=(-(20.0*T_0_Vbulk_sourcep)/(17.0+(20.0*T_0))/(17.0+(20.0*T_0)));
    4423                 :            : #endif
    4424                 :          0 : T1=(1.0/(17.0+(20.0*T_0)));
    4425                 :            : #if defined(_DERIVATE)
    4426                 :          0 : Rds_Vgate_sourcep=(((rds0*T_0_Vgate_sourcep)*T1)+((rds0*(0.8+T_0))*T1_Vgate_sourcep));
    4427                 :          0 : Rds_Vdrainp_sourcep=(((rds0*T_0_Vdrainp_sourcep)*T1)+((rds0*(0.8+T_0))*T1_Vdrainp_sourcep));
    4428                 :          0 : Rds_Vbulk_sourcep=(((rds0*T_0_Vbulk_sourcep)*T1)+((rds0*(0.8+T_0))*T1_Vbulk_sourcep));
    4429                 :            : #endif
    4430                 :          0 : Rds=((rds0*(0.8+T_0))*T1);
    4431                 :            : }
    4432                 :            : #if defined(_DERIVATE)
    4433                 :          0 : T1_Vgate_sourcep=0.0;
    4434                 :          0 : T1_Vdrainp_sourcep=(-(0.5*k1ox)*sqrtPhis_Vdrainp_sourcep/sqrtPhis/sqrtPhis);
    4435                 :          0 : T1_Vbulk_sourcep=(-(0.5*k1ox)*sqrtPhis_Vbulk_sourcep/sqrtPhis/sqrtPhis);
    4436                 :            : #endif
    4437                 :          0 : T1=((0.5*k1ox)/sqrtPhis);
    4438                 :            : {
    4439                 :          0 : double m00_sqrt(d00_sqrt0,(xj*Xdep))
    4440                 :            : #if defined(_DERIVATE)
    4441                 :          0 : double m10_sqrt(d10_sqrt0,d00_sqrt0,(xj*Xdep))
    4442                 :            : #endif
    4443                 :            : #if defined(_DERIVATE)
    4444                 :          0 : T9_Vgate_sourcep=0.0;
    4445                 :          0 : T9_Vdrainp_sourcep=(xj*Xdep_Vdrainp_sourcep)*d10_sqrt0;
    4446                 :          0 : T9_Vbulk_sourcep=(xj*Xdep_Vbulk_sourcep)*d10_sqrt0;
    4447                 :            : #endif
    4448                 :          0 : T9=d00_sqrt0;
    4449                 :            : }
    4450                 :            : #if defined(_DERIVATE)
    4451                 :          0 : tmp1_Vdrainp_sourcep=(2.0*T9_Vdrainp_sourcep);
    4452                 :          0 : tmp1_Vbulk_sourcep=(2.0*T9_Vbulk_sourcep);
    4453                 :            : #endif
    4454                 :          0 : tmp1=(Leff+(2.0*T9));
    4455                 :            : #if defined(_DERIVATE)
    4456                 :          0 : T5_Vgate_sourcep=0.0;
    4457                 :          0 : T5_Vdrainp_sourcep=(-Leff*tmp1_Vdrainp_sourcep/tmp1/tmp1);
    4458                 :          0 : T5_Vbulk_sourcep=(-Leff*tmp1_Vbulk_sourcep/tmp1/tmp1);
    4459                 :            : #endif
    4460                 :          0 : T5=(Leff/tmp1);
    4461                 :            : #if defined(_DERIVATE)
    4462                 :          0 : tmp2_Vgate_sourcep=(a0*T5_Vgate_sourcep);
    4463                 :          0 : tmp2_Vdrainp_sourcep=(a0*T5_Vdrainp_sourcep);
    4464                 :          0 : tmp2_Vbulk_sourcep=(a0*T5_Vbulk_sourcep);
    4465                 :            : #endif
    4466                 :          0 : tmp2=(a0*T5);
    4467                 :            : #if defined(_DERIVATE)
    4468                 :          0 : tmp3_Vdrainp_sourcep=0.0;
    4469                 :          0 : tmp3_Vbulk_sourcep=0.0;
    4470                 :            : #endif
    4471                 :          0 : tmp3=(weff+b1);
    4472                 :            : #if defined(_DERIVATE)
    4473                 :          0 : tmp4_Vgate_sourcep=0.0;
    4474                 :          0 : tmp4_Vdrainp_sourcep=(-b0*tmp3_Vdrainp_sourcep/tmp3/tmp3);
    4475                 :          0 : tmp4_Vbulk_sourcep=(-b0*tmp3_Vbulk_sourcep/tmp3/tmp3);
    4476                 :            : #endif
    4477                 :          0 : tmp4=(b0/tmp3);
    4478                 :            : #if defined(_DERIVATE)
    4479                 :          0 : T2_Vgate_sourcep=(tmp2_Vgate_sourcep+tmp4_Vgate_sourcep);
    4480                 :          0 : T2_Vdrainp_sourcep=(tmp2_Vdrainp_sourcep+tmp4_Vdrainp_sourcep);
    4481                 :          0 : T2_Vbulk_sourcep=(tmp2_Vbulk_sourcep+tmp4_Vbulk_sourcep);
    4482                 :            : #endif
    4483                 :          0 : T2=(tmp2+tmp4);
    4484                 :            : #if defined(_DERIVATE)
    4485                 :          0 : T6_Vgate_sourcep=((T5_Vgate_sourcep*T5)+(T5*T5_Vgate_sourcep));
    4486                 :          0 : T6_Vdrainp_sourcep=((T5_Vdrainp_sourcep*T5)+(T5*T5_Vdrainp_sourcep));
    4487                 :          0 : T6_Vbulk_sourcep=((T5_Vbulk_sourcep*T5)+(T5*T5_Vbulk_sourcep));
    4488                 :            : #endif
    4489                 :          0 : T6=(T5*T5);
    4490                 :            : #if defined(_DERIVATE)
    4491                 :          0 : T7_Vgate_sourcep=((T5_Vgate_sourcep*T6)+(T5*T6_Vgate_sourcep));
    4492                 :          0 : T7_Vdrainp_sourcep=((T5_Vdrainp_sourcep*T6)+(T5*T6_Vdrainp_sourcep));
    4493                 :          0 : T7_Vbulk_sourcep=((T5_Vbulk_sourcep*T6)+(T5*T6_Vbulk_sourcep));
    4494                 :            : #endif
    4495                 :          0 : T7=(T5*T6);
    4496                 :            : #if defined(_DERIVATE)
    4497                 :          0 : Abulk0_Vgate_sourcep=((T1_Vgate_sourcep*T2)+(T1*T2_Vgate_sourcep));
    4498                 :          0 : Abulk0_Vdrainp_sourcep=((T1_Vdrainp_sourcep*T2)+(T1*T2_Vdrainp_sourcep));
    4499                 :          0 : Abulk0_Vbulk_sourcep=((T1_Vbulk_sourcep*T2)+(T1*T2_Vbulk_sourcep));
    4500                 :            : #endif
    4501                 :          0 : Abulk0=(1.0+(T1*T2));
    4502                 :            : #if defined(_DERIVATE)
    4503                 :          0 : T8_Vgate_sourcep=((ags*a0)*T7_Vgate_sourcep);
    4504                 :          0 : T8_Vdrainp_sourcep=((ags*a0)*T7_Vdrainp_sourcep);
    4505                 :          0 : T8_Vbulk_sourcep=((ags*a0)*T7_Vbulk_sourcep);
    4506                 :            : #endif
    4507                 :          0 : T8=((ags*a0)*T7);
    4508                 :            : #if defined(_DERIVATE)
    4509                 :          0 : Abulk_Vgate_sourcep=(Abulk0_Vgate_sourcep+(((((-T1_Vgate_sourcep)*T8)+((-T1)*T8_Vgate_sourcep))*Vgsteff)+(((-T1)*T8)*Vgsteff_Vgate_sourcep)));
    4510                 :          0 : Abulk_Vdrainp_sourcep=(Abulk0_Vdrainp_sourcep+(((((-T1_Vdrainp_sourcep)*T8)+((-T1)*T8_Vdrainp_sourcep))*Vgsteff)+(((-T1)*T8)*Vgsteff_Vdrainp_sourcep)));
    4511                 :          0 : Abulk_Vbulk_sourcep=(Abulk0_Vbulk_sourcep+(((((-T1_Vbulk_sourcep)*T8)+((-T1)*T8_Vbulk_sourcep))*Vgsteff)+(((-T1)*T8)*Vgsteff_Vbulk_sourcep)));
    4512                 :            : #endif
    4513                 :          0 : Abulk=(Abulk0+(((-T1)*T8)*Vgsteff));
    4514         [ #  # ]:          0 : if
    4515                 :            : (Abulk0<0.1)
    4516                 :            : {
    4517                 :            : #if defined(_DERIVATE)
    4518                 :          0 : T9_Vgate_sourcep=(-(-(20.0*Abulk0_Vgate_sourcep))/(3.0-(20.0*Abulk0))/(3.0-(20.0*Abulk0)));
    4519                 :          0 : T9_Vdrainp_sourcep=(-(-(20.0*Abulk0_Vdrainp_sourcep))/(3.0-(20.0*Abulk0))/(3.0-(20.0*Abulk0)));
    4520                 :          0 : T9_Vbulk_sourcep=(-(-(20.0*Abulk0_Vbulk_sourcep))/(3.0-(20.0*Abulk0))/(3.0-(20.0*Abulk0)));
    4521                 :            : #endif
    4522                 :          0 : T9=(1.0/(3.0-(20.0*Abulk0)));
    4523                 :            : #if defined(_DERIVATE)
    4524                 :          0 : Abulk0_Vgate_sourcep=(((-Abulk0_Vgate_sourcep)*T9)+((0.2-Abulk0)*T9_Vgate_sourcep));
    4525                 :          0 : Abulk0_Vdrainp_sourcep=(((-Abulk0_Vdrainp_sourcep)*T9)+((0.2-Abulk0)*T9_Vdrainp_sourcep));
    4526                 :          0 : Abulk0_Vbulk_sourcep=(((-Abulk0_Vbulk_sourcep)*T9)+((0.2-Abulk0)*T9_Vbulk_sourcep));
    4527                 :            : #endif
    4528                 :          0 : Abulk0=((0.2-Abulk0)*T9);
    4529                 :            : }
    4530         [ #  # ]:          0 : if
    4531                 :            : (Abulk<0.1)
    4532                 :            : {
    4533                 :            : #if defined(_DERIVATE)
    4534                 :          0 : T9_Vgate_sourcep=(-(-(20.0*Abulk_Vgate_sourcep))/(3.0-(20.0*Abulk))/(3.0-(20.0*Abulk)));
    4535                 :          0 : T9_Vdrainp_sourcep=(-(-(20.0*Abulk_Vdrainp_sourcep))/(3.0-(20.0*Abulk))/(3.0-(20.0*Abulk)));
    4536                 :          0 : T9_Vbulk_sourcep=(-(-(20.0*Abulk_Vbulk_sourcep))/(3.0-(20.0*Abulk))/(3.0-(20.0*Abulk)));
    4537                 :            : #endif
    4538                 :          0 : T9=(1.0/(3.0-(20.0*Abulk)));
    4539                 :            : #if defined(_DERIVATE)
    4540                 :          0 : Abulk_Vgate_sourcep=(((-Abulk_Vgate_sourcep)*T9)+((0.2-Abulk)*T9_Vgate_sourcep));
    4541                 :          0 : Abulk_Vdrainp_sourcep=(((-Abulk_Vdrainp_sourcep)*T9)+((0.2-Abulk)*T9_Vdrainp_sourcep));
    4542                 :          0 : Abulk_Vbulk_sourcep=(((-Abulk_Vbulk_sourcep)*T9)+((0.2-Abulk)*T9_Vbulk_sourcep));
    4543                 :            : #endif
    4544                 :          0 : Abulk=((0.2-Abulk)*T9);
    4545                 :            : }
    4546                 :            : #if defined(_DERIVATE)
    4547                 :          0 : T2_Vgate_sourcep=0.0;
    4548                 :          0 : T2_Vdrainp_sourcep=(keta*Vbseff_Vdrainp_sourcep);
    4549                 :          0 : T2_Vbulk_sourcep=(keta*Vbseff_Vbulk_sourcep);
    4550                 :            : #endif
    4551                 :          0 : T2=(keta*Vbseff);
    4552         [ #  # ]:          0 : if
    4553                 :            : (T2>=(-0.9))
    4554                 :            : {
    4555                 :            : #if defined(_DERIVATE)
    4556                 :          0 : T_0_Vgate_sourcep=(-T2_Vgate_sourcep/(1.0+T2)/(1.0+T2));
    4557                 :          0 : T_0_Vdrainp_sourcep=(-T2_Vdrainp_sourcep/(1.0+T2)/(1.0+T2));
    4558                 :          0 : T_0_Vbulk_sourcep=(-T2_Vbulk_sourcep/(1.0+T2)/(1.0+T2));
    4559                 :            : #endif
    4560                 :          0 : T_0=(1.0/(1.0+T2));
    4561                 :            : }
    4562                 :            : else
    4563                 :            : {
    4564                 :            : #if defined(_DERIVATE)
    4565                 :          0 : T1_Vgate_sourcep=(-T2_Vgate_sourcep/(0.8+T2)/(0.8+T2));
    4566                 :          0 : T1_Vdrainp_sourcep=(-T2_Vdrainp_sourcep/(0.8+T2)/(0.8+T2));
    4567                 :          0 : T1_Vbulk_sourcep=(-T2_Vbulk_sourcep/(0.8+T2)/(0.8+T2));
    4568                 :            : #endif
    4569                 :          0 : T1=(1.0/(0.8+T2));
    4570                 :            : #if defined(_DERIVATE)
    4571                 :          0 : T_0_Vgate_sourcep=(((20.0*T2_Vgate_sourcep)*T1)+((17.0+(20.0*T2))*T1_Vgate_sourcep));
    4572                 :          0 : T_0_Vdrainp_sourcep=(((20.0*T2_Vdrainp_sourcep)*T1)+((17.0+(20.0*T2))*T1_Vdrainp_sourcep));
    4573                 :          0 : T_0_Vbulk_sourcep=(((20.0*T2_Vbulk_sourcep)*T1)+((17.0+(20.0*T2))*T1_Vbulk_sourcep));
    4574                 :            : #endif
    4575                 :          0 : T_0=((17.0+(20.0*T2))*T1);
    4576                 :            : }
    4577                 :            : #if defined(_DERIVATE)
    4578                 :          0 : Abulk_Vgate_sourcep=((T_0_Vgate_sourcep*Abulk)+(T_0*Abulk_Vgate_sourcep));
    4579                 :          0 : Abulk_Vdrainp_sourcep=((T_0_Vdrainp_sourcep*Abulk)+(T_0*Abulk_Vdrainp_sourcep));
    4580                 :          0 : Abulk_Vbulk_sourcep=((T_0_Vbulk_sourcep*Abulk)+(T_0*Abulk_Vbulk_sourcep));
    4581                 :            : #endif
    4582                 :          0 : Abulk=(T_0*Abulk);
    4583                 :            : #if defined(_DERIVATE)
    4584                 :          0 : Abulk0_Vgate_sourcep=((T_0_Vgate_sourcep*Abulk0)+(T_0*Abulk0_Vgate_sourcep));
    4585                 :          0 : Abulk0_Vdrainp_sourcep=((T_0_Vdrainp_sourcep*Abulk0)+(T_0*Abulk0_Vdrainp_sourcep));
    4586                 :          0 : Abulk0_Vbulk_sourcep=((T_0_Vbulk_sourcep*Abulk0)+(T_0*Abulk0_Vbulk_sourcep));
    4587                 :            : #endif
    4588                 :          0 : Abulk0=(T_0*Abulk0);
    4589         [ #  # ]:          0 : if
    4590                 :            : (MOBMOD==1)
    4591                 :            : {
    4592                 :            : #if defined(_DERIVATE)
    4593                 :          0 : T_0_Vgate_sourcep=Vgsteff_Vgate_sourcep;
    4594                 :          0 : T_0_Vdrainp_sourcep=((Vgsteff_Vdrainp_sourcep+Vth_Vdrainp_sourcep)+Vth_Vdrainp_sourcep);
    4595                 :          0 : T_0_Vbulk_sourcep=((Vgsteff_Vbulk_sourcep+Vth_Vbulk_sourcep)+Vth_Vbulk_sourcep);
    4596                 :            : #endif
    4597                 :          0 : T_0=((Vgsteff+Vth)+Vth);
    4598                 :            : #if defined(_DERIVATE)
    4599                 :          0 : T2_Vgate_sourcep=0.0;
    4600                 :          0 : T2_Vdrainp_sourcep=(uc*Vbseff_Vdrainp_sourcep);
    4601                 :          0 : T2_Vbulk_sourcep=(uc*Vbseff_Vbulk_sourcep);
    4602                 :            : #endif
    4603                 :          0 : T2=(ua+(uc*Vbseff));
    4604                 :            : #if defined(_DERIVATE)
    4605                 :          0 : T3_Vgate_sourcep=(T_0_Vgate_sourcep/tox);
    4606                 :          0 : T3_Vdrainp_sourcep=(T_0_Vdrainp_sourcep/tox);
    4607                 :          0 : T3_Vbulk_sourcep=(T_0_Vbulk_sourcep/tox);
    4608                 :            : #endif
    4609                 :          0 : T3=(T_0/tox);
    4610                 :            : #if defined(_DERIVATE)
    4611                 :          0 : T5_Vgate_sourcep=((T3_Vgate_sourcep*(T2+(ub*T3)))+(T3*(T2_Vgate_sourcep+(ub*T3_Vgate_sourcep))));
    4612                 :          0 : T5_Vdrainp_sourcep=((T3_Vdrainp_sourcep*(T2+(ub*T3)))+(T3*(T2_Vdrainp_sourcep+(ub*T3_Vdrainp_sourcep))));
    4613                 :          0 : T5_Vbulk_sourcep=((T3_Vbulk_sourcep*(T2+(ub*T3)))+(T3*(T2_Vbulk_sourcep+(ub*T3_Vbulk_sourcep))));
    4614                 :            : #endif
    4615                 :          0 : T5=(T3*(T2+(ub*T3)));
    4616                 :            : }
    4617                 :            : else
    4618                 :            : {
    4619         [ #  # ]:          0 : if
    4620                 :            : (MOBMOD==2)
    4621                 :            : {
    4622                 :            : #if defined(_DERIVATE)
    4623                 :          0 : T5_Vgate_sourcep=(((Vgsteff_Vgate_sourcep/tox)*((ua+(uc*Vbseff))+((ub*Vgsteff)/tox)))+((Vgsteff/tox)*((ub*Vgsteff_Vgate_sourcep)/tox)));
    4624                 :          0 : T5_Vdrainp_sourcep=(((Vgsteff_Vdrainp_sourcep/tox)*((ua+(uc*Vbseff))+((ub*Vgsteff)/tox)))+((Vgsteff/tox)*((uc*Vbseff_Vdrainp_sourcep)+((ub*Vgsteff_Vdrainp_sourcep)/tox))));
    4625                 :          0 : T5_Vbulk_sourcep=(((Vgsteff_Vbulk_sourcep/tox)*((ua+(uc*Vbseff))+((ub*Vgsteff)/tox)))+((Vgsteff/tox)*((uc*Vbseff_Vbulk_sourcep)+((ub*Vgsteff_Vbulk_sourcep)/tox))));
    4626                 :            : #endif
    4627                 :          0 : T5=((Vgsteff/tox)*((ua+(uc*Vbseff))+((ub*Vgsteff)/tox)));
    4628                 :            : }
    4629                 :            : else
    4630                 :            : {
    4631                 :            : #if defined(_DERIVATE)
    4632                 :          0 : T_0_Vgate_sourcep=Vgsteff_Vgate_sourcep;
    4633                 :          0 : T_0_Vdrainp_sourcep=((Vgsteff_Vdrainp_sourcep+Vth_Vdrainp_sourcep)+Vth_Vdrainp_sourcep);
    4634                 :          0 : T_0_Vbulk_sourcep=((Vgsteff_Vbulk_sourcep+Vth_Vbulk_sourcep)+Vth_Vbulk_sourcep);
    4635                 :            : #endif
    4636                 :          0 : T_0=((Vgsteff+Vth)+Vth);
    4637                 :            : #if defined(_DERIVATE)
    4638                 :          0 : T2_Vgate_sourcep=0.0;
    4639                 :          0 : T2_Vdrainp_sourcep=(uc*Vbseff_Vdrainp_sourcep);
    4640                 :          0 : T2_Vbulk_sourcep=(uc*Vbseff_Vbulk_sourcep);
    4641                 :            : #endif
    4642                 :          0 : T2=(1.0+(uc*Vbseff));
    4643                 :            : #if defined(_DERIVATE)
    4644                 :          0 : T3_Vgate_sourcep=(T_0_Vgate_sourcep/tox);
    4645                 :          0 : T3_Vdrainp_sourcep=(T_0_Vdrainp_sourcep/tox);
    4646                 :          0 : T3_Vbulk_sourcep=(T_0_Vbulk_sourcep/tox);
    4647                 :            : #endif
    4648                 :          0 : T3=(T_0/tox);
    4649                 :            : #if defined(_DERIVATE)
    4650                 :          0 : T4_Vgate_sourcep=((T3_Vgate_sourcep*(ua+(ub*T3)))+(T3*(ub*T3_Vgate_sourcep)));
    4651                 :          0 : T4_Vdrainp_sourcep=((T3_Vdrainp_sourcep*(ua+(ub*T3)))+(T3*(ub*T3_Vdrainp_sourcep)));
    4652                 :          0 : T4_Vbulk_sourcep=((T3_Vbulk_sourcep*(ua+(ub*T3)))+(T3*(ub*T3_Vbulk_sourcep)));
    4653                 :            : #endif
    4654                 :          0 : T4=(T3*(ua+(ub*T3)));
    4655                 :            : #if defined(_DERIVATE)
    4656                 :          0 : T5_Vgate_sourcep=((T4_Vgate_sourcep*T2)+(T4*T2_Vgate_sourcep));
    4657                 :          0 : T5_Vdrainp_sourcep=((T4_Vdrainp_sourcep*T2)+(T4*T2_Vdrainp_sourcep));
    4658                 :          0 : T5_Vbulk_sourcep=((T4_Vbulk_sourcep*T2)+(T4*T2_Vbulk_sourcep));
    4659                 :            : #endif
    4660                 :          0 : T5=(T4*T2);
    4661                 :            : }
    4662                 :            : }
    4663         [ #  # ]:          0 : if
    4664                 :            : (T5>=(-0.8))
    4665                 :            : {
    4666                 :            : #if defined(_DERIVATE)
    4667                 :          0 : Denomi_Vgate_sourcep=T5_Vgate_sourcep;
    4668                 :          0 : Denomi_Vdrainp_sourcep=T5_Vdrainp_sourcep;
    4669                 :          0 : Denomi_Vbulk_sourcep=T5_Vbulk_sourcep;
    4670                 :            : #endif
    4671                 :          0 : Denomi=(1.0+T5);
    4672                 :            : }
    4673                 :            : else
    4674                 :            : {
    4675                 :            : #if defined(_DERIVATE)
    4676                 :          0 : Denomi_Vgate_sourcep=((T5_Vgate_sourcep*(1.0/(7.0+(10.0*T5))))+((0.6+T5)*(-(10.0*T5_Vgate_sourcep)/(7.0+(10.0*T5))/(7.0+(10.0*T5)))));
    4677                 :          0 : Denomi_Vdrainp_sourcep=((T5_Vdrainp_sourcep*(1.0/(7.0+(10.0*T5))))+((0.6+T5)*(-(10.0*T5_Vdrainp_sourcep)/(7.0+(10.0*T5))/(7.0+(10.0*T5)))));
    4678                 :          0 : Denomi_Vbulk_sourcep=((T5_Vbulk_sourcep*(1.0/(7.0+(10.0*T5))))+((0.6+T5)*(-(10.0*T5_Vbulk_sourcep)/(7.0+(10.0*T5))/(7.0+(10.0*T5)))));
    4679                 :            : #endif
    4680                 :          0 : Denomi=((0.6+T5)*(1.0/(7.0+(10.0*T5))));
    4681                 :            : }
    4682                 :            : #if defined(_DERIVATE)
    4683                 :          0 : ueff_Vgate_sourcep=(-u0temp*Denomi_Vgate_sourcep/Denomi/Denomi);
    4684                 :          0 : ueff_Vdrainp_sourcep=(-u0temp*Denomi_Vdrainp_sourcep/Denomi/Denomi);
    4685                 :          0 : ueff_Vbulk_sourcep=(-u0temp*Denomi_Vbulk_sourcep/Denomi/Denomi);
    4686                 :            : #endif
    4687                 :          0 : ueff=(u0temp/Denomi);
    4688                 :            : #if defined(_DERIVATE)
    4689                 :          0 : WVCox_Vdrainp_sourcep=Weff_Vdrainp_sourcep*vsattemp*cox;
    4690                 :          0 : WVCox_Vgate_sourcep=Weff_Vgate_sourcep*vsattemp*cox;
    4691                 :          0 : WVCox_Vbulk_sourcep=Weff_Vbulk_sourcep*vsattemp*cox;
    4692                 :            : #endif
    4693                 :          0 : WVCox=((Weff*vsattemp)*cox);
    4694                 :            : #if defined(_DERIVATE)
    4695                 :          0 : WVCoxRds_Vdrainp_sourcep=((WVCox_Vdrainp_sourcep*Rds)+(WVCox*Rds_Vdrainp_sourcep));
    4696                 :          0 : WVCoxRds_Vgate_sourcep=((WVCox_Vgate_sourcep*Rds)+(WVCox*Rds_Vgate_sourcep));
    4697                 :          0 : WVCoxRds_Vbulk_sourcep=((WVCox_Vbulk_sourcep*Rds)+(WVCox*Rds_Vbulk_sourcep));
    4698                 :            : #endif
    4699                 :          0 : WVCoxRds=(WVCox*Rds);
    4700                 :            : #if defined(_DERIVATE)
    4701                 :          0 : Esat_Vgate_sourcep=(-(2.0*vsattemp)*ueff_Vgate_sourcep/ueff/ueff);
    4702                 :          0 : Esat_Vdrainp_sourcep=(-(2.0*vsattemp)*ueff_Vdrainp_sourcep/ueff/ueff);
    4703                 :          0 : Esat_Vbulk_sourcep=(-(2.0*vsattemp)*ueff_Vbulk_sourcep/ueff/ueff);
    4704                 :            : #endif
    4705                 :          0 : Esat=((2.0*vsattemp)/ueff);
    4706                 :            : #if defined(_DERIVATE)
    4707                 :          0 : EsatL_Vgate_sourcep=Esat_Vgate_sourcep*Leff;
    4708                 :          0 : EsatL_Vdrainp_sourcep=Esat_Vdrainp_sourcep*Leff;
    4709                 :          0 : EsatL_Vbulk_sourcep=Esat_Vbulk_sourcep*Leff;
    4710                 :            : #endif
    4711                 :          0 : EsatL=(Esat*Leff);
    4712         [ #  # ]:          0 : if
    4713                 :            : (a1==0.0)
    4714                 :            : {
    4715                 :            : #if defined(_DERIVATE)
    4716                 :          0 : Lambda_Vgate_sourcep=0.0;
    4717                 :          0 : Lambda_Vdrainp_sourcep=0.0;
    4718                 :          0 : Lambda_Vbulk_sourcep=0.0;
    4719                 :            : #endif
    4720                 :          0 : Lambda=a2;
    4721                 :            : }
    4722                 :            : else
    4723                 :            : {
    4724         [ #  # ]:          0 : if
    4725                 :            : (a1>0.0)
    4726                 :            : {
    4727                 :            : #if defined(_DERIVATE)
    4728                 :          0 : T_0_Vgate_sourcep=0.0;
    4729                 :          0 : T_0_Vdrainp_sourcep=0.0;
    4730                 :          0 : T_0_Vbulk_sourcep=0.0;
    4731                 :            : #endif
    4732                 :          0 : T_0=(1.0-a2);
    4733                 :            : #if defined(_DERIVATE)
    4734                 :          0 : T1_Vgate_sourcep=(T_0_Vgate_sourcep-(a1*Vgsteff_Vgate_sourcep));
    4735                 :          0 : T1_Vdrainp_sourcep=(T_0_Vdrainp_sourcep-(a1*Vgsteff_Vdrainp_sourcep));
    4736                 :          0 : T1_Vbulk_sourcep=(T_0_Vbulk_sourcep-(a1*Vgsteff_Vbulk_sourcep));
    4737                 :            : #endif
    4738                 :          0 : T1=((T_0-(a1*Vgsteff))-0.0001);
    4739                 :            : {
    4740                 :          0 : double m00_sqrt(d00_sqrt0,((T1*T1)+(0.0004*T_0)))
    4741                 :            : #if defined(_DERIVATE)
    4742                 :          0 : double m10_sqrt(d10_sqrt0,d00_sqrt0,((T1*T1)+(0.0004*T_0)))
    4743                 :            : #endif
    4744                 :            : #if defined(_DERIVATE)
    4745                 :          0 : T2_Vgate_sourcep=(((T1_Vgate_sourcep*T1)+(T1*T1_Vgate_sourcep))+(0.0004*T_0_Vgate_sourcep))*d10_sqrt0;
    4746                 :          0 : T2_Vdrainp_sourcep=(((T1_Vdrainp_sourcep*T1)+(T1*T1_Vdrainp_sourcep))+(0.0004*T_0_Vdrainp_sourcep))*d10_sqrt0;
    4747                 :          0 : T2_Vbulk_sourcep=(((T1_Vbulk_sourcep*T1)+(T1*T1_Vbulk_sourcep))+(0.0004*T_0_Vbulk_sourcep))*d10_sqrt0;
    4748                 :            : #endif
    4749                 :          0 : T2=d00_sqrt0;
    4750                 :            : }
    4751                 :            : #if defined(_DERIVATE)
    4752                 :          0 : Lambda_Vgate_sourcep=(T_0_Vgate_sourcep-(0.5*(T1_Vgate_sourcep+T2_Vgate_sourcep)));
    4753                 :          0 : Lambda_Vdrainp_sourcep=(T_0_Vdrainp_sourcep-(0.5*(T1_Vdrainp_sourcep+T2_Vdrainp_sourcep)));
    4754                 :          0 : Lambda_Vbulk_sourcep=(T_0_Vbulk_sourcep-(0.5*(T1_Vbulk_sourcep+T2_Vbulk_sourcep)));
    4755                 :            : #endif
    4756                 :          0 : Lambda=((a2+T_0)-(0.5*(T1+T2)));
    4757                 :            : }
    4758                 :            : else
    4759                 :            : {
    4760                 :            : #if defined(_DERIVATE)
    4761                 :          0 : T1_Vgate_sourcep=(a1*Vgsteff_Vgate_sourcep);
    4762                 :          0 : T1_Vdrainp_sourcep=(a1*Vgsteff_Vdrainp_sourcep);
    4763                 :          0 : T1_Vbulk_sourcep=(a1*Vgsteff_Vbulk_sourcep);
    4764                 :            : #endif
    4765                 :          0 : T1=((a2+(a1*Vgsteff))-0.0001);
    4766                 :            : {
    4767                 :          0 : double m00_sqrt(d00_sqrt0,((T1*T1)+(0.0004*a2)))
    4768                 :            : #if defined(_DERIVATE)
    4769                 :          0 : double m10_sqrt(d10_sqrt0,d00_sqrt0,((T1*T1)+(0.0004*a2)))
    4770                 :            : #endif
    4771                 :            : #if defined(_DERIVATE)
    4772                 :          0 : T2_Vgate_sourcep=((T1_Vgate_sourcep*T1)+(T1*T1_Vgate_sourcep))*d10_sqrt0;
    4773                 :          0 : T2_Vdrainp_sourcep=((T1_Vdrainp_sourcep*T1)+(T1*T1_Vdrainp_sourcep))*d10_sqrt0;
    4774                 :          0 : T2_Vbulk_sourcep=((T1_Vbulk_sourcep*T1)+(T1*T1_Vbulk_sourcep))*d10_sqrt0;
    4775                 :            : #endif
    4776                 :          0 : T2=d00_sqrt0;
    4777                 :            : }
    4778                 :            : #if defined(_DERIVATE)
    4779                 :          0 : Lambda_Vgate_sourcep=(0.5*(T1_Vgate_sourcep+T2_Vgate_sourcep));
    4780                 :          0 : Lambda_Vdrainp_sourcep=(0.5*(T1_Vdrainp_sourcep+T2_Vdrainp_sourcep));
    4781                 :          0 : Lambda_Vbulk_sourcep=(0.5*(T1_Vbulk_sourcep+T2_Vbulk_sourcep));
    4782                 :            : #endif
    4783                 :          0 : Lambda=(0.5*(T1+T2));
    4784                 :            : }
    4785                 :            : }
    4786                 :            : #if defined(_DERIVATE)
    4787                 :          0 : Vgst2Vtm_Vdrainp_sourcep=Vgsteff_Vdrainp_sourcep;
    4788                 :          0 : Vgst2Vtm_Vgate_sourcep=Vgsteff_Vgate_sourcep;
    4789                 :          0 : Vgst2Vtm_Vbulk_sourcep=Vgsteff_Vbulk_sourcep;
    4790                 :            : #endif
    4791                 :          0 : Vgst2Vtm=(Vgsteff+(2.0*Vtm));
    4792 [ #  # ][ #  # ]:          0 : if
    4793                 :            : ((Rds==0.0)&&(Lambda==1.0))
    4794                 :            : {
    4795                 :            : #if defined(_DERIVATE)
    4796                 :          0 : T_0_Vgate_sourcep=(-(((Abulk_Vgate_sourcep*EsatL)+(Abulk*EsatL_Vgate_sourcep))+Vgst2Vtm_Vgate_sourcep)/((Abulk*EsatL)+Vgst2Vtm)/((Abulk*EsatL)+Vgst2Vtm));
    4797                 :          0 : T_0_Vdrainp_sourcep=(-(((Abulk_Vdrainp_sourcep*EsatL)+(Abulk*EsatL_Vdrainp_sourcep))+Vgst2Vtm_Vdrainp_sourcep)/((Abulk*EsatL)+Vgst2Vtm)/((Abulk*EsatL)+Vgst2Vtm));
    4798                 :          0 : T_0_Vbulk_sourcep=(-(((Abulk_Vbulk_sourcep*EsatL)+(Abulk*EsatL_Vbulk_sourcep))+Vgst2Vtm_Vbulk_sourcep)/((Abulk*EsatL)+Vgst2Vtm)/((Abulk*EsatL)+Vgst2Vtm));
    4799                 :            : #endif
    4800                 :          0 : T_0=(1.0/((Abulk*EsatL)+Vgst2Vtm));
    4801                 :            : #if defined(_DYNAMIC)
    4802                 :            : #if defined(_DERIVATE)
    4803                 :          0 : tmp1_Vdrainp_sourcep=0.0;
    4804                 :          0 : tmp1_Vbulk_sourcep=0.0;
    4805                 :            : #endif
    4806                 :          0 : tmp1=0.0;
    4807                 :            : #endif
    4808                 :            : #if defined(_DERIVATE)
    4809                 :          0 : T1_Vgate_sourcep=((T_0_Vgate_sourcep*T_0)+(T_0*T_0_Vgate_sourcep));
    4810                 :          0 : T1_Vdrainp_sourcep=((T_0_Vdrainp_sourcep*T_0)+(T_0*T_0_Vdrainp_sourcep));
    4811                 :          0 : T1_Vbulk_sourcep=((T_0_Vbulk_sourcep*T_0)+(T_0*T_0_Vbulk_sourcep));
    4812                 :            : #endif
    4813                 :          0 : T1=(T_0*T_0);
    4814                 :            : #if defined(_DERIVATE)
    4815                 :          0 : T2_Vgate_sourcep=((Vgst2Vtm_Vgate_sourcep*T_0)+(Vgst2Vtm*T_0_Vgate_sourcep));
    4816                 :          0 : T2_Vdrainp_sourcep=((Vgst2Vtm_Vdrainp_sourcep*T_0)+(Vgst2Vtm*T_0_Vdrainp_sourcep));
    4817                 :          0 : T2_Vbulk_sourcep=((Vgst2Vtm_Vbulk_sourcep*T_0)+(Vgst2Vtm*T_0_Vbulk_sourcep));
    4818                 :            : #endif
    4819                 :          0 : T2=(Vgst2Vtm*T_0);
    4820                 :            : #if defined(_DERIVATE)
    4821                 :          0 : T3_Vgate_sourcep=((EsatL_Vgate_sourcep*Vgst2Vtm)+(EsatL*Vgst2Vtm_Vgate_sourcep));
    4822                 :          0 : T3_Vdrainp_sourcep=((EsatL_Vdrainp_sourcep*Vgst2Vtm)+(EsatL*Vgst2Vtm_Vdrainp_sourcep));
    4823                 :          0 : T3_Vbulk_sourcep=((EsatL_Vbulk_sourcep*Vgst2Vtm)+(EsatL*Vgst2Vtm_Vbulk_sourcep));
    4824                 :            : #endif
    4825                 :          0 : T3=(EsatL*Vgst2Vtm);
    4826                 :            : #if defined(_DERIVATE)
    4827                 :          0 : Vdsat_Vgate_sourcep=((T3_Vgate_sourcep*T_0)+(T3*T_0_Vgate_sourcep));
    4828                 :          0 : Vdsat_Vdrainp_sourcep=((T3_Vdrainp_sourcep*T_0)+(T3*T_0_Vdrainp_sourcep));
    4829                 :          0 : Vdsat_Vbulk_sourcep=((T3_Vbulk_sourcep*T_0)+(T3*T_0_Vbulk_sourcep));
    4830                 :            : #endif
    4831                 :          0 : Vdsat=(T3*T_0);
    4832                 :            : }
    4833                 :            : else
    4834                 :            : {
    4835                 :            : #if defined(_DERIVATE)
    4836                 :          0 : T9_Vgate_sourcep=((Abulk_Vgate_sourcep*WVCoxRds)+(Abulk*WVCoxRds_Vgate_sourcep));
    4837                 :          0 : T9_Vdrainp_sourcep=((Abulk_Vdrainp_sourcep*WVCoxRds)+(Abulk*WVCoxRds_Vdrainp_sourcep));
    4838                 :          0 : T9_Vbulk_sourcep=((Abulk_Vbulk_sourcep*WVCoxRds)+(Abulk*WVCoxRds_Vbulk_sourcep));
    4839                 :            : #endif
    4840                 :          0 : T9=(Abulk*WVCoxRds);
    4841                 :            : #if defined(_DERIVATE)
    4842                 :          0 : T7_Vgate_sourcep=((Vgst2Vtm_Vgate_sourcep*T9)+(Vgst2Vtm*T9_Vgate_sourcep));
    4843                 :          0 : T7_Vdrainp_sourcep=((Vgst2Vtm_Vdrainp_sourcep*T9)+(Vgst2Vtm*T9_Vdrainp_sourcep));
    4844                 :          0 : T7_Vbulk_sourcep=((Vgst2Vtm_Vbulk_sourcep*T9)+(Vgst2Vtm*T9_Vbulk_sourcep));
    4845                 :            : #endif
    4846                 :          0 : T7=(Vgst2Vtm*T9);
    4847                 :            : #if defined(_DERIVATE)
    4848                 :          0 : T6_Vgate_sourcep=((Vgst2Vtm_Vgate_sourcep*WVCoxRds)+(Vgst2Vtm*WVCoxRds_Vgate_sourcep));
    4849                 :          0 : T6_Vdrainp_sourcep=((Vgst2Vtm_Vdrainp_sourcep*WVCoxRds)+(Vgst2Vtm*WVCoxRds_Vdrainp_sourcep));
    4850                 :          0 : T6_Vbulk_sourcep=((Vgst2Vtm_Vbulk_sourcep*WVCoxRds)+(Vgst2Vtm*WVCoxRds_Vbulk_sourcep));
    4851                 :            : #endif
    4852                 :          0 : T6=(Vgst2Vtm*WVCoxRds);
    4853                 :            : #if defined(_DERIVATE)
    4854                 :          0 : T_0_Vgate_sourcep=(((2.0*Abulk_Vgate_sourcep)*((T9-1.0)+(1.0/Lambda)))+((2.0*Abulk)*(T9_Vgate_sourcep+(-Lambda_Vgate_sourcep/Lambda/Lambda))));
    4855                 :          0 : T_0_Vdrainp_sourcep=(((2.0*Abulk_Vdrainp_sourcep)*((T9-1.0)+(1.0/Lambda)))+((2.0*Abulk)*(T9_Vdrainp_sourcep+(-Lambda_Vdrainp_sourcep/Lambda/Lambda))));
    4856                 :          0 : T_0_Vbulk_sourcep=(((2.0*Abulk_Vbulk_sourcep)*((T9-1.0)+(1.0/Lambda)))+((2.0*Abulk)*(T9_Vbulk_sourcep+(-Lambda_Vbulk_sourcep/Lambda/Lambda))));
    4857                 :            : #endif
    4858                 :          0 : T_0=((2.0*Abulk)*((T9-1.0)+(1.0/Lambda)));
    4859                 :            : #if defined(_DERIVATE)
    4860                 :          0 : T1_Vgate_sourcep=((((Vgst2Vtm_Vgate_sourcep*((2.0/Lambda)-1.0))+(Vgst2Vtm*(-2.0*Lambda_Vgate_sourcep/Lambda/Lambda)))+((Abulk_Vgate_sourcep*EsatL)+(Abulk*EsatL_Vgate_sourcep)))+(3.0*T7_Vgate_sourcep));
    4861                 :          0 : T1_Vdrainp_sourcep=((((Vgst2Vtm_Vdrainp_sourcep*((2.0/Lambda)-1.0))+(Vgst2Vtm*(-2.0*Lambda_Vdrainp_sourcep/Lambda/Lambda)))+((Abulk_Vdrainp_sourcep*EsatL)+(Abulk*EsatL_Vdrainp_sourcep)))+(3.0*T7_Vdrainp_sourcep));
    4862                 :          0 : T1_Vbulk_sourcep=((((Vgst2Vtm_Vbulk_sourcep*((2.0/Lambda)-1.0))+(Vgst2Vtm*(-2.0*Lambda_Vbulk_sourcep/Lambda/Lambda)))+((Abulk_Vbulk_sourcep*EsatL)+(Abulk*EsatL_Vbulk_sourcep)))+(3.0*T7_Vbulk_sourcep));
    4863                 :            : #endif
    4864                 :          0 : T1=(((Vgst2Vtm*((2.0/Lambda)-1.0))+(Abulk*EsatL))+(3.0*T7));
    4865                 :            : #if defined(_DERIVATE)
    4866                 :          0 : T2_Vgate_sourcep=((Vgst2Vtm_Vgate_sourcep*(EsatL+(2.0*T6)))+(Vgst2Vtm*(EsatL_Vgate_sourcep+(2.0*T6_Vgate_sourcep))));
    4867                 :          0 : T2_Vdrainp_sourcep=((Vgst2Vtm_Vdrainp_sourcep*(EsatL+(2.0*T6)))+(Vgst2Vtm*(EsatL_Vdrainp_sourcep+(2.0*T6_Vdrainp_sourcep))));
    4868                 :          0 : T2_Vbulk_sourcep=((Vgst2Vtm_Vbulk_sourcep*(EsatL+(2.0*T6)))+(Vgst2Vtm*(EsatL_Vbulk_sourcep+(2.0*T6_Vbulk_sourcep))));
    4869                 :            : #endif
    4870                 :          0 : T2=(Vgst2Vtm*(EsatL+(2.0*T6)));
    4871                 :            : {
    4872                 :          0 : double m00_sqrt(d00_sqrt0,((T1*T1)-((2.0*T_0)*T2)))
    4873                 :            : #if defined(_DERIVATE)
    4874                 :          0 : double m10_sqrt(d10_sqrt0,d00_sqrt0,((T1*T1)-((2.0*T_0)*T2)))
    4875                 :            : #endif
    4876                 :            : #if defined(_DERIVATE)
    4877                 :          0 : T3_Vgate_sourcep=(((T1_Vgate_sourcep*T1)+(T1*T1_Vgate_sourcep))-(((2.0*T_0_Vgate_sourcep)*T2)+((2.0*T_0)*T2_Vgate_sourcep)))*d10_sqrt0;
    4878                 :          0 : T3_Vdrainp_sourcep=(((T1_Vdrainp_sourcep*T1)+(T1*T1_Vdrainp_sourcep))-(((2.0*T_0_Vdrainp_sourcep)*T2)+((2.0*T_0)*T2_Vdrainp_sourcep)))*d10_sqrt0;
    4879                 :          0 : T3_Vbulk_sourcep=(((T1_Vbulk_sourcep*T1)+(T1*T1_Vbulk_sourcep))-(((2.0*T_0_Vbulk_sourcep)*T2)+((2.0*T_0)*T2_Vbulk_sourcep)))*d10_sqrt0;
    4880                 :            : #endif
    4881                 :          0 : T3=d00_sqrt0;
    4882                 :            : }
    4883                 :            : #if defined(_DERIVATE)
    4884                 :          0 : Vdsat_Vgate_sourcep=(((T1_Vgate_sourcep-T3_Vgate_sourcep)*T_0-(T1-T3)*T_0_Vgate_sourcep)/T_0/T_0);
    4885                 :          0 : Vdsat_Vdrainp_sourcep=(((T1_Vdrainp_sourcep-T3_Vdrainp_sourcep)*T_0-(T1-T3)*T_0_Vdrainp_sourcep)/T_0/T_0);
    4886                 :          0 : Vdsat_Vbulk_sourcep=(((T1_Vbulk_sourcep-T3_Vbulk_sourcep)*T_0-(T1-T3)*T_0_Vbulk_sourcep)/T_0/T_0);
    4887                 :            : #endif
    4888                 :          0 : Vdsat=((T1-T3)/T_0);
    4889                 :            : }
    4890                 :            : #if defined(_DYNAMIC)
    4891                 :          0 : vdsat=Vdsat;
    4892                 :            : #endif
    4893                 :            : #if defined(_DERIVATE)
    4894                 :          0 : T1_Vgate_sourcep=Vdsat_Vgate_sourcep;
    4895                 :          0 : T1_Vdrainp_sourcep=(Vdsat_Vdrainp_sourcep-Vds_Vdrainp_sourcep);
    4896                 :          0 : T1_Vbulk_sourcep=Vdsat_Vbulk_sourcep;
    4897                 :            : #endif
    4898                 :          0 : T1=((Vdsat-Vds)-delta);
    4899                 :            : {
    4900                 :          0 : double m00_sqrt(d00_sqrt0,((T1*T1)+((4.0*delta)*Vdsat)))
    4901                 :            : #if defined(_DERIVATE)
    4902                 :          0 : double m10_sqrt(d10_sqrt0,d00_sqrt0,((T1*T1)+((4.0*delta)*Vdsat)))
    4903                 :            : #endif
    4904                 :            : #if defined(_DERIVATE)
    4905                 :          0 : T2_Vgate_sourcep=(((T1_Vgate_sourcep*T1)+(T1*T1_Vgate_sourcep))+((4.0*delta)*Vdsat_Vgate_sourcep))*d10_sqrt0;
    4906                 :          0 : T2_Vdrainp_sourcep=(((T1_Vdrainp_sourcep*T1)+(T1*T1_Vdrainp_sourcep))+((4.0*delta)*Vdsat_Vdrainp_sourcep))*d10_sqrt0;
    4907                 :          0 : T2_Vbulk_sourcep=(((T1_Vbulk_sourcep*T1)+(T1*T1_Vbulk_sourcep))+((4.0*delta)*Vdsat_Vbulk_sourcep))*d10_sqrt0;
    4908                 :            : #endif
    4909                 :          0 : T2=d00_sqrt0;
    4910                 :            : }
    4911                 :            : #if defined(_DERIVATE)
    4912                 :          0 : Vdseff_Vgate_sourcep=(Vdsat_Vgate_sourcep-(0.5*(T1_Vgate_sourcep+T2_Vgate_sourcep)));
    4913                 :          0 : Vdseff_Vdrainp_sourcep=(Vdsat_Vdrainp_sourcep-(0.5*(T1_Vdrainp_sourcep+T2_Vdrainp_sourcep)));
    4914                 :          0 : Vdseff_Vbulk_sourcep=(Vdsat_Vbulk_sourcep-(0.5*(T1_Vbulk_sourcep+T2_Vbulk_sourcep)));
    4915                 :            : #endif
    4916                 :          0 : Vdseff=(Vdsat-(0.5*(T1+T2)));
    4917 [ #  # ][ #  # ]:          0 : if
    4918                 :            : ((Vds==0.0)&&(VERSION==3.24))
    4919                 :            : {
    4920                 :            : #if defined(_DERIVATE)
    4921                 :          0 : Vdseff_Vgate_sourcep=0.0;
    4922                 :          0 : Vdseff_Vdrainp_sourcep=0.0;
    4923                 :          0 : Vdseff_Vbulk_sourcep=0.0;
    4924                 :            : #endif
    4925                 :          0 : Vdseff=0.0;
    4926                 :            : }
    4927                 :            : #if defined(_DERIVATE)
    4928                 :          0 : tmp4_Vgate_sourcep=(-(((((0.5*Abulk_Vgate_sourcep)*Vdsat)+((0.5*Abulk)*Vdsat_Vgate_sourcep))*Vgst2Vtm-((0.5*Abulk)*Vdsat)*Vgst2Vtm_Vgate_sourcep)/Vgst2Vtm/Vgst2Vtm));
    4929                 :          0 : tmp4_Vdrainp_sourcep=(-(((((0.5*Abulk_Vdrainp_sourcep)*Vdsat)+((0.5*Abulk)*Vdsat_Vdrainp_sourcep))*Vgst2Vtm-((0.5*Abulk)*Vdsat)*Vgst2Vtm_Vdrainp_sourcep)/Vgst2Vtm/Vgst2Vtm));
    4930                 :          0 : tmp4_Vbulk_sourcep=(-(((((0.5*Abulk_Vbulk_sourcep)*Vdsat)+((0.5*Abulk)*Vdsat_Vbulk_sourcep))*Vgst2Vtm-((0.5*Abulk)*Vdsat)*Vgst2Vtm_Vbulk_sourcep)/Vgst2Vtm/Vgst2Vtm));
    4931                 :            : #endif
    4932                 :          0 : tmp4=(1.0-(((0.5*Abulk)*Vdsat)/Vgst2Vtm));
    4933                 :            : #if defined(_DERIVATE)
    4934                 :          0 : T9_Vgate_sourcep=((WVCoxRds_Vgate_sourcep*Vgsteff)+(WVCoxRds*Vgsteff_Vgate_sourcep));
    4935                 :          0 : T9_Vdrainp_sourcep=((WVCoxRds_Vdrainp_sourcep*Vgsteff)+(WVCoxRds*Vgsteff_Vdrainp_sourcep));
    4936                 :          0 : T9_Vbulk_sourcep=((WVCoxRds_Vbulk_sourcep*Vgsteff)+(WVCoxRds*Vgsteff_Vbulk_sourcep));
    4937                 :            : #endif
    4938                 :          0 : T9=(WVCoxRds*Vgsteff);
    4939                 :            : #if defined(_DERIVATE)
    4940                 :          0 : T_0_Vgate_sourcep=((EsatL_Vgate_sourcep+Vdsat_Vgate_sourcep)+(((2.0*T9_Vgate_sourcep)*tmp4)+((2.0*T9)*tmp4_Vgate_sourcep)));
    4941                 :          0 : T_0_Vdrainp_sourcep=((EsatL_Vdrainp_sourcep+Vdsat_Vdrainp_sourcep)+(((2.0*T9_Vdrainp_sourcep)*tmp4)+((2.0*T9)*tmp4_Vdrainp_sourcep)));
    4942                 :          0 : T_0_Vbulk_sourcep=((EsatL_Vbulk_sourcep+Vdsat_Vbulk_sourcep)+(((2.0*T9_Vbulk_sourcep)*tmp4)+((2.0*T9)*tmp4_Vbulk_sourcep)));
    4943                 :            : #endif
    4944                 :          0 : T_0=((EsatL+Vdsat)+((2.0*T9)*tmp4));
    4945                 :            : #if defined(_DERIVATE)
    4946                 :          0 : T9_Vgate_sourcep=((WVCoxRds_Vgate_sourcep*Abulk)+(WVCoxRds*Abulk_Vgate_sourcep));
    4947                 :          0 : T9_Vdrainp_sourcep=((WVCoxRds_Vdrainp_sourcep*Abulk)+(WVCoxRds*Abulk_Vdrainp_sourcep));
    4948                 :          0 : T9_Vbulk_sourcep=((WVCoxRds_Vbulk_sourcep*Abulk)+(WVCoxRds*Abulk_Vbulk_sourcep));
    4949                 :            : #endif
    4950                 :          0 : T9=(WVCoxRds*Abulk);
    4951                 :            : #if defined(_DERIVATE)
    4952                 :          0 : T1_Vgate_sourcep=((-2.0*Lambda_Vgate_sourcep/Lambda/Lambda)+T9_Vgate_sourcep);
    4953                 :          0 : T1_Vdrainp_sourcep=((-2.0*Lambda_Vdrainp_sourcep/Lambda/Lambda)+T9_Vdrainp_sourcep);
    4954                 :          0 : T1_Vbulk_sourcep=((-2.0*Lambda_Vbulk_sourcep/Lambda/Lambda)+T9_Vbulk_sourcep);
    4955                 :            : #endif
    4956                 :          0 : T1=(((2.0/Lambda)-1.0)+T9);
    4957                 :            : #if defined(_DERIVATE)
    4958                 :          0 : Vasat_Vgate_sourcep=((T_0_Vgate_sourcep*T1-T_0*T1_Vgate_sourcep)/T1/T1);
    4959                 :          0 : Vasat_Vdrainp_sourcep=((T_0_Vdrainp_sourcep*T1-T_0*T1_Vdrainp_sourcep)/T1/T1);
    4960                 :          0 : Vasat_Vbulk_sourcep=((T_0_Vbulk_sourcep*T1-T_0*T1_Vbulk_sourcep)/T1/T1);
    4961                 :            : #endif
    4962                 :          0 : Vasat=(T_0/T1);
    4963         [ #  # ]:          0 : if
    4964                 :            : (Vdseff>Vds)
    4965                 :            : {
    4966                 :            : #if defined(_DERIVATE)
    4967                 :          0 : Vdseff_Vgate_sourcep=0.0;
    4968                 :          0 : Vdseff_Vdrainp_sourcep=Vds_Vdrainp_sourcep;
    4969                 :          0 : Vdseff_Vbulk_sourcep=0.0;
    4970                 :            : #endif
    4971                 :          0 : Vdseff=Vds;
    4972                 :            : }
    4973                 :            : #if defined(_DERIVATE)
    4974                 :          0 : diffVds_Vdrainp_sourcep=(Vds_Vdrainp_sourcep-Vdseff_Vdrainp_sourcep);
    4975                 :          0 : diffVds_Vgate_sourcep=(-Vdseff_Vgate_sourcep);
    4976                 :          0 : diffVds_Vbulk_sourcep=(-Vdseff_Vbulk_sourcep);
    4977                 :            : #endif
    4978                 :          0 : diffVds=(Vds-Vdseff);
    4979 [ #  # ][ #  # ]:          0 : if
    4980                 :            : ((pclm>0.0)&&(diffVds>1.0e-10))
    4981                 :            : {
    4982                 :            : #if defined(_DERIVATE)
    4983                 :          0 : T_0_Vgate_sourcep=(-(pclm*Abulk_Vgate_sourcep)*litl/((pclm*Abulk)*litl)/((pclm*Abulk)*litl));
    4984                 :          0 : T_0_Vdrainp_sourcep=(-(pclm*Abulk_Vdrainp_sourcep)*litl/((pclm*Abulk)*litl)/((pclm*Abulk)*litl));
    4985                 :          0 : T_0_Vbulk_sourcep=(-(pclm*Abulk_Vbulk_sourcep)*litl/((pclm*Abulk)*litl)/((pclm*Abulk)*litl));
    4986                 :            : #endif
    4987                 :          0 : T_0=(1.0/((pclm*Abulk)*litl));
    4988                 :            : #if defined(_DERIVATE)
    4989                 :          0 : T2_Vgate_sourcep=((Vgsteff_Vgate_sourcep*EsatL-Vgsteff*EsatL_Vgate_sourcep)/EsatL/EsatL);
    4990                 :          0 : T2_Vdrainp_sourcep=((Vgsteff_Vdrainp_sourcep*EsatL-Vgsteff*EsatL_Vdrainp_sourcep)/EsatL/EsatL);
    4991                 :          0 : T2_Vbulk_sourcep=((Vgsteff_Vbulk_sourcep*EsatL-Vgsteff*EsatL_Vbulk_sourcep)/EsatL/EsatL);
    4992                 :            : #endif
    4993                 :          0 : T2=(Vgsteff/EsatL);
    4994                 :            : #if defined(_DERIVATE)
    4995                 :          0 : T1_Vgate_sourcep=(Leff*(Abulk_Vgate_sourcep+T2_Vgate_sourcep));
    4996                 :          0 : T1_Vdrainp_sourcep=(Leff*(Abulk_Vdrainp_sourcep+T2_Vdrainp_sourcep));
    4997                 :          0 : T1_Vbulk_sourcep=(Leff*(Abulk_Vbulk_sourcep+T2_Vbulk_sourcep));
    4998                 :            : #endif
    4999                 :          0 : T1=(Leff*(Abulk+T2));
    5000                 :            : #if defined(_DERIVATE)
    5001                 :          0 : T9_Vgate_sourcep=((T_0_Vgate_sourcep*T1)+(T_0*T1_Vgate_sourcep));
    5002                 :          0 : T9_Vdrainp_sourcep=((T_0_Vdrainp_sourcep*T1)+(T_0*T1_Vdrainp_sourcep));
    5003                 :          0 : T9_Vbulk_sourcep=((T_0_Vbulk_sourcep*T1)+(T_0*T1_Vbulk_sourcep));
    5004                 :            : #endif
    5005                 :          0 : T9=(T_0*T1);
    5006                 :            : #if defined(_DERIVATE)
    5007                 :          0 : VACLM_Vgate_sourcep=((T9_Vgate_sourcep*diffVds)+(T9*diffVds_Vgate_sourcep));
    5008                 :          0 : VACLM_Vdrainp_sourcep=((T9_Vdrainp_sourcep*diffVds)+(T9*diffVds_Vdrainp_sourcep));
    5009                 :          0 : VACLM_Vbulk_sourcep=((T9_Vbulk_sourcep*diffVds)+(T9*diffVds_Vbulk_sourcep));
    5010                 :            : #endif
    5011                 :          0 : VACLM=(T9*diffVds);
    5012                 :            : }
    5013                 :            : else
    5014                 :            : {
    5015                 :            : #if defined(_DERIVATE)
    5016                 :          0 : VACLM_Vgate_sourcep=0.0;
    5017                 :          0 : VACLM_Vdrainp_sourcep=0.0;
    5018                 :          0 : VACLM_Vbulk_sourcep=0.0;
    5019                 :            : #endif
    5020                 :          0 : VACLM=5.834617425e14;
    5021                 :            : }
    5022         [ #  # ]:          0 : if
    5023                 :            : (thetaRout>0.0)
    5024                 :            : {
    5025                 :            : #if defined(_DERIVATE)
    5026                 :          0 : T_0_Vgate_sourcep=((((Vgst2Vtm_Vgate_sourcep*Abulk)+(Vgst2Vtm*Abulk_Vgate_sourcep))*Vdsat)+((Vgst2Vtm*Abulk)*Vdsat_Vgate_sourcep));
    5027                 :          0 : T_0_Vdrainp_sourcep=((((Vgst2Vtm_Vdrainp_sourcep*Abulk)+(Vgst2Vtm*Abulk_Vdrainp_sourcep))*Vdsat)+((Vgst2Vtm*Abulk)*Vdsat_Vdrainp_sourcep));
    5028                 :          0 : T_0_Vbulk_sourcep=((((Vgst2Vtm_Vbulk_sourcep*Abulk)+(Vgst2Vtm*Abulk_Vbulk_sourcep))*Vdsat)+((Vgst2Vtm*Abulk)*Vdsat_Vbulk_sourcep));
    5029                 :            : #endif
    5030                 :          0 : T_0=((Vgst2Vtm*Abulk)*Vdsat);
    5031                 :            : #if defined(_DERIVATE)
    5032                 :          0 : T1_Vgate_sourcep=(Vgst2Vtm_Vgate_sourcep+((Abulk_Vgate_sourcep*Vdsat)+(Abulk*Vdsat_Vgate_sourcep)));
    5033                 :          0 : T1_Vdrainp_sourcep=(Vgst2Vtm_Vdrainp_sourcep+((Abulk_Vdrainp_sourcep*Vdsat)+(Abulk*Vdsat_Vdrainp_sourcep)));
    5034                 :          0 : T1_Vbulk_sourcep=(Vgst2Vtm_Vbulk_sourcep+((Abulk_Vbulk_sourcep*Vdsat)+(Abulk*Vdsat_Vbulk_sourcep)));
    5035                 :            : #endif
    5036                 :          0 : T1=(Vgst2Vtm+(Abulk*Vdsat));
    5037                 :            : #if defined(_DERIVATE)
    5038                 :          0 : VADIBL_Vdrainp_sourcep=((Vgst2Vtm_Vdrainp_sourcep-((T_0_Vdrainp_sourcep*T1-T_0*T1_Vdrainp_sourcep)/T1/T1))/thetaRout);
    5039                 :          0 : VADIBL_Vgate_sourcep=((Vgst2Vtm_Vgate_sourcep-((T_0_Vgate_sourcep*T1-T_0*T1_Vgate_sourcep)/T1/T1))/thetaRout);
    5040                 :          0 : VADIBL_Vbulk_sourcep=((Vgst2Vtm_Vbulk_sourcep-((T_0_Vbulk_sourcep*T1-T_0*T1_Vbulk_sourcep)/T1/T1))/thetaRout);
    5041                 :            : #endif
    5042                 :          0 : VADIBL=((Vgst2Vtm-(T_0/T1))/thetaRout);
    5043                 :            : #if defined(_DERIVATE)
    5044                 :          0 : T7_Vgate_sourcep=0.0;
    5045                 :          0 : T7_Vdrainp_sourcep=(pdiblb*Vbseff_Vdrainp_sourcep);
    5046                 :          0 : T7_Vbulk_sourcep=(pdiblb*Vbseff_Vbulk_sourcep);
    5047                 :            : #endif
    5048                 :          0 : T7=(pdiblb*Vbseff);
    5049         [ #  # ]:          0 : if
    5050                 :            : (T7>=(-0.9))
    5051                 :            : {
    5052                 :            : #if defined(_DERIVATE)
    5053                 :          0 : T3_Vgate_sourcep=(-T7_Vgate_sourcep/(1.0+T7)/(1.0+T7));
    5054                 :          0 : T3_Vdrainp_sourcep=(-T7_Vdrainp_sourcep/(1.0+T7)/(1.0+T7));
    5055                 :          0 : T3_Vbulk_sourcep=(-T7_Vbulk_sourcep/(1.0+T7)/(1.0+T7));
    5056                 :            : #endif
    5057                 :          0 : T3=(1.0/(1.0+T7));
    5058                 :            : #if defined(_DERIVATE)
    5059                 :          0 : VADIBL_Vdrainp_sourcep=((T3_Vdrainp_sourcep*VADIBL)+(T3*VADIBL_Vdrainp_sourcep));
    5060                 :          0 : VADIBL_Vgate_sourcep=((T3_Vgate_sourcep*VADIBL)+(T3*VADIBL_Vgate_sourcep));
    5061                 :          0 : VADIBL_Vbulk_sourcep=((T3_Vbulk_sourcep*VADIBL)+(T3*VADIBL_Vbulk_sourcep));
    5062                 :            : #endif
    5063                 :          0 : VADIBL=(T3*VADIBL);
    5064                 :            : }
    5065                 :            : else
    5066                 :            : {
    5067                 :            : #if defined(_DERIVATE)
    5068                 :          0 : T4_Vgate_sourcep=(-T7_Vgate_sourcep/(0.8+T7)/(0.8+T7));
    5069                 :          0 : T4_Vdrainp_sourcep=(-T7_Vdrainp_sourcep/(0.8+T7)/(0.8+T7));
    5070                 :          0 : T4_Vbulk_sourcep=(-T7_Vbulk_sourcep/(0.8+T7)/(0.8+T7));
    5071                 :            : #endif
    5072                 :          0 : T4=(1.0/(0.8+T7));
    5073                 :            : #if defined(_DERIVATE)
    5074                 :          0 : T3_Vgate_sourcep=(((20.0*T7_Vgate_sourcep)*T4)+((17.0+(20.0*T7))*T4_Vgate_sourcep));
    5075                 :          0 : T3_Vdrainp_sourcep=(((20.0*T7_Vdrainp_sourcep)*T4)+((17.0+(20.0*T7))*T4_Vdrainp_sourcep));
    5076                 :          0 : T3_Vbulk_sourcep=(((20.0*T7_Vbulk_sourcep)*T4)+((17.0+(20.0*T7))*T4_Vbulk_sourcep));
    5077                 :            : #endif
    5078                 :          0 : T3=((17.0+(20.0*T7))*T4);
    5079                 :            : #if defined(_DERIVATE)
    5080                 :          0 : VADIBL_Vdrainp_sourcep=((T3_Vdrainp_sourcep*VADIBL)+(T3*VADIBL_Vdrainp_sourcep));
    5081                 :          0 : VADIBL_Vgate_sourcep=((T3_Vgate_sourcep*VADIBL)+(T3*VADIBL_Vgate_sourcep));
    5082                 :          0 : VADIBL_Vbulk_sourcep=((T3_Vbulk_sourcep*VADIBL)+(T3*VADIBL_Vbulk_sourcep));
    5083                 :            : #endif
    5084                 :          0 : VADIBL=(T3*VADIBL);
    5085                 :            : }
    5086                 :            : }
    5087                 :            : else
    5088                 :            : {
    5089                 :            : #if defined(_DERIVATE)
    5090                 :          0 : VADIBL_Vdrainp_sourcep=0.0;
    5091                 :          0 : VADIBL_Vgate_sourcep=0.0;
    5092                 :          0 : VADIBL_Vbulk_sourcep=0.0;
    5093                 :            : #endif
    5094                 :          0 : VADIBL=5.834617425e14;
    5095                 :            : }
    5096                 :            : #if defined(_DERIVATE)
    5097                 :          0 : T9_Vgate_sourcep=(((-pvag*EsatL_Vgate_sourcep/EsatL/EsatL)*Vgsteff)+((pvag/EsatL)*Vgsteff_Vgate_sourcep));
    5098                 :          0 : T9_Vdrainp_sourcep=(((-pvag*EsatL_Vdrainp_sourcep/EsatL/EsatL)*Vgsteff)+((pvag/EsatL)*Vgsteff_Vdrainp_sourcep));
    5099                 :          0 : T9_Vbulk_sourcep=(((-pvag*EsatL_Vbulk_sourcep/EsatL/EsatL)*Vgsteff)+((pvag/EsatL)*Vgsteff_Vbulk_sourcep));
    5100                 :            : #endif
    5101                 :          0 : T9=((pvag/EsatL)*Vgsteff);
    5102         [ #  # ]:          0 : if
    5103                 :            : (T9>(-0.9))
    5104                 :            : {
    5105                 :            : #if defined(_DERIVATE)
    5106                 :          0 : T_0_Vgate_sourcep=T9_Vgate_sourcep;
    5107                 :          0 : T_0_Vdrainp_sourcep=T9_Vdrainp_sourcep;
    5108                 :          0 : T_0_Vbulk_sourcep=T9_Vbulk_sourcep;
    5109                 :            : #endif
    5110                 :          0 : T_0=(1.0+T9);
    5111                 :            : }
    5112                 :            : else
    5113                 :            : {
    5114                 :            : #if defined(_DERIVATE)
    5115                 :          0 : T_0_Vgate_sourcep=((T9_Vgate_sourcep*1.0*(17.0+(20.0*T9))-((0.8+T9)*1.0)*(20.0*T9_Vgate_sourcep))/(17.0+(20.0*T9))/(17.0+(20.0*T9)));
    5116                 :          0 : T_0_Vdrainp_sourcep=((T9_Vdrainp_sourcep*1.0*(17.0+(20.0*T9))-((0.8+T9)*1.0)*(20.0*T9_Vdrainp_sourcep))/(17.0+(20.0*T9))/(17.0+(20.0*T9)));
    5117                 :          0 : T_0_Vbulk_sourcep=((T9_Vbulk_sourcep*1.0*(17.0+(20.0*T9))-((0.8+T9)*1.0)*(20.0*T9_Vbulk_sourcep))/(17.0+(20.0*T9))/(17.0+(20.0*T9)));
    5118                 :            : #endif
    5119                 :          0 : T_0=(((0.8+T9)*1.0)/(17.0+(20.0*T9)));
    5120                 :            : }
    5121                 :            : #if defined(_DERIVATE)
    5122                 :          0 : T1_Vgate_sourcep=((((VACLM_Vgate_sourcep*VADIBL)+(VACLM*VADIBL_Vgate_sourcep))*(VACLM+VADIBL)-(VACLM*VADIBL)*(VACLM_Vgate_sourcep+VADIBL_Vgate_sourcep))/(VACLM+VADIBL)/(VACLM+VADIBL));
    5123                 :          0 : T1_Vdrainp_sourcep=((((VACLM_Vdrainp_sourcep*VADIBL)+(VACLM*VADIBL_Vdrainp_sourcep))*(VACLM+VADIBL)-(VACLM*VADIBL)*(VACLM_Vdrainp_sourcep+VADIBL_Vdrainp_sourcep))/(VACLM+VADIBL)/(VACLM+VADIBL));
    5124                 :          0 : T1_Vbulk_sourcep=((((VACLM_Vbulk_sourcep*VADIBL)+(VACLM*VADIBL_Vbulk_sourcep))*(VACLM+VADIBL)-(VACLM*VADIBL)*(VACLM_Vbulk_sourcep+VADIBL_Vbulk_sourcep))/(VACLM+VADIBL)/(VACLM+VADIBL));
    5125                 :            : #endif
    5126                 :          0 : T1=((VACLM*VADIBL)/(VACLM+VADIBL));
    5127                 :            : #if defined(_DERIVATE)
    5128                 :          0 : Va_Vgate_sourcep=(Vasat_Vgate_sourcep+((T_0_Vgate_sourcep*T1)+(T_0*T1_Vgate_sourcep)));
    5129                 :          0 : Va_Vdrainp_sourcep=(Vasat_Vdrainp_sourcep+((T_0_Vdrainp_sourcep*T1)+(T_0*T1_Vdrainp_sourcep)));
    5130                 :          0 : Va_Vbulk_sourcep=(Vasat_Vbulk_sourcep+((T_0_Vbulk_sourcep*T1)+(T_0*T1_Vbulk_sourcep)));
    5131                 :            : #endif
    5132                 :          0 : Va=(Vasat+(T_0*T1));
    5133         [ #  # ]:          0 : if
    5134                 :            : (pscbe2>0.0)
    5135                 :            : {
    5136         [ #  # ]:          0 : if
    5137                 :            : (diffVds>((pscbe1*litl)/34.0))
    5138                 :            : {
    5139                 :            : {
    5140                 :          0 : double m00_exp(d00_exp0,((pscbe1*litl)/diffVds))
    5141                 :            : #if defined(_DERIVATE)
    5142                 :            : #define d10_exp0 d00_exp0
    5143                 :            : #endif
    5144                 :            : #if defined(_DERIVATE)
    5145                 :          0 : VASCBE_Vdrainp_sourcep=((Leff*(-(pscbe1*litl)*diffVds_Vdrainp_sourcep/diffVds/diffVds)*d10_exp0)/pscbe2);
    5146                 :          0 : VASCBE_Vgate_sourcep=((Leff*(-(pscbe1*litl)*diffVds_Vgate_sourcep/diffVds/diffVds)*d10_exp0)/pscbe2);
    5147                 :          0 : VASCBE_Vbulk_sourcep=((Leff*(-(pscbe1*litl)*diffVds_Vbulk_sourcep/diffVds/diffVds)*d10_exp0)/pscbe2);
    5148                 :            : #endif
    5149                 :          0 : VASCBE=((Leff*d00_exp0)/pscbe2);
    5150                 :            : }
    5151                 :            : }
    5152                 :            : else
    5153                 :            : {
    5154                 :            : #if defined(_DERIVATE)
    5155                 :          0 : VASCBE_Vdrainp_sourcep=0.0;
    5156                 :          0 : VASCBE_Vgate_sourcep=0.0;
    5157                 :          0 : VASCBE_Vbulk_sourcep=0.0;
    5158                 :            : #endif
    5159                 :          0 : VASCBE=((5.834617425e14*Leff)/pscbe2);
    5160                 :            : }
    5161                 :            : }
    5162                 :            : else
    5163                 :            : {
    5164                 :            : #if defined(_DERIVATE)
    5165                 :          0 : VASCBE_Vdrainp_sourcep=0.0;
    5166                 :          0 : VASCBE_Vgate_sourcep=0.0;
    5167                 :          0 : VASCBE_Vbulk_sourcep=0.0;
    5168                 :            : #endif
    5169                 :          0 : VASCBE=5.834617425e14;
    5170                 :            : }
    5171                 :            : #if defined(_DERIVATE)
    5172                 :          0 : CoxWovL_Vdrainp_sourcep=((cox*Weff_Vdrainp_sourcep)/Leff);
    5173                 :          0 : CoxWovL_Vgate_sourcep=((cox*Weff_Vgate_sourcep)/Leff);
    5174                 :          0 : CoxWovL_Vbulk_sourcep=((cox*Weff_Vbulk_sourcep)/Leff);
    5175                 :            : #endif
    5176                 :          0 : CoxWovL=((cox*Weff)/Leff);
    5177                 :            : #if defined(_DERIVATE)
    5178                 :          0 : beta_Vgate_sourcep=((ueff_Vgate_sourcep*CoxWovL)+(ueff*CoxWovL_Vgate_sourcep));
    5179                 :          0 : beta_Vdrainp_sourcep=((ueff_Vdrainp_sourcep*CoxWovL)+(ueff*CoxWovL_Vdrainp_sourcep));
    5180                 :          0 : beta_Vbulk_sourcep=((ueff_Vbulk_sourcep*CoxWovL)+(ueff*CoxWovL_Vbulk_sourcep));
    5181                 :            : #endif
    5182                 :          0 : beta=(ueff*CoxWovL);
    5183                 :            : #if defined(_DERIVATE)
    5184                 :          0 : fgche1_Vdrainp_sourcep=((Vgsteff_Vdrainp_sourcep*(1.0-(((0.5*Abulk)*Vdseff)/Vgst2Vtm)))+(Vgsteff*(-(((((0.5*Abulk_Vdrainp_sourcep)*Vdseff)+((0.5*Abulk)*Vdseff_Vdrainp_sourcep))*Vgst2Vtm-((0.5*Abulk)*Vdseff)*Vgst2Vtm_Vdrainp_sourcep)/Vgst2Vtm/Vgst2Vtm))));
    5185                 :          0 : fgche1_Vgate_sourcep=((Vgsteff_Vgate_sourcep*(1.0-(((0.5*Abulk)*Vdseff)/Vgst2Vtm)))+(Vgsteff*(-(((((0.5*Abulk_Vgate_sourcep)*Vdseff)+((0.5*Abulk)*Vdseff_Vgate_sourcep))*Vgst2Vtm-((0.5*Abulk)*Vdseff)*Vgst2Vtm_Vgate_sourcep)/Vgst2Vtm/Vgst2Vtm))));
    5186                 :          0 : fgche1_Vbulk_sourcep=((Vgsteff_Vbulk_sourcep*(1.0-(((0.5*Abulk)*Vdseff)/Vgst2Vtm)))+(Vgsteff*(-(((((0.5*Abulk_Vbulk_sourcep)*Vdseff)+((0.5*Abulk)*Vdseff_Vbulk_sourcep))*Vgst2Vtm-((0.5*Abulk)*Vdseff)*Vgst2Vtm_Vbulk_sourcep)/Vgst2Vtm/Vgst2Vtm))));
    5187                 :            : #endif
    5188                 :          0 : fgche1=(Vgsteff*(1.0-(((0.5*Abulk)*Vdseff)/Vgst2Vtm)));
    5189                 :            : #if defined(_DERIVATE)
    5190                 :          0 : fgche2_Vgate_sourcep=((Vdseff_Vgate_sourcep*EsatL-Vdseff*EsatL_Vgate_sourcep)/EsatL/EsatL);
    5191                 :          0 : fgche2_Vdrainp_sourcep=((Vdseff_Vdrainp_sourcep*EsatL-Vdseff*EsatL_Vdrainp_sourcep)/EsatL/EsatL);
    5192                 :          0 : fgche2_Vbulk_sourcep=((Vdseff_Vbulk_sourcep*EsatL-Vdseff*EsatL_Vbulk_sourcep)/EsatL/EsatL);
    5193                 :            : #endif
    5194                 :          0 : fgche2=(1.0+(Vdseff/EsatL));
    5195                 :            : #if defined(_DERIVATE)
    5196                 :          0 : gche_Vgate_sourcep=((((beta_Vgate_sourcep*fgche1)+(beta*fgche1_Vgate_sourcep))*fgche2-(beta*fgche1)*fgche2_Vgate_sourcep)/fgche2/fgche2);
    5197                 :          0 : gche_Vdrainp_sourcep=((((beta_Vdrainp_sourcep*fgche1)+(beta*fgche1_Vdrainp_sourcep))*fgche2-(beta*fgche1)*fgche2_Vdrainp_sourcep)/fgche2/fgche2);
    5198                 :          0 : gche_Vbulk_sourcep=((((beta_Vbulk_sourcep*fgche1)+(beta*fgche1_Vbulk_sourcep))*fgche2-(beta*fgche1)*fgche2_Vbulk_sourcep)/fgche2/fgche2);
    5199                 :            : #endif
    5200                 :          0 : gche=((beta*fgche1)/fgche2);
    5201                 :            : #if defined(_DERIVATE)
    5202                 :          0 : Idl_Vgate_sourcep=((((gche_Vgate_sourcep*Vdseff)+(gche*Vdseff_Vgate_sourcep))*(1.0+(gche*Rds))-(gche*Vdseff)*((gche_Vgate_sourcep*Rds)+(gche*Rds_Vgate_sourcep)))/(1.0+(gche*Rds))/(1.0+(gche*Rds)));
    5203                 :          0 : Idl_Vdrainp_sourcep=((((gche_Vdrainp_sourcep*Vdseff)+(gche*Vdseff_Vdrainp_sourcep))*(1.0+(gche*Rds))-(gche*Vdseff)*((gche_Vdrainp_sourcep*Rds)+(gche*Rds_Vdrainp_sourcep)))/(1.0+(gche*Rds))/(1.0+(gche*Rds)));
    5204                 :          0 : Idl_Vbulk_sourcep=((((gche_Vbulk_sourcep*Vdseff)+(gche*Vdseff_Vbulk_sourcep))*(1.0+(gche*Rds))-(gche*Vdseff)*((gche_Vbulk_sourcep*Rds)+(gche*Rds_Vbulk_sourcep)))/(1.0+(gche*Rds))/(1.0+(gche*Rds)));
    5205                 :            : #endif
    5206                 :          0 : Idl=((gche*Vdseff)/(1.0+(gche*Rds)));
    5207                 :            : #if defined(_DERIVATE)
    5208                 :          0 : Idsa_Vgate_sourcep=((Idl_Vgate_sourcep*(1.0+(diffVds/Va)))+(Idl*((diffVds_Vgate_sourcep*Va-diffVds*Va_Vgate_sourcep)/Va/Va)));
    5209                 :          0 : Idsa_Vdrainp_sourcep=((Idl_Vdrainp_sourcep*(1.0+(diffVds/Va)))+(Idl*((diffVds_Vdrainp_sourcep*Va-diffVds*Va_Vdrainp_sourcep)/Va/Va)));
    5210                 :          0 : Idsa_Vbulk_sourcep=((Idl_Vbulk_sourcep*(1.0+(diffVds/Va)))+(Idl*((diffVds_Vbulk_sourcep*Va-diffVds*Va_Vbulk_sourcep)/Va/Va)));
    5211                 :            : #endif
    5212                 :          0 : Idsa=(Idl*(1.0+(diffVds/Va)));
    5213                 :            : #if defined(_DERIVATE)
    5214                 :          0 : Ids_Vgate_sourcep=((Idsa_Vgate_sourcep*(1.0+(diffVds/VASCBE)))+(Idsa*((diffVds_Vgate_sourcep*VASCBE-diffVds*VASCBE_Vgate_sourcep)/VASCBE/VASCBE)));
    5215                 :          0 : Ids_Vdrainp_sourcep=((Idsa_Vdrainp_sourcep*(1.0+(diffVds/VASCBE)))+(Idsa*((diffVds_Vdrainp_sourcep*VASCBE-diffVds*VASCBE_Vdrainp_sourcep)/VASCBE/VASCBE)));
    5216                 :          0 : Ids_Vbulk_sourcep=((Idsa_Vbulk_sourcep*(1.0+(diffVds/VASCBE)))+(Idsa*((diffVds_Vbulk_sourcep*VASCBE-diffVds*VASCBE_Vbulk_sourcep)/VASCBE/VASCBE)));
    5217                 :            : #endif
    5218                 :          0 : Ids=(Idsa*(1.0+(diffVds/VASCBE)));
    5219                 :            : #if defined(_DERIVATE)
    5220                 :          0 : tmp_Vgate_sourcep=0.0;
    5221                 :          0 : tmp_Vdrainp_sourcep=0.0;
    5222                 :          0 : tmp_Vbulk_sourcep=0.0;
    5223                 :            : #endif
    5224                 :          0 : tmp=(alpha0+(alpha1*Leff));
    5225 [ #  # ][ #  # ]:          0 : if
    5226                 :            : ((tmp<=0.0)||(beta0<=0.0))
    5227                 :            : {
    5228                 :            : #if defined(_DERIVATE)
    5229                 :          0 : Isub_Vgate_sourcep=0.0;
    5230                 :          0 : Isub_Vdrainp_sourcep=0.0;
    5231                 :          0 : Isub_Vbulk_sourcep=0.0;
    5232                 :            : #endif
    5233                 :          0 : Isub=0.0;
    5234                 :            : }
    5235                 :            : else
    5236                 :            : {
    5237                 :            : #if defined(_DERIVATE)
    5238                 :          0 : T2_Vgate_sourcep=0.0;
    5239                 :          0 : T2_Vdrainp_sourcep=0.0;
    5240                 :          0 : T2_Vbulk_sourcep=0.0;
    5241                 :            : #endif
    5242                 :          0 : T2=(tmp/Leff);
    5243         [ #  # ]:          0 : if
    5244                 :            : (diffVds>(beta0/34.0))
    5245                 :            : {
    5246                 :            : {
    5247                 :          0 : double m00_exp(d00_exp0,((-beta0)/diffVds))
    5248                 :            : #if defined(_DERIVATE)
    5249                 :            : #define d10_exp0 d00_exp0
    5250                 :            : #endif
    5251                 :            : #if defined(_DERIVATE)
    5252                 :          0 : T1_Vgate_sourcep=((((T2_Vgate_sourcep*diffVds)+(T2*diffVds_Vgate_sourcep))*d00_exp0)+((T2*diffVds)*(-(-beta0)*diffVds_Vgate_sourcep/diffVds/diffVds)*d10_exp0));
    5253                 :          0 : T1_Vdrainp_sourcep=((((T2_Vdrainp_sourcep*diffVds)+(T2*diffVds_Vdrainp_sourcep))*d00_exp0)+((T2*diffVds)*(-(-beta0)*diffVds_Vdrainp_sourcep/diffVds/diffVds)*d10_exp0));
    5254                 :          0 : T1_Vbulk_sourcep=((((T2_Vbulk_sourcep*diffVds)+(T2*diffVds_Vbulk_sourcep))*d00_exp0)+((T2*diffVds)*(-(-beta0)*diffVds_Vbulk_sourcep/diffVds/diffVds)*d10_exp0));
    5255                 :            : #endif
    5256                 :          0 : T1=((T2*diffVds)*d00_exp0);
    5257                 :            : }
    5258                 :            : }
    5259                 :            : else
    5260                 :            : {
    5261                 :            : #if defined(_DERIVATE)
    5262                 :          0 : T1_Vgate_sourcep=((T2_Vgate_sourcep*1.713908431e-15*diffVds)+((T2*1.713908431e-15)*diffVds_Vgate_sourcep));
    5263                 :          0 : T1_Vdrainp_sourcep=((T2_Vdrainp_sourcep*1.713908431e-15*diffVds)+((T2*1.713908431e-15)*diffVds_Vdrainp_sourcep));
    5264                 :          0 : T1_Vbulk_sourcep=((T2_Vbulk_sourcep*1.713908431e-15*diffVds)+((T2*1.713908431e-15)*diffVds_Vbulk_sourcep));
    5265                 :            : #endif
    5266                 :          0 : T1=((T2*1.713908431e-15)*diffVds);
    5267                 :            : }
    5268                 :            : #if defined(_DERIVATE)
    5269                 :          0 : Isub_Vgate_sourcep=((T1_Vgate_sourcep*Idsa)+(T1*Idsa_Vgate_sourcep));
    5270                 :          0 : Isub_Vdrainp_sourcep=((T1_Vdrainp_sourcep*Idsa)+(T1*Idsa_Vdrainp_sourcep));
    5271                 :          0 : Isub_Vbulk_sourcep=((T1_Vbulk_sourcep*Idsa)+(T1*Idsa_Vbulk_sourcep));
    5272                 :            : #endif
    5273                 :          0 : Isub=(T1*Idsa);
    5274                 :            : }
    5275                 :            : #if defined(_DERIVATE)
    5276                 :          0 : cdrain_Vgate_sourcep=Ids_Vgate_sourcep;
    5277                 :          0 : cdrain_Vdrainp_sourcep=Ids_Vdrainp_sourcep;
    5278                 :          0 : cdrain_Vbulk_sourcep=Ids_Vbulk_sourcep;
    5279                 :            : #endif
    5280                 :          0 : cdrain=Ids;
    5281                 :            : #if defined(_DERIVATE)
    5282                 :          0 : csub_Vgate_sourcep=Isub_Vgate_sourcep;
    5283                 :          0 : csub_Vdrainp_sourcep=Isub_Vdrainp_sourcep;
    5284                 :          0 : csub_Vbulk_sourcep=Isub_Vbulk_sourcep;
    5285                 :            : #endif
    5286                 :          0 : csub=Isub;
    5287         [ #  # ]:          0 : if
    5288                 :            : (VERSION==3.24)
    5289                 :            : {
    5290                 :          0 : czbd=(unitAreaTempJctCap*drainArea);
    5291                 :          0 : czbs=(unitAreaTempJctCap*sourceArea);
    5292                 :            : }
    5293                 :            : else
    5294                 :            : {
    5295                 :          0 : czbd=(unitAreaJctCap*drainArea);
    5296                 :          0 : czbs=(unitAreaJctCap*sourceArea);
    5297                 :            : }
    5298         [ #  # ]:          0 : if
    5299                 :            : (drainPerimeter<weff)
    5300                 :            : {
    5301         [ #  # ]:          0 : if
    5302                 :            : (VERSION==3.24)
    5303                 :            : {
    5304                 :          0 : czbdswg=(unitLengthGateSidewallTempJctCap*drainPerimeter);
    5305                 :            : }
    5306                 :            : else
    5307                 :            : {
    5308                 :          0 : czbdswg=(unitLengthGateSidewallJctCap*drainPerimeter);
    5309                 :            : }
    5310                 :          0 : czbdsw=0.0;
    5311                 :            : }
    5312                 :            : else
    5313                 :            : {
    5314         [ #  # ]:          0 : if
    5315                 :            : (VERSION==3.24)
    5316                 :            : {
    5317                 :          0 : czbdsw=(unitLengthSidewallTempJctCap*(drainPerimeter-weff));
    5318                 :          0 : czbdswg=(unitLengthGateSidewallTempJctCap*weff);
    5319                 :            : }
    5320                 :            : else
    5321                 :            : {
    5322                 :          0 : czbdsw=(unitLengthSidewallJctCap*(drainPerimeter-weff));
    5323                 :          0 : czbdswg=(unitLengthGateSidewallJctCap*weff);
    5324                 :            : }
    5325                 :            : }
    5326         [ #  # ]:          0 : if
    5327                 :            : (sourcePerimeter<weff)
    5328                 :            : {
    5329                 :          0 : czbssw=0.0;
    5330         [ #  # ]:          0 : if
    5331                 :            : (VERSION==3.24)
    5332                 :            : {
    5333                 :          0 : czbsswg=(unitLengthGateSidewallTempJctCap*sourcePerimeter);
    5334                 :            : }
    5335                 :            : else
    5336                 :            : {
    5337                 :          0 : czbsswg=(unitLengthGateSidewallJctCap*sourcePerimeter);
    5338                 :            : }
    5339                 :            : }
    5340                 :            : else
    5341                 :            : {
    5342         [ #  # ]:          0 : if
    5343                 :            : (VERSION==3.24)
    5344                 :            : {
    5345                 :          0 : czbssw=(unitLengthSidewallTempJctCap*(sourcePerimeter-weff));
    5346                 :          0 : czbsswg=(unitLengthGateSidewallTempJctCap*weff);
    5347                 :            : }
    5348                 :            : else
    5349                 :            : {
    5350                 :          0 : czbssw=(unitLengthSidewallJctCap*(sourcePerimeter-weff));
    5351                 :          0 : czbsswg=(unitLengthGateSidewallJctCap*weff);
    5352                 :            : }
    5353                 :            : }
    5354                 :          0 : mj=bulkJctBotGradingCoeff;
    5355                 :          0 : mjsw=bulkJctSideGradingCoeff;
    5356                 :          0 : mjswg=bulkJctGateSideGradingCoeff;
    5357                 :            : #if defined(_DYNAMIC)
    5358                 :            : #if defined(_DERIVATE)
    5359                 :          0 : qbs_Vgate_sourcep=0.0;
    5360                 :          0 : qbs_Vdrainp_sourcep=0.0;
    5361                 :          0 : qbs_Vbulk_sourcep=0.0;
    5362                 :            : #endif
    5363                 :          0 : qbs=0.0;
    5364                 :            : #endif
    5365                 :            : #if defined(_DYNAMIC)
    5366                 :            : #if defined(_DERIVATE)
    5367                 :          0 : qbd_Vgate_sourcep=0.0;
    5368                 :          0 : qbd_Vdrainp_sourcep=0.0;
    5369                 :          0 : qbd_Vbulk_sourcep=0.0;
    5370                 :            : #endif
    5371                 :          0 : qbd=0.0;
    5372                 :            : #endif
    5373         [ #  # ]:          0 : if
    5374                 :            : (vbs==0.0)
    5375                 :            : {
    5376                 :            : #if defined(_DYNAMIC)
    5377                 :            : #if defined(_DERIVATE)
    5378                 :          0 : qbs_Vgate_sourcep=0.0;
    5379                 :          0 : qbs_Vdrainp_sourcep=0.0;
    5380                 :          0 : qbs_Vbulk_sourcep=0.0;
    5381                 :            : #endif
    5382                 :          0 : qbs=0.0;
    5383                 :            : #endif
    5384                 :            : #if defined(_DYNAMIC)
    5385                 :          0 : capbs=((czbs+czbssw)+czbsswg);
    5386                 :            : #endif
    5387                 :            : }
    5388                 :            : else
    5389                 :            : {
    5390         [ #  # ]:          0 : if
    5391                 :            : (vbs<0.0)
    5392                 :            : {
    5393                 :            : #ifdef _DYNAMIC
    5394         [ #  # ]:          0 : if
    5395                 :            : (czbs>0.0)
    5396                 :            : {
    5397                 :            : #if defined(_DYNAMIC)
    5398                 :            : #if defined(_DERIVATE)
    5399                 :          0 : arg_Vdrainp_sourcep=0.0;
    5400                 :          0 : arg_Vbulk_sourcep=(-(vbs_Vbulk_sourcep/PhiB));
    5401                 :            : #endif
    5402                 :          0 : arg=(1.0-(vbs/PhiB));
    5403                 :            : #endif
    5404                 :            : #ifdef _DYNAMIC
    5405         [ #  # ]:          0 : if
    5406                 :            : (mj==0.5)
    5407                 :            : {
    5408                 :            : #if defined(_DYNAMIC)
    5409                 :            : {
    5410                 :          0 : double m00_sqrt(d00_sqrt0,arg)
    5411                 :            : #if defined(_DERIVATE)
    5412                 :          0 : double m10_sqrt(d10_sqrt0,d00_sqrt0,arg)
    5413                 :            : #endif
    5414                 :            : #if defined(_DERIVATE)
    5415                 :          0 : sarg_Vdrainp_sourcep=0.0;
    5416                 :          0 : sarg_Vbulk_sourcep=(-arg_Vbulk_sourcep*d10_sqrt0/d00_sqrt0/d00_sqrt0);
    5417                 :            : #endif
    5418                 :          0 : sarg=(1.0/d00_sqrt0);
    5419                 :            : }
    5420                 :            : #endif
    5421                 :            : }
    5422                 :            : else
    5423                 :            : {
    5424                 :            : #if defined(_DYNAMIC)
    5425                 :            : {
    5426                 :          0 : double m00_logE(d00_logE0,arg)
    5427                 :          0 : double m00_exp(d00_exp1,((-mj)*d00_logE0))
    5428                 :            : #if defined(_DERIVATE)
    5429                 :          0 : double m10_logE(d10_logE0,d00_logE0,arg)
    5430                 :            : #define d10_exp1 d00_exp1
    5431                 :            : #endif
    5432                 :            : #if defined(_DERIVATE)
    5433                 :          0 : sarg_Vdrainp_sourcep=0.0;
    5434                 :          0 : sarg_Vbulk_sourcep=((-mj)*arg_Vbulk_sourcep*d10_logE0)*d10_exp1;
    5435                 :            : #endif
    5436                 :          0 : sarg=d00_exp1;
    5437                 :            : }
    5438                 :            : #endif
    5439                 :            : }
    5440                 :            : #endif /* if (...) */
    5441                 :            : #if defined(_DYNAMIC)
    5442                 :            : #if defined(_DERIVATE)
    5443                 :          0 : qbs_Vgate_sourcep=0.0;
    5444                 :          0 : qbs_Vdrainp_sourcep=0.0;
    5445                 :          0 : qbs_Vbulk_sourcep=(((PhiB*czbs)*(-((arg_Vbulk_sourcep*sarg)+(arg*sarg_Vbulk_sourcep))))/(1.0-mj));
    5446                 :            : #endif
    5447                 :          0 : qbs=(((PhiB*czbs)*(1.0-(arg*sarg)))/(1.0-mj));
    5448                 :            : #endif
    5449                 :            : #if defined(_DYNAMIC)
    5450                 :          0 : capbs=(czbs*sarg);
    5451                 :            : #endif
    5452                 :            : }
    5453                 :            : else
    5454                 :            : {
    5455                 :            : #if defined(_DYNAMIC)
    5456                 :            : #if defined(_DERIVATE)
    5457                 :          0 : qbs_Vgate_sourcep=0.0;
    5458                 :          0 : qbs_Vdrainp_sourcep=0.0;
    5459                 :          0 : qbs_Vbulk_sourcep=0.0;
    5460                 :            : #endif
    5461                 :          0 : qbs=0.0;
    5462                 :            : #endif
    5463                 :            : #if defined(_DYNAMIC)
    5464                 :          0 : capbs=0.0;
    5465                 :            : #endif
    5466                 :            : }
    5467                 :            : #endif /* if (...) */
    5468                 :            : #ifdef _DYNAMIC
    5469         [ #  # ]:          0 : if
    5470                 :            : (czbssw>0.0)
    5471                 :            : {
    5472                 :            : #if defined(_DYNAMIC)
    5473                 :            : #if defined(_DERIVATE)
    5474                 :          0 : arg_Vdrainp_sourcep=0.0;
    5475                 :          0 : arg_Vbulk_sourcep=(-(vbs_Vbulk_sourcep/PhiBSW));
    5476                 :            : #endif
    5477                 :          0 : arg=(1.0-(vbs/PhiBSW));
    5478                 :            : #endif
    5479                 :            : #ifdef _DYNAMIC
    5480         [ #  # ]:          0 : if
    5481                 :            : (mjsw==0.5)
    5482                 :            : {
    5483                 :            : #if defined(_DYNAMIC)
    5484                 :            : {
    5485                 :          0 : double m00_sqrt(d00_sqrt0,arg)
    5486                 :            : #if defined(_DERIVATE)
    5487                 :          0 : double m10_sqrt(d10_sqrt0,d00_sqrt0,arg)
    5488                 :            : #endif
    5489                 :            : #if defined(_DERIVATE)
    5490                 :          0 : sarg_Vdrainp_sourcep=0.0;
    5491                 :          0 : sarg_Vbulk_sourcep=(-arg_Vbulk_sourcep*d10_sqrt0/d00_sqrt0/d00_sqrt0);
    5492                 :            : #endif
    5493                 :          0 : sarg=(1.0/d00_sqrt0);
    5494                 :            : }
    5495                 :            : #endif
    5496                 :            : }
    5497                 :            : else
    5498                 :            : {
    5499                 :            : #if defined(_DYNAMIC)
    5500                 :            : {
    5501                 :          0 : double m00_logE(d00_logE0,arg)
    5502                 :          0 : double m00_exp(d00_exp1,((-mjsw)*d00_logE0))
    5503                 :            : #if defined(_DERIVATE)
    5504                 :          0 : double m10_logE(d10_logE0,d00_logE0,arg)
    5505                 :            : #define d10_exp1 d00_exp1
    5506                 :            : #endif
    5507                 :            : #if defined(_DERIVATE)
    5508                 :          0 : sarg_Vdrainp_sourcep=0.0;
    5509                 :          0 : sarg_Vbulk_sourcep=((-mjsw)*arg_Vbulk_sourcep*d10_logE0)*d10_exp1;
    5510                 :            : #endif
    5511                 :          0 : sarg=d00_exp1;
    5512                 :            : }
    5513                 :            : #endif
    5514                 :            : }
    5515                 :            : #endif /* if (...) */
    5516                 :            : #if defined(_DYNAMIC)
    5517                 :            : #if defined(_DERIVATE)
    5518                 :          0 : qbs_Vgate_sourcep=0.0;
    5519                 :          0 : qbs_Vdrainp_sourcep=0.0;
    5520                 :          0 : qbs_Vbulk_sourcep=(qbs_Vbulk_sourcep+(((PhiBSW*czbssw)*(-((arg_Vbulk_sourcep*sarg)+(arg*sarg_Vbulk_sourcep))))/(1.0-mjsw)));
    5521                 :            : #endif
    5522                 :          0 : qbs=(qbs+(((PhiBSW*czbssw)*(1.0-(arg*sarg)))/(1.0-mjsw)));
    5523                 :            : #endif
    5524                 :            : #if defined(_DYNAMIC)
    5525                 :          0 : capbs=(capbs+(czbssw*sarg));
    5526                 :            : #endif
    5527                 :            : }
    5528                 :            : #endif /* if (...) */
    5529                 :            : #ifdef _DYNAMIC
    5530         [ #  # ]:          0 : if
    5531                 :            : (czbsswg>0.0)
    5532                 :            : {
    5533                 :            : #if defined(_DYNAMIC)
    5534                 :            : #if defined(_DERIVATE)
    5535                 :          0 : arg_Vdrainp_sourcep=0.0;
    5536                 :          0 : arg_Vbulk_sourcep=(-(vbs_Vbulk_sourcep/PhiBSWG));
    5537                 :            : #endif
    5538                 :          0 : arg=(1.0-(vbs/PhiBSWG));
    5539                 :            : #endif
    5540                 :            : #ifdef _DYNAMIC
    5541         [ #  # ]:          0 : if
    5542                 :            : (mjswg==0.5)
    5543                 :            : {
    5544                 :            : #if defined(_DYNAMIC)
    5545                 :            : {
    5546                 :          0 : double m00_sqrt(d00_sqrt0,arg)
    5547                 :            : #if defined(_DERIVATE)
    5548                 :          0 : double m10_sqrt(d10_sqrt0,d00_sqrt0,arg)
    5549                 :            : #endif
    5550                 :            : #if defined(_DERIVATE)
    5551                 :          0 : sarg_Vdrainp_sourcep=0.0;
    5552                 :          0 : sarg_Vbulk_sourcep=(-arg_Vbulk_sourcep*d10_sqrt0/d00_sqrt0/d00_sqrt0);
    5553                 :            : #endif
    5554                 :          0 : sarg=(1.0/d00_sqrt0);
    5555                 :            : }
    5556                 :            : #endif
    5557                 :            : }
    5558                 :            : else
    5559                 :            : {
    5560                 :            : #if defined(_DYNAMIC)
    5561                 :            : {
    5562                 :          0 : double m00_logE(d00_logE0,arg)
    5563                 :          0 : double m00_exp(d00_exp1,((-mjswg)*d00_logE0))
    5564                 :            : #if defined(_DERIVATE)
    5565                 :          0 : double m10_logE(d10_logE0,d00_logE0,arg)
    5566                 :            : #define d10_exp1 d00_exp1
    5567                 :            : #endif
    5568                 :            : #if defined(_DERIVATE)
    5569                 :          0 : sarg_Vdrainp_sourcep=0.0;
    5570                 :          0 : sarg_Vbulk_sourcep=((-mjswg)*arg_Vbulk_sourcep*d10_logE0)*d10_exp1;
    5571                 :            : #endif
    5572                 :          0 : sarg=d00_exp1;
    5573                 :            : }
    5574                 :            : #endif
    5575                 :            : }
    5576                 :            : #endif /* if (...) */
    5577                 :            : #if defined(_DYNAMIC)
    5578                 :            : #if defined(_DERIVATE)
    5579                 :          0 : qbs_Vgate_sourcep=0.0;
    5580                 :          0 : qbs_Vdrainp_sourcep=0.0;
    5581                 :          0 : qbs_Vbulk_sourcep=(qbs_Vbulk_sourcep+(((PhiBSWG*czbsswg)*(-((arg_Vbulk_sourcep*sarg)+(arg*sarg_Vbulk_sourcep))))/(1.0-mjswg)));
    5582                 :            : #endif
    5583                 :          0 : qbs=(qbs+(((PhiBSWG*czbsswg)*(1.0-(arg*sarg)))/(1.0-mjswg)));
    5584                 :            : #endif
    5585                 :            : #if defined(_DYNAMIC)
    5586                 :          0 : capbs=(capbs+(czbsswg*sarg));
    5587                 :            : #endif
    5588                 :            : }
    5589                 :            : #endif /* if (...) */
    5590                 :            : }
    5591                 :            : else
    5592                 :            : {
    5593                 :            : #if defined(_DERIVATE)
    5594                 :          0 : T_0_Vgate_sourcep=0.0;
    5595                 :          0 : T_0_Vdrainp_sourcep=0.0;
    5596                 :          0 : T_0_Vbulk_sourcep=0.0;
    5597                 :            : #endif
    5598                 :          0 : T_0=((czbs+czbssw)+czbsswg);
    5599                 :            : #if defined(_DERIVATE)
    5600                 :          0 : T1_Vgate_sourcep=0.0;
    5601                 :          0 : T1_Vdrainp_sourcep=0.0;
    5602                 :          0 : T1_Vbulk_sourcep=vbs_Vbulk_sourcep*((((czbs*mj)/PhiB)+((czbssw*mjsw)/PhiBSW))+((czbsswg*mjswg)/PhiBSWG));
    5603                 :            : #endif
    5604                 :          0 : T1=(vbs*((((czbs*mj)/PhiB)+((czbssw*mjsw)/PhiBSW))+((czbsswg*mjswg)/PhiBSWG)));
    5605                 :            : #if defined(_DYNAMIC)
    5606                 :            : #if defined(_DERIVATE)
    5607                 :          0 : qbs_Vgate_sourcep=(vbs*(T_0_Vgate_sourcep+(0.5*T1_Vgate_sourcep)));
    5608                 :          0 : qbs_Vdrainp_sourcep=(vbs*(T_0_Vdrainp_sourcep+(0.5*T1_Vdrainp_sourcep)));
    5609                 :          0 : qbs_Vbulk_sourcep=((vbs_Vbulk_sourcep*(T_0+(0.5*T1)))+(vbs*(T_0_Vbulk_sourcep+(0.5*T1_Vbulk_sourcep))));
    5610                 :            : #endif
    5611                 :          0 : qbs=(vbs*(T_0+(0.5*T1)));
    5612                 :            : #endif
    5613                 :            : #if defined(_DYNAMIC)
    5614                 :          0 : capbs=(T_0+T1);
    5615                 :            : #endif
    5616                 :            : }
    5617                 :            : }
    5618         [ #  # ]:          0 : if
    5619                 :            : (vbd==0.0)
    5620                 :            : {
    5621                 :            : #if defined(_DYNAMIC)
    5622                 :            : #if defined(_DERIVATE)
    5623                 :          0 : qbd_Vgate_sourcep=0.0;
    5624                 :          0 : qbd_Vdrainp_sourcep=0.0;
    5625                 :          0 : qbd_Vbulk_sourcep=0.0;
    5626                 :            : #endif
    5627                 :          0 : qbd=0.0;
    5628                 :            : #endif
    5629                 :            : #if defined(_DYNAMIC)
    5630                 :          0 : capbd=((czbd+czbdsw)+czbdswg);
    5631                 :            : #endif
    5632                 :            : }
    5633                 :            : else
    5634                 :            : {
    5635         [ #  # ]:          0 : if
    5636                 :            : (vbd<0.0)
    5637                 :            : {
    5638                 :            : #ifdef _DYNAMIC
    5639         [ #  # ]:          0 : if
    5640                 :            : (czbd>0.0)
    5641                 :            : {
    5642                 :            : #if defined(_DYNAMIC)
    5643                 :            : #if defined(_DERIVATE)
    5644                 :          0 : arg_Vdrainp_sourcep=(-(vbd_Vdrainp_sourcep/PhiB));
    5645                 :          0 : arg_Vbulk_sourcep=(-(vbd_Vbulk_sourcep/PhiB));
    5646                 :            : #endif
    5647                 :          0 : arg=(1.0-(vbd/PhiB));
    5648                 :            : #endif
    5649                 :            : #ifdef _DYNAMIC
    5650         [ #  # ]:          0 : if
    5651                 :            : (mj==0.5)
    5652                 :            : {
    5653                 :            : #if defined(_DYNAMIC)
    5654                 :            : {
    5655                 :          0 : double m00_sqrt(d00_sqrt0,arg)
    5656                 :            : #if defined(_DERIVATE)
    5657                 :          0 : double m10_sqrt(d10_sqrt0,d00_sqrt0,arg)
    5658                 :            : #endif
    5659                 :            : #if defined(_DERIVATE)
    5660                 :          0 : sarg_Vdrainp_sourcep=(-arg_Vdrainp_sourcep*d10_sqrt0/d00_sqrt0/d00_sqrt0);
    5661                 :          0 : sarg_Vbulk_sourcep=(-arg_Vbulk_sourcep*d10_sqrt0/d00_sqrt0/d00_sqrt0);
    5662                 :            : #endif
    5663                 :          0 : sarg=(1.0/d00_sqrt0);
    5664                 :            : }
    5665                 :            : #endif
    5666                 :            : }
    5667                 :            : else
    5668                 :            : {
    5669                 :            : #if defined(_DYNAMIC)
    5670                 :            : {
    5671                 :          0 : double m00_logE(d00_logE0,arg)
    5672                 :          0 : double m00_exp(d00_exp1,((-mj)*d00_logE0))
    5673                 :            : #if defined(_DERIVATE)
    5674                 :          0 : double m10_logE(d10_logE0,d00_logE0,arg)
    5675                 :            : #define d10_exp1 d00_exp1
    5676                 :            : #endif
    5677                 :            : #if defined(_DERIVATE)
    5678                 :          0 : sarg_Vdrainp_sourcep=((-mj)*arg_Vdrainp_sourcep*d10_logE0)*d10_exp1;
    5679                 :          0 : sarg_Vbulk_sourcep=((-mj)*arg_Vbulk_sourcep*d10_logE0)*d10_exp1;
    5680                 :            : #endif
    5681                 :          0 : sarg=d00_exp1;
    5682                 :            : }
    5683                 :            : #endif
    5684                 :            : }
    5685                 :            : #endif /* if (...) */
    5686                 :            : #if defined(_DYNAMIC)
    5687                 :            : #if defined(_DERIVATE)
    5688                 :          0 : qbd_Vgate_sourcep=0.0;
    5689                 :          0 : qbd_Vdrainp_sourcep=(((PhiB*czbd)*(-((arg_Vdrainp_sourcep*sarg)+(arg*sarg_Vdrainp_sourcep))))/(1.0-mj));
    5690                 :          0 : qbd_Vbulk_sourcep=(((PhiB*czbd)*(-((arg_Vbulk_sourcep*sarg)+(arg*sarg_Vbulk_sourcep))))/(1.0-mj));
    5691                 :            : #endif
    5692                 :          0 : qbd=(((PhiB*czbd)*(1.0-(arg*sarg)))/(1.0-mj));
    5693                 :            : #endif
    5694                 :            : #if defined(_DYNAMIC)
    5695                 :          0 : capbd=(czbd*sarg);
    5696                 :            : #endif
    5697                 :            : }
    5698                 :            : else
    5699                 :            : {
    5700                 :            : #if defined(_DYNAMIC)
    5701                 :            : #if defined(_DERIVATE)
    5702                 :          0 : qbd_Vgate_sourcep=0.0;
    5703                 :          0 : qbd_Vdrainp_sourcep=0.0;
    5704                 :          0 : qbd_Vbulk_sourcep=0.0;
    5705                 :            : #endif
    5706                 :          0 : qbd=0.0;
    5707                 :            : #endif
    5708                 :            : #if defined(_DYNAMIC)
    5709                 :          0 : capbd=0.0;
    5710                 :            : #endif
    5711                 :            : }
    5712                 :            : #endif /* if (...) */
    5713                 :            : #ifdef _DYNAMIC
    5714         [ #  # ]:          0 : if
    5715                 :            : (czbdsw>0.0)
    5716                 :            : {
    5717                 :            : #if defined(_DYNAMIC)
    5718                 :            : #if defined(_DERIVATE)
    5719                 :          0 : arg_Vdrainp_sourcep=(-(vbd_Vdrainp_sourcep/PhiBSW));
    5720                 :          0 : arg_Vbulk_sourcep=(-(vbd_Vbulk_sourcep/PhiBSW));
    5721                 :            : #endif
    5722                 :          0 : arg=(1.0-(vbd/PhiBSW));
    5723                 :            : #endif
    5724                 :            : #ifdef _DYNAMIC
    5725         [ #  # ]:          0 : if
    5726                 :            : (mjsw==0.5)
    5727                 :            : {
    5728                 :            : #if defined(_DYNAMIC)
    5729                 :            : {
    5730                 :          0 : double m00_sqrt(d00_sqrt0,arg)
    5731                 :            : #if defined(_DERIVATE)
    5732                 :          0 : double m10_sqrt(d10_sqrt0,d00_sqrt0,arg)
    5733                 :            : #endif
    5734                 :            : #if defined(_DERIVATE)
    5735                 :          0 : sarg_Vdrainp_sourcep=(-arg_Vdrainp_sourcep*d10_sqrt0/d00_sqrt0/d00_sqrt0);
    5736                 :          0 : sarg_Vbulk_sourcep=(-arg_Vbulk_sourcep*d10_sqrt0/d00_sqrt0/d00_sqrt0);
    5737                 :            : #endif
    5738                 :          0 : sarg=(1.0/d00_sqrt0);
    5739                 :            : }
    5740                 :            : #endif
    5741                 :            : }
    5742                 :            : else
    5743                 :            : {
    5744                 :            : #if defined(_DYNAMIC)
    5745                 :            : {
    5746                 :          0 : double m00_logE(d00_logE0,arg)
    5747                 :          0 : double m00_exp(d00_exp1,((-mjsw)*d00_logE0))
    5748                 :            : #if defined(_DERIVATE)
    5749                 :          0 : double m10_logE(d10_logE0,d00_logE0,arg)
    5750                 :            : #define d10_exp1 d00_exp1
    5751                 :            : #endif
    5752                 :            : #if defined(_DERIVATE)
    5753                 :          0 : sarg_Vdrainp_sourcep=((-mjsw)*arg_Vdrainp_sourcep*d10_logE0)*d10_exp1;
    5754                 :          0 : sarg_Vbulk_sourcep=((-mjsw)*arg_Vbulk_sourcep*d10_logE0)*d10_exp1;
    5755                 :            : #endif
    5756                 :          0 : sarg=d00_exp1;
    5757                 :            : }
    5758                 :            : #endif
    5759                 :            : }
    5760                 :            : #endif /* if (...) */
    5761                 :            : #if defined(_DYNAMIC)
    5762                 :            : #if defined(_DERIVATE)
    5763                 :          0 : qbd_Vgate_sourcep=0.0;
    5764                 :          0 : qbd_Vdrainp_sourcep=(qbd_Vdrainp_sourcep+(((PhiBSW*czbdsw)*(-((arg_Vdrainp_sourcep*sarg)+(arg*sarg_Vdrainp_sourcep))))/(1.0-mjsw)));
    5765                 :          0 : qbd_Vbulk_sourcep=(qbd_Vbulk_sourcep+(((PhiBSW*czbdsw)*(-((arg_Vbulk_sourcep*sarg)+(arg*sarg_Vbulk_sourcep))))/(1.0-mjsw)));
    5766                 :            : #endif
    5767                 :          0 : qbd=(qbd+(((PhiBSW*czbdsw)*(1.0-(arg*sarg)))/(1.0-mjsw)));
    5768                 :            : #endif
    5769                 :            : #if defined(_DYNAMIC)
    5770                 :          0 : capbd=(capbd+(czbdsw*sarg));
    5771                 :            : #endif
    5772                 :            : }
    5773                 :            : #endif /* if (...) */
    5774                 :            : #ifdef _DYNAMIC
    5775         [ #  # ]:          0 : if
    5776                 :            : (czbdswg>0.0)
    5777                 :            : {
    5778                 :            : #if defined(_DYNAMIC)
    5779                 :            : #if defined(_DERIVATE)
    5780                 :          0 : arg_Vdrainp_sourcep=(-(vbd_Vdrainp_sourcep/PhiBSWG));
    5781                 :          0 : arg_Vbulk_sourcep=(-(vbd_Vbulk_sourcep/PhiBSWG));
    5782                 :            : #endif
    5783                 :          0 : arg=(1.0-(vbd/PhiBSWG));
    5784                 :            : #endif
    5785                 :            : #ifdef _DYNAMIC
    5786         [ #  # ]:          0 : if
    5787                 :            : (mjswg==0.5)
    5788                 :            : {
    5789                 :            : #if defined(_DYNAMIC)
    5790                 :            : {
    5791                 :          0 : double m00_sqrt(d00_sqrt0,arg)
    5792                 :            : #if defined(_DERIVATE)
    5793                 :          0 : double m10_sqrt(d10_sqrt0,d00_sqrt0,arg)
    5794                 :            : #endif
    5795                 :            : #if defined(_DERIVATE)
    5796                 :          0 : sarg_Vdrainp_sourcep=(-arg_Vdrainp_sourcep*d10_sqrt0/d00_sqrt0/d00_sqrt0);
    5797                 :          0 : sarg_Vbulk_sourcep=(-arg_Vbulk_sourcep*d10_sqrt0/d00_sqrt0/d00_sqrt0);
    5798                 :            : #endif
    5799                 :          0 : sarg=(1.0/d00_sqrt0);
    5800                 :            : }
    5801                 :            : #endif
    5802                 :            : }
    5803                 :            : else
    5804                 :            : {
    5805                 :            : #if defined(_DYNAMIC)
    5806                 :            : {
    5807                 :          0 : double m00_logE(d00_logE0,arg)
    5808                 :          0 : double m00_exp(d00_exp1,((-mjswg)*d00_logE0))
    5809                 :            : #if defined(_DERIVATE)
    5810                 :          0 : double m10_logE(d10_logE0,d00_logE0,arg)
    5811                 :            : #define d10_exp1 d00_exp1
    5812                 :            : #endif
    5813                 :            : #if defined(_DERIVATE)
    5814                 :          0 : sarg_Vdrainp_sourcep=((-mjswg)*arg_Vdrainp_sourcep*d10_logE0)*d10_exp1;
    5815                 :          0 : sarg_Vbulk_sourcep=((-mjswg)*arg_Vbulk_sourcep*d10_logE0)*d10_exp1;
    5816                 :            : #endif
    5817                 :          0 : sarg=d00_exp1;
    5818                 :            : }
    5819                 :            : #endif
    5820                 :            : }
    5821                 :            : #endif /* if (...) */
    5822                 :            : #if defined(_DYNAMIC)
    5823                 :            : #if defined(_DERIVATE)
    5824                 :          0 : qbd_Vgate_sourcep=0.0;
    5825                 :          0 : qbd_Vdrainp_sourcep=(qbd_Vdrainp_sourcep+(((PhiBSWG*czbdswg)*(-((arg_Vdrainp_sourcep*sarg)+(arg*sarg_Vdrainp_sourcep))))/(1.0-mjswg)));
    5826                 :          0 : qbd_Vbulk_sourcep=(qbd_Vbulk_sourcep+(((PhiBSWG*czbdswg)*(-((arg_Vbulk_sourcep*sarg)+(arg*sarg_Vbulk_sourcep))))/(1.0-mjswg)));
    5827                 :            : #endif
    5828                 :          0 : qbd=(qbd+(((PhiBSWG*czbdswg)*(1.0-(arg*sarg)))/(1.0-mjswg)));
    5829                 :            : #endif
    5830                 :            : #if defined(_DYNAMIC)
    5831                 :          0 : capbd=(capbd+(czbdswg*sarg));
    5832                 :            : #endif
    5833                 :            : }
    5834                 :            : #endif /* if (...) */
    5835                 :            : }
    5836                 :            : else
    5837                 :            : {
    5838                 :            : #if defined(_DERIVATE)
    5839                 :          0 : T_0_Vgate_sourcep=0.0;
    5840                 :          0 : T_0_Vdrainp_sourcep=0.0;
    5841                 :          0 : T_0_Vbulk_sourcep=0.0;
    5842                 :            : #endif
    5843                 :          0 : T_0=((czbd+czbdsw)+czbdswg);
    5844                 :            : #if defined(_DERIVATE)
    5845                 :          0 : T1_Vgate_sourcep=0.0;
    5846                 :          0 : T1_Vdrainp_sourcep=vbd_Vdrainp_sourcep*((((czbd*mj)/PhiB)+((czbdsw*mjsw)/PhiBSW))+((czbdswg*mjswg)/PhiBSWG));
    5847                 :          0 : T1_Vbulk_sourcep=vbd_Vbulk_sourcep*((((czbd*mj)/PhiB)+((czbdsw*mjsw)/PhiBSW))+((czbdswg*mjswg)/PhiBSWG));
    5848                 :            : #endif
    5849                 :          0 : T1=(vbd*((((czbd*mj)/PhiB)+((czbdsw*mjsw)/PhiBSW))+((czbdswg*mjswg)/PhiBSWG)));
    5850                 :            : #if defined(_DYNAMIC)
    5851                 :            : #if defined(_DERIVATE)
    5852                 :          0 : qbd_Vgate_sourcep=(vbd*(T_0_Vgate_sourcep+(0.5*T1_Vgate_sourcep)));
    5853                 :          0 : qbd_Vdrainp_sourcep=((vbd_Vdrainp_sourcep*(T_0+(0.5*T1)))+(vbd*(T_0_Vdrainp_sourcep+(0.5*T1_Vdrainp_sourcep))));
    5854                 :          0 : qbd_Vbulk_sourcep=((vbd_Vbulk_sourcep*(T_0+(0.5*T1)))+(vbd*(T_0_Vbulk_sourcep+(0.5*T1_Vbulk_sourcep))));
    5855                 :            : #endif
    5856                 :          0 : qbd=(vbd*(T_0+(0.5*T1)));
    5857                 :            : #endif
    5858                 :            : #if defined(_DYNAMIC)
    5859                 :          0 : capbd=(T_0+T1);
    5860                 :            : #endif
    5861                 :            : }
    5862                 :            : }
    5863                 :            : #if defined(_DERIVATE)
    5864                 :          0 : qgate_Vdrainp_sourcep=0.0;
    5865                 :          0 : qgate_Vgate_sourcep=0.0;
    5866                 :          0 : qgate_Vbulk_sourcep=0.0;
    5867                 :            : #endif
    5868                 :          0 : qgate=0.0;
    5869                 :            : #if defined(_DERIVATE)
    5870                 :          0 : qdrn_Vgate_sourcep=0.0;
    5871                 :          0 : qdrn_Vdrainp_sourcep=0.0;
    5872                 :          0 : qdrn_Vbulk_sourcep=0.0;
    5873                 :            : #endif
    5874                 :          0 : qdrn=0.0;
    5875                 :            : #if defined(_DYNAMIC)
    5876                 :            : #if defined(_DERIVATE)
    5877                 :          0 : qsrc_Vgate_sourcep=0.0;
    5878                 :          0 : qsrc_Vdrainp_sourcep=0.0;
    5879                 :          0 : qsrc_Vbulk_sourcep=0.0;
    5880                 :            : #endif
    5881                 :          0 : qsrc=0.0;
    5882                 :            : #endif
    5883                 :            : #if defined(_DERIVATE)
    5884                 :          0 : qbulk_Vdrainp_sourcep=0.0;
    5885                 :          0 : qbulk_Vgate_sourcep=0.0;
    5886                 :          0 : qbulk_Vbulk_sourcep=0.0;
    5887                 :            : #endif
    5888                 :          0 : qbulk=0.0;
    5889         [ #  # ]:          0 : if
    5890                 :            : (XPART<0)
    5891                 :            : {
    5892                 :            : #if defined(_DERIVATE)
    5893                 :          0 : qgate_Vdrainp_sourcep=0.0;
    5894                 :          0 : qgate_Vgate_sourcep=0.0;
    5895                 :          0 : qgate_Vbulk_sourcep=0.0;
    5896                 :            : #endif
    5897                 :          0 : qgate=0.0;
    5898                 :            : #if defined(_DERIVATE)
    5899                 :          0 : qdrn_Vgate_sourcep=0.0;
    5900                 :          0 : qdrn_Vdrainp_sourcep=0.0;
    5901                 :          0 : qdrn_Vbulk_sourcep=0.0;
    5902                 :            : #endif
    5903                 :          0 : qdrn=0.0;
    5904                 :            : #if defined(_DYNAMIC)
    5905                 :            : #if defined(_DERIVATE)
    5906                 :          0 : qsrc_Vgate_sourcep=0.0;
    5907                 :          0 : qsrc_Vdrainp_sourcep=0.0;
    5908                 :          0 : qsrc_Vbulk_sourcep=0.0;
    5909                 :            : #endif
    5910                 :          0 : qsrc=0.0;
    5911                 :            : #endif
    5912                 :            : #if defined(_DERIVATE)
    5913                 :          0 : qbulk_Vdrainp_sourcep=0.0;
    5914                 :          0 : qbulk_Vgate_sourcep=0.0;
    5915                 :          0 : qbulk_Vbulk_sourcep=0.0;
    5916                 :            : #endif
    5917                 :          0 : qbulk=0.0;
    5918                 :            : }
    5919                 :            : else
    5920                 :            : {
    5921         [ #  # ]:          0 : if
    5922                 :            : (CAPMOD==0)
    5923                 :            : {
    5924         [ #  # ]:          0 : if
    5925                 :            : (Vbseff<0.0)
    5926                 :            : {
    5927                 :            : #if defined(_DERIVATE)
    5928                 :          0 : Vbseff_Vdrainp_sourcep=Vbs_Vdrainp_sourcep;
    5929                 :          0 : Vbseff_Vbulk_sourcep=Vbs_Vbulk_sourcep;
    5930                 :            : #endif
    5931                 :          0 : Vbseff=Vbs;
    5932                 :            : }
    5933                 :            : else
    5934                 :            : {
    5935                 :            : #if defined(_DERIVATE)
    5936                 :          0 : Vbseff_Vdrainp_sourcep=(-Phis_Vdrainp_sourcep);
    5937                 :          0 : Vbseff_Vbulk_sourcep=(-Phis_Vbulk_sourcep);
    5938                 :            : #endif
    5939                 :          0 : Vbseff=(phi-Phis);
    5940                 :            : }
    5941                 :            : #if defined(_DERIVATE)
    5942                 :          0 : Vfb_Vdrainp_sourcep=0.0;
    5943                 :          0 : Vfb_Vbulk_sourcep=0.0;
    5944                 :            : #endif
    5945                 :          0 : Vfb=vfbcv;
    5946                 :            : #if defined(_DERIVATE)
    5947                 :          0 : Vth_Vdrainp_sourcep=(Vfb_Vdrainp_sourcep+(k1ox*sqrtPhis_Vdrainp_sourcep));
    5948                 :          0 : Vth_Vbulk_sourcep=(Vfb_Vbulk_sourcep+(k1ox*sqrtPhis_Vbulk_sourcep));
    5949                 :            : #endif
    5950                 :          0 : Vth=((Vfb+phi)+(k1ox*sqrtPhis));
    5951                 :            : #if defined(_DERIVATE)
    5952                 :          0 : Vgst_Vdrainp_sourcep=(Vgs_eff_Vdrainp_sourcep-Vth_Vdrainp_sourcep);
    5953                 :          0 : Vgst_Vgate_sourcep=Vgs_eff_Vgate_sourcep;
    5954                 :          0 : Vgst_Vbulk_sourcep=(Vgs_eff_Vbulk_sourcep-Vth_Vbulk_sourcep);
    5955                 :            : #endif
    5956                 :          0 : Vgst=(Vgs_eff-Vth);
    5957                 :          0 : CoxWL=((cox*weffCV)*leffCV);
    5958                 :            : #if defined(_DERIVATE)
    5959                 :          0 : Arg1_Vdrainp_sourcep=((Vgs_eff_Vdrainp_sourcep-Vbseff_Vdrainp_sourcep)-Vfb_Vdrainp_sourcep);
    5960                 :          0 : Arg1_Vgate_sourcep=Vgs_eff_Vgate_sourcep;
    5961                 :          0 : Arg1_Vbulk_sourcep=((Vgs_eff_Vbulk_sourcep-Vbseff_Vbulk_sourcep)-Vfb_Vbulk_sourcep);
    5962                 :            : #endif
    5963                 :          0 : Arg1=((Vgs_eff-Vbseff)-Vfb);
    5964         [ #  # ]:          0 : if
    5965                 :            : (Arg1<=0.0)
    5966                 :            : {
    5967                 :            : #if defined(_DERIVATE)
    5968                 :          0 : qgate_Vdrainp_sourcep=(CoxWL*Arg1_Vdrainp_sourcep);
    5969                 :          0 : qgate_Vgate_sourcep=(CoxWL*Arg1_Vgate_sourcep);
    5970                 :          0 : qgate_Vbulk_sourcep=(CoxWL*Arg1_Vbulk_sourcep);
    5971                 :            : #endif
    5972                 :          0 : qgate=(CoxWL*Arg1);
    5973                 :            : #if defined(_DERIVATE)
    5974                 :          0 : qbulk_Vdrainp_sourcep=(-qgate_Vdrainp_sourcep);
    5975                 :          0 : qbulk_Vgate_sourcep=(-qgate_Vgate_sourcep);
    5976                 :          0 : qbulk_Vbulk_sourcep=(-qgate_Vbulk_sourcep);
    5977                 :            : #endif
    5978                 :          0 : qbulk=(-qgate);
    5979                 :            : #if defined(_DERIVATE)
    5980                 :          0 : qdrn_Vgate_sourcep=0.0;
    5981                 :          0 : qdrn_Vdrainp_sourcep=0.0;
    5982                 :          0 : qdrn_Vbulk_sourcep=0.0;
    5983                 :            : #endif
    5984                 :          0 : qdrn=0.0;
    5985                 :            : #if defined(_DERIVATE)
    5986                 :          0 : qinv_Vdrainp_sourcep=0.0;
    5987                 :          0 : qinv_Vgate_sourcep=0.0;
    5988                 :          0 : qinv_Vbulk_sourcep=0.0;
    5989                 :            : #endif
    5990                 :          0 : qinv=0.0;
    5991                 :            : }
    5992                 :            : else
    5993                 :            : {
    5994         [ #  # ]:          0 : if
    5995                 :            : (Vgst<=0.0)
    5996                 :            : {
    5997                 :            : #if defined(_DERIVATE)
    5998                 :          0 : T1_Vgate_sourcep=0.0;
    5999                 :          0 : T1_Vdrainp_sourcep=0.0;
    6000                 :          0 : T1_Vbulk_sourcep=0.0;
    6001                 :            : #endif
    6002                 :          0 : T1=(0.5*k1ox);
    6003                 :            : {
    6004                 :          0 : double m00_sqrt(d00_sqrt0,((T1*T1)+Arg1))
    6005                 :            : #if defined(_DERIVATE)
    6006                 :          0 : double m10_sqrt(d10_sqrt0,d00_sqrt0,((T1*T1)+Arg1))
    6007                 :            : #endif
    6008                 :            : #if defined(_DERIVATE)
    6009                 :          0 : T2_Vgate_sourcep=(((T1_Vgate_sourcep*T1)+(T1*T1_Vgate_sourcep))+Arg1_Vgate_sourcep)*d10_sqrt0;
    6010                 :          0 : T2_Vdrainp_sourcep=(((T1_Vdrainp_sourcep*T1)+(T1*T1_Vdrainp_sourcep))+Arg1_Vdrainp_sourcep)*d10_sqrt0;
    6011                 :          0 : T2_Vbulk_sourcep=(((T1_Vbulk_sourcep*T1)+(T1*T1_Vbulk_sourcep))+Arg1_Vbulk_sourcep)*d10_sqrt0;
    6012                 :            : #endif
    6013                 :          0 : T2=d00_sqrt0;
    6014                 :            : }
    6015                 :            : #if defined(_DERIVATE)
    6016                 :          0 : qgate_Vdrainp_sourcep=((CoxWL*k1ox)*(T2_Vdrainp_sourcep-T1_Vdrainp_sourcep));
    6017                 :          0 : qgate_Vgate_sourcep=((CoxWL*k1ox)*(T2_Vgate_sourcep-T1_Vgate_sourcep));
    6018                 :          0 : qgate_Vbulk_sourcep=((CoxWL*k1ox)*(T2_Vbulk_sourcep-T1_Vbulk_sourcep));
    6019                 :            : #endif
    6020                 :          0 : qgate=((CoxWL*k1ox)*(T2-T1));
    6021                 :            : #if defined(_DERIVATE)
    6022                 :          0 : qbulk_Vdrainp_sourcep=(-qgate_Vdrainp_sourcep);
    6023                 :          0 : qbulk_Vgate_sourcep=(-qgate_Vgate_sourcep);
    6024                 :          0 : qbulk_Vbulk_sourcep=(-qgate_Vbulk_sourcep);
    6025                 :            : #endif
    6026                 :          0 : qbulk=(-qgate);
    6027                 :            : #if defined(_DERIVATE)
    6028                 :          0 : qdrn_Vgate_sourcep=0.0;
    6029                 :          0 : qdrn_Vdrainp_sourcep=0.0;
    6030                 :          0 : qdrn_Vbulk_sourcep=0.0;
    6031                 :            : #endif
    6032                 :          0 : qdrn=0.0;
    6033                 :            : #if defined(_DERIVATE)
    6034                 :          0 : qinv_Vdrainp_sourcep=0.0;
    6035                 :          0 : qinv_Vgate_sourcep=0.0;
    6036                 :          0 : qinv_Vbulk_sourcep=0.0;
    6037                 :            : #endif
    6038                 :          0 : qinv=0.0;
    6039                 :            : }
    6040                 :            : else
    6041                 :            : {
    6042                 :          0 : One_Third_CoxWL=(CoxWL/3.0);
    6043                 :          0 : Two_Third_CoxWL=(2.0*One_Third_CoxWL);
    6044                 :            : #if defined(_DERIVATE)
    6045                 :          0 : AbulkCV_Vgate_sourcep=Abulk0_Vgate_sourcep*abulkCVfactor;
    6046                 :          0 : AbulkCV_Vdrainp_sourcep=Abulk0_Vdrainp_sourcep*abulkCVfactor;
    6047                 :          0 : AbulkCV_Vbulk_sourcep=Abulk0_Vbulk_sourcep*abulkCVfactor;
    6048                 :            : #endif
    6049                 :          0 : AbulkCV=(Abulk0*abulkCVfactor);
    6050                 :            : #if defined(_DERIVATE)
    6051                 :          0 : Vdsat_Vgate_sourcep=((Vgst_Vgate_sourcep*AbulkCV-Vgst*AbulkCV_Vgate_sourcep)/AbulkCV/AbulkCV);
    6052                 :          0 : Vdsat_Vdrainp_sourcep=((Vgst_Vdrainp_sourcep*AbulkCV-Vgst*AbulkCV_Vdrainp_sourcep)/AbulkCV/AbulkCV);
    6053                 :          0 : Vdsat_Vbulk_sourcep=((Vgst_Vbulk_sourcep*AbulkCV-Vgst*AbulkCV_Vbulk_sourcep)/AbulkCV/AbulkCV);
    6054                 :            : #endif
    6055                 :          0 : Vdsat=(Vgst/AbulkCV);
    6056         [ #  # ]:          0 : if
    6057                 :            : (XPART>0.5)
    6058                 :            : {
    6059         [ #  # ]:          0 : if
    6060                 :            : (Vdsat<=Vds)
    6061                 :            : {
    6062                 :            : #if defined(_DERIVATE)
    6063                 :          0 : T1_Vgate_sourcep=(Vdsat_Vgate_sourcep/3.0);
    6064                 :          0 : T1_Vdrainp_sourcep=(Vdsat_Vdrainp_sourcep/3.0);
    6065                 :          0 : T1_Vbulk_sourcep=(Vdsat_Vbulk_sourcep/3.0);
    6066                 :            : #endif
    6067                 :          0 : T1=(Vdsat/3.0);
    6068                 :            : #if defined(_DERIVATE)
    6069                 :          0 : qgate_Vdrainp_sourcep=(CoxWL*((Vgs_eff_Vdrainp_sourcep-Vfb_Vdrainp_sourcep)-T1_Vdrainp_sourcep));
    6070                 :          0 : qgate_Vgate_sourcep=(CoxWL*(Vgs_eff_Vgate_sourcep-T1_Vgate_sourcep));
    6071                 :          0 : qgate_Vbulk_sourcep=(CoxWL*((Vgs_eff_Vbulk_sourcep-Vfb_Vbulk_sourcep)-T1_Vbulk_sourcep));
    6072                 :            : #endif
    6073                 :          0 : qgate=(CoxWL*(((Vgs_eff-Vfb)-phi)-T1));
    6074                 :            : #if defined(_DERIVATE)
    6075                 :          0 : T2_Vgate_sourcep=((-Two_Third_CoxWL)*Vgst_Vgate_sourcep);
    6076                 :          0 : T2_Vdrainp_sourcep=((-Two_Third_CoxWL)*Vgst_Vdrainp_sourcep);
    6077                 :          0 : T2_Vbulk_sourcep=((-Two_Third_CoxWL)*Vgst_Vbulk_sourcep);
    6078                 :            : #endif
    6079                 :          0 : T2=((-Two_Third_CoxWL)*Vgst);
    6080                 :            : #if defined(_DERIVATE)
    6081                 :          0 : qbulk_Vdrainp_sourcep=(-(qgate_Vdrainp_sourcep+T2_Vdrainp_sourcep));
    6082                 :          0 : qbulk_Vgate_sourcep=(-(qgate_Vgate_sourcep+T2_Vgate_sourcep));
    6083                 :          0 : qbulk_Vbulk_sourcep=(-(qgate_Vbulk_sourcep+T2_Vbulk_sourcep));
    6084                 :            : #endif
    6085                 :          0 : qbulk=(-(qgate+T2));
    6086                 :            : #if defined(_DERIVATE)
    6087                 :          0 : qdrn_Vgate_sourcep=0.0;
    6088                 :          0 : qdrn_Vdrainp_sourcep=0.0;
    6089                 :          0 : qdrn_Vbulk_sourcep=0.0;
    6090                 :            : #endif
    6091                 :          0 : qdrn=0.0;
    6092                 :            : #if defined(_DERIVATE)
    6093                 :          0 : qinv_Vdrainp_sourcep=(-(qgate_Vdrainp_sourcep+qbulk_Vdrainp_sourcep));
    6094                 :          0 : qinv_Vgate_sourcep=(-(qgate_Vgate_sourcep+qbulk_Vgate_sourcep));
    6095                 :          0 : qinv_Vbulk_sourcep=(-(qgate_Vbulk_sourcep+qbulk_Vbulk_sourcep));
    6096                 :            : #endif
    6097                 :          0 : qinv=(-(qgate+qbulk));
    6098                 :            : }
    6099                 :            : else
    6100                 :            : {
    6101                 :            : #if defined(_DERIVATE)
    6102                 :          0 : Alphaz_Vdrainp_sourcep=((Vgst_Vdrainp_sourcep*Vdsat-Vgst*Vdsat_Vdrainp_sourcep)/Vdsat/Vdsat);
    6103                 :          0 : Alphaz_Vgate_sourcep=((Vgst_Vgate_sourcep*Vdsat-Vgst*Vdsat_Vgate_sourcep)/Vdsat/Vdsat);
    6104                 :          0 : Alphaz_Vbulk_sourcep=((Vgst_Vbulk_sourcep*Vdsat-Vgst*Vdsat_Vbulk_sourcep)/Vdsat/Vdsat);
    6105                 :            : #endif
    6106                 :          0 : Alphaz=(Vgst/Vdsat);
    6107                 :            : #if defined(_DERIVATE)
    6108                 :          0 : T1_Vgate_sourcep=(2.0*Vdsat_Vgate_sourcep);
    6109                 :          0 : T1_Vdrainp_sourcep=((2.0*Vdsat_Vdrainp_sourcep)-Vds_Vdrainp_sourcep);
    6110                 :          0 : T1_Vbulk_sourcep=(2.0*Vdsat_Vbulk_sourcep);
    6111                 :            : #endif
    6112                 :          0 : T1=((2.0*Vdsat)-Vds);
    6113                 :            : #if defined(_DERIVATE)
    6114                 :          0 : T2_Vgate_sourcep=(-Vds*(3.0*T1_Vgate_sourcep)/(3.0*T1)/(3.0*T1));
    6115                 :          0 : T2_Vdrainp_sourcep=((Vds_Vdrainp_sourcep*(3.0*T1)-Vds*(3.0*T1_Vdrainp_sourcep))/(3.0*T1)/(3.0*T1));
    6116                 :          0 : T2_Vbulk_sourcep=(-Vds*(3.0*T1_Vbulk_sourcep)/(3.0*T1)/(3.0*T1));
    6117                 :            : #endif
    6118                 :          0 : T2=(Vds/(3.0*T1));
    6119                 :            : #if defined(_DERIVATE)
    6120                 :          0 : T3_Vgate_sourcep=T2_Vgate_sourcep*Vds;
    6121                 :          0 : T3_Vdrainp_sourcep=((T2_Vdrainp_sourcep*Vds)+(T2*Vds_Vdrainp_sourcep));
    6122                 :          0 : T3_Vbulk_sourcep=T2_Vbulk_sourcep*Vds;
    6123                 :            : #endif
    6124                 :          0 : T3=(T2*Vds);
    6125                 :            : #if defined(_DERIVATE)
    6126                 :          0 : T9_Vgate_sourcep=0.0;
    6127                 :          0 : T9_Vdrainp_sourcep=0.0;
    6128                 :          0 : T9_Vbulk_sourcep=0.0;
    6129                 :            : #endif
    6130                 :          0 : T9=(0.25*CoxWL);
    6131                 :            : #if defined(_DERIVATE)
    6132                 :          0 : T4_Vgate_sourcep=((T9_Vgate_sourcep*Alphaz)+(T9*Alphaz_Vgate_sourcep));
    6133                 :          0 : T4_Vdrainp_sourcep=((T9_Vdrainp_sourcep*Alphaz)+(T9*Alphaz_Vdrainp_sourcep));
    6134                 :          0 : T4_Vbulk_sourcep=((T9_Vbulk_sourcep*Alphaz)+(T9*Alphaz_Vbulk_sourcep));
    6135                 :            : #endif
    6136                 :          0 : T4=(T9*Alphaz);
    6137                 :            : #if defined(_DERIVATE)
    6138                 :          0 : T7_Vgate_sourcep=((-T1_Vgate_sourcep)-(3.0*T3_Vgate_sourcep));
    6139                 :          0 : T7_Vdrainp_sourcep=(((2.0*Vds_Vdrainp_sourcep)-T1_Vdrainp_sourcep)-(3.0*T3_Vdrainp_sourcep));
    6140                 :          0 : T7_Vbulk_sourcep=((-T1_Vbulk_sourcep)-(3.0*T3_Vbulk_sourcep));
    6141                 :            : #endif
    6142                 :          0 : T7=(((2.0*Vds)-T1)-(3.0*T3));
    6143                 :            : #if defined(_DERIVATE)
    6144                 :          0 : T8_Vgate_sourcep=(T3_Vgate_sourcep-T1_Vgate_sourcep);
    6145                 :          0 : T8_Vdrainp_sourcep=((T3_Vdrainp_sourcep-T1_Vdrainp_sourcep)-(2.0*Vds_Vdrainp_sourcep));
    6146                 :          0 : T8_Vbulk_sourcep=(T3_Vbulk_sourcep-T1_Vbulk_sourcep);
    6147                 :            : #endif
    6148                 :          0 : T8=((T3-T1)-(2.0*Vds));
    6149                 :            : #if defined(_DERIVATE)
    6150                 :          0 : qgate_Vdrainp_sourcep=(CoxWL*((Vgs_eff_Vdrainp_sourcep-Vfb_Vdrainp_sourcep)-(0.5*(Vds_Vdrainp_sourcep-T3_Vdrainp_sourcep))));
    6151                 :          0 : qgate_Vgate_sourcep=(CoxWL*(Vgs_eff_Vgate_sourcep-(0.5*(-T3_Vgate_sourcep))));
    6152                 :          0 : qgate_Vbulk_sourcep=(CoxWL*((Vgs_eff_Vbulk_sourcep-Vfb_Vbulk_sourcep)-(0.5*(-T3_Vbulk_sourcep))));
    6153                 :            : #endif
    6154                 :          0 : qgate=(CoxWL*(((Vgs_eff-Vfb)-phi)-(0.5*(Vds-T3))));
    6155                 :            : #if defined(_DERIVATE)
    6156                 :          0 : T10_Vgate_sourcep=((T4_Vgate_sourcep*T8)+(T4*T8_Vgate_sourcep));
    6157                 :          0 : T10_Vdrainp_sourcep=((T4_Vdrainp_sourcep*T8)+(T4*T8_Vdrainp_sourcep));
    6158                 :          0 : T10_Vbulk_sourcep=((T4_Vbulk_sourcep*T8)+(T4*T8_Vbulk_sourcep));
    6159                 :            : #endif
    6160                 :          0 : T10=(T4*T8);
    6161                 :            : #if defined(_DERIVATE)
    6162                 :          0 : qdrn_Vgate_sourcep=((T4_Vgate_sourcep*T7)+(T4*T7_Vgate_sourcep));
    6163                 :          0 : qdrn_Vdrainp_sourcep=((T4_Vdrainp_sourcep*T7)+(T4*T7_Vdrainp_sourcep));
    6164                 :          0 : qdrn_Vbulk_sourcep=((T4_Vbulk_sourcep*T7)+(T4*T7_Vbulk_sourcep));
    6165                 :            : #endif
    6166                 :          0 : qdrn=(T4*T7);
    6167                 :            : #if defined(_DERIVATE)
    6168                 :          0 : qbulk_Vdrainp_sourcep=(-((qgate_Vdrainp_sourcep+qdrn_Vdrainp_sourcep)+T10_Vdrainp_sourcep));
    6169                 :          0 : qbulk_Vgate_sourcep=(-((qgate_Vgate_sourcep+qdrn_Vgate_sourcep)+T10_Vgate_sourcep));
    6170                 :          0 : qbulk_Vbulk_sourcep=(-((qgate_Vbulk_sourcep+qdrn_Vbulk_sourcep)+T10_Vbulk_sourcep));
    6171                 :            : #endif
    6172                 :          0 : qbulk=(-((qgate+qdrn)+T10));
    6173                 :            : #if defined(_DERIVATE)
    6174                 :          0 : qinv_Vdrainp_sourcep=(-(qgate_Vdrainp_sourcep+qbulk_Vdrainp_sourcep));
    6175                 :          0 : qinv_Vgate_sourcep=(-(qgate_Vgate_sourcep+qbulk_Vgate_sourcep));
    6176                 :          0 : qinv_Vbulk_sourcep=(-(qgate_Vbulk_sourcep+qbulk_Vbulk_sourcep));
    6177                 :            : #endif
    6178                 :          0 : qinv=(-(qgate+qbulk));
    6179                 :            : }
    6180                 :            : }
    6181                 :            : else
    6182                 :            : {
    6183         [ #  # ]:          0 : if
    6184                 :            : (XPART<0.5)
    6185                 :            : {
    6186         [ #  # ]:          0 : if
    6187                 :            : (Vds>=Vdsat)
    6188                 :            : {
    6189                 :            : #if defined(_DERIVATE)
    6190                 :          0 : T1_Vgate_sourcep=(Vdsat_Vgate_sourcep/3.0);
    6191                 :          0 : T1_Vdrainp_sourcep=(Vdsat_Vdrainp_sourcep/3.0);
    6192                 :          0 : T1_Vbulk_sourcep=(Vdsat_Vbulk_sourcep/3.0);
    6193                 :            : #endif
    6194                 :          0 : T1=(Vdsat/3.0);
    6195                 :            : #if defined(_DERIVATE)
    6196                 :          0 : qgate_Vdrainp_sourcep=(CoxWL*((Vgs_eff_Vdrainp_sourcep-Vfb_Vdrainp_sourcep)-T1_Vdrainp_sourcep));
    6197                 :          0 : qgate_Vgate_sourcep=(CoxWL*(Vgs_eff_Vgate_sourcep-T1_Vgate_sourcep));
    6198                 :          0 : qgate_Vbulk_sourcep=(CoxWL*((Vgs_eff_Vbulk_sourcep-Vfb_Vbulk_sourcep)-T1_Vbulk_sourcep));
    6199                 :            : #endif
    6200                 :          0 : qgate=(CoxWL*(((Vgs_eff-Vfb)-phi)-T1));
    6201                 :            : #if defined(_DERIVATE)
    6202                 :          0 : T2_Vgate_sourcep=((-Two_Third_CoxWL)*Vgst_Vgate_sourcep);
    6203                 :          0 : T2_Vdrainp_sourcep=((-Two_Third_CoxWL)*Vgst_Vdrainp_sourcep);
    6204                 :          0 : T2_Vbulk_sourcep=((-Two_Third_CoxWL)*Vgst_Vbulk_sourcep);
    6205                 :            : #endif
    6206                 :          0 : T2=((-Two_Third_CoxWL)*Vgst);
    6207                 :            : #if defined(_DERIVATE)
    6208                 :          0 : qbulk_Vdrainp_sourcep=(-(qgate_Vdrainp_sourcep+T2_Vdrainp_sourcep));
    6209                 :          0 : qbulk_Vgate_sourcep=(-(qgate_Vgate_sourcep+T2_Vgate_sourcep));
    6210                 :          0 : qbulk_Vbulk_sourcep=(-(qgate_Vbulk_sourcep+T2_Vbulk_sourcep));
    6211                 :            : #endif
    6212                 :          0 : qbulk=(-(qgate+T2));
    6213                 :            : #if defined(_DERIVATE)
    6214                 :          0 : qdrn_Vgate_sourcep=(0.4*T2_Vgate_sourcep);
    6215                 :          0 : qdrn_Vdrainp_sourcep=(0.4*T2_Vdrainp_sourcep);
    6216                 :          0 : qdrn_Vbulk_sourcep=(0.4*T2_Vbulk_sourcep);
    6217                 :            : #endif
    6218                 :          0 : qdrn=(0.4*T2);
    6219                 :            : #if defined(_DERIVATE)
    6220                 :          0 : qinv_Vdrainp_sourcep=(-(qgate_Vdrainp_sourcep+qbulk_Vdrainp_sourcep));
    6221                 :          0 : qinv_Vgate_sourcep=(-(qgate_Vgate_sourcep+qbulk_Vgate_sourcep));
    6222                 :          0 : qinv_Vbulk_sourcep=(-(qgate_Vbulk_sourcep+qbulk_Vbulk_sourcep));
    6223                 :            : #endif
    6224                 :          0 : qinv=(-(qgate+qbulk));
    6225                 :            : }
    6226                 :            : else
    6227                 :            : {
    6228                 :            : #if defined(_DERIVATE)
    6229                 :          0 : Alphaz_Vdrainp_sourcep=((Vgst_Vdrainp_sourcep*Vdsat-Vgst*Vdsat_Vdrainp_sourcep)/Vdsat/Vdsat);
    6230                 :          0 : Alphaz_Vgate_sourcep=((Vgst_Vgate_sourcep*Vdsat-Vgst*Vdsat_Vgate_sourcep)/Vdsat/Vdsat);
    6231                 :          0 : Alphaz_Vbulk_sourcep=((Vgst_Vbulk_sourcep*Vdsat-Vgst*Vdsat_Vbulk_sourcep)/Vdsat/Vdsat);
    6232                 :            : #endif
    6233                 :          0 : Alphaz=(Vgst/Vdsat);
    6234                 :            : #if defined(_DERIVATE)
    6235                 :          0 : T1_Vgate_sourcep=(2.0*Vdsat_Vgate_sourcep);
    6236                 :          0 : T1_Vdrainp_sourcep=((2.0*Vdsat_Vdrainp_sourcep)-Vds_Vdrainp_sourcep);
    6237                 :          0 : T1_Vbulk_sourcep=(2.0*Vdsat_Vbulk_sourcep);
    6238                 :            : #endif
    6239                 :          0 : T1=((2.0*Vdsat)-Vds);
    6240                 :            : #if defined(_DERIVATE)
    6241                 :          0 : T2_Vgate_sourcep=(-Vds*(3.0*T1_Vgate_sourcep)/(3.0*T1)/(3.0*T1));
    6242                 :          0 : T2_Vdrainp_sourcep=((Vds_Vdrainp_sourcep*(3.0*T1)-Vds*(3.0*T1_Vdrainp_sourcep))/(3.0*T1)/(3.0*T1));
    6243                 :          0 : T2_Vbulk_sourcep=(-Vds*(3.0*T1_Vbulk_sourcep)/(3.0*T1)/(3.0*T1));
    6244                 :            : #endif
    6245                 :          0 : T2=(Vds/(3.0*T1));
    6246                 :            : #if defined(_DERIVATE)
    6247                 :          0 : T3_Vgate_sourcep=T2_Vgate_sourcep*Vds;
    6248                 :          0 : T3_Vdrainp_sourcep=((T2_Vdrainp_sourcep*Vds)+(T2*Vds_Vdrainp_sourcep));
    6249                 :          0 : T3_Vbulk_sourcep=T2_Vbulk_sourcep*Vds;
    6250                 :            : #endif
    6251                 :          0 : T3=(T2*Vds);
    6252                 :            : #if defined(_DERIVATE)
    6253                 :          0 : T9_Vgate_sourcep=0.0;
    6254                 :          0 : T9_Vdrainp_sourcep=0.0;
    6255                 :          0 : T9_Vbulk_sourcep=0.0;
    6256                 :            : #endif
    6257                 :          0 : T9=(0.25*CoxWL);
    6258                 :            : #if defined(_DERIVATE)
    6259                 :          0 : T4_Vgate_sourcep=((T9_Vgate_sourcep*Alphaz)+(T9*Alphaz_Vgate_sourcep));
    6260                 :          0 : T4_Vdrainp_sourcep=((T9_Vdrainp_sourcep*Alphaz)+(T9*Alphaz_Vdrainp_sourcep));
    6261                 :          0 : T4_Vbulk_sourcep=((T9_Vbulk_sourcep*Alphaz)+(T9*Alphaz_Vbulk_sourcep));
    6262                 :            : #endif
    6263                 :          0 : T4=(T9*Alphaz);
    6264                 :            : #if defined(_DERIVATE)
    6265                 :          0 : qgate_Vdrainp_sourcep=(CoxWL*((Vgs_eff_Vdrainp_sourcep-Vfb_Vdrainp_sourcep)-(0.5*(Vds_Vdrainp_sourcep-T3_Vdrainp_sourcep))));
    6266                 :          0 : qgate_Vgate_sourcep=(CoxWL*(Vgs_eff_Vgate_sourcep-(0.5*(-T3_Vgate_sourcep))));
    6267                 :          0 : qgate_Vbulk_sourcep=(CoxWL*((Vgs_eff_Vbulk_sourcep-Vfb_Vbulk_sourcep)-(0.5*(-T3_Vbulk_sourcep))));
    6268                 :            : #endif
    6269                 :          0 : qgate=(CoxWL*(((Vgs_eff-Vfb)-phi)-(0.5*(Vds-T3))));
    6270                 :            : #if defined(_DERIVATE)
    6271                 :          0 : T6_Vgate_sourcep=((((8.0*Vdsat_Vgate_sourcep)*Vdsat)+((8.0*Vdsat)*Vdsat_Vgate_sourcep))-(6.0*Vdsat_Vgate_sourcep)*Vds);
    6272                 :          0 : T6_Vdrainp_sourcep=(((((8.0*Vdsat_Vdrainp_sourcep)*Vdsat)+((8.0*Vdsat)*Vdsat_Vdrainp_sourcep))-(((6.0*Vdsat_Vdrainp_sourcep)*Vds)+((6.0*Vdsat)*Vds_Vdrainp_sourcep)))+(((1.2*Vds_Vdrainp_sourcep)*Vds)+((1.2*Vds)*Vds_Vdrainp_sourcep)));
    6273                 :          0 : T6_Vbulk_sourcep=((((8.0*Vdsat_Vbulk_sourcep)*Vdsat)+((8.0*Vdsat)*Vdsat_Vbulk_sourcep))-(6.0*Vdsat_Vbulk_sourcep)*Vds);
    6274                 :            : #endif
    6275                 :          0 : T6=((((8.0*Vdsat)*Vdsat)-((6.0*Vdsat)*Vds))+((1.2*Vds)*Vds));
    6276                 :            : #if defined(_DERIVATE)
    6277                 :          0 : T8_Vgate_sourcep=((T2_Vgate_sourcep*T1-T2*T1_Vgate_sourcep)/T1/T1);
    6278                 :          0 : T8_Vdrainp_sourcep=((T2_Vdrainp_sourcep*T1-T2*T1_Vdrainp_sourcep)/T1/T1);
    6279                 :          0 : T8_Vbulk_sourcep=((T2_Vbulk_sourcep*T1-T2*T1_Vbulk_sourcep)/T1/T1);
    6280                 :            : #endif
    6281                 :          0 : T8=(T2/T1);
    6282                 :            : #if defined(_DERIVATE)
    6283                 :          0 : T7_Vgate_sourcep=((-T1_Vgate_sourcep)-((T8_Vgate_sourcep*T6)+(T8*T6_Vgate_sourcep)));
    6284                 :          0 : T7_Vdrainp_sourcep=((Vds_Vdrainp_sourcep-T1_Vdrainp_sourcep)-((T8_Vdrainp_sourcep*T6)+(T8*T6_Vdrainp_sourcep)));
    6285                 :          0 : T7_Vbulk_sourcep=((-T1_Vbulk_sourcep)-((T8_Vbulk_sourcep*T6)+(T8*T6_Vbulk_sourcep)));
    6286                 :            : #endif
    6287                 :          0 : T7=((Vds-T1)-(T8*T6));
    6288                 :            : #if defined(_DERIVATE)
    6289                 :          0 : qdrn_Vgate_sourcep=((T4_Vgate_sourcep*T7)+(T4*T7_Vgate_sourcep));
    6290                 :          0 : qdrn_Vdrainp_sourcep=((T4_Vdrainp_sourcep*T7)+(T4*T7_Vdrainp_sourcep));
    6291                 :          0 : qdrn_Vbulk_sourcep=((T4_Vbulk_sourcep*T7)+(T4*T7_Vbulk_sourcep));
    6292                 :            : #endif
    6293                 :          0 : qdrn=(T4*T7);
    6294                 :            : #if defined(_DERIVATE)
    6295                 :          0 : T7_Vgate_sourcep=(2.0*(T1_Vgate_sourcep+T3_Vgate_sourcep));
    6296                 :          0 : T7_Vdrainp_sourcep=(2.0*(T1_Vdrainp_sourcep+T3_Vdrainp_sourcep));
    6297                 :          0 : T7_Vbulk_sourcep=(2.0*(T1_Vbulk_sourcep+T3_Vbulk_sourcep));
    6298                 :            : #endif
    6299                 :          0 : T7=(2.0*(T1+T3));
    6300                 :            : #if defined(_DERIVATE)
    6301                 :          0 : qbulk_Vdrainp_sourcep=(-(qgate_Vdrainp_sourcep-((T4_Vdrainp_sourcep*T7)+(T4*T7_Vdrainp_sourcep))));
    6302                 :          0 : qbulk_Vgate_sourcep=(-(qgate_Vgate_sourcep-((T4_Vgate_sourcep*T7)+(T4*T7_Vgate_sourcep))));
    6303                 :          0 : qbulk_Vbulk_sourcep=(-(qgate_Vbulk_sourcep-((T4_Vbulk_sourcep*T7)+(T4*T7_Vbulk_sourcep))));
    6304                 :            : #endif
    6305                 :          0 : qbulk=(-(qgate-(T4*T7)));
    6306                 :            : #if defined(_DERIVATE)
    6307                 :          0 : qinv_Vdrainp_sourcep=(-(qgate_Vdrainp_sourcep+qbulk_Vdrainp_sourcep));
    6308                 :          0 : qinv_Vgate_sourcep=(-(qgate_Vgate_sourcep+qbulk_Vgate_sourcep));
    6309                 :          0 : qinv_Vbulk_sourcep=(-(qgate_Vbulk_sourcep+qbulk_Vbulk_sourcep));
    6310                 :            : #endif
    6311                 :          0 : qinv=(-(qgate+qbulk));
    6312                 :            : }
    6313                 :            : }
    6314                 :            : else
    6315                 :            : {
    6316         [ #  # ]:          0 : if
    6317                 :            : (Vds>=Vdsat)
    6318                 :            : {
    6319                 :            : #if defined(_DERIVATE)
    6320                 :          0 : T1_Vgate_sourcep=(Vdsat_Vgate_sourcep/3.0);
    6321                 :          0 : T1_Vdrainp_sourcep=(Vdsat_Vdrainp_sourcep/3.0);
    6322                 :          0 : T1_Vbulk_sourcep=(Vdsat_Vbulk_sourcep/3.0);
    6323                 :            : #endif
    6324                 :          0 : T1=(Vdsat/3.0);
    6325                 :            : #if defined(_DERIVATE)
    6326                 :          0 : qgate_Vdrainp_sourcep=(CoxWL*((Vgs_eff_Vdrainp_sourcep-Vfb_Vdrainp_sourcep)-T1_Vdrainp_sourcep));
    6327                 :          0 : qgate_Vgate_sourcep=(CoxWL*(Vgs_eff_Vgate_sourcep-T1_Vgate_sourcep));
    6328                 :          0 : qgate_Vbulk_sourcep=(CoxWL*((Vgs_eff_Vbulk_sourcep-Vfb_Vbulk_sourcep)-T1_Vbulk_sourcep));
    6329                 :            : #endif
    6330                 :          0 : qgate=(CoxWL*(((Vgs_eff-Vfb)-phi)-T1));
    6331                 :            : #if defined(_DERIVATE)
    6332                 :          0 : T2_Vgate_sourcep=((-Two_Third_CoxWL)*Vgst_Vgate_sourcep);
    6333                 :          0 : T2_Vdrainp_sourcep=((-Two_Third_CoxWL)*Vgst_Vdrainp_sourcep);
    6334                 :          0 : T2_Vbulk_sourcep=((-Two_Third_CoxWL)*Vgst_Vbulk_sourcep);
    6335                 :            : #endif
    6336                 :          0 : T2=((-Two_Third_CoxWL)*Vgst);
    6337                 :            : #if defined(_DERIVATE)
    6338                 :          0 : qbulk_Vdrainp_sourcep=(-(qgate_Vdrainp_sourcep+T2_Vdrainp_sourcep));
    6339                 :          0 : qbulk_Vgate_sourcep=(-(qgate_Vgate_sourcep+T2_Vgate_sourcep));
    6340                 :          0 : qbulk_Vbulk_sourcep=(-(qgate_Vbulk_sourcep+T2_Vbulk_sourcep));
    6341                 :            : #endif
    6342                 :          0 : qbulk=(-(qgate+T2));
    6343                 :            : #if defined(_DERIVATE)
    6344                 :          0 : qdrn_Vgate_sourcep=(0.5*T2_Vgate_sourcep);
    6345                 :          0 : qdrn_Vdrainp_sourcep=(0.5*T2_Vdrainp_sourcep);
    6346                 :          0 : qdrn_Vbulk_sourcep=(0.5*T2_Vbulk_sourcep);
    6347                 :            : #endif
    6348                 :          0 : qdrn=(0.5*T2);
    6349                 :            : #if defined(_DERIVATE)
    6350                 :          0 : qinv_Vdrainp_sourcep=(-(qgate_Vdrainp_sourcep+qbulk_Vdrainp_sourcep));
    6351                 :          0 : qinv_Vgate_sourcep=(-(qgate_Vgate_sourcep+qbulk_Vgate_sourcep));
    6352                 :          0 : qinv_Vbulk_sourcep=(-(qgate_Vbulk_sourcep+qbulk_Vbulk_sourcep));
    6353                 :            : #endif
    6354                 :          0 : qinv=(-(qgate+qbulk));
    6355                 :            : }
    6356                 :            : else
    6357                 :            : {
    6358                 :            : #if defined(_DERIVATE)
    6359                 :          0 : Alphaz_Vdrainp_sourcep=((Vgst_Vdrainp_sourcep*Vdsat-Vgst*Vdsat_Vdrainp_sourcep)/Vdsat/Vdsat);
    6360                 :          0 : Alphaz_Vgate_sourcep=((Vgst_Vgate_sourcep*Vdsat-Vgst*Vdsat_Vgate_sourcep)/Vdsat/Vdsat);
    6361                 :          0 : Alphaz_Vbulk_sourcep=((Vgst_Vbulk_sourcep*Vdsat-Vgst*Vdsat_Vbulk_sourcep)/Vdsat/Vdsat);
    6362                 :            : #endif
    6363                 :          0 : Alphaz=(Vgst/Vdsat);
    6364                 :            : #if defined(_DERIVATE)
    6365                 :          0 : T1_Vgate_sourcep=(2.0*Vdsat_Vgate_sourcep);
    6366                 :          0 : T1_Vdrainp_sourcep=((2.0*Vdsat_Vdrainp_sourcep)-Vds_Vdrainp_sourcep);
    6367                 :          0 : T1_Vbulk_sourcep=(2.0*Vdsat_Vbulk_sourcep);
    6368                 :            : #endif
    6369                 :          0 : T1=((2.0*Vdsat)-Vds);
    6370                 :            : #if defined(_DERIVATE)
    6371                 :          0 : T2_Vgate_sourcep=(-Vds*(3.0*T1_Vgate_sourcep)/(3.0*T1)/(3.0*T1));
    6372                 :          0 : T2_Vdrainp_sourcep=((Vds_Vdrainp_sourcep*(3.0*T1)-Vds*(3.0*T1_Vdrainp_sourcep))/(3.0*T1)/(3.0*T1));
    6373                 :          0 : T2_Vbulk_sourcep=(-Vds*(3.0*T1_Vbulk_sourcep)/(3.0*T1)/(3.0*T1));
    6374                 :            : #endif
    6375                 :          0 : T2=(Vds/(3.0*T1));
    6376                 :            : #if defined(_DERIVATE)
    6377                 :          0 : T3_Vgate_sourcep=T2_Vgate_sourcep*Vds;
    6378                 :          0 : T3_Vdrainp_sourcep=((T2_Vdrainp_sourcep*Vds)+(T2*Vds_Vdrainp_sourcep));
    6379                 :          0 : T3_Vbulk_sourcep=T2_Vbulk_sourcep*Vds;
    6380                 :            : #endif
    6381                 :          0 : T3=(T2*Vds);
    6382                 :            : #if defined(_DERIVATE)
    6383                 :          0 : T9_Vgate_sourcep=0.0;
    6384                 :          0 : T9_Vdrainp_sourcep=0.0;
    6385                 :          0 : T9_Vbulk_sourcep=0.0;
    6386                 :            : #endif
    6387                 :          0 : T9=(0.25*CoxWL);
    6388                 :            : #if defined(_DERIVATE)
    6389                 :          0 : T4_Vgate_sourcep=((T9_Vgate_sourcep*Alphaz)+(T9*Alphaz_Vgate_sourcep));
    6390                 :          0 : T4_Vdrainp_sourcep=((T9_Vdrainp_sourcep*Alphaz)+(T9*Alphaz_Vdrainp_sourcep));
    6391                 :          0 : T4_Vbulk_sourcep=((T9_Vbulk_sourcep*Alphaz)+(T9*Alphaz_Vbulk_sourcep));
    6392                 :            : #endif
    6393                 :          0 : T4=(T9*Alphaz);
    6394                 :            : #if defined(_DERIVATE)
    6395                 :          0 : qgate_Vdrainp_sourcep=(CoxWL*((Vgs_eff_Vdrainp_sourcep-Vfb_Vdrainp_sourcep)-(0.5*(Vds_Vdrainp_sourcep-T3_Vdrainp_sourcep))));
    6396                 :          0 : qgate_Vgate_sourcep=(CoxWL*(Vgs_eff_Vgate_sourcep-(0.5*(-T3_Vgate_sourcep))));
    6397                 :          0 : qgate_Vbulk_sourcep=(CoxWL*((Vgs_eff_Vbulk_sourcep-Vfb_Vbulk_sourcep)-(0.5*(-T3_Vbulk_sourcep))));
    6398                 :            : #endif
    6399                 :          0 : qgate=(CoxWL*(((Vgs_eff-Vfb)-phi)-(0.5*(Vds-T3))));
    6400                 :            : #if defined(_DERIVATE)
    6401                 :          0 : T7_Vgate_sourcep=(T1_Vgate_sourcep+T3_Vgate_sourcep);
    6402                 :          0 : T7_Vdrainp_sourcep=(T1_Vdrainp_sourcep+T3_Vdrainp_sourcep);
    6403                 :          0 : T7_Vbulk_sourcep=(T1_Vbulk_sourcep+T3_Vbulk_sourcep);
    6404                 :            : #endif
    6405                 :          0 : T7=(T1+T3);
    6406                 :            : #if defined(_DERIVATE)
    6407                 :          0 : qdrn_Vgate_sourcep=(((-T4_Vgate_sourcep)*T7)+((-T4)*T7_Vgate_sourcep));
    6408                 :          0 : qdrn_Vdrainp_sourcep=(((-T4_Vdrainp_sourcep)*T7)+((-T4)*T7_Vdrainp_sourcep));
    6409                 :          0 : qdrn_Vbulk_sourcep=(((-T4_Vbulk_sourcep)*T7)+((-T4)*T7_Vbulk_sourcep));
    6410                 :            : #endif
    6411                 :          0 : qdrn=((-T4)*T7);
    6412                 :            : #if defined(_DERIVATE)
    6413                 :          0 : qbulk_Vdrainp_sourcep=(-((qgate_Vdrainp_sourcep+qdrn_Vdrainp_sourcep)+qdrn_Vdrainp_sourcep));
    6414                 :          0 : qbulk_Vgate_sourcep=(-((qgate_Vgate_sourcep+qdrn_Vgate_sourcep)+qdrn_Vgate_sourcep));
    6415                 :          0 : qbulk_Vbulk_sourcep=(-((qgate_Vbulk_sourcep+qdrn_Vbulk_sourcep)+qdrn_Vbulk_sourcep));
    6416                 :            : #endif
    6417                 :          0 : qbulk=(-((qgate+qdrn)+qdrn));
    6418                 :            : #if defined(_DERIVATE)
    6419                 :          0 : qinv_Vdrainp_sourcep=(-(qgate_Vdrainp_sourcep+qbulk_Vdrainp_sourcep));
    6420                 :          0 : qinv_Vgate_sourcep=(-(qgate_Vgate_sourcep+qbulk_Vgate_sourcep));
    6421                 :          0 : qinv_Vbulk_sourcep=(-(qgate_Vbulk_sourcep+qbulk_Vbulk_sourcep));
    6422                 :            : #endif
    6423                 :          0 : qinv=(-(qgate+qbulk));
    6424                 :            : }
    6425                 :            : }
    6426                 :            : }
    6427                 :            : }
    6428                 :            : }
    6429                 :            : }
    6430                 :            : else
    6431                 :            : {
    6432         [ #  # ]:          0 : if
    6433                 :            : (Vbseff<0.0)
    6434                 :            : {
    6435                 :            : #if defined(_DERIVATE)
    6436                 :          0 : VbseffCV_Vdrainp_sourcep=Vbseff_Vdrainp_sourcep;
    6437                 :          0 : VbseffCV_Vbulk_sourcep=Vbseff_Vbulk_sourcep;
    6438                 :            : #endif
    6439                 :          0 : VbseffCV=Vbseff;
    6440                 :            : }
    6441                 :            : else
    6442                 :            : {
    6443                 :            : #if defined(_DERIVATE)
    6444                 :          0 : VbseffCV_Vdrainp_sourcep=(-Phis_Vdrainp_sourcep);
    6445                 :          0 : VbseffCV_Vbulk_sourcep=(-Phis_Vbulk_sourcep);
    6446                 :            : #endif
    6447                 :          0 : VbseffCV=(phi-Phis);
    6448                 :            : }
    6449                 :          0 : CoxWL=((cox*weffCV)*leffCV);
    6450                 :            : #if defined(_DERIVATE)
    6451                 :          0 : Noff2_Vdrainp_sourcep=n_Vdrainp_sourcep*noff_param;
    6452                 :          0 : Noff2_Vbulk_sourcep=n_Vbulk_sourcep*noff_param;
    6453                 :            : #endif
    6454                 :          0 : Noff2=(n*noff_param);
    6455                 :            : #if defined(_DERIVATE)
    6456                 :          0 : T_0_Vgate_sourcep=0.0;
    6457                 :          0 : T_0_Vdrainp_sourcep=(Vtm*Noff2_Vdrainp_sourcep);
    6458                 :          0 : T_0_Vbulk_sourcep=(Vtm*Noff2_Vbulk_sourcep);
    6459                 :            : #endif
    6460                 :          0 : T_0=(Vtm*Noff2);
    6461                 :            : #if defined(_DERIVATE)
    6462                 :          0 : VgstNVt_Vdrainp_sourcep=((Vgst_Vdrainp_sourcep*T_0-(Vgst-voffcv_param)*T_0_Vdrainp_sourcep)/T_0/T_0);
    6463                 :          0 : VgstNVt_Vgate_sourcep=((Vgst_Vgate_sourcep*T_0-(Vgst-voffcv_param)*T_0_Vgate_sourcep)/T_0/T_0);
    6464                 :          0 : VgstNVt_Vbulk_sourcep=((Vgst_Vbulk_sourcep*T_0-(Vgst-voffcv_param)*T_0_Vbulk_sourcep)/T_0/T_0);
    6465                 :            : #endif
    6466                 :          0 : VgstNVt=((Vgst-voffcv_param)/T_0);
    6467         [ #  # ]:          0 : if
    6468                 :            : (VgstNVt>34.0)
    6469                 :            : {
    6470                 :            : #if defined(_DERIVATE)
    6471                 :          0 : Vgsteff_Vdrainp_sourcep=Vgst_Vdrainp_sourcep;
    6472                 :          0 : Vgsteff_Vgate_sourcep=Vgst_Vgate_sourcep;
    6473                 :          0 : Vgsteff_Vbulk_sourcep=Vgst_Vbulk_sourcep;
    6474                 :            : #endif
    6475                 :          0 : Vgsteff=(Vgst-voffcv_param);
    6476                 :            : }
    6477                 :            : else
    6478                 :            : {
    6479         [ #  # ]:          0 : if
    6480                 :            : (VgstNVt<(-34.0))
    6481                 :            : {
    6482                 :            : {
    6483                 :          0 : double m00_logE(d00_logE0,(1.0+1.713908431e-15))
    6484                 :            : #if defined(_DERIVATE)
    6485                 :          0 : Vgsteff_Vdrainp_sourcep=T_0_Vdrainp_sourcep*d00_logE0;
    6486                 :          0 : Vgsteff_Vgate_sourcep=T_0_Vgate_sourcep*d00_logE0;
    6487                 :          0 : Vgsteff_Vbulk_sourcep=T_0_Vbulk_sourcep*d00_logE0;
    6488                 :            : #endif
    6489                 :          0 : Vgsteff=(T_0*d00_logE0);
    6490                 :            : }
    6491                 :            : }
    6492                 :            : else
    6493                 :            : {
    6494                 :            : {
    6495                 :          0 : double m00_exp(d00_exp0,VgstNVt)
    6496                 :            : #if defined(_DERIVATE)
    6497                 :            : #define d10_exp0 d00_exp0
    6498                 :            : #endif
    6499                 :            : #if defined(_DERIVATE)
    6500                 :          0 : ExpVgst_Vgate_sourcep=VgstNVt_Vgate_sourcep*d10_exp0;
    6501                 :          0 : ExpVgst_Vdrainp_sourcep=VgstNVt_Vdrainp_sourcep*d10_exp0;
    6502                 :          0 : ExpVgst_Vbulk_sourcep=VgstNVt_Vbulk_sourcep*d10_exp0;
    6503                 :            : #endif
    6504                 :          0 : ExpVgst=d00_exp0;
    6505                 :            : }
    6506                 :            : {
    6507                 :          0 : double m00_logE(d00_logE0,(1.0+ExpVgst))
    6508                 :            : #if defined(_DERIVATE)
    6509                 :          0 : double m10_logE(d10_logE0,d00_logE0,(1.0+ExpVgst))
    6510                 :            : #endif
    6511                 :            : #if defined(_DERIVATE)
    6512                 :          0 : Vgsteff_Vdrainp_sourcep=((T_0_Vdrainp_sourcep*d00_logE0)+(T_0*ExpVgst_Vdrainp_sourcep*d10_logE0));
    6513                 :          0 : Vgsteff_Vgate_sourcep=((T_0_Vgate_sourcep*d00_logE0)+(T_0*ExpVgst_Vgate_sourcep*d10_logE0));
    6514                 :          0 : Vgsteff_Vbulk_sourcep=((T_0_Vbulk_sourcep*d00_logE0)+(T_0*ExpVgst_Vbulk_sourcep*d10_logE0));
    6515                 :            : #endif
    6516                 :          0 : Vgsteff=(T_0*d00_logE0);
    6517                 :            : }
    6518                 :            : }
    6519                 :            : }
    6520         [ #  # ]:          0 : if
    6521                 :            : (CAPMOD==1)
    6522                 :            : {
    6523         [ #  # ]:          0 : if
    6524                 :            : (VERSION<3.2)
    6525                 :            : {
    6526                 :            : #if defined(_DERIVATE)
    6527                 :          0 : Vfb_Vdrainp_sourcep=(Vth_Vdrainp_sourcep-(k1ox*sqrtPhis_Vdrainp_sourcep));
    6528                 :          0 : Vfb_Vbulk_sourcep=(Vth_Vbulk_sourcep-(k1ox*sqrtPhis_Vbulk_sourcep));
    6529                 :            : #endif
    6530                 :          0 : Vfb=((Vth-phi)-(k1ox*sqrtPhis));
    6531                 :            : }
    6532                 :            : else
    6533                 :            : {
    6534                 :            : #if defined(_DERIVATE)
    6535                 :          0 : Vfb_Vdrainp_sourcep=0.0;
    6536                 :          0 : Vfb_Vbulk_sourcep=0.0;
    6537                 :            : #endif
    6538                 :          0 : Vfb=vfbzb;
    6539                 :            : }
    6540                 :            : #if defined(_DERIVATE)
    6541                 :          0 : Arg1_Vdrainp_sourcep=(((Vgs_eff_Vdrainp_sourcep-VbseffCV_Vdrainp_sourcep)-Vfb_Vdrainp_sourcep)-Vgsteff_Vdrainp_sourcep);
    6542                 :          0 : Arg1_Vgate_sourcep=(Vgs_eff_Vgate_sourcep-Vgsteff_Vgate_sourcep);
    6543                 :          0 : Arg1_Vbulk_sourcep=(((Vgs_eff_Vbulk_sourcep-VbseffCV_Vbulk_sourcep)-Vfb_Vbulk_sourcep)-Vgsteff_Vbulk_sourcep);
    6544                 :            : #endif
    6545                 :          0 : Arg1=(((Vgs_eff-VbseffCV)-Vfb)-Vgsteff);
    6546         [ #  # ]:          0 : if
    6547                 :            : (Arg1<=0.0)
    6548                 :            : {
    6549                 :            : #if defined(_DERIVATE)
    6550                 :          0 : qgate_Vdrainp_sourcep=(CoxWL*Arg1_Vdrainp_sourcep);
    6551                 :          0 : qgate_Vgate_sourcep=(CoxWL*Arg1_Vgate_sourcep);
    6552                 :          0 : qgate_Vbulk_sourcep=(CoxWL*Arg1_Vbulk_sourcep);
    6553                 :            : #endif
    6554                 :          0 : qgate=(CoxWL*Arg1);
    6555                 :            : }
    6556                 :            : else
    6557                 :            : {
    6558                 :            : #if defined(_DERIVATE)
    6559                 :          0 : T_0_Vgate_sourcep=0.0;
    6560                 :          0 : T_0_Vdrainp_sourcep=0.0;
    6561                 :          0 : T_0_Vbulk_sourcep=0.0;
    6562                 :            : #endif
    6563                 :          0 : T_0=(0.5*k1ox);
    6564                 :            : {
    6565                 :          0 : double m00_sqrt(d00_sqrt0,((T_0*T_0)+Arg1))
    6566                 :            : #if defined(_DERIVATE)
    6567                 :          0 : double m10_sqrt(d10_sqrt0,d00_sqrt0,((T_0*T_0)+Arg1))
    6568                 :            : #endif
    6569                 :            : #if defined(_DERIVATE)
    6570                 :          0 : T1_Vgate_sourcep=(((T_0_Vgate_sourcep*T_0)+(T_0*T_0_Vgate_sourcep))+Arg1_Vgate_sourcep)*d10_sqrt0;
    6571                 :          0 : T1_Vdrainp_sourcep=(((T_0_Vdrainp_sourcep*T_0)+(T_0*T_0_Vdrainp_sourcep))+Arg1_Vdrainp_sourcep)*d10_sqrt0;
    6572                 :          0 : T1_Vbulk_sourcep=(((T_0_Vbulk_sourcep*T_0)+(T_0*T_0_Vbulk_sourcep))+Arg1_Vbulk_sourcep)*d10_sqrt0;
    6573                 :            : #endif
    6574                 :          0 : T1=d00_sqrt0;
    6575                 :            : }
    6576                 :            : #if defined(_DERIVATE)
    6577                 :          0 : qgate_Vdrainp_sourcep=((CoxWL*k1ox)*(T1_Vdrainp_sourcep-T_0_Vdrainp_sourcep));
    6578                 :          0 : qgate_Vgate_sourcep=((CoxWL*k1ox)*(T1_Vgate_sourcep-T_0_Vgate_sourcep));
    6579                 :          0 : qgate_Vbulk_sourcep=((CoxWL*k1ox)*(T1_Vbulk_sourcep-T_0_Vbulk_sourcep));
    6580                 :            : #endif
    6581                 :          0 : qgate=((CoxWL*k1ox)*(T1-T_0));
    6582                 :            : }
    6583                 :            : #if defined(_DERIVATE)
    6584                 :          0 : qbulk_Vdrainp_sourcep=(-qgate_Vdrainp_sourcep);
    6585                 :          0 : qbulk_Vgate_sourcep=(-qgate_Vgate_sourcep);
    6586                 :          0 : qbulk_Vbulk_sourcep=(-qgate_Vbulk_sourcep);
    6587                 :            : #endif
    6588                 :          0 : qbulk=(-qgate);
    6589                 :          0 : One_Third_CoxWL=(CoxWL/3.0);
    6590                 :          0 : Two_Third_CoxWL=(2.0*One_Third_CoxWL);
    6591                 :            : #if defined(_DERIVATE)
    6592                 :          0 : AbulkCV_Vgate_sourcep=Abulk0_Vgate_sourcep*abulkCVfactor;
    6593                 :          0 : AbulkCV_Vdrainp_sourcep=Abulk0_Vdrainp_sourcep*abulkCVfactor;
    6594                 :          0 : AbulkCV_Vbulk_sourcep=Abulk0_Vbulk_sourcep*abulkCVfactor;
    6595                 :            : #endif
    6596                 :          0 : AbulkCV=(Abulk0*abulkCVfactor);
    6597                 :            : #if defined(_DERIVATE)
    6598                 :          0 : VdsatCV_Vdrainp_sourcep=((Vgsteff_Vdrainp_sourcep*AbulkCV-Vgsteff*AbulkCV_Vdrainp_sourcep)/AbulkCV/AbulkCV);
    6599                 :          0 : VdsatCV_Vgate_sourcep=((Vgsteff_Vgate_sourcep*AbulkCV-Vgsteff*AbulkCV_Vgate_sourcep)/AbulkCV/AbulkCV);
    6600                 :          0 : VdsatCV_Vbulk_sourcep=((Vgsteff_Vbulk_sourcep*AbulkCV-Vgsteff*AbulkCV_Vbulk_sourcep)/AbulkCV/AbulkCV);
    6601                 :            : #endif
    6602                 :          0 : VdsatCV=(Vgsteff/AbulkCV);
    6603         [ #  # ]:          0 : if
    6604                 :            : (VdsatCV<Vds)
    6605                 :            : {
    6606                 :            : #if defined(_DERIVATE)
    6607                 :          0 : T_0_Vgate_sourcep=(Vgsteff_Vgate_sourcep-(VdsatCV_Vgate_sourcep/3.0));
    6608                 :          0 : T_0_Vdrainp_sourcep=(Vgsteff_Vdrainp_sourcep-(VdsatCV_Vdrainp_sourcep/3.0));
    6609                 :          0 : T_0_Vbulk_sourcep=(Vgsteff_Vbulk_sourcep-(VdsatCV_Vbulk_sourcep/3.0));
    6610                 :            : #endif
    6611                 :          0 : T_0=(Vgsteff-(VdsatCV/3.0));
    6612                 :            : #if defined(_DERIVATE)
    6613                 :          0 : qgate_Vdrainp_sourcep=(qgate_Vdrainp_sourcep+(CoxWL*T_0_Vdrainp_sourcep));
    6614                 :          0 : qgate_Vgate_sourcep=(qgate_Vgate_sourcep+(CoxWL*T_0_Vgate_sourcep));
    6615                 :          0 : qgate_Vbulk_sourcep=(qgate_Vbulk_sourcep+(CoxWL*T_0_Vbulk_sourcep));
    6616                 :            : #endif
    6617                 :          0 : qgate=(qgate+(CoxWL*T_0));
    6618                 :            : #if defined(_DERIVATE)
    6619                 :          0 : T_0_Vgate_sourcep=(VdsatCV_Vgate_sourcep-Vgsteff_Vgate_sourcep);
    6620                 :          0 : T_0_Vdrainp_sourcep=(VdsatCV_Vdrainp_sourcep-Vgsteff_Vdrainp_sourcep);
    6621                 :          0 : T_0_Vbulk_sourcep=(VdsatCV_Vbulk_sourcep-Vgsteff_Vbulk_sourcep);
    6622                 :            : #endif
    6623                 :          0 : T_0=(VdsatCV-Vgsteff);
    6624                 :            : #if defined(_DERIVATE)
    6625                 :          0 : qbulk_Vdrainp_sourcep=(qbulk_Vdrainp_sourcep+(One_Third_CoxWL*T_0_Vdrainp_sourcep));
    6626                 :          0 : qbulk_Vgate_sourcep=(qbulk_Vgate_sourcep+(One_Third_CoxWL*T_0_Vgate_sourcep));
    6627                 :          0 : qbulk_Vbulk_sourcep=(qbulk_Vbulk_sourcep+(One_Third_CoxWL*T_0_Vbulk_sourcep));
    6628                 :            : #endif
    6629                 :          0 : qbulk=(qbulk+(One_Third_CoxWL*T_0));
    6630         [ #  # ]:          0 : if
    6631                 :            : (XPART>0.5)
    6632                 :            : {
    6633                 :            : #if defined(_DERIVATE)
    6634                 :          0 : T_0_Vgate_sourcep=0.0;
    6635                 :          0 : T_0_Vdrainp_sourcep=0.0;
    6636                 :          0 : T_0_Vbulk_sourcep=0.0;
    6637                 :            : #endif
    6638                 :          0 : T_0=(-Two_Third_CoxWL);
    6639                 :            : }
    6640                 :            : else
    6641                 :            : {
    6642         [ #  # ]:          0 : if
    6643                 :            : (XPART<0.5)
    6644                 :            : {
    6645                 :            : #if defined(_DERIVATE)
    6646                 :          0 : T_0_Vgate_sourcep=0.0;
    6647                 :          0 : T_0_Vdrainp_sourcep=0.0;
    6648                 :          0 : T_0_Vbulk_sourcep=0.0;
    6649                 :            : #endif
    6650                 :          0 : T_0=((-0.4)*CoxWL);
    6651                 :            : }
    6652                 :            : else
    6653                 :            : {
    6654                 :            : #if defined(_DERIVATE)
    6655                 :          0 : T_0_Vgate_sourcep=0.0;
    6656                 :          0 : T_0_Vdrainp_sourcep=0.0;
    6657                 :          0 : T_0_Vbulk_sourcep=0.0;
    6658                 :            : #endif
    6659                 :          0 : T_0=(-One_Third_CoxWL);
    6660                 :            : }
    6661                 :            : }
    6662                 :            : #if defined(_DYNAMIC)
    6663                 :            : #if defined(_DERIVATE)
    6664                 :          0 : qsrc_Vgate_sourcep=((T_0_Vgate_sourcep*Vgsteff)+(T_0*Vgsteff_Vgate_sourcep));
    6665                 :          0 : qsrc_Vdrainp_sourcep=((T_0_Vdrainp_sourcep*Vgsteff)+(T_0*Vgsteff_Vdrainp_sourcep));
    6666                 :          0 : qsrc_Vbulk_sourcep=((T_0_Vbulk_sourcep*Vgsteff)+(T_0*Vgsteff_Vbulk_sourcep));
    6667                 :            : #endif
    6668                 :          0 : qsrc=(T_0*Vgsteff);
    6669                 :            : #endif
    6670                 :            : }
    6671                 :            : else
    6672                 :            : {
    6673                 :            : #if defined(_DERIVATE)
    6674                 :          0 : T_0_Vgate_sourcep=AbulkCV_Vgate_sourcep*Vds;
    6675                 :          0 : T_0_Vdrainp_sourcep=((AbulkCV_Vdrainp_sourcep*Vds)+(AbulkCV*Vds_Vdrainp_sourcep));
    6676                 :          0 : T_0_Vbulk_sourcep=AbulkCV_Vbulk_sourcep*Vds;
    6677                 :            : #endif
    6678                 :          0 : T_0=(AbulkCV*Vds);
    6679                 :            : #if defined(_DERIVATE)
    6680                 :          0 : T1_Vgate_sourcep=(12.0*(Vgsteff_Vgate_sourcep-(0.5*T_0_Vgate_sourcep)));
    6681                 :          0 : T1_Vdrainp_sourcep=(12.0*(Vgsteff_Vdrainp_sourcep-(0.5*T_0_Vdrainp_sourcep)));
    6682                 :          0 : T1_Vbulk_sourcep=(12.0*(Vgsteff_Vbulk_sourcep-(0.5*T_0_Vbulk_sourcep)));
    6683                 :            : #endif
    6684                 :          0 : T1=(12.0*((Vgsteff-(0.5*T_0))+1.0e-20));
    6685                 :            : #if defined(_DERIVATE)
    6686                 :          0 : T2_Vgate_sourcep=(-Vds*T1_Vgate_sourcep/T1/T1);
    6687                 :          0 : T2_Vdrainp_sourcep=((Vds_Vdrainp_sourcep*T1-Vds*T1_Vdrainp_sourcep)/T1/T1);
    6688                 :          0 : T2_Vbulk_sourcep=(-Vds*T1_Vbulk_sourcep/T1/T1);
    6689                 :            : #endif
    6690                 :          0 : T2=(Vds/T1);
    6691                 :            : #if defined(_DERIVATE)
    6692                 :          0 : T3_Vgate_sourcep=((T_0_Vgate_sourcep*T2)+(T_0*T2_Vgate_sourcep));
    6693                 :          0 : T3_Vdrainp_sourcep=((T_0_Vdrainp_sourcep*T2)+(T_0*T2_Vdrainp_sourcep));
    6694                 :          0 : T3_Vbulk_sourcep=((T_0_Vbulk_sourcep*T2)+(T_0*T2_Vbulk_sourcep));
    6695                 :            : #endif
    6696                 :          0 : T3=(T_0*T2);
    6697                 :            : #if defined(_DERIVATE)
    6698                 :          0 : qgate_Vdrainp_sourcep=(qgate_Vdrainp_sourcep+(CoxWL*((Vgsteff_Vdrainp_sourcep-(0.5*Vds_Vdrainp_sourcep))+T3_Vdrainp_sourcep)));
    6699                 :          0 : qgate_Vgate_sourcep=(qgate_Vgate_sourcep+(CoxWL*(Vgsteff_Vgate_sourcep+T3_Vgate_sourcep)));
    6700                 :          0 : qgate_Vbulk_sourcep=(qgate_Vbulk_sourcep+(CoxWL*(Vgsteff_Vbulk_sourcep+T3_Vbulk_sourcep)));
    6701                 :            : #endif
    6702                 :          0 : qgate=(qgate+(CoxWL*((Vgsteff-(0.5*Vds))+T3)));
    6703                 :            : #if defined(_DERIVATE)
    6704                 :          0 : qbulk_Vdrainp_sourcep=(qbulk_Vdrainp_sourcep+(((CoxWL*(-AbulkCV_Vdrainp_sourcep))*((0.5*Vds)-T3))+((CoxWL*(1.0-AbulkCV))*((0.5*Vds_Vdrainp_sourcep)-T3_Vdrainp_sourcep))));
    6705                 :          0 : qbulk_Vgate_sourcep=(qbulk_Vgate_sourcep+(((CoxWL*(-AbulkCV_Vgate_sourcep))*((0.5*Vds)-T3))+((CoxWL*(1.0-AbulkCV))*(-T3_Vgate_sourcep))));
    6706                 :          0 : qbulk_Vbulk_sourcep=(qbulk_Vbulk_sourcep+(((CoxWL*(-AbulkCV_Vbulk_sourcep))*((0.5*Vds)-T3))+((CoxWL*(1.0-AbulkCV))*(-T3_Vbulk_sourcep))));
    6707                 :            : #endif
    6708                 :          0 : qbulk=(qbulk+((CoxWL*(1.0-AbulkCV))*((0.5*Vds)-T3)));
    6709         [ #  # ]:          0 : if
    6710                 :            : (XPART>0.5)
    6711                 :            : {
    6712                 :            : #if defined(_DYNAMIC)
    6713                 :            : #if defined(_DERIVATE)
    6714                 :          0 : qsrc_Vgate_sourcep=((-CoxWL)*(((0.5*Vgsteff_Vgate_sourcep)+(0.25*T_0_Vgate_sourcep))-((((T_0_Vgate_sourcep*T_0)+(T_0*T_0_Vgate_sourcep))*(T1+T1)-(T_0*T_0)*(T1_Vgate_sourcep+T1_Vgate_sourcep))/(T1+T1)/(T1+T1))));
    6715                 :          0 : qsrc_Vdrainp_sourcep=((-CoxWL)*(((0.5*Vgsteff_Vdrainp_sourcep)+(0.25*T_0_Vdrainp_sourcep))-((((T_0_Vdrainp_sourcep*T_0)+(T_0*T_0_Vdrainp_sourcep))*(T1+T1)-(T_0*T_0)*(T1_Vdrainp_sourcep+T1_Vdrainp_sourcep))/(T1+T1)/(T1+T1))));
    6716                 :          0 : qsrc_Vbulk_sourcep=((-CoxWL)*(((0.5*Vgsteff_Vbulk_sourcep)+(0.25*T_0_Vbulk_sourcep))-((((T_0_Vbulk_sourcep*T_0)+(T_0*T_0_Vbulk_sourcep))*(T1+T1)-(T_0*T_0)*(T1_Vbulk_sourcep+T1_Vbulk_sourcep))/(T1+T1)/(T1+T1))));
    6717                 :            : #endif
    6718                 :          0 : qsrc=((-CoxWL)*(((0.5*Vgsteff)+(0.25*T_0))-((T_0*T_0)/(T1+T1))));
    6719                 :            : #endif
    6720                 :            : }
    6721                 :            : else
    6722                 :            : {
    6723         [ #  # ]:          0 : if
    6724                 :            : (XPART<0.5)
    6725                 :            : {
    6726                 :            : #if defined(_DERIVATE)
    6727                 :          0 : T2_Vgate_sourcep=(-(0.5*CoxWL)*((((T1_Vgate_sourcep/12.0)*T1)+((T1/12.0)*T1_Vgate_sourcep))/12.0)/(((T1/12.0)*T1)/12.0)/(((T1/12.0)*T1)/12.0));
    6728                 :          0 : T2_Vdrainp_sourcep=(-(0.5*CoxWL)*((((T1_Vdrainp_sourcep/12.0)*T1)+((T1/12.0)*T1_Vdrainp_sourcep))/12.0)/(((T1/12.0)*T1)/12.0)/(((T1/12.0)*T1)/12.0));
    6729                 :          0 : T2_Vbulk_sourcep=(-(0.5*CoxWL)*((((T1_Vbulk_sourcep/12.0)*T1)+((T1/12.0)*T1_Vbulk_sourcep))/12.0)/(((T1/12.0)*T1)/12.0)/(((T1/12.0)*T1)/12.0));
    6730                 :            : #endif
    6731                 :          0 : T2=((0.5*CoxWL)/(((T1/12.0)*T1)/12.0));
    6732                 :            : #if defined(_DERIVATE)
    6733                 :          0 : T3_Vgate_sourcep=(((Vgsteff_Vgate_sourcep*((((2.0*T_0)*T_0)/3.0)+(Vgsteff*(Vgsteff-((4.0*T_0)/3.0)))))+(Vgsteff*(((((2.0*T_0_Vgate_sourcep)*T_0)+((2.0*T_0)*T_0_Vgate_sourcep))/3.0)+((Vgsteff_Vgate_sourcep*(Vgsteff-((4.0*T_0)/3.0)))+(Vgsteff*(Vgsteff_Vgate_sourcep-((4.0*T_0_Vgate_sourcep)/3.0)))))))-((((((2.0*T_0_Vgate_sourcep)*T_0)+((2.0*T_0)*T_0_Vgate_sourcep))*T_0)+(((2.0*T_0)*T_0)*T_0_Vgate_sourcep))/15.0));
    6734                 :          0 : T3_Vdrainp_sourcep=(((Vgsteff_Vdrainp_sourcep*((((2.0*T_0)*T_0)/3.0)+(Vgsteff*(Vgsteff-((4.0*T_0)/3.0)))))+(Vgsteff*(((((2.0*T_0_Vdrainp_sourcep)*T_0)+((2.0*T_0)*T_0_Vdrainp_sourcep))/3.0)+((Vgsteff_Vdrainp_sourcep*(Vgsteff-((4.0*T_0)/3.0)))+(Vgsteff*(Vgsteff_Vdrainp_sourcep-((4.0*T_0_Vdrainp_sourcep)/3.0)))))))-((((((2.0*T_0_Vdrainp_sourcep)*T_0)+((2.0*T_0)*T_0_Vdrainp_sourcep))*T_0)+(((2.0*T_0)*T_0)*T_0_Vdrainp_sourcep))/15.0));
    6735                 :          0 : T3_Vbulk_sourcep=(((Vgsteff_Vbulk_sourcep*((((2.0*T_0)*T_0)/3.0)+(Vgsteff*(Vgsteff-((4.0*T_0)/3.0)))))+(Vgsteff*(((((2.0*T_0_Vbulk_sourcep)*T_0)+((2.0*T_0)*T_0_Vbulk_sourcep))/3.0)+((Vgsteff_Vbulk_sourcep*(Vgsteff-((4.0*T_0)/3.0)))+(Vgsteff*(Vgsteff_Vbulk_sourcep-((4.0*T_0_Vbulk_sourcep)/3.0)))))))-((((((2.0*T_0_Vbulk_sourcep)*T_0)+((2.0*T_0)*T_0_Vbulk_sourcep))*T_0)+(((2.0*T_0)*T_0)*T_0_Vbulk_sourcep))/15.0));
    6736                 :            : #endif
    6737                 :          0 : T3=((Vgsteff*((((2.0*T_0)*T_0)/3.0)+(Vgsteff*(Vgsteff-((4.0*T_0)/3.0)))))-((((2.0*T_0)*T_0)*T_0)/15.0));
    6738                 :            : #if defined(_DYNAMIC)
    6739                 :            : #if defined(_DERIVATE)
    6740                 :          0 : qsrc_Vgate_sourcep=(((-T2_Vgate_sourcep)*T3)+((-T2)*T3_Vgate_sourcep));
    6741                 :          0 : qsrc_Vdrainp_sourcep=(((-T2_Vdrainp_sourcep)*T3)+((-T2)*T3_Vdrainp_sourcep));
    6742                 :          0 : qsrc_Vbulk_sourcep=(((-T2_Vbulk_sourcep)*T3)+((-T2)*T3_Vbulk_sourcep));
    6743                 :            : #endif
    6744                 :          0 : qsrc=((-T2)*T3);
    6745                 :            : #endif
    6746                 :            : }
    6747                 :            : else
    6748                 :            : {
    6749                 :            : #if defined(_DYNAMIC)
    6750                 :            : #if defined(_DERIVATE)
    6751                 :          0 : qsrc_Vgate_sourcep=((-0.5)*(qgate_Vgate_sourcep+qbulk_Vgate_sourcep));
    6752                 :          0 : qsrc_Vdrainp_sourcep=((-0.5)*(qgate_Vdrainp_sourcep+qbulk_Vdrainp_sourcep));
    6753                 :          0 : qsrc_Vbulk_sourcep=((-0.5)*(qgate_Vbulk_sourcep+qbulk_Vbulk_sourcep));
    6754                 :            : #endif
    6755                 :          0 : qsrc=((-0.5)*(qgate+qbulk));
    6756                 :            : #endif
    6757                 :            : }
    6758                 :            : }
    6759                 :            : }
    6760                 :            : #if defined(_DYNAMIC)
    6761                 :            : #if defined(_DERIVATE)
    6762                 :          0 : qdrn_Vgate_sourcep=(-((qgate_Vgate_sourcep+qbulk_Vgate_sourcep)+qsrc_Vgate_sourcep));
    6763                 :          0 : qdrn_Vdrainp_sourcep=(-((qgate_Vdrainp_sourcep+qbulk_Vdrainp_sourcep)+qsrc_Vdrainp_sourcep));
    6764                 :          0 : qdrn_Vbulk_sourcep=(-((qgate_Vbulk_sourcep+qbulk_Vbulk_sourcep)+qsrc_Vbulk_sourcep));
    6765                 :            : #endif
    6766                 :          0 : qdrn=(-((qgate+qbulk)+qsrc));
    6767                 :            : #endif
    6768                 :            : #if defined(_DERIVATE)
    6769                 :          0 : qinv_Vdrainp_sourcep=(-(qgate_Vdrainp_sourcep+qbulk_Vdrainp_sourcep));
    6770                 :          0 : qinv_Vgate_sourcep=(-(qgate_Vgate_sourcep+qbulk_Vgate_sourcep));
    6771                 :          0 : qinv_Vbulk_sourcep=(-(qgate_Vbulk_sourcep+qbulk_Vbulk_sourcep));
    6772                 :            : #endif
    6773                 :          0 : qinv=(-(qgate+qbulk));
    6774                 :            : }
    6775                 :            : else
    6776                 :            : {
    6777         [ #  # ]:          0 : if
    6778                 :            : (CAPMOD==2)
    6779                 :            : {
    6780         [ #  # ]:          0 : if
    6781                 :            : (VERSION<3.2)
    6782                 :            : {
    6783                 :            : #if defined(_DERIVATE)
    6784                 :          0 : Vfb_Vdrainp_sourcep=(Vth_Vdrainp_sourcep-(k1ox*sqrtPhis_Vdrainp_sourcep));
    6785                 :          0 : Vfb_Vbulk_sourcep=(Vth_Vbulk_sourcep-(k1ox*sqrtPhis_Vbulk_sourcep));
    6786                 :            : #endif
    6787                 :          0 : Vfb=((Vth-phi)-(k1ox*sqrtPhis));
    6788                 :            : }
    6789                 :            : else
    6790                 :            : {
    6791                 :            : #if defined(_DERIVATE)
    6792                 :          0 : Vfb_Vdrainp_sourcep=0.0;
    6793                 :          0 : Vfb_Vbulk_sourcep=0.0;
    6794                 :            : #endif
    6795                 :          0 : Vfb=vfbzb;
    6796                 :            : }
    6797                 :            : #if defined(_DERIVATE)
    6798                 :          0 : V3_Vdrainp_sourcep=((Vfb_Vdrainp_sourcep-Vgs_eff_Vdrainp_sourcep)+VbseffCV_Vdrainp_sourcep);
    6799                 :          0 : V3_Vbulk_sourcep=((Vfb_Vbulk_sourcep-Vgs_eff_Vbulk_sourcep)+VbseffCV_Vbulk_sourcep);
    6800                 :          0 : V3_Vgate_sourcep=(-Vgs_eff_Vgate_sourcep);
    6801                 :            : #endif
    6802                 :          0 : V3=(((Vfb-Vgs_eff)+VbseffCV)-0.02);
    6803         [ #  # ]:          0 : if
    6804                 :            : (Vfb<=0.0)
    6805                 :            : {
    6806                 :            : {
    6807                 :          0 : double m00_sqrt(d00_sqrt0,((V3*V3)-((4.0*0.02)*Vfb)))
    6808                 :            : #if defined(_DERIVATE)
    6809                 :          0 : double m10_sqrt(d10_sqrt0,d00_sqrt0,((V3*V3)-((4.0*0.02)*Vfb)))
    6810                 :            : #endif
    6811                 :            : #if defined(_DERIVATE)
    6812                 :          0 : T_0_Vgate_sourcep=((V3_Vgate_sourcep*V3)+(V3*V3_Vgate_sourcep))*d10_sqrt0;
    6813                 :          0 : T_0_Vdrainp_sourcep=(((V3_Vdrainp_sourcep*V3)+(V3*V3_Vdrainp_sourcep))-((4.0*0.02)*Vfb_Vdrainp_sourcep))*d10_sqrt0;
    6814                 :          0 : T_0_Vbulk_sourcep=(((V3_Vbulk_sourcep*V3)+(V3*V3_Vbulk_sourcep))-((4.0*0.02)*Vfb_Vbulk_sourcep))*d10_sqrt0;
    6815                 :            : #endif
    6816                 :          0 : T_0=d00_sqrt0;
    6817                 :            : }
    6818                 :            : #if defined(_DERIVATE)
    6819                 :          0 : T2_Vgate_sourcep=(-(-0.02)*T_0_Vgate_sourcep/T_0/T_0);
    6820                 :          0 : T2_Vdrainp_sourcep=(-(-0.02)*T_0_Vdrainp_sourcep/T_0/T_0);
    6821                 :          0 : T2_Vbulk_sourcep=(-(-0.02)*T_0_Vbulk_sourcep/T_0/T_0);
    6822                 :            : #endif
    6823                 :          0 : T2=((-0.02)/T_0);
    6824                 :            : }
    6825                 :            : else
    6826                 :            : {
    6827                 :            : {
    6828                 :          0 : double m00_sqrt(d00_sqrt0,((V3*V3)+((4.0*0.02)*Vfb)))
    6829                 :            : #if defined(_DERIVATE)
    6830                 :          0 : double m10_sqrt(d10_sqrt0,d00_sqrt0,((V3*V3)+((4.0*0.02)*Vfb)))
    6831                 :            : #endif
    6832                 :            : #if defined(_DERIVATE)
    6833                 :          0 : T_0_Vgate_sourcep=((V3_Vgate_sourcep*V3)+(V3*V3_Vgate_sourcep))*d10_sqrt0;
    6834                 :          0 : T_0_Vdrainp_sourcep=(((V3_Vdrainp_sourcep*V3)+(V3*V3_Vdrainp_sourcep))+((4.0*0.02)*Vfb_Vdrainp_sourcep))*d10_sqrt0;
    6835                 :          0 : T_0_Vbulk_sourcep=(((V3_Vbulk_sourcep*V3)+(V3*V3_Vbulk_sourcep))+((4.0*0.02)*Vfb_Vbulk_sourcep))*d10_sqrt0;
    6836                 :            : #endif
    6837                 :          0 : T_0=d00_sqrt0;
    6838                 :            : }
    6839                 :            : #if defined(_DERIVATE)
    6840                 :          0 : T2_Vgate_sourcep=(-0.02*T_0_Vgate_sourcep/T_0/T_0);
    6841                 :          0 : T2_Vdrainp_sourcep=(-0.02*T_0_Vdrainp_sourcep/T_0/T_0);
    6842                 :          0 : T2_Vbulk_sourcep=(-0.02*T_0_Vbulk_sourcep/T_0/T_0);
    6843                 :            : #endif
    6844                 :          0 : T2=(0.02/T_0);
    6845                 :            : }
    6846                 :            : #if defined(_DERIVATE)
    6847                 :          0 : T1_Vgate_sourcep=(0.5*((V3_Vgate_sourcep*T_0-V3*T_0_Vgate_sourcep)/T_0/T_0));
    6848                 :          0 : T1_Vdrainp_sourcep=(0.5*((V3_Vdrainp_sourcep*T_0-V3*T_0_Vdrainp_sourcep)/T_0/T_0));
    6849                 :          0 : T1_Vbulk_sourcep=(0.5*((V3_Vbulk_sourcep*T_0-V3*T_0_Vbulk_sourcep)/T_0/T_0));
    6850                 :            : #endif
    6851                 :          0 : T1=(0.5*(1.0+(V3/T_0)));
    6852                 :            : #if defined(_DERIVATE)
    6853                 :          0 : Vfbeff_Vdrainp_sourcep=(Vfb_Vdrainp_sourcep-(0.5*(V3_Vdrainp_sourcep+T_0_Vdrainp_sourcep)));
    6854                 :          0 : Vfbeff_Vbulk_sourcep=(Vfb_Vbulk_sourcep-(0.5*(V3_Vbulk_sourcep+T_0_Vbulk_sourcep)));
    6855                 :          0 : Vfbeff_Vgate_sourcep=(-(0.5*(V3_Vgate_sourcep+T_0_Vgate_sourcep)));
    6856                 :            : #endif
    6857                 :          0 : Vfbeff=(Vfb-(0.5*(V3+T_0)));
    6858                 :            : #if defined(_DYNAMIC)
    6859                 :            : #if defined(_DERIVATE)
    6860                 :          0 : Qac0_Vdrainp_sourcep=(CoxWL*(Vfbeff_Vdrainp_sourcep-Vfb_Vdrainp_sourcep));
    6861                 :          0 : Qac0_Vbulk_sourcep=(CoxWL*(Vfbeff_Vbulk_sourcep-Vfb_Vbulk_sourcep));
    6862                 :          0 : Qac0_Vgate_sourcep=(CoxWL*Vfbeff_Vgate_sourcep);
    6863                 :            : #endif
    6864                 :          0 : Qac0=(CoxWL*(Vfbeff-Vfb));
    6865                 :            : #endif
    6866                 :            : #if defined(_DERIVATE)
    6867                 :          0 : T_0_Vgate_sourcep=0.0;
    6868                 :          0 : T_0_Vdrainp_sourcep=0.0;
    6869                 :          0 : T_0_Vbulk_sourcep=0.0;
    6870                 :            : #endif
    6871                 :          0 : T_0=(0.5*k1ox);
    6872                 :            : #if defined(_DERIVATE)
    6873                 :          0 : T3_Vgate_sourcep=((Vgs_eff_Vgate_sourcep-Vfbeff_Vgate_sourcep)-Vgsteff_Vgate_sourcep);
    6874                 :          0 : T3_Vdrainp_sourcep=(((Vgs_eff_Vdrainp_sourcep-Vfbeff_Vdrainp_sourcep)-VbseffCV_Vdrainp_sourcep)-Vgsteff_Vdrainp_sourcep);
    6875                 :          0 : T3_Vbulk_sourcep=(((Vgs_eff_Vbulk_sourcep-Vfbeff_Vbulk_sourcep)-VbseffCV_Vbulk_sourcep)-Vgsteff_Vbulk_sourcep);
    6876                 :            : #endif
    6877                 :          0 : T3=(((Vgs_eff-Vfbeff)-VbseffCV)-Vgsteff);
    6878         [ #  # ]:          0 : if
    6879                 :            : (k1ox==0.0)
    6880                 :            : {
    6881                 :            : #if defined(_DERIVATE)
    6882                 :          0 : T1_Vgate_sourcep=0.0;
    6883                 :          0 : T1_Vdrainp_sourcep=0.0;
    6884                 :          0 : T1_Vbulk_sourcep=0.0;
    6885                 :            : #endif
    6886                 :          0 : T1=0.0;
    6887                 :            : #if defined(_DERIVATE)
    6888                 :          0 : T2_Vgate_sourcep=0.0;
    6889                 :          0 : T2_Vdrainp_sourcep=0.0;
    6890                 :          0 : T2_Vbulk_sourcep=0.0;
    6891                 :            : #endif
    6892                 :          0 : T2=0.0;
    6893                 :            : }
    6894                 :            : else
    6895                 :            : {
    6896         [ #  # ]:          0 : if
    6897                 :            : (T3<0.0)
    6898                 :            : {
    6899                 :            : #if defined(_DERIVATE)
    6900                 :          0 : T1_Vgate_sourcep=(T_0_Vgate_sourcep+(T3_Vgate_sourcep/k1ox));
    6901                 :          0 : T1_Vdrainp_sourcep=(T_0_Vdrainp_sourcep+(T3_Vdrainp_sourcep/k1ox));
    6902                 :          0 : T1_Vbulk_sourcep=(T_0_Vbulk_sourcep+(T3_Vbulk_sourcep/k1ox));
    6903                 :            : #endif
    6904                 :          0 : T1=(T_0+(T3/k1ox));
    6905                 :            : #if defined(_DERIVATE)
    6906                 :          0 : T2_Vgate_sourcep=0.0;
    6907                 :          0 : T2_Vdrainp_sourcep=0.0;
    6908                 :          0 : T2_Vbulk_sourcep=0.0;
    6909                 :            : #endif
    6910                 :          0 : T2=CoxWL;
    6911                 :            : }
    6912                 :            : else
    6913                 :            : {
    6914                 :            : {
    6915                 :          0 : double m00_sqrt(d00_sqrt0,((T_0*T_0)+T3))
    6916                 :            : #if defined(_DERIVATE)
    6917                 :          0 : double m10_sqrt(d10_sqrt0,d00_sqrt0,((T_0*T_0)+T3))
    6918                 :            : #endif
    6919                 :            : #if defined(_DERIVATE)
    6920                 :          0 : T1_Vgate_sourcep=(((T_0_Vgate_sourcep*T_0)+(T_0*T_0_Vgate_sourcep))+T3_Vgate_sourcep)*d10_sqrt0;
    6921                 :          0 : T1_Vdrainp_sourcep=(((T_0_Vdrainp_sourcep*T_0)+(T_0*T_0_Vdrainp_sourcep))+T3_Vdrainp_sourcep)*d10_sqrt0;
    6922                 :          0 : T1_Vbulk_sourcep=(((T_0_Vbulk_sourcep*T_0)+(T_0*T_0_Vbulk_sourcep))+T3_Vbulk_sourcep)*d10_sqrt0;
    6923                 :            : #endif
    6924                 :          0 : T1=d00_sqrt0;
    6925                 :            : }
    6926                 :            : #if defined(_DERIVATE)
    6927                 :          0 : T2_Vgate_sourcep=(((CoxWL*T_0_Vgate_sourcep)*T1-(CoxWL*T_0)*T1_Vgate_sourcep)/T1/T1);
    6928                 :          0 : T2_Vdrainp_sourcep=(((CoxWL*T_0_Vdrainp_sourcep)*T1-(CoxWL*T_0)*T1_Vdrainp_sourcep)/T1/T1);
    6929                 :          0 : T2_Vbulk_sourcep=(((CoxWL*T_0_Vbulk_sourcep)*T1-(CoxWL*T_0)*T1_Vbulk_sourcep)/T1/T1);
    6930                 :            : #endif
    6931                 :          0 : T2=((CoxWL*T_0)/T1);
    6932                 :            : }
    6933                 :            : }
    6934                 :            : #if defined(_DYNAMIC)
    6935                 :            : #if defined(_DERIVATE)
    6936                 :          0 : Qsub0_Vgate_sourcep=((CoxWL*k1ox)*(T1_Vgate_sourcep-T_0_Vgate_sourcep));
    6937                 :          0 : Qsub0_Vdrainp_sourcep=((CoxWL*k1ox)*(T1_Vdrainp_sourcep-T_0_Vdrainp_sourcep));
    6938                 :          0 : Qsub0_Vbulk_sourcep=((CoxWL*k1ox)*(T1_Vbulk_sourcep-T_0_Vbulk_sourcep));
    6939                 :            : #endif
    6940                 :          0 : Qsub0=((CoxWL*k1ox)*(T1-T_0));
    6941                 :            : #endif
    6942                 :            : #if defined(_DERIVATE)
    6943                 :          0 : AbulkCV_Vgate_sourcep=Abulk0_Vgate_sourcep*abulkCVfactor;
    6944                 :          0 : AbulkCV_Vdrainp_sourcep=Abulk0_Vdrainp_sourcep*abulkCVfactor;
    6945                 :          0 : AbulkCV_Vbulk_sourcep=Abulk0_Vbulk_sourcep*abulkCVfactor;
    6946                 :            : #endif
    6947                 :          0 : AbulkCV=(Abulk0*abulkCVfactor);
    6948                 :            : #if defined(_DERIVATE)
    6949                 :          0 : VdsatCV_Vdrainp_sourcep=((Vgsteff_Vdrainp_sourcep*AbulkCV-Vgsteff*AbulkCV_Vdrainp_sourcep)/AbulkCV/AbulkCV);
    6950                 :          0 : VdsatCV_Vgate_sourcep=((Vgsteff_Vgate_sourcep*AbulkCV-Vgsteff*AbulkCV_Vgate_sourcep)/AbulkCV/AbulkCV);
    6951                 :          0 : VdsatCV_Vbulk_sourcep=((Vgsteff_Vbulk_sourcep*AbulkCV-Vgsteff*AbulkCV_Vbulk_sourcep)/AbulkCV/AbulkCV);
    6952                 :            : #endif
    6953                 :          0 : VdsatCV=(Vgsteff/AbulkCV);
    6954                 :            : #if defined(_DERIVATE)
    6955                 :          0 : V4_Vdrainp_sourcep=(VdsatCV_Vdrainp_sourcep-Vds_Vdrainp_sourcep);
    6956                 :          0 : V4_Vgate_sourcep=VdsatCV_Vgate_sourcep;
    6957                 :          0 : V4_Vbulk_sourcep=VdsatCV_Vbulk_sourcep;
    6958                 :            : #endif
    6959                 :          0 : V4=((VdsatCV-Vds)-0.02);
    6960                 :            : {
    6961                 :          0 : double m00_sqrt(d00_sqrt0,((V4*V4)+((4.0*0.02)*VdsatCV)))
    6962                 :            : #if defined(_DERIVATE)
    6963                 :          0 : double m10_sqrt(d10_sqrt0,d00_sqrt0,((V4*V4)+((4.0*0.02)*VdsatCV)))
    6964                 :            : #endif
    6965                 :            : #if defined(_DERIVATE)
    6966                 :          0 : T_0_Vgate_sourcep=(((V4_Vgate_sourcep*V4)+(V4*V4_Vgate_sourcep))+((4.0*0.02)*VdsatCV_Vgate_sourcep))*d10_sqrt0;
    6967                 :          0 : T_0_Vdrainp_sourcep=(((V4_Vdrainp_sourcep*V4)+(V4*V4_Vdrainp_sourcep))+((4.0*0.02)*VdsatCV_Vdrainp_sourcep))*d10_sqrt0;
    6968                 :          0 : T_0_Vbulk_sourcep=(((V4_Vbulk_sourcep*V4)+(V4*V4_Vbulk_sourcep))+((4.0*0.02)*VdsatCV_Vbulk_sourcep))*d10_sqrt0;
    6969                 :            : #endif
    6970                 :          0 : T_0=d00_sqrt0;
    6971                 :            : }
    6972                 :            : #if defined(_DERIVATE)
    6973                 :          0 : VdseffCV_Vdrainp_sourcep=(VdsatCV_Vdrainp_sourcep-(0.5*(V4_Vdrainp_sourcep+T_0_Vdrainp_sourcep)));
    6974                 :          0 : VdseffCV_Vgate_sourcep=(VdsatCV_Vgate_sourcep-(0.5*(V4_Vgate_sourcep+T_0_Vgate_sourcep)));
    6975                 :          0 : VdseffCV_Vbulk_sourcep=(VdsatCV_Vbulk_sourcep-(0.5*(V4_Vbulk_sourcep+T_0_Vbulk_sourcep)));
    6976                 :            : #endif
    6977                 :          0 : VdseffCV=(VdsatCV-(0.5*(V4+T_0)));
    6978 [ #  # ][ #  # ]:          0 : if
    6979                 :            : ((Vds==0.0)&&(VERSION==3.24))
    6980                 :            : {
    6981                 :            : #if defined(_DERIVATE)
    6982                 :          0 : VdseffCV_Vdrainp_sourcep=0.0;
    6983                 :          0 : VdseffCV_Vgate_sourcep=0.0;
    6984                 :          0 : VdseffCV_Vbulk_sourcep=0.0;
    6985                 :            : #endif
    6986                 :          0 : VdseffCV=0.0;
    6987                 :            : }
    6988                 :            : #if defined(_DERIVATE)
    6989                 :          0 : T_0_Vgate_sourcep=((AbulkCV_Vgate_sourcep*VdseffCV)+(AbulkCV*VdseffCV_Vgate_sourcep));
    6990                 :          0 : T_0_Vdrainp_sourcep=((AbulkCV_Vdrainp_sourcep*VdseffCV)+(AbulkCV*VdseffCV_Vdrainp_sourcep));
    6991                 :          0 : T_0_Vbulk_sourcep=((AbulkCV_Vbulk_sourcep*VdseffCV)+(AbulkCV*VdseffCV_Vbulk_sourcep));
    6992                 :            : #endif
    6993                 :          0 : T_0=(AbulkCV*VdseffCV);
    6994                 :            : #if defined(_DERIVATE)
    6995                 :          0 : T1_Vgate_sourcep=(12.0*(Vgsteff_Vgate_sourcep-(0.5*T_0_Vgate_sourcep)));
    6996                 :          0 : T1_Vdrainp_sourcep=(12.0*(Vgsteff_Vdrainp_sourcep-(0.5*T_0_Vdrainp_sourcep)));
    6997                 :          0 : T1_Vbulk_sourcep=(12.0*(Vgsteff_Vbulk_sourcep-(0.5*T_0_Vbulk_sourcep)));
    6998                 :            : #endif
    6999                 :          0 : T1=(12.0*((Vgsteff-(0.5*T_0))+1e-20));
    7000                 :            : #if defined(_DERIVATE)
    7001                 :          0 : T2_Vgate_sourcep=((VdseffCV_Vgate_sourcep*T1-VdseffCV*T1_Vgate_sourcep)/T1/T1);
    7002                 :          0 : T2_Vdrainp_sourcep=((VdseffCV_Vdrainp_sourcep*T1-VdseffCV*T1_Vdrainp_sourcep)/T1/T1);
    7003                 :          0 : T2_Vbulk_sourcep=((VdseffCV_Vbulk_sourcep*T1-VdseffCV*T1_Vbulk_sourcep)/T1/T1);
    7004                 :            : #endif
    7005                 :          0 : T2=(VdseffCV/T1);
    7006                 :            : #if defined(_DERIVATE)
    7007                 :          0 : T3_Vgate_sourcep=((T_0_Vgate_sourcep*T2)+(T_0*T2_Vgate_sourcep));
    7008                 :          0 : T3_Vdrainp_sourcep=((T_0_Vdrainp_sourcep*T2)+(T_0*T2_Vdrainp_sourcep));
    7009                 :          0 : T3_Vbulk_sourcep=((T_0_Vbulk_sourcep*T2)+(T_0*T2_Vbulk_sourcep));
    7010                 :            : #endif
    7011                 :          0 : T3=(T_0*T2);
    7012                 :            : #if defined(_DYNAMIC)
    7013                 :            : #if defined(_DERIVATE)
    7014                 :          0 : T4_Vgate_sourcep=(-(((((12.0*T2_Vgate_sourcep)*T2)+((12.0*T2)*T2_Vgate_sourcep))*AbulkCV)+(((12.0*T2)*T2)*AbulkCV_Vgate_sourcep)));
    7015                 :          0 : T4_Vdrainp_sourcep=(-(((((12.0*T2_Vdrainp_sourcep)*T2)+((12.0*T2)*T2_Vdrainp_sourcep))*AbulkCV)+(((12.0*T2)*T2)*AbulkCV_Vdrainp_sourcep)));
    7016                 :          0 : T4_Vbulk_sourcep=(-(((((12.0*T2_Vbulk_sourcep)*T2)+((12.0*T2)*T2_Vbulk_sourcep))*AbulkCV)+(((12.0*T2)*T2)*AbulkCV_Vbulk_sourcep)));
    7017                 :            : #endif
    7018                 :          0 : T4=(1.0-(((12.0*T2)*T2)*AbulkCV));
    7019                 :            : #endif
    7020                 :            : #if defined(_DYNAMIC)
    7021                 :            : #if defined(_DERIVATE)
    7022                 :          0 : T5_Vgate_sourcep=(((((6.0*T_0_Vgate_sourcep)*((4.0*Vgsteff)-T_0))+((6.0*T_0)*((4.0*Vgsteff_Vgate_sourcep)-T_0_Vgate_sourcep)))*(T1*T1)-((6.0*T_0)*((4.0*Vgsteff)-T_0))*((T1_Vgate_sourcep*T1)+(T1*T1_Vgate_sourcep)))/(T1*T1)/(T1*T1));
    7023                 :          0 : T5_Vdrainp_sourcep=(((((6.0*T_0_Vdrainp_sourcep)*((4.0*Vgsteff)-T_0))+((6.0*T_0)*((4.0*Vgsteff_Vdrainp_sourcep)-T_0_Vdrainp_sourcep)))*(T1*T1)-((6.0*T_0)*((4.0*Vgsteff)-T_0))*((T1_Vdrainp_sourcep*T1)+(T1*T1_Vdrainp_sourcep)))/(T1*T1)/(T1*T1));
    7024                 :          0 : T5_Vbulk_sourcep=(((((6.0*T_0_Vbulk_sourcep)*((4.0*Vgsteff)-T_0))+((6.0*T_0)*((4.0*Vgsteff_Vbulk_sourcep)-T_0_Vbulk_sourcep)))*(T1*T1)-((6.0*T_0)*((4.0*Vgsteff)-T_0))*((T1_Vbulk_sourcep*T1)+(T1*T1_Vbulk_sourcep)))/(T1*T1)/(T1*T1));
    7025                 :            : #endif
    7026                 :          0 : T5=((((6.0*T_0)*((4.0*Vgsteff)-T_0))/(T1*T1))-0.5);
    7027                 :            : #endif
    7028                 :            : #if defined(_DYNAMIC)
    7029                 :            : #if defined(_DERIVATE)
    7030                 :          0 : T6_Vgate_sourcep=(((((12.0*T2_Vgate_sourcep)*T2)+((12.0*T2)*T2_Vgate_sourcep))*Vgsteff)+(((12.0*T2)*T2)*Vgsteff_Vgate_sourcep));
    7031                 :          0 : T6_Vdrainp_sourcep=(((((12.0*T2_Vdrainp_sourcep)*T2)+((12.0*T2)*T2_Vdrainp_sourcep))*Vgsteff)+(((12.0*T2)*T2)*Vgsteff_Vdrainp_sourcep));
    7032                 :          0 : T6_Vbulk_sourcep=(((((12.0*T2_Vbulk_sourcep)*T2)+((12.0*T2)*T2_Vbulk_sourcep))*Vgsteff)+(((12.0*T2)*T2)*Vgsteff_Vbulk_sourcep));
    7033                 :            : #endif
    7034                 :          0 : T6=(((12.0*T2)*T2)*Vgsteff);
    7035                 :            : #endif
    7036                 :            : #if defined(_DERIVATE)
    7037                 :          0 : qinoi_Vdrainp_sourcep=((-CoxWL)*((Vgsteff_Vdrainp_sourcep-(0.5*T_0_Vdrainp_sourcep))+((AbulkCV_Vdrainp_sourcep*T3)+(AbulkCV*T3_Vdrainp_sourcep))));
    7038                 :          0 : qinoi_Vgate_sourcep=((-CoxWL)*((Vgsteff_Vgate_sourcep-(0.5*T_0_Vgate_sourcep))+((AbulkCV_Vgate_sourcep*T3)+(AbulkCV*T3_Vgate_sourcep))));
    7039                 :          0 : qinoi_Vbulk_sourcep=((-CoxWL)*((Vgsteff_Vbulk_sourcep-(0.5*T_0_Vbulk_sourcep))+((AbulkCV_Vbulk_sourcep*T3)+(AbulkCV*T3_Vbulk_sourcep))));
    7040                 :            : #endif
    7041                 :          0 : qinoi=((-CoxWL)*((Vgsteff-(0.5*T_0))+(AbulkCV*T3)));
    7042                 :            : #if defined(_DYNAMIC)
    7043                 :            : #if defined(_DERIVATE)
    7044                 :          0 : qgate_Vdrainp_sourcep=(CoxWL*((Vgsteff_Vdrainp_sourcep-(0.5*VdseffCV_Vdrainp_sourcep))+T3_Vdrainp_sourcep));
    7045                 :          0 : qgate_Vgate_sourcep=(CoxWL*((Vgsteff_Vgate_sourcep-(0.5*VdseffCV_Vgate_sourcep))+T3_Vgate_sourcep));
    7046                 :          0 : qgate_Vbulk_sourcep=(CoxWL*((Vgsteff_Vbulk_sourcep-(0.5*VdseffCV_Vbulk_sourcep))+T3_Vbulk_sourcep));
    7047                 :            : #endif
    7048                 :          0 : qgate=(CoxWL*((Vgsteff-(0.5*VdseffCV))+T3));
    7049                 :            : #endif
    7050                 :            : #if defined(_DYNAMIC)
    7051                 :            : #if defined(_DERIVATE)
    7052                 :          0 : T7_Vgate_sourcep=(-AbulkCV_Vgate_sourcep);
    7053                 :          0 : T7_Vdrainp_sourcep=(-AbulkCV_Vdrainp_sourcep);
    7054                 :          0 : T7_Vbulk_sourcep=(-AbulkCV_Vbulk_sourcep);
    7055                 :            : #endif
    7056                 :          0 : T7=(1.0-AbulkCV);
    7057                 :            : #endif
    7058                 :            : #if defined(_DYNAMIC)
    7059                 :            : #if defined(_DERIVATE)
    7060                 :          0 : qbulk_Vdrainp_sourcep=(((CoxWL*T7_Vdrainp_sourcep)*((0.5*VdseffCV)-T3))+((CoxWL*T7)*((0.5*VdseffCV_Vdrainp_sourcep)-T3_Vdrainp_sourcep)));
    7061                 :          0 : qbulk_Vgate_sourcep=(((CoxWL*T7_Vgate_sourcep)*((0.5*VdseffCV)-T3))+((CoxWL*T7)*((0.5*VdseffCV_Vgate_sourcep)-T3_Vgate_sourcep)));
    7062                 :          0 : qbulk_Vbulk_sourcep=(((CoxWL*T7_Vbulk_sourcep)*((0.5*VdseffCV)-T3))+((CoxWL*T7)*((0.5*VdseffCV_Vbulk_sourcep)-T3_Vbulk_sourcep)));
    7063                 :            : #endif
    7064                 :          0 : qbulk=((CoxWL*T7)*((0.5*VdseffCV)-T3));
    7065                 :            : #endif
    7066         [ #  # ]:          0 : if
    7067                 :            : (XPART>0.5)
    7068                 :            : {
    7069                 :            : #if defined(_DYNAMIC)
    7070                 :            : #if defined(_DERIVATE)
    7071                 :          0 : qsrc_Vgate_sourcep=((-CoxWL)*(((0.5*Vgsteff_Vgate_sourcep)+(0.25*T_0_Vgate_sourcep))-((((T_0_Vgate_sourcep*T_0)+(T_0*T_0_Vgate_sourcep))*(T1+T1)-(T_0*T_0)*(T1_Vgate_sourcep+T1_Vgate_sourcep))/(T1+T1)/(T1+T1))));
    7072                 :          0 : qsrc_Vdrainp_sourcep=((-CoxWL)*(((0.5*Vgsteff_Vdrainp_sourcep)+(0.25*T_0_Vdrainp_sourcep))-((((T_0_Vdrainp_sourcep*T_0)+(T_0*T_0_Vdrainp_sourcep))*(T1+T1)-(T_0*T_0)*(T1_Vdrainp_sourcep+T1_Vdrainp_sourcep))/(T1+T1)/(T1+T1))));
    7073                 :          0 : qsrc_Vbulk_sourcep=((-CoxWL)*(((0.5*Vgsteff_Vbulk_sourcep)+(0.25*T_0_Vbulk_sourcep))-((((T_0_Vbulk_sourcep*T_0)+(T_0*T_0_Vbulk_sourcep))*(T1+T1)-(T_0*T_0)*(T1_Vbulk_sourcep+T1_Vbulk_sourcep))/(T1+T1)/(T1+T1))));
    7074                 :            : #endif
    7075                 :          0 : qsrc=((-CoxWL)*(((0.5*Vgsteff)+(0.25*T_0))-((T_0*T_0)/(T1+T1))));
    7076                 :            : #endif
    7077                 :            : }
    7078                 :            : else
    7079                 :            : {
    7080         [ #  # ]:          0 : if
    7081                 :            : (XPART<0.5)
    7082                 :            : {
    7083                 :            : #if defined(_DERIVATE)
    7084                 :          0 : T2_Vgate_sourcep=(-(0.5*CoxWL)*((((T1_Vgate_sourcep/12.0)*T1)+((T1/12.0)*T1_Vgate_sourcep))/12.0)/(((T1/12.0)*T1)/12.0)/(((T1/12.0)*T1)/12.0));
    7085                 :          0 : T2_Vdrainp_sourcep=(-(0.5*CoxWL)*((((T1_Vdrainp_sourcep/12.0)*T1)+((T1/12.0)*T1_Vdrainp_sourcep))/12.0)/(((T1/12.0)*T1)/12.0)/(((T1/12.0)*T1)/12.0));
    7086                 :          0 : T2_Vbulk_sourcep=(-(0.5*CoxWL)*((((T1_Vbulk_sourcep/12.0)*T1)+((T1/12.0)*T1_Vbulk_sourcep))/12.0)/(((T1/12.0)*T1)/12.0)/(((T1/12.0)*T1)/12.0));
    7087                 :            : #endif
    7088                 :          0 : T2=((0.5*CoxWL)/(((T1/12.0)*T1)/12.0));
    7089                 :            : #if defined(_DERIVATE)
    7090                 :          0 : T3_Vgate_sourcep=(((Vgsteff_Vgate_sourcep*((((2.0*T_0)*T_0)/3.0)+(Vgsteff*(Vgsteff-((4.0*T_0)/3.0)))))+(Vgsteff*(((((2.0*T_0_Vgate_sourcep)*T_0)+((2.0*T_0)*T_0_Vgate_sourcep))/3.0)+((Vgsteff_Vgate_sourcep*(Vgsteff-((4.0*T_0)/3.0)))+(Vgsteff*(Vgsteff_Vgate_sourcep-((4.0*T_0_Vgate_sourcep)/3.0)))))))-((((((2.0*T_0_Vgate_sourcep)*T_0)+((2.0*T_0)*T_0_Vgate_sourcep))*T_0)+(((2.0*T_0)*T_0)*T_0_Vgate_sourcep))/15.0));
    7091                 :          0 : T3_Vdrainp_sourcep=(((Vgsteff_Vdrainp_sourcep*((((2.0*T_0)*T_0)/3.0)+(Vgsteff*(Vgsteff-((4.0*T_0)/3.0)))))+(Vgsteff*(((((2.0*T_0_Vdrainp_sourcep)*T_0)+((2.0*T_0)*T_0_Vdrainp_sourcep))/3.0)+((Vgsteff_Vdrainp_sourcep*(Vgsteff-((4.0*T_0)/3.0)))+(Vgsteff*(Vgsteff_Vdrainp_sourcep-((4.0*T_0_Vdrainp_sourcep)/3.0)))))))-((((((2.0*T_0_Vdrainp_sourcep)*T_0)+((2.0*T_0)*T_0_Vdrainp_sourcep))*T_0)+(((2.0*T_0)*T_0)*T_0_Vdrainp_sourcep))/15.0));
    7092                 :          0 : T3_Vbulk_sourcep=(((Vgsteff_Vbulk_sourcep*((((2.0*T_0)*T_0)/3.0)+(Vgsteff*(Vgsteff-((4.0*T_0)/3.0)))))+(Vgsteff*(((((2.0*T_0_Vbulk_sourcep)*T_0)+((2.0*T_0)*T_0_Vbulk_sourcep))/3.0)+((Vgsteff_Vbulk_sourcep*(Vgsteff-((4.0*T_0)/3.0)))+(Vgsteff*(Vgsteff_Vbulk_sourcep-((4.0*T_0_Vbulk_sourcep)/3.0)))))))-((((((2.0*T_0_Vbulk_sourcep)*T_0)+((2.0*T_0)*T_0_Vbulk_sourcep))*T_0)+(((2.0*T_0)*T_0)*T_0_Vbulk_sourcep))/15.0));
    7093                 :            : #endif
    7094                 :          0 : T3=((Vgsteff*((((2.0*T_0)*T_0)/3.0)+(Vgsteff*(Vgsteff-((4.0*T_0)/3.0)))))-((((2.0*T_0)*T_0)*T_0)/15.0));
    7095                 :            : #if defined(_DYNAMIC)
    7096                 :            : #if defined(_DERIVATE)
    7097                 :          0 : qsrc_Vgate_sourcep=(((-T2_Vgate_sourcep)*T3)+((-T2)*T3_Vgate_sourcep));
    7098                 :          0 : qsrc_Vdrainp_sourcep=(((-T2_Vdrainp_sourcep)*T3)+((-T2)*T3_Vdrainp_sourcep));
    7099                 :          0 : qsrc_Vbulk_sourcep=(((-T2_Vbulk_sourcep)*T3)+((-T2)*T3_Vbulk_sourcep));
    7100                 :            : #endif
    7101                 :          0 : qsrc=((-T2)*T3);
    7102                 :            : #endif
    7103                 :            : }
    7104                 :            : else
    7105                 :            : {
    7106                 :            : #if defined(_DYNAMIC)
    7107                 :            : #if defined(_DERIVATE)
    7108                 :          0 : qsrc_Vgate_sourcep=((-0.5)*(qgate_Vgate_sourcep+qbulk_Vgate_sourcep));
    7109                 :          0 : qsrc_Vdrainp_sourcep=((-0.5)*(qgate_Vdrainp_sourcep+qbulk_Vdrainp_sourcep));
    7110                 :          0 : qsrc_Vbulk_sourcep=((-0.5)*(qgate_Vbulk_sourcep+qbulk_Vbulk_sourcep));
    7111                 :            : #endif
    7112                 :          0 : qsrc=((-0.5)*(qgate+qbulk));
    7113                 :            : #endif
    7114                 :            : }
    7115                 :            : }
    7116                 :            : #if defined(_DYNAMIC)
    7117                 :            : #if defined(_DERIVATE)
    7118                 :          0 : qgate_Vdrainp_sourcep=((qgate_Vdrainp_sourcep+Qac0_Vdrainp_sourcep)+Qsub0_Vdrainp_sourcep);
    7119                 :          0 : qgate_Vgate_sourcep=((qgate_Vgate_sourcep+Qac0_Vgate_sourcep)+Qsub0_Vgate_sourcep);
    7120                 :          0 : qgate_Vbulk_sourcep=((qgate_Vbulk_sourcep+Qac0_Vbulk_sourcep)+Qsub0_Vbulk_sourcep);
    7121                 :            : #endif
    7122                 :          0 : qgate=((qgate+Qac0)+Qsub0);
    7123                 :            : #endif
    7124                 :            : #if defined(_DYNAMIC)
    7125                 :            : #if defined(_DERIVATE)
    7126                 :          0 : qbulk_Vdrainp_sourcep=(qbulk_Vdrainp_sourcep-(Qac0_Vdrainp_sourcep+Qsub0_Vdrainp_sourcep));
    7127                 :          0 : qbulk_Vgate_sourcep=(qbulk_Vgate_sourcep-(Qac0_Vgate_sourcep+Qsub0_Vgate_sourcep));
    7128                 :          0 : qbulk_Vbulk_sourcep=(qbulk_Vbulk_sourcep-(Qac0_Vbulk_sourcep+Qsub0_Vbulk_sourcep));
    7129                 :            : #endif
    7130                 :          0 : qbulk=(qbulk-(Qac0+Qsub0));
    7131                 :            : #endif
    7132                 :            : #if defined(_DYNAMIC)
    7133                 :            : #if defined(_DERIVATE)
    7134                 :          0 : qdrn_Vgate_sourcep=(-((qgate_Vgate_sourcep+qbulk_Vgate_sourcep)+qsrc_Vgate_sourcep));
    7135                 :          0 : qdrn_Vdrainp_sourcep=(-((qgate_Vdrainp_sourcep+qbulk_Vdrainp_sourcep)+qsrc_Vdrainp_sourcep));
    7136                 :          0 : qdrn_Vbulk_sourcep=(-((qgate_Vbulk_sourcep+qbulk_Vbulk_sourcep)+qsrc_Vbulk_sourcep));
    7137                 :            : #endif
    7138                 :          0 : qdrn=(-((qgate+qbulk)+qsrc));
    7139                 :            : #endif
    7140                 :            : #if defined(_DERIVATE)
    7141                 :          0 : qinv_Vdrainp_sourcep=qinoi_Vdrainp_sourcep;
    7142                 :          0 : qinv_Vgate_sourcep=qinoi_Vgate_sourcep;
    7143                 :          0 : qinv_Vbulk_sourcep=qinoi_Vbulk_sourcep;
    7144                 :            : #endif
    7145                 :          0 : qinv=qinoi;
    7146                 :            : }
    7147                 :            : else
    7148                 :            : {
    7149         [ #  # ]:          0 : if
    7150                 :            : (CAPMOD==3)
    7151                 :            : {
    7152                 :            : #if defined(_DERIVATE)
    7153                 :          0 : V3_Vdrainp_sourcep=((-Vgs_eff_Vdrainp_sourcep)+VbseffCV_Vdrainp_sourcep);
    7154                 :          0 : V3_Vbulk_sourcep=((-Vgs_eff_Vbulk_sourcep)+VbseffCV_Vbulk_sourcep);
    7155                 :          0 : V3_Vgate_sourcep=(-Vgs_eff_Vgate_sourcep);
    7156                 :            : #endif
    7157                 :          0 : V3=(((vfbzb-Vgs_eff)+VbseffCV)-0.02);
    7158         [ #  # ]:          0 : if
    7159                 :            : (vfbzb<=0.0)
    7160                 :            : {
    7161                 :            : {
    7162                 :          0 : double m00_sqrt(d00_sqrt0,((V3*V3)-((4.0*0.02)*vfbzb)))
    7163                 :            : #if defined(_DERIVATE)
    7164                 :          0 : double m10_sqrt(d10_sqrt0,d00_sqrt0,((V3*V3)-((4.0*0.02)*vfbzb)))
    7165                 :            : #endif
    7166                 :            : #if defined(_DERIVATE)
    7167                 :          0 : T_0_Vgate_sourcep=((V3_Vgate_sourcep*V3)+(V3*V3_Vgate_sourcep))*d10_sqrt0;
    7168                 :          0 : T_0_Vdrainp_sourcep=((V3_Vdrainp_sourcep*V3)+(V3*V3_Vdrainp_sourcep))*d10_sqrt0;
    7169                 :          0 : T_0_Vbulk_sourcep=((V3_Vbulk_sourcep*V3)+(V3*V3_Vbulk_sourcep))*d10_sqrt0;
    7170                 :            : #endif
    7171                 :          0 : T_0=d00_sqrt0;
    7172                 :            : }
    7173                 :            : #if defined(_DERIVATE)
    7174                 :          0 : T2_Vgate_sourcep=(-(-0.02)*T_0_Vgate_sourcep/T_0/T_0);
    7175                 :          0 : T2_Vdrainp_sourcep=(-(-0.02)*T_0_Vdrainp_sourcep/T_0/T_0);
    7176                 :          0 : T2_Vbulk_sourcep=(-(-0.02)*T_0_Vbulk_sourcep/T_0/T_0);
    7177                 :            : #endif
    7178                 :          0 : T2=((-0.02)/T_0);
    7179                 :            : }
    7180                 :            : else
    7181                 :            : {
    7182                 :            : {
    7183                 :          0 : double m00_sqrt(d00_sqrt0,((V3*V3)+((4.0*0.02)*vfbzb)))
    7184                 :            : #if defined(_DERIVATE)
    7185                 :          0 : double m10_sqrt(d10_sqrt0,d00_sqrt0,((V3*V3)+((4.0*0.02)*vfbzb)))
    7186                 :            : #endif
    7187                 :            : #if defined(_DERIVATE)
    7188                 :          0 : T_0_Vgate_sourcep=((V3_Vgate_sourcep*V3)+(V3*V3_Vgate_sourcep))*d10_sqrt0;
    7189                 :          0 : T_0_Vdrainp_sourcep=((V3_Vdrainp_sourcep*V3)+(V3*V3_Vdrainp_sourcep))*d10_sqrt0;
    7190                 :          0 : T_0_Vbulk_sourcep=((V3_Vbulk_sourcep*V3)+(V3*V3_Vbulk_sourcep))*d10_sqrt0;
    7191                 :            : #endif
    7192                 :          0 : T_0=d00_sqrt0;
    7193                 :            : }
    7194                 :            : #if defined(_DERIVATE)
    7195                 :          0 : T2_Vgate_sourcep=(-0.02*T_0_Vgate_sourcep/T_0/T_0);
    7196                 :          0 : T2_Vdrainp_sourcep=(-0.02*T_0_Vdrainp_sourcep/T_0/T_0);
    7197                 :          0 : T2_Vbulk_sourcep=(-0.02*T_0_Vbulk_sourcep/T_0/T_0);
    7198                 :            : #endif
    7199                 :          0 : T2=(0.02/T_0);
    7200                 :            : }
    7201                 :            : #if defined(_DERIVATE)
    7202                 :          0 : T1_Vgate_sourcep=(0.5*((V3_Vgate_sourcep*T_0-V3*T_0_Vgate_sourcep)/T_0/T_0));
    7203                 :          0 : T1_Vdrainp_sourcep=(0.5*((V3_Vdrainp_sourcep*T_0-V3*T_0_Vdrainp_sourcep)/T_0/T_0));
    7204                 :          0 : T1_Vbulk_sourcep=(0.5*((V3_Vbulk_sourcep*T_0-V3*T_0_Vbulk_sourcep)/T_0/T_0));
    7205                 :            : #endif
    7206                 :          0 : T1=(0.5*(1.0+(V3/T_0)));
    7207                 :            : #if defined(_DERIVATE)
    7208                 :          0 : Vfbeff_Vdrainp_sourcep=(-(0.5*(V3_Vdrainp_sourcep+T_0_Vdrainp_sourcep)));
    7209                 :          0 : Vfbeff_Vbulk_sourcep=(-(0.5*(V3_Vbulk_sourcep+T_0_Vbulk_sourcep)));
    7210                 :          0 : Vfbeff_Vgate_sourcep=(-(0.5*(V3_Vgate_sourcep+T_0_Vgate_sourcep)));
    7211                 :            : #endif
    7212                 :          0 : Vfbeff=(vfbzb-(0.5*(V3+T_0)));
    7213                 :          0 : Cox=cox;
    7214                 :          0 : Tox=(1.0e8*tox);
    7215                 :            : #if defined(_DERIVATE)
    7216                 :          0 : T_0_Vgate_sourcep=(Vgs_eff_Vgate_sourcep/Tox);
    7217                 :          0 : T_0_Vdrainp_sourcep=((Vgs_eff_Vdrainp_sourcep-VbseffCV_Vdrainp_sourcep)/Tox);
    7218                 :          0 : T_0_Vbulk_sourcep=((Vgs_eff_Vbulk_sourcep-VbseffCV_Vbulk_sourcep)/Tox);
    7219                 :            : #endif
    7220                 :          0 : T_0=(((Vgs_eff-VbseffCV)-vfbzb)/Tox);
    7221                 :            : #if defined(_DERIVATE)
    7222                 :          0 : tmp_Vgate_sourcep=T_0_Vgate_sourcep*acde;
    7223                 :          0 : tmp_Vdrainp_sourcep=T_0_Vdrainp_sourcep*acde;
    7224                 :          0 : tmp_Vbulk_sourcep=T_0_Vbulk_sourcep*acde;
    7225                 :            : #endif
    7226                 :          0 : tmp=(T_0*acde);
    7227 [ #  # ][ #  # ]:          0 : if
    7228                 :            : (((-34.0)<tmp)&&(tmp<34.0))
    7229                 :            : {
    7230                 :            : {
    7231                 :          0 : double m00_exp(d00_exp0,tmp)
    7232                 :            : #if defined(_DERIVATE)
    7233                 :            : #define d10_exp0 d00_exp0
    7234                 :            : #endif
    7235                 :            : #if defined(_DERIVATE)
    7236                 :          0 : Tcen_Vgate_sourcep=(ldeb*tmp_Vgate_sourcep*d10_exp0);
    7237                 :          0 : Tcen_Vdrainp_sourcep=(ldeb*tmp_Vdrainp_sourcep*d10_exp0);
    7238                 :          0 : Tcen_Vbulk_sourcep=(ldeb*tmp_Vbulk_sourcep*d10_exp0);
    7239                 :            : #endif
    7240                 :          0 : Tcen=(ldeb*d00_exp0);
    7241                 :          0 : }
    7242                 :            : }
    7243                 :            : else
    7244                 :            : {
    7245         [ #  # ]:          0 : if
    7246                 :            : (tmp<=(-34.0))
    7247                 :            : {
    7248                 :            : #if defined(_DERIVATE)
    7249                 :          0 : Tcen_Vgate_sourcep=0.0;
    7250                 :          0 : Tcen_Vdrainp_sourcep=0.0;
    7251                 :          0 : Tcen_Vbulk_sourcep=0.0;
    7252                 :            : #endif
    7253                 :          0 : Tcen=(ldeb*1.713908431e-15);
    7254                 :            : }
    7255                 :            : else
    7256                 :            : {
    7257                 :            : #if defined(_DERIVATE)
    7258                 :          0 : Tcen_Vgate_sourcep=0.0;
    7259                 :          0 : Tcen_Vdrainp_sourcep=0.0;
    7260                 :          0 : Tcen_Vbulk_sourcep=0.0;
    7261                 :            : #endif
    7262                 :          0 : Tcen=(ldeb*5.834617425e14);
    7263                 :            : }
    7264                 :            : }
    7265                 :          0 : LINK=(1.0e-3*tox);
    7266                 :            : #if defined(_DERIVATE)
    7267                 :          0 : V3_Vdrainp_sourcep=(-Tcen_Vdrainp_sourcep);
    7268                 :          0 : V3_Vbulk_sourcep=(-Tcen_Vbulk_sourcep);
    7269                 :          0 : V3_Vgate_sourcep=(-Tcen_Vgate_sourcep);
    7270                 :            : #endif
    7271                 :          0 : V3=((ldeb-Tcen)-LINK);
    7272                 :            : {
    7273                 :          0 : double m00_sqrt(d00_sqrt0,((V3*V3)+((4.0*LINK)*ldeb)))
    7274                 :            : #if defined(_DERIVATE)
    7275                 :          0 : double m10_sqrt(d10_sqrt0,d00_sqrt0,((V3*V3)+((4.0*LINK)*ldeb)))
    7276                 :            : #endif
    7277                 :            : #if defined(_DERIVATE)
    7278                 :          0 : V4_Vdrainp_sourcep=((V3_Vdrainp_sourcep*V3)+(V3*V3_Vdrainp_sourcep))*d10_sqrt0;
    7279                 :          0 : V4_Vgate_sourcep=((V3_Vgate_sourcep*V3)+(V3*V3_Vgate_sourcep))*d10_sqrt0;
    7280                 :          0 : V4_Vbulk_sourcep=((V3_Vbulk_sourcep*V3)+(V3*V3_Vbulk_sourcep))*d10_sqrt0;
    7281                 :            : #endif
    7282                 :          0 : V4=d00_sqrt0;
    7283                 :            : }
    7284                 :            : #if defined(_DERIVATE)
    7285                 :          0 : Tcen_Vgate_sourcep=(-(0.5*(V3_Vgate_sourcep+V4_Vgate_sourcep)));
    7286                 :          0 : Tcen_Vdrainp_sourcep=(-(0.5*(V3_Vdrainp_sourcep+V4_Vdrainp_sourcep)));
    7287                 :          0 : Tcen_Vbulk_sourcep=(-(0.5*(V3_Vbulk_sourcep+V4_Vbulk_sourcep)));
    7288                 :            : #endif
    7289                 :          0 : Tcen=(ldeb-(0.5*(V3+V4)));
    7290                 :            : #if defined(_DERIVATE)
    7291                 :          0 : T1_Vgate_sourcep=(0.5*((V3_Vgate_sourcep*V4-V3*V4_Vgate_sourcep)/V4/V4));
    7292                 :          0 : T1_Vdrainp_sourcep=(0.5*((V3_Vdrainp_sourcep*V4-V3*V4_Vdrainp_sourcep)/V4/V4));
    7293                 :          0 : T1_Vbulk_sourcep=(0.5*((V3_Vbulk_sourcep*V4-V3*V4_Vbulk_sourcep)/V4/V4));
    7294                 :            : #endif
    7295                 :          0 : T1=(0.5*(1.0+(V3/V4)));
    7296                 :            : #if defined(_DERIVATE)
    7297                 :          0 : Ccen_Vgate_sourcep=(-1.03594e-10*Tcen_Vgate_sourcep/Tcen/Tcen);
    7298                 :          0 : Ccen_Vdrainp_sourcep=(-1.03594e-10*Tcen_Vdrainp_sourcep/Tcen/Tcen);
    7299                 :          0 : Ccen_Vbulk_sourcep=(-1.03594e-10*Tcen_Vbulk_sourcep/Tcen/Tcen);
    7300                 :            : #endif
    7301                 :          0 : Ccen=(1.03594e-10/Tcen);
    7302                 :            : #if defined(_DERIVATE)
    7303                 :          0 : T2_Vgate_sourcep=(-Cox*Ccen_Vgate_sourcep/(Cox+Ccen)/(Cox+Ccen));
    7304                 :          0 : T2_Vdrainp_sourcep=(-Cox*Ccen_Vdrainp_sourcep/(Cox+Ccen)/(Cox+Ccen));
    7305                 :          0 : T2_Vbulk_sourcep=(-Cox*Ccen_Vbulk_sourcep/(Cox+Ccen)/(Cox+Ccen));
    7306                 :            : #endif
    7307                 :          0 : T2=(Cox/(Cox+Ccen));
    7308                 :            : #if defined(_DERIVATE)
    7309                 :          0 : Coxeff_Vgate_sourcep=((T2_Vgate_sourcep*Ccen)+(T2*Ccen_Vgate_sourcep));
    7310                 :          0 : Coxeff_Vdrainp_sourcep=((T2_Vdrainp_sourcep*Ccen)+(T2*Ccen_Vdrainp_sourcep));
    7311                 :          0 : Coxeff_Vbulk_sourcep=((T2_Vbulk_sourcep*Ccen)+(T2*Ccen_Vbulk_sourcep));
    7312                 :            : #endif
    7313                 :          0 : Coxeff=(T2*Ccen);
    7314                 :            : #if defined(_DERIVATE)
    7315                 :          0 : T3_Vgate_sourcep=(((-Ccen_Vgate_sourcep)*Tcen-(-Ccen)*Tcen_Vgate_sourcep)/Tcen/Tcen);
    7316                 :          0 : T3_Vdrainp_sourcep=(((-Ccen_Vdrainp_sourcep)*Tcen-(-Ccen)*Tcen_Vdrainp_sourcep)/Tcen/Tcen);
    7317                 :          0 : T3_Vbulk_sourcep=(((-Ccen_Vbulk_sourcep)*Tcen-(-Ccen)*Tcen_Vbulk_sourcep)/Tcen/Tcen);
    7318                 :            : #endif
    7319                 :          0 : T3=((-Ccen)/Tcen);
    7320                 :            : #if defined(_DERIVATE)
    7321                 :          0 : CoxWLcen_Vgate_sourcep=((CoxWL*Coxeff_Vgate_sourcep)/Cox);
    7322                 :          0 : CoxWLcen_Vdrainp_sourcep=((CoxWL*Coxeff_Vdrainp_sourcep)/Cox);
    7323                 :          0 : CoxWLcen_Vbulk_sourcep=((CoxWL*Coxeff_Vbulk_sourcep)/Cox);
    7324                 :            : #endif
    7325                 :          0 : CoxWLcen=((CoxWL*Coxeff)/Cox);
    7326                 :            : #if defined(_DYNAMIC)
    7327                 :            : #if defined(_DERIVATE)
    7328                 :          0 : Qac0_Vdrainp_sourcep=((CoxWLcen_Vdrainp_sourcep*(Vfbeff-vfbzb))+(CoxWLcen*Vfbeff_Vdrainp_sourcep));
    7329                 :          0 : Qac0_Vbulk_sourcep=((CoxWLcen_Vbulk_sourcep*(Vfbeff-vfbzb))+(CoxWLcen*Vfbeff_Vbulk_sourcep));
    7330                 :          0 : Qac0_Vgate_sourcep=((CoxWLcen_Vgate_sourcep*(Vfbeff-vfbzb))+(CoxWLcen*Vfbeff_Vgate_sourcep));
    7331                 :            : #endif
    7332                 :          0 : Qac0=(CoxWLcen*(Vfbeff-vfbzb));
    7333                 :            : #endif
    7334                 :            : #if defined(_DERIVATE)
    7335                 :          0 : T_0_Vgate_sourcep=0.0;
    7336                 :          0 : T_0_Vdrainp_sourcep=0.0;
    7337                 :          0 : T_0_Vbulk_sourcep=0.0;
    7338                 :            : #endif
    7339                 :          0 : T_0=(0.5*k1ox);
    7340                 :            : #if defined(_DERIVATE)
    7341                 :          0 : T3_Vgate_sourcep=((Vgs_eff_Vgate_sourcep-Vfbeff_Vgate_sourcep)-Vgsteff_Vgate_sourcep);
    7342                 :          0 : T3_Vdrainp_sourcep=(((Vgs_eff_Vdrainp_sourcep-Vfbeff_Vdrainp_sourcep)-VbseffCV_Vdrainp_sourcep)-Vgsteff_Vdrainp_sourcep);
    7343                 :          0 : T3_Vbulk_sourcep=(((Vgs_eff_Vbulk_sourcep-Vfbeff_Vbulk_sourcep)-VbseffCV_Vbulk_sourcep)-Vgsteff_Vbulk_sourcep);
    7344                 :            : #endif
    7345                 :          0 : T3=(((Vgs_eff-Vfbeff)-VbseffCV)-Vgsteff);
    7346         [ #  # ]:          0 : if
    7347                 :            : (k1ox==0.0)
    7348                 :            : {
    7349                 :            : #if defined(_DERIVATE)
    7350                 :          0 : T1_Vgate_sourcep=0.0;
    7351                 :          0 : T1_Vdrainp_sourcep=0.0;
    7352                 :          0 : T1_Vbulk_sourcep=0.0;
    7353                 :            : #endif
    7354                 :          0 : T1=0.0;
    7355                 :            : #if defined(_DERIVATE)
    7356                 :          0 : T2_Vgate_sourcep=0.0;
    7357                 :          0 : T2_Vdrainp_sourcep=0.0;
    7358                 :          0 : T2_Vbulk_sourcep=0.0;
    7359                 :            : #endif
    7360                 :          0 : T2=0.0;
    7361                 :            : }
    7362                 :            : else
    7363                 :            : {
    7364         [ #  # ]:          0 : if
    7365                 :            : (T3<0.0)
    7366                 :            : {
    7367                 :            : #if defined(_DERIVATE)
    7368                 :          0 : T1_Vgate_sourcep=(T_0_Vgate_sourcep+(T3_Vgate_sourcep/k1ox));
    7369                 :          0 : T1_Vdrainp_sourcep=(T_0_Vdrainp_sourcep+(T3_Vdrainp_sourcep/k1ox));
    7370                 :          0 : T1_Vbulk_sourcep=(T_0_Vbulk_sourcep+(T3_Vbulk_sourcep/k1ox));
    7371                 :            : #endif
    7372                 :          0 : T1=(T_0+(T3/k1ox));
    7373                 :            : #if defined(_DERIVATE)
    7374                 :          0 : T2_Vgate_sourcep=CoxWLcen_Vgate_sourcep;
    7375                 :          0 : T2_Vdrainp_sourcep=CoxWLcen_Vdrainp_sourcep;
    7376                 :          0 : T2_Vbulk_sourcep=CoxWLcen_Vbulk_sourcep;
    7377                 :            : #endif
    7378                 :          0 : T2=CoxWLcen;
    7379                 :            : }
    7380                 :            : else
    7381                 :            : {
    7382                 :            : {
    7383                 :          0 : double m00_sqrt(d00_sqrt0,((T_0*T_0)+T3))
    7384                 :            : #if defined(_DERIVATE)
    7385                 :          0 : double m10_sqrt(d10_sqrt0,d00_sqrt0,((T_0*T_0)+T3))
    7386                 :            : #endif
    7387                 :            : #if defined(_DERIVATE)
    7388                 :          0 : T1_Vgate_sourcep=(((T_0_Vgate_sourcep*T_0)+(T_0*T_0_Vgate_sourcep))+T3_Vgate_sourcep)*d10_sqrt0;
    7389                 :          0 : T1_Vdrainp_sourcep=(((T_0_Vdrainp_sourcep*T_0)+(T_0*T_0_Vdrainp_sourcep))+T3_Vdrainp_sourcep)*d10_sqrt0;
    7390                 :          0 : T1_Vbulk_sourcep=(((T_0_Vbulk_sourcep*T_0)+(T_0*T_0_Vbulk_sourcep))+T3_Vbulk_sourcep)*d10_sqrt0;
    7391                 :            : #endif
    7392                 :          0 : T1=d00_sqrt0;
    7393                 :            : }
    7394                 :            : #if defined(_DERIVATE)
    7395                 :          0 : T2_Vgate_sourcep=((((CoxWLcen_Vgate_sourcep*T_0)+(CoxWLcen*T_0_Vgate_sourcep))*T1-(CoxWLcen*T_0)*T1_Vgate_sourcep)/T1/T1);
    7396                 :          0 : T2_Vdrainp_sourcep=((((CoxWLcen_Vdrainp_sourcep*T_0)+(CoxWLcen*T_0_Vdrainp_sourcep))*T1-(CoxWLcen*T_0)*T1_Vdrainp_sourcep)/T1/T1);
    7397                 :          0 : T2_Vbulk_sourcep=((((CoxWLcen_Vbulk_sourcep*T_0)+(CoxWLcen*T_0_Vbulk_sourcep))*T1-(CoxWLcen*T_0)*T1_Vbulk_sourcep)/T1/T1);
    7398                 :            : #endif
    7399                 :          0 : T2=((CoxWLcen*T_0)/T1);
    7400                 :            : }
    7401                 :            : }
    7402                 :            : #if defined(_DYNAMIC)
    7403                 :            : #if defined(_DERIVATE)
    7404                 :          0 : Qsub0_Vgate_sourcep=((CoxWLcen_Vgate_sourcep*k1ox*(T1-T_0))+((CoxWLcen*k1ox)*(T1_Vgate_sourcep-T_0_Vgate_sourcep)));
    7405                 :          0 : Qsub0_Vdrainp_sourcep=((CoxWLcen_Vdrainp_sourcep*k1ox*(T1-T_0))+((CoxWLcen*k1ox)*(T1_Vdrainp_sourcep-T_0_Vdrainp_sourcep)));
    7406                 :          0 : Qsub0_Vbulk_sourcep=((CoxWLcen_Vbulk_sourcep*k1ox*(T1-T_0))+((CoxWLcen*k1ox)*(T1_Vbulk_sourcep-T_0_Vbulk_sourcep)));
    7407                 :            : #endif
    7408                 :          0 : Qsub0=((CoxWLcen*k1ox)*(T1-T_0));
    7409                 :            : #endif
    7410         [ #  # ]:          0 : if
    7411                 :            : (k1ox<=0.0)
    7412                 :            : {
    7413                 :            : #if defined(_DERIVATE)
    7414                 :          0 : Denomi_Vgate_sourcep=0.0;
    7415                 :          0 : Denomi_Vdrainp_sourcep=0.0;
    7416                 :          0 : Denomi_Vbulk_sourcep=0.0;
    7417                 :            : #endif
    7418                 :          0 : Denomi=((0.25*moin)*Vtm);
    7419                 :            : #if defined(_DERIVATE)
    7420                 :          0 : T_0_Vgate_sourcep=0.0;
    7421                 :          0 : T_0_Vdrainp_sourcep=0.0;
    7422                 :          0 : T_0_Vbulk_sourcep=0.0;
    7423                 :            : #endif
    7424                 :          0 : T_0=(0.5*sqrtPhi);
    7425                 :            : }
    7426                 :            : else
    7427                 :            : {
    7428                 :            : #if defined(_DERIVATE)
    7429                 :          0 : Denomi_Vgate_sourcep=0.0;
    7430                 :          0 : Denomi_Vdrainp_sourcep=0.0;
    7431                 :          0 : Denomi_Vbulk_sourcep=0.0;
    7432                 :            : #endif
    7433                 :          0 : Denomi=(((moin*Vtm)*k1ox)*k1ox);
    7434                 :            : #if defined(_DERIVATE)
    7435                 :          0 : T_0_Vgate_sourcep=0.0;
    7436                 :          0 : T_0_Vdrainp_sourcep=0.0;
    7437                 :          0 : T_0_Vbulk_sourcep=0.0;
    7438                 :            : #endif
    7439                 :          0 : T_0=(k1ox*sqrtPhi);
    7440                 :            : }
    7441                 :            : #if defined(_DERIVATE)
    7442                 :          0 : T1_Vgate_sourcep=((2.0*T_0_Vgate_sourcep)+Vgsteff_Vgate_sourcep);
    7443                 :          0 : T1_Vdrainp_sourcep=((2.0*T_0_Vdrainp_sourcep)+Vgsteff_Vdrainp_sourcep);
    7444                 :          0 : T1_Vbulk_sourcep=((2.0*T_0_Vbulk_sourcep)+Vgsteff_Vbulk_sourcep);
    7445                 :            : #endif
    7446                 :          0 : T1=((2.0*T_0)+Vgsteff);
    7447                 :            : {
    7448                 :          0 : double m00_logE(d00_logE0,(1.0+((T1*Vgsteff)/Denomi)))
    7449                 :            : #if defined(_DERIVATE)
    7450                 :          0 : double m10_logE(d10_logE0,d00_logE0,(1.0+((T1*Vgsteff)/Denomi)))
    7451                 :            : #endif
    7452                 :            : #if defined(_DERIVATE)
    7453                 :          0 : DeltaPhi_Vgate_sourcep=(Vtm*((((T1_Vgate_sourcep*Vgsteff)+(T1*Vgsteff_Vgate_sourcep))*Denomi-(T1*Vgsteff)*Denomi_Vgate_sourcep)/Denomi/Denomi)*d10_logE0);
    7454                 :          0 : DeltaPhi_Vdrainp_sourcep=(Vtm*((((T1_Vdrainp_sourcep*Vgsteff)+(T1*Vgsteff_Vdrainp_sourcep))*Denomi-(T1*Vgsteff)*Denomi_Vdrainp_sourcep)/Denomi/Denomi)*d10_logE0);
    7455                 :          0 : DeltaPhi_Vbulk_sourcep=(Vtm*((((T1_Vbulk_sourcep*Vgsteff)+(T1*Vgsteff_Vbulk_sourcep))*Denomi-(T1*Vgsteff)*Denomi_Vbulk_sourcep)/Denomi/Denomi)*d10_logE0);
    7456                 :            : #endif
    7457                 :          0 : DeltaPhi=(Vtm*d00_logE0);
    7458                 :            : }
    7459                 :            : #if defined(_DERIVATE)
    7460                 :          0 : T3_Vgate_sourcep=0.0;
    7461                 :          0 : T3_Vdrainp_sourcep=(4.0*Vth_Vdrainp_sourcep);
    7462                 :          0 : T3_Vbulk_sourcep=(4.0*Vth_Vbulk_sourcep);
    7463                 :            : #endif
    7464                 :          0 : T3=(4.0*((Vth-vfbzb)-phi));
    7465                 :          0 : Tox2=(Tox+Tox);
    7466         [ #  # ]:          0 : if
    7467                 :            : (T3>=0.0)
    7468                 :            : {
    7469                 :            : #if defined(_DERIVATE)
    7470                 :          0 : T_0_Vgate_sourcep=((Vgsteff_Vgate_sourcep+T3_Vgate_sourcep)/Tox2);
    7471                 :          0 : T_0_Vdrainp_sourcep=((Vgsteff_Vdrainp_sourcep+T3_Vdrainp_sourcep)/Tox2);
    7472                 :          0 : T_0_Vbulk_sourcep=((Vgsteff_Vbulk_sourcep+T3_Vbulk_sourcep)/Tox2);
    7473                 :            : #endif
    7474                 :          0 : T_0=((Vgsteff+T3)/Tox2);
    7475                 :            : }
    7476                 :            : else
    7477                 :            : {
    7478                 :            : #if defined(_DERIVATE)
    7479                 :          0 : T_0_Vgate_sourcep=(Vgsteff_Vgate_sourcep/Tox2);
    7480                 :          0 : T_0_Vdrainp_sourcep=(Vgsteff_Vdrainp_sourcep/Tox2);
    7481                 :          0 : T_0_Vbulk_sourcep=(Vgsteff_Vbulk_sourcep/Tox2);
    7482                 :            : #endif
    7483                 :          0 : T_0=((Vgsteff+1.0e-20)/Tox2);
    7484                 :            : }
    7485                 :            : {
    7486                 :          0 : double m00_logE(d00_logE0,T_0)
    7487                 :          0 : double m00_exp(d00_exp1,(0.7*d00_logE0))
    7488                 :            : #if defined(_DERIVATE)
    7489                 :          0 : double m10_logE(d10_logE0,d00_logE0,T_0)
    7490                 :            : #define d10_exp1 d00_exp1
    7491                 :            : #endif
    7492                 :            : #if defined(_DERIVATE)
    7493                 :          0 : tmp_Vgate_sourcep=(0.7*T_0_Vgate_sourcep*d10_logE0)*d10_exp1;
    7494                 :          0 : tmp_Vdrainp_sourcep=(0.7*T_0_Vdrainp_sourcep*d10_logE0)*d10_exp1;
    7495                 :          0 : tmp_Vbulk_sourcep=(0.7*T_0_Vbulk_sourcep*d10_logE0)*d10_exp1;
    7496                 :            : #endif
    7497                 :          0 : tmp=d00_exp1;
    7498                 :            : }
    7499                 :            : #if defined(_DERIVATE)
    7500                 :          0 : T1_Vgate_sourcep=tmp_Vgate_sourcep;
    7501                 :          0 : T1_Vdrainp_sourcep=tmp_Vdrainp_sourcep;
    7502                 :          0 : T1_Vbulk_sourcep=tmp_Vbulk_sourcep;
    7503                 :            : #endif
    7504                 :          0 : T1=(1.0+tmp);
    7505                 :            : #if defined(_DERIVATE)
    7506                 :          0 : T2_Vgate_sourcep=(((0.7*tmp_Vgate_sourcep)*(T_0*Tox2)-(0.7*tmp)*T_0_Vgate_sourcep*Tox2)/(T_0*Tox2)/(T_0*Tox2));
    7507                 :          0 : T2_Vdrainp_sourcep=(((0.7*tmp_Vdrainp_sourcep)*(T_0*Tox2)-(0.7*tmp)*T_0_Vdrainp_sourcep*Tox2)/(T_0*Tox2)/(T_0*Tox2));
    7508                 :          0 : T2_Vbulk_sourcep=(((0.7*tmp_Vbulk_sourcep)*(T_0*Tox2)-(0.7*tmp)*T_0_Vbulk_sourcep*Tox2)/(T_0*Tox2)/(T_0*Tox2));
    7509                 :            : #endif
    7510                 :          0 : T2=((0.7*tmp)/(T_0*Tox2));
    7511                 :            : #if defined(_DERIVATE)
    7512                 :          0 : Tcen_Vgate_sourcep=(-1.9e-9*T1_Vgate_sourcep/T1/T1);
    7513                 :          0 : Tcen_Vdrainp_sourcep=(-1.9e-9*T1_Vdrainp_sourcep/T1/T1);
    7514                 :          0 : Tcen_Vbulk_sourcep=(-1.9e-9*T1_Vbulk_sourcep/T1/T1);
    7515                 :            : #endif
    7516                 :          0 : Tcen=(1.9e-9/T1);
    7517                 :            : #if defined(_DERIVATE)
    7518                 :          0 : Ccen_Vgate_sourcep=(-1.03594e-10*Tcen_Vgate_sourcep/Tcen/Tcen);
    7519                 :          0 : Ccen_Vdrainp_sourcep=(-1.03594e-10*Tcen_Vdrainp_sourcep/Tcen/Tcen);
    7520                 :          0 : Ccen_Vbulk_sourcep=(-1.03594e-10*Tcen_Vbulk_sourcep/Tcen/Tcen);
    7521                 :            : #endif
    7522                 :          0 : Ccen=(1.03594e-10/Tcen);
    7523                 :            : #if defined(_DERIVATE)
    7524                 :          0 : T_0_Vgate_sourcep=(-Cox*Ccen_Vgate_sourcep/(Cox+Ccen)/(Cox+Ccen));
    7525                 :          0 : T_0_Vdrainp_sourcep=(-Cox*Ccen_Vdrainp_sourcep/(Cox+Ccen)/(Cox+Ccen));
    7526                 :          0 : T_0_Vbulk_sourcep=(-Cox*Ccen_Vbulk_sourcep/(Cox+Ccen)/(Cox+Ccen));
    7527                 :            : #endif
    7528                 :          0 : T_0=(Cox/(Cox+Ccen));
    7529                 :            : #if defined(_DERIVATE)
    7530                 :          0 : Coxeff_Vgate_sourcep=((T_0_Vgate_sourcep*Ccen)+(T_0*Ccen_Vgate_sourcep));
    7531                 :          0 : Coxeff_Vdrainp_sourcep=((T_0_Vdrainp_sourcep*Ccen)+(T_0*Ccen_Vdrainp_sourcep));
    7532                 :          0 : Coxeff_Vbulk_sourcep=((T_0_Vbulk_sourcep*Ccen)+(T_0*Ccen_Vbulk_sourcep));
    7533                 :            : #endif
    7534                 :          0 : Coxeff=(T_0*Ccen);
    7535                 :            : #if defined(_DERIVATE)
    7536                 :          0 : T1_Vgate_sourcep=(((-Ccen_Vgate_sourcep)*Tcen-(-Ccen)*Tcen_Vgate_sourcep)/Tcen/Tcen);
    7537                 :          0 : T1_Vdrainp_sourcep=(((-Ccen_Vdrainp_sourcep)*Tcen-(-Ccen)*Tcen_Vdrainp_sourcep)/Tcen/Tcen);
    7538                 :          0 : T1_Vbulk_sourcep=(((-Ccen_Vbulk_sourcep)*Tcen-(-Ccen)*Tcen_Vbulk_sourcep)/Tcen/Tcen);
    7539                 :            : #endif
    7540                 :          0 : T1=((-Ccen)/Tcen);
    7541                 :            : #if defined(_DERIVATE)
    7542                 :          0 : CoxWLcen_Vgate_sourcep=((CoxWL*Coxeff_Vgate_sourcep)/Cox);
    7543                 :          0 : CoxWLcen_Vdrainp_sourcep=((CoxWL*Coxeff_Vdrainp_sourcep)/Cox);
    7544                 :          0 : CoxWLcen_Vbulk_sourcep=((CoxWL*Coxeff_Vbulk_sourcep)/Cox);
    7545                 :            : #endif
    7546                 :          0 : CoxWLcen=((CoxWL*Coxeff)/Cox);
    7547                 :            : #if defined(_DERIVATE)
    7548                 :          0 : AbulkCV_Vgate_sourcep=Abulk0_Vgate_sourcep*abulkCVfactor;
    7549                 :          0 : AbulkCV_Vdrainp_sourcep=Abulk0_Vdrainp_sourcep*abulkCVfactor;
    7550                 :          0 : AbulkCV_Vbulk_sourcep=Abulk0_Vbulk_sourcep*abulkCVfactor;
    7551                 :            : #endif
    7552                 :          0 : AbulkCV=(Abulk0*abulkCVfactor);
    7553                 :            : #if defined(_DERIVATE)
    7554                 :          0 : VdsatCV_Vdrainp_sourcep=(((Vgsteff_Vdrainp_sourcep-DeltaPhi_Vdrainp_sourcep)*AbulkCV-(Vgsteff-DeltaPhi)*AbulkCV_Vdrainp_sourcep)/AbulkCV/AbulkCV);
    7555                 :          0 : VdsatCV_Vgate_sourcep=(((Vgsteff_Vgate_sourcep-DeltaPhi_Vgate_sourcep)*AbulkCV-(Vgsteff-DeltaPhi)*AbulkCV_Vgate_sourcep)/AbulkCV/AbulkCV);
    7556                 :          0 : VdsatCV_Vbulk_sourcep=(((Vgsteff_Vbulk_sourcep-DeltaPhi_Vbulk_sourcep)*AbulkCV-(Vgsteff-DeltaPhi)*AbulkCV_Vbulk_sourcep)/AbulkCV/AbulkCV);
    7557                 :            : #endif
    7558                 :          0 : VdsatCV=((Vgsteff-DeltaPhi)/AbulkCV);
    7559                 :            : #if defined(_DERIVATE)
    7560                 :          0 : V4_Vdrainp_sourcep=(VdsatCV_Vdrainp_sourcep-Vds_Vdrainp_sourcep);
    7561                 :          0 : V4_Vgate_sourcep=VdsatCV_Vgate_sourcep;
    7562                 :          0 : V4_Vbulk_sourcep=VdsatCV_Vbulk_sourcep;
    7563                 :            : #endif
    7564                 :          0 : V4=((VdsatCV-Vds)-0.02);
    7565                 :            : {
    7566                 :          0 : double m00_sqrt(d00_sqrt0,((V4*V4)+((4.0*0.02)*VdsatCV)))
    7567                 :            : #if defined(_DERIVATE)
    7568                 :          0 : double m10_sqrt(d10_sqrt0,d00_sqrt0,((V4*V4)+((4.0*0.02)*VdsatCV)))
    7569                 :            : #endif
    7570                 :            : #if defined(_DERIVATE)
    7571                 :          0 : T_0_Vgate_sourcep=(((V4_Vgate_sourcep*V4)+(V4*V4_Vgate_sourcep))+((4.0*0.02)*VdsatCV_Vgate_sourcep))*d10_sqrt0;
    7572                 :          0 : T_0_Vdrainp_sourcep=(((V4_Vdrainp_sourcep*V4)+(V4*V4_Vdrainp_sourcep))+((4.0*0.02)*VdsatCV_Vdrainp_sourcep))*d10_sqrt0;
    7573                 :          0 : T_0_Vbulk_sourcep=(((V4_Vbulk_sourcep*V4)+(V4*V4_Vbulk_sourcep))+((4.0*0.02)*VdsatCV_Vbulk_sourcep))*d10_sqrt0;
    7574                 :            : #endif
    7575                 :          0 : T_0=d00_sqrt0;
    7576                 :            : }
    7577                 :            : #if defined(_DERIVATE)
    7578                 :          0 : VdseffCV_Vdrainp_sourcep=(VdsatCV_Vdrainp_sourcep-(0.5*(V4_Vdrainp_sourcep+T_0_Vdrainp_sourcep)));
    7579                 :          0 : VdseffCV_Vgate_sourcep=(VdsatCV_Vgate_sourcep-(0.5*(V4_Vgate_sourcep+T_0_Vgate_sourcep)));
    7580                 :          0 : VdseffCV_Vbulk_sourcep=(VdsatCV_Vbulk_sourcep-(0.5*(V4_Vbulk_sourcep+T_0_Vbulk_sourcep)));
    7581                 :            : #endif
    7582                 :          0 : VdseffCV=(VdsatCV-(0.5*(V4+T_0)));
    7583                 :            : #if defined(_DERIVATE)
    7584                 :          0 : T1_Vgate_sourcep=(0.5*((V4_Vgate_sourcep*T_0-V4*T_0_Vgate_sourcep)/T_0/T_0));
    7585                 :          0 : T1_Vdrainp_sourcep=(0.5*((V4_Vdrainp_sourcep*T_0-V4*T_0_Vdrainp_sourcep)/T_0/T_0));
    7586                 :          0 : T1_Vbulk_sourcep=(0.5*((V4_Vbulk_sourcep*T_0-V4*T_0_Vbulk_sourcep)/T_0/T_0));
    7587                 :            : #endif
    7588                 :          0 : T1=(0.5*(1.0+(V4/T_0)));
    7589                 :            : #if defined(_DERIVATE)
    7590                 :          0 : T2_Vgate_sourcep=(-0.02*T_0_Vgate_sourcep/T_0/T_0);
    7591                 :          0 : T2_Vdrainp_sourcep=(-0.02*T_0_Vdrainp_sourcep/T_0/T_0);
    7592                 :          0 : T2_Vbulk_sourcep=(-0.02*T_0_Vbulk_sourcep/T_0/T_0);
    7593                 :            : #endif
    7594                 :          0 : T2=(0.02/T_0);
    7595                 :            : #if defined(_DERIVATE)
    7596                 :          0 : T3_Vgate_sourcep=((((-T1_Vgate_sourcep)-T2_Vgate_sourcep)*AbulkCV-((1.0-T1)-T2)*AbulkCV_Vgate_sourcep)/AbulkCV/AbulkCV);
    7597                 :          0 : T3_Vdrainp_sourcep=((((-T1_Vdrainp_sourcep)-T2_Vdrainp_sourcep)*AbulkCV-((1.0-T1)-T2)*AbulkCV_Vdrainp_sourcep)/AbulkCV/AbulkCV);
    7598                 :          0 : T3_Vbulk_sourcep=((((-T1_Vbulk_sourcep)-T2_Vbulk_sourcep)*AbulkCV-((1.0-T1)-T2)*AbulkCV_Vbulk_sourcep)/AbulkCV/AbulkCV);
    7599                 :            : #endif
    7600                 :          0 : T3=(((1.0-T1)-T2)/AbulkCV);
    7601 [ #  # ][ #  # ]:          0 : if
    7602                 :            : ((Vds==0.0)&&(VERSION==3.24))
    7603                 :            : {
    7604                 :            : #if defined(_DERIVATE)
    7605                 :          0 : VdseffCV_Vdrainp_sourcep=0.0;
    7606                 :          0 : VdseffCV_Vgate_sourcep=0.0;
    7607                 :          0 : VdseffCV_Vbulk_sourcep=0.0;
    7608                 :            : #endif
    7609                 :          0 : VdseffCV=0.0;
    7610                 :            : }
    7611                 :            : #if defined(_DERIVATE)
    7612                 :          0 : T_0_Vgate_sourcep=((AbulkCV_Vgate_sourcep*VdseffCV)+(AbulkCV*VdseffCV_Vgate_sourcep));
    7613                 :          0 : T_0_Vdrainp_sourcep=((AbulkCV_Vdrainp_sourcep*VdseffCV)+(AbulkCV*VdseffCV_Vdrainp_sourcep));
    7614                 :          0 : T_0_Vbulk_sourcep=((AbulkCV_Vbulk_sourcep*VdseffCV)+(AbulkCV*VdseffCV_Vbulk_sourcep));
    7615                 :            : #endif
    7616                 :          0 : T_0=(AbulkCV*VdseffCV);
    7617                 :            : #if defined(_DERIVATE)
    7618                 :          0 : T1_Vgate_sourcep=(Vgsteff_Vgate_sourcep-DeltaPhi_Vgate_sourcep);
    7619                 :          0 : T1_Vdrainp_sourcep=(Vgsteff_Vdrainp_sourcep-DeltaPhi_Vdrainp_sourcep);
    7620                 :          0 : T1_Vbulk_sourcep=(Vgsteff_Vbulk_sourcep-DeltaPhi_Vbulk_sourcep);
    7621                 :            : #endif
    7622                 :          0 : T1=(Vgsteff-DeltaPhi);
    7623                 :            : #if defined(_DERIVATE)
    7624                 :          0 : T2_Vgate_sourcep=(12.0*(T1_Vgate_sourcep-(0.5*T_0_Vgate_sourcep)));
    7625                 :          0 : T2_Vdrainp_sourcep=(12.0*(T1_Vdrainp_sourcep-(0.5*T_0_Vdrainp_sourcep)));
    7626                 :          0 : T2_Vbulk_sourcep=(12.0*(T1_Vbulk_sourcep-(0.5*T_0_Vbulk_sourcep)));
    7627                 :            : #endif
    7628                 :          0 : T2=(12.0*((T1-(0.5*T_0))+1.0e-20));
    7629                 :            : #if defined(_DERIVATE)
    7630                 :          0 : T3_Vgate_sourcep=((T_0_Vgate_sourcep*T2-T_0*T2_Vgate_sourcep)/T2/T2);
    7631                 :          0 : T3_Vdrainp_sourcep=((T_0_Vdrainp_sourcep*T2-T_0*T2_Vdrainp_sourcep)/T2/T2);
    7632                 :          0 : T3_Vbulk_sourcep=((T_0_Vbulk_sourcep*T2-T_0*T2_Vbulk_sourcep)/T2/T2);
    7633                 :            : #endif
    7634                 :          0 : T3=(T_0/T2);
    7635                 :            : #if defined(_DYNAMIC)
    7636                 :            : #if defined(_DERIVATE)
    7637                 :          0 : T4_Vgate_sourcep=(-(((12.0*T3_Vgate_sourcep)*T3)+((12.0*T3)*T3_Vgate_sourcep)));
    7638                 :          0 : T4_Vdrainp_sourcep=(-(((12.0*T3_Vdrainp_sourcep)*T3)+((12.0*T3)*T3_Vdrainp_sourcep)));
    7639                 :          0 : T4_Vbulk_sourcep=(-(((12.0*T3_Vbulk_sourcep)*T3)+((12.0*T3)*T3_Vbulk_sourcep)));
    7640                 :            : #endif
    7641                 :          0 : T4=(1.0-((12.0*T3)*T3));
    7642                 :            : #endif
    7643                 :            : #if defined(_DYNAMIC)
    7644                 :            : #if defined(_DERIVATE)
    7645                 :          0 : T5_Vgate_sourcep=((AbulkCV_Vgate_sourcep*((((6.0*T_0)*((4.0*T1)-T_0))/(T2*T2))-0.5))+(AbulkCV*(((((6.0*T_0_Vgate_sourcep)*((4.0*T1)-T_0))+((6.0*T_0)*((4.0*T1_Vgate_sourcep)-T_0_Vgate_sourcep)))*(T2*T2)-((6.0*T_0)*((4.0*T1)-T_0))*((T2_Vgate_sourcep*T2)+(T2*T2_Vgate_sourcep)))/(T2*T2)/(T2*T2))));
    7646                 :          0 : T5_Vdrainp_sourcep=((AbulkCV_Vdrainp_sourcep*((((6.0*T_0)*((4.0*T1)-T_0))/(T2*T2))-0.5))+(AbulkCV*(((((6.0*T_0_Vdrainp_sourcep)*((4.0*T1)-T_0))+((6.0*T_0)*((4.0*T1_Vdrainp_sourcep)-T_0_Vdrainp_sourcep)))*(T2*T2)-((6.0*T_0)*((4.0*T1)-T_0))*((T2_Vdrainp_sourcep*T2)+(T2*T2_Vdrainp_sourcep)))/(T2*T2)/(T2*T2))));
    7647                 :          0 : T5_Vbulk_sourcep=((AbulkCV_Vbulk_sourcep*((((6.0*T_0)*((4.0*T1)-T_0))/(T2*T2))-0.5))+(AbulkCV*(((((6.0*T_0_Vbulk_sourcep)*((4.0*T1)-T_0))+((6.0*T_0)*((4.0*T1_Vbulk_sourcep)-T_0_Vbulk_sourcep)))*(T2*T2)-((6.0*T_0)*((4.0*T1)-T_0))*((T2_Vbulk_sourcep*T2)+(T2*T2_Vbulk_sourcep)))/(T2*T2)/(T2*T2))));
    7648                 :            : #endif
    7649                 :          0 : T5=(AbulkCV*((((6.0*T_0)*((4.0*T1)-T_0))/(T2*T2))-0.5));
    7650                 :            : #endif
    7651                 :            : #if defined(_DYNAMIC)
    7652                 :            : #if defined(_DERIVATE)
    7653                 :          0 : T6_Vgate_sourcep=((((T5_Vgate_sourcep*VdseffCV)+(T5*VdseffCV_Vgate_sourcep))*AbulkCV-(T5*VdseffCV)*AbulkCV_Vgate_sourcep)/AbulkCV/AbulkCV);
    7654                 :          0 : T6_Vdrainp_sourcep=((((T5_Vdrainp_sourcep*VdseffCV)+(T5*VdseffCV_Vdrainp_sourcep))*AbulkCV-(T5*VdseffCV)*AbulkCV_Vdrainp_sourcep)/AbulkCV/AbulkCV);
    7655                 :          0 : T6_Vbulk_sourcep=((((T5_Vbulk_sourcep*VdseffCV)+(T5*VdseffCV_Vbulk_sourcep))*AbulkCV-(T5*VdseffCV)*AbulkCV_Vbulk_sourcep)/AbulkCV/AbulkCV);
    7656                 :            : #endif
    7657                 :          0 : T6=((T5*VdseffCV)/AbulkCV);
    7658                 :            : #endif
    7659                 :            : #if defined(_DERIVATE)
    7660                 :          0 : qinoi_Vdrainp_sourcep=((CoxWLcen_Vdrainp_sourcep*(T1-(T_0*(0.5-T3))))+(CoxWLcen*(T1_Vdrainp_sourcep-((T_0_Vdrainp_sourcep*(0.5-T3))+(T_0*(-T3_Vdrainp_sourcep))))));
    7661                 :          0 : qinoi_Vgate_sourcep=((CoxWLcen_Vgate_sourcep*(T1-(T_0*(0.5-T3))))+(CoxWLcen*(T1_Vgate_sourcep-((T_0_Vgate_sourcep*(0.5-T3))+(T_0*(-T3_Vgate_sourcep))))));
    7662                 :          0 : qinoi_Vbulk_sourcep=((CoxWLcen_Vbulk_sourcep*(T1-(T_0*(0.5-T3))))+(CoxWLcen*(T1_Vbulk_sourcep-((T_0_Vbulk_sourcep*(0.5-T3))+(T_0*(-T3_Vbulk_sourcep))))));
    7663                 :            : #endif
    7664                 :          0 : qinoi=(CoxWLcen*(T1-(T_0*(0.5-T3))));
    7665                 :            : #if defined(_DYNAMIC)
    7666                 :            : #if defined(_DERIVATE)
    7667                 :          0 : qgate_Vdrainp_sourcep=qinoi_Vdrainp_sourcep;
    7668                 :          0 : qgate_Vgate_sourcep=qinoi_Vgate_sourcep;
    7669                 :          0 : qgate_Vbulk_sourcep=qinoi_Vbulk_sourcep;
    7670                 :            : #endif
    7671                 :          0 : qgate=qinoi;
    7672                 :            : #endif
    7673                 :            : #if defined(_DYNAMIC)
    7674                 :            : #if defined(_DERIVATE)
    7675                 :          0 : T7_Vgate_sourcep=(-AbulkCV_Vgate_sourcep);
    7676                 :          0 : T7_Vdrainp_sourcep=(-AbulkCV_Vdrainp_sourcep);
    7677                 :          0 : T7_Vbulk_sourcep=(-AbulkCV_Vbulk_sourcep);
    7678                 :            : #endif
    7679                 :          0 : T7=(1.0-AbulkCV);
    7680                 :            : #endif
    7681                 :            : #if defined(_DYNAMIC)
    7682                 :            : #if defined(_DERIVATE)
    7683                 :          0 : qbulk_Vdrainp_sourcep=((((CoxWLcen_Vdrainp_sourcep*T7)+(CoxWLcen*T7_Vdrainp_sourcep))*((0.5*VdseffCV)-((T_0*VdseffCV)/T2)))+((CoxWLcen*T7)*((0.5*VdseffCV_Vdrainp_sourcep)-((((T_0_Vdrainp_sourcep*VdseffCV)+(T_0*VdseffCV_Vdrainp_sourcep))*T2-(T_0*VdseffCV)*T2_Vdrainp_sourcep)/T2/T2))));
    7684                 :          0 : qbulk_Vgate_sourcep=((((CoxWLcen_Vgate_sourcep*T7)+(CoxWLcen*T7_Vgate_sourcep))*((0.5*VdseffCV)-((T_0*VdseffCV)/T2)))+((CoxWLcen*T7)*((0.5*VdseffCV_Vgate_sourcep)-((((T_0_Vgate_sourcep*VdseffCV)+(T_0*VdseffCV_Vgate_sourcep))*T2-(T_0*VdseffCV)*T2_Vgate_sourcep)/T2/T2))));
    7685                 :          0 : qbulk_Vbulk_sourcep=((((CoxWLcen_Vbulk_sourcep*T7)+(CoxWLcen*T7_Vbulk_sourcep))*((0.5*VdseffCV)-((T_0*VdseffCV)/T2)))+((CoxWLcen*T7)*((0.5*VdseffCV_Vbulk_sourcep)-((((T_0_Vbulk_sourcep*VdseffCV)+(T_0*VdseffCV_Vbulk_sourcep))*T2-(T_0*VdseffCV)*T2_Vbulk_sourcep)/T2/T2))));
    7686                 :            : #endif
    7687                 :          0 : qbulk=((CoxWLcen*T7)*((0.5*VdseffCV)-((T_0*VdseffCV)/T2)));
    7688                 :            : #endif
    7689                 :            : #ifdef _DYNAMIC
    7690         [ #  # ]:          0 : if
    7691                 :            : (XPART>0.5)
    7692                 :            : {
    7693                 :            : #if defined(_DYNAMIC)
    7694                 :            : #if defined(_DERIVATE)
    7695                 :          0 : qsrc_Vgate_sourcep=(((-CoxWLcen_Vgate_sourcep)*(((T1/2.0)+(T_0/4.0))-(((0.5*T_0)*T_0)/T2)))+((-CoxWLcen)*(((T1_Vgate_sourcep/2.0)+(T_0_Vgate_sourcep/4.0))-(((((0.5*T_0_Vgate_sourcep)*T_0)+((0.5*T_0)*T_0_Vgate_sourcep))*T2-((0.5*T_0)*T_0)*T2_Vgate_sourcep)/T2/T2))));
    7696                 :          0 : qsrc_Vdrainp_sourcep=(((-CoxWLcen_Vdrainp_sourcep)*(((T1/2.0)+(T_0/4.0))-(((0.5*T_0)*T_0)/T2)))+((-CoxWLcen)*(((T1_Vdrainp_sourcep/2.0)+(T_0_Vdrainp_sourcep/4.0))-(((((0.5*T_0_Vdrainp_sourcep)*T_0)+((0.5*T_0)*T_0_Vdrainp_sourcep))*T2-((0.5*T_0)*T_0)*T2_Vdrainp_sourcep)/T2/T2))));
    7697                 :          0 : qsrc_Vbulk_sourcep=(((-CoxWLcen_Vbulk_sourcep)*(((T1/2.0)+(T_0/4.0))-(((0.5*T_0)*T_0)/T2)))+((-CoxWLcen)*(((T1_Vbulk_sourcep/2.0)+(T_0_Vbulk_sourcep/4.0))-(((((0.5*T_0_Vbulk_sourcep)*T_0)+((0.5*T_0)*T_0_Vbulk_sourcep))*T2-((0.5*T_0)*T_0)*T2_Vbulk_sourcep)/T2/T2))));
    7698                 :            : #endif
    7699                 :          0 : qsrc=((-CoxWLcen)*(((T1/2.0)+(T_0/4.0))-(((0.5*T_0)*T_0)/T2)));
    7700                 :            : #endif
    7701                 :            : }
    7702                 :            : else
    7703                 :            : {
    7704                 :            : #ifdef _DYNAMIC
    7705         [ #  # ]:          0 : if
    7706                 :            : (XPART<0.5)
    7707                 :            : {
    7708                 :            : #if defined(_DYNAMIC)
    7709                 :            : #if defined(_DERIVATE)
    7710                 :          0 : T2_Vgate_sourcep=(T2_Vgate_sourcep/12.0);
    7711                 :          0 : T2_Vdrainp_sourcep=(T2_Vdrainp_sourcep/12.0);
    7712                 :          0 : T2_Vbulk_sourcep=(T2_Vbulk_sourcep/12.0);
    7713                 :            : #endif
    7714                 :          0 : T2=(T2/12.0);
    7715                 :            : #endif
    7716                 :            : #if defined(_DYNAMIC)
    7717                 :            : #if defined(_DERIVATE)
    7718                 :          0 : T3_Vgate_sourcep=(((0.5*CoxWLcen_Vgate_sourcep)*(T2*T2)-(0.5*CoxWLcen)*((T2_Vgate_sourcep*T2)+(T2*T2_Vgate_sourcep)))/(T2*T2)/(T2*T2));
    7719                 :          0 : T3_Vdrainp_sourcep=(((0.5*CoxWLcen_Vdrainp_sourcep)*(T2*T2)-(0.5*CoxWLcen)*((T2_Vdrainp_sourcep*T2)+(T2*T2_Vdrainp_sourcep)))/(T2*T2)/(T2*T2));
    7720                 :          0 : T3_Vbulk_sourcep=(((0.5*CoxWLcen_Vbulk_sourcep)*(T2*T2)-(0.5*CoxWLcen)*((T2_Vbulk_sourcep*T2)+(T2*T2_Vbulk_sourcep)))/(T2*T2)/(T2*T2));
    7721                 :            : #endif
    7722                 :          0 : T3=((0.5*CoxWLcen)/(T2*T2));
    7723                 :            : #endif
    7724                 :            : #if defined(_DYNAMIC)
    7725                 :            : #if defined(_DERIVATE)
    7726                 :          0 : T4_Vgate_sourcep=(((T1_Vgate_sourcep*((((2.0*T_0)*T_0)/3.0)+(T1*(T1-((4.0*T_0)/3.0)))))+(T1*(((((2.0*T_0_Vgate_sourcep)*T_0)+((2.0*T_0)*T_0_Vgate_sourcep))/3.0)+((T1_Vgate_sourcep*(T1-((4.0*T_0)/3.0)))+(T1*(T1_Vgate_sourcep-((4.0*T_0_Vgate_sourcep)/3.0)))))))-((((((2.0*T_0_Vgate_sourcep)*T_0)+((2.0*T_0)*T_0_Vgate_sourcep))*T_0)+(((2.0*T_0)*T_0)*T_0_Vgate_sourcep))/15.0));
    7727                 :          0 : T4_Vdrainp_sourcep=(((T1_Vdrainp_sourcep*((((2.0*T_0)*T_0)/3.0)+(T1*(T1-((4.0*T_0)/3.0)))))+(T1*(((((2.0*T_0_Vdrainp_sourcep)*T_0)+((2.0*T_0)*T_0_Vdrainp_sourcep))/3.0)+((T1_Vdrainp_sourcep*(T1-((4.0*T_0)/3.0)))+(T1*(T1_Vdrainp_sourcep-((4.0*T_0_Vdrainp_sourcep)/3.0)))))))-((((((2.0*T_0_Vdrainp_sourcep)*T_0)+((2.0*T_0)*T_0_Vdrainp_sourcep))*T_0)+(((2.0*T_0)*T_0)*T_0_Vdrainp_sourcep))/15.0));
    7728                 :          0 : T4_Vbulk_sourcep=(((T1_Vbulk_sourcep*((((2.0*T_0)*T_0)/3.0)+(T1*(T1-((4.0*T_0)/3.0)))))+(T1*(((((2.0*T_0_Vbulk_sourcep)*T_0)+((2.0*T_0)*T_0_Vbulk_sourcep))/3.0)+((T1_Vbulk_sourcep*(T1-((4.0*T_0)/3.0)))+(T1*(T1_Vbulk_sourcep-((4.0*T_0_Vbulk_sourcep)/3.0)))))))-((((((2.0*T_0_Vbulk_sourcep)*T_0)+((2.0*T_0)*T_0_Vbulk_sourcep))*T_0)+(((2.0*T_0)*T_0)*T_0_Vbulk_sourcep))/15.0));
    7729                 :            : #endif
    7730                 :          0 : T4=((T1*((((2.0*T_0)*T_0)/3.0)+(T1*(T1-((4.0*T_0)/3.0)))))-((((2.0*T_0)*T_0)*T_0)/15.0));
    7731                 :            : #endif
    7732                 :            : #if defined(_DYNAMIC)
    7733                 :            : #if defined(_DERIVATE)
    7734                 :          0 : qsrc_Vgate_sourcep=(((-T3_Vgate_sourcep)*T4)+((-T3)*T4_Vgate_sourcep));
    7735                 :          0 : qsrc_Vdrainp_sourcep=(((-T3_Vdrainp_sourcep)*T4)+((-T3)*T4_Vdrainp_sourcep));
    7736                 :          0 : qsrc_Vbulk_sourcep=(((-T3_Vbulk_sourcep)*T4)+((-T3)*T4_Vbulk_sourcep));
    7737                 :            : #endif
    7738                 :          0 : qsrc=((-T3)*T4);
    7739                 :            : #endif
    7740                 :            : }
    7741                 :            : else
    7742                 :            : {
    7743                 :            : #if defined(_DYNAMIC)
    7744                 :            : #if defined(_DERIVATE)
    7745                 :          0 : qsrc_Vgate_sourcep=((-0.5)*qgate_Vgate_sourcep);
    7746                 :          0 : qsrc_Vdrainp_sourcep=((-0.5)*qgate_Vdrainp_sourcep);
    7747                 :          0 : qsrc_Vbulk_sourcep=((-0.5)*qgate_Vbulk_sourcep);
    7748                 :            : #endif
    7749                 :          0 : qsrc=((-0.5)*qgate);
    7750                 :            : #endif
    7751                 :            : }
    7752                 :            : #endif /* if (...) */
    7753                 :            : }
    7754                 :            : #endif /* if (...) */
    7755                 :            : #if defined(_DYNAMIC)
    7756                 :            : #if defined(_DERIVATE)
    7757                 :          0 : qgate_Vdrainp_sourcep=(((qgate_Vdrainp_sourcep+Qac0_Vdrainp_sourcep)+Qsub0_Vdrainp_sourcep)-qbulk_Vdrainp_sourcep);
    7758                 :          0 : qgate_Vgate_sourcep=(((qgate_Vgate_sourcep+Qac0_Vgate_sourcep)+Qsub0_Vgate_sourcep)-qbulk_Vgate_sourcep);
    7759                 :          0 : qgate_Vbulk_sourcep=(((qgate_Vbulk_sourcep+Qac0_Vbulk_sourcep)+Qsub0_Vbulk_sourcep)-qbulk_Vbulk_sourcep);
    7760                 :            : #endif
    7761                 :          0 : qgate=(((qgate+Qac0)+Qsub0)-qbulk);
    7762                 :            : #endif
    7763                 :            : #if defined(_DYNAMIC)
    7764                 :            : #if defined(_DERIVATE)
    7765                 :          0 : qbulk_Vdrainp_sourcep=(qbulk_Vdrainp_sourcep-(Qac0_Vdrainp_sourcep+Qsub0_Vdrainp_sourcep));
    7766                 :          0 : qbulk_Vgate_sourcep=(qbulk_Vgate_sourcep-(Qac0_Vgate_sourcep+Qsub0_Vgate_sourcep));
    7767                 :          0 : qbulk_Vbulk_sourcep=(qbulk_Vbulk_sourcep-(Qac0_Vbulk_sourcep+Qsub0_Vbulk_sourcep));
    7768                 :            : #endif
    7769                 :          0 : qbulk=(qbulk-(Qac0+Qsub0));
    7770                 :            : #endif
    7771                 :            : #if defined(_DYNAMIC)
    7772                 :            : #if defined(_DERIVATE)
    7773                 :          0 : qdrn_Vgate_sourcep=(-((qgate_Vgate_sourcep+qbulk_Vgate_sourcep)+qsrc_Vgate_sourcep));
    7774                 :          0 : qdrn_Vdrainp_sourcep=(-((qgate_Vdrainp_sourcep+qbulk_Vdrainp_sourcep)+qsrc_Vdrainp_sourcep));
    7775                 :          0 : qdrn_Vbulk_sourcep=(-((qgate_Vbulk_sourcep+qbulk_Vbulk_sourcep)+qsrc_Vbulk_sourcep));
    7776                 :            : #endif
    7777                 :          0 : qdrn=(-((qgate+qbulk)+qsrc));
    7778                 :            : #endif
    7779                 :            : #if defined(_DERIVATE)
    7780                 :          0 : qinv_Vdrainp_sourcep=(-qinoi_Vdrainp_sourcep);
    7781                 :          0 : qinv_Vgate_sourcep=(-qinoi_Vgate_sourcep);
    7782                 :          0 : qinv_Vbulk_sourcep=(-qinoi_Vbulk_sourcep);
    7783                 :            : #endif
    7784                 :          0 : qinv=(-qinoi);
    7785                 :            : }
    7786                 :            : }
    7787                 :            : }
    7788                 :            : }
    7789                 :            : }
    7790                 :            : #if defined(_DYNAMIC)
    7791                 :            : #if defined(_DERIVATE)
    7792                 :          0 : qgdo_Vbulk_sourcep=0.0;
    7793                 :          0 : qgdo_Vgate_sourcep=0.0;
    7794                 :          0 : qgdo_Vdrainp_sourcep=0.0;
    7795                 :            : #endif
    7796                 :          0 : qgdo=0.0;
    7797                 :            : #endif
    7798                 :            : #if defined(_DYNAMIC)
    7799                 :            : #if defined(_DERIVATE)
    7800                 :          0 : qgso_Vdrainp_sourcep=0.0;
    7801                 :          0 : qgso_Vbulk_sourcep=0.0;
    7802                 :          0 : qgso_Vgate_sourcep=0.0;
    7803                 :            : #endif
    7804                 :          0 : qgso=0.0;
    7805                 :            : #endif
    7806                 :            : #ifdef _DYNAMIC
    7807         [ #  # ]:          0 : if
    7808                 :            : (CAPMOD==0.0)
    7809                 :            : {
    7810                 :            : #if defined(_DYNAMIC)
    7811                 :            : #if defined(_DERIVATE)
    7812                 :          0 : qgdo_Vbulk_sourcep=0.0;
    7813                 :          0 : qgdo_Vgate_sourcep=(cgdo_param*vgd_Vgate_sourcep);
    7814                 :          0 : qgdo_Vdrainp_sourcep=(cgdo_param*vgd_Vdrainp_sourcep);
    7815                 :            : #endif
    7816                 :          0 : qgdo=(cgdo_param*vgd);
    7817                 :            : #endif
    7818                 :            : #if defined(_DYNAMIC)
    7819                 :            : #if defined(_DERIVATE)
    7820                 :          0 : qgso_Vdrainp_sourcep=0.0;
    7821                 :          0 : qgso_Vbulk_sourcep=0.0;
    7822                 :          0 : qgso_Vgate_sourcep=(cgso_param*vgs_Vgate_sourcep);
    7823                 :            : #endif
    7824                 :          0 : qgso=(cgso_param*vgs);
    7825                 :            : #endif
    7826                 :            : }
    7827                 :            : else
    7828                 :            : {
    7829                 :            : #ifdef _DYNAMIC
    7830         [ #  # ]:          0 : if
    7831                 :            : (CAPMOD==1.0)
    7832                 :            : {
    7833                 :            : #ifdef _DYNAMIC
    7834         [ #  # ]:          0 : if
    7835                 :            : (vgd<0.0)
    7836                 :            : {
    7837                 :            : #if defined(_DYNAMIC)
    7838                 :            : {
    7839                 :          0 : double m00_sqrt(d00_sqrt0,(1.0-((4.0*vgd)/ckappa)))
    7840                 :            : #if defined(_DERIVATE)
    7841                 :          0 : double m10_sqrt(d10_sqrt0,d00_sqrt0,(1.0-((4.0*vgd)/ckappa)))
    7842                 :            : #endif
    7843                 :            : #if defined(_DERIVATE)
    7844                 :          0 : T1_Vgate_sourcep=(-((4.0*vgd_Vgate_sourcep)/ckappa))*d10_sqrt0;
    7845                 :          0 : T1_Vdrainp_sourcep=(-((4.0*vgd_Vdrainp_sourcep)/ckappa))*d10_sqrt0;
    7846                 :          0 : T1_Vbulk_sourcep=0.0;
    7847                 :            : #endif
    7848                 :          0 : T1=d00_sqrt0;
    7849                 :            : }
    7850                 :            : #endif
    7851                 :            : #if defined(_DYNAMIC)
    7852                 :            : #if defined(_DERIVATE)
    7853                 :          0 : qgdo_Vbulk_sourcep=(-((((weffCV*0.5)*cgdl)*ckappa)*T1_Vbulk_sourcep));
    7854                 :          0 : qgdo_Vgate_sourcep=((cgdo_param*vgd_Vgate_sourcep)-((((weffCV*0.5)*cgdl)*ckappa)*T1_Vgate_sourcep));
    7855                 :          0 : qgdo_Vdrainp_sourcep=((cgdo_param*vgd_Vdrainp_sourcep)-((((weffCV*0.5)*cgdl)*ckappa)*T1_Vdrainp_sourcep));
    7856                 :            : #endif
    7857                 :          0 : qgdo=((cgdo_param*vgd)-((((weffCV*0.5)*cgdl)*ckappa)*(T1-1.0)));
    7858                 :            : #endif
    7859                 :            : }
    7860                 :            : else
    7861                 :            : {
    7862                 :            : #if defined(_DYNAMIC)
    7863                 :            : #if defined(_DERIVATE)
    7864                 :          0 : qgdo_Vbulk_sourcep=0.0;
    7865                 :          0 : qgdo_Vgate_sourcep=(((weffCV*cgdl)+cgdo_param)*vgd_Vgate_sourcep);
    7866                 :          0 : qgdo_Vdrainp_sourcep=(((weffCV*cgdl)+cgdo_param)*vgd_Vdrainp_sourcep);
    7867                 :            : #endif
    7868                 :          0 : qgdo=(((weffCV*cgdl)+cgdo_param)*vgd);
    7869                 :            : #endif
    7870                 :            : }
    7871                 :            : #endif /* if (...) */
    7872                 :            : #ifdef _DYNAMIC
    7873         [ #  # ]:          0 : if
    7874                 :            : (vgs<0.0)
    7875                 :            : {
    7876                 :            : #if defined(_DYNAMIC)
    7877                 :            : {
    7878                 :          0 : double m00_sqrt(d00_sqrt0,(1.0-((4.0*vgs)/ckappa)))
    7879                 :            : #if defined(_DERIVATE)
    7880                 :          0 : double m10_sqrt(d10_sqrt0,d00_sqrt0,(1.0-((4.0*vgs)/ckappa)))
    7881                 :            : #endif
    7882                 :            : #if defined(_DERIVATE)
    7883                 :          0 : T1_Vgate_sourcep=(-((4.0*vgs_Vgate_sourcep)/ckappa))*d10_sqrt0;
    7884                 :          0 : T1_Vdrainp_sourcep=0.0;
    7885                 :          0 : T1_Vbulk_sourcep=0.0;
    7886                 :            : #endif
    7887                 :          0 : T1=d00_sqrt0;
    7888                 :            : }
    7889                 :            : #endif
    7890                 :            : #if defined(_DYNAMIC)
    7891                 :            : #if defined(_DERIVATE)
    7892                 :          0 : qgso_Vdrainp_sourcep=(-((((weffCV*0.5)*cgsl)*ckappa)*T1_Vdrainp_sourcep));
    7893                 :          0 : qgso_Vbulk_sourcep=(-((((weffCV*0.5)*cgsl)*ckappa)*T1_Vbulk_sourcep));
    7894                 :          0 : qgso_Vgate_sourcep=((cgso_param*vgs_Vgate_sourcep)-((((weffCV*0.5)*cgsl)*ckappa)*T1_Vgate_sourcep));
    7895                 :            : #endif
    7896                 :          0 : qgso=((cgso_param*vgs)-((((weffCV*0.5)*cgsl)*ckappa)*(T1-1.0)));
    7897                 :            : #endif
    7898                 :            : }
    7899                 :            : else
    7900                 :            : {
    7901                 :            : #if defined(_DYNAMIC)
    7902                 :            : #if defined(_DERIVATE)
    7903                 :          0 : qgso_Vdrainp_sourcep=0.0;
    7904                 :          0 : qgso_Vbulk_sourcep=0.0;
    7905                 :          0 : qgso_Vgate_sourcep=(((weffCV*cgsl)+cgso_param)*vgs_Vgate_sourcep);
    7906                 :            : #endif
    7907                 :          0 : qgso=(((weffCV*cgsl)+cgso_param)*vgs);
    7908                 :            : #endif
    7909                 :            : }
    7910                 :            : #endif /* if (...) */
    7911                 :            : }
    7912                 :            : else
    7913                 :            : {
    7914                 :            : #if defined(_DYNAMIC)
    7915                 :            : #if defined(_DERIVATE)
    7916                 :          0 : T_0_Vgate_sourcep=vgd_Vgate_sourcep;
    7917                 :          0 : T_0_Vdrainp_sourcep=vgd_Vdrainp_sourcep;
    7918                 :          0 : T_0_Vbulk_sourcep=0.0;
    7919                 :            : #endif
    7920                 :          0 : T_0=(vgd+0.02);
    7921                 :            : #endif
    7922                 :            : #if defined(_DYNAMIC)
    7923                 :            : {
    7924                 :          0 : double m00_sqrt(d00_sqrt0,((T_0*T_0)+(4.0*0.02)))
    7925                 :            : #if defined(_DERIVATE)
    7926                 :          0 : double m10_sqrt(d10_sqrt0,d00_sqrt0,((T_0*T_0)+(4.0*0.02)))
    7927                 :            : #endif
    7928                 :            : #if defined(_DERIVATE)
    7929                 :          0 : T1_Vgate_sourcep=((T_0_Vgate_sourcep*T_0)+(T_0*T_0_Vgate_sourcep))*d10_sqrt0;
    7930                 :          0 : T1_Vdrainp_sourcep=((T_0_Vdrainp_sourcep*T_0)+(T_0*T_0_Vdrainp_sourcep))*d10_sqrt0;
    7931                 :          0 : T1_Vbulk_sourcep=((T_0_Vbulk_sourcep*T_0)+(T_0*T_0_Vbulk_sourcep))*d10_sqrt0;
    7932                 :            : #endif
    7933                 :          0 : T1=d00_sqrt0;
    7934                 :            : }
    7935                 :            : #endif
    7936                 :            : #if defined(_DYNAMIC)
    7937                 :            : #if defined(_DERIVATE)
    7938                 :          0 : T2_Vgate_sourcep=(0.5*(T_0_Vgate_sourcep-T1_Vgate_sourcep));
    7939                 :          0 : T2_Vdrainp_sourcep=(0.5*(T_0_Vdrainp_sourcep-T1_Vdrainp_sourcep));
    7940                 :          0 : T2_Vbulk_sourcep=(0.5*(T_0_Vbulk_sourcep-T1_Vbulk_sourcep));
    7941                 :            : #endif
    7942                 :          0 : T2=(0.5*(T_0-T1));
    7943                 :            : #endif
    7944                 :            : #if defined(_DYNAMIC)
    7945                 :            : #if defined(_DERIVATE)
    7946                 :          0 : T3_Vgate_sourcep=0.0;
    7947                 :          0 : T3_Vdrainp_sourcep=0.0;
    7948                 :          0 : T3_Vbulk_sourcep=0.0;
    7949                 :            : #endif
    7950                 :          0 : T3=(weffCV*cgdl);
    7951                 :            : #endif
    7952                 :            : #if defined(_DYNAMIC)
    7953                 :            : {
    7954                 :          0 : double m00_sqrt(d00_sqrt0,(1.0-((4.0*T2)/ckappa)))
    7955                 :            : #if defined(_DERIVATE)
    7956                 :          0 : double m10_sqrt(d10_sqrt0,d00_sqrt0,(1.0-((4.0*T2)/ckappa)))
    7957                 :            : #endif
    7958                 :            : #if defined(_DERIVATE)
    7959                 :          0 : T4_Vgate_sourcep=(-((4.0*T2_Vgate_sourcep)/ckappa))*d10_sqrt0;
    7960                 :          0 : T4_Vdrainp_sourcep=(-((4.0*T2_Vdrainp_sourcep)/ckappa))*d10_sqrt0;
    7961                 :          0 : T4_Vbulk_sourcep=(-((4.0*T2_Vbulk_sourcep)/ckappa))*d10_sqrt0;
    7962                 :            : #endif
    7963                 :          0 : T4=d00_sqrt0;
    7964                 :            : }
    7965                 :            : #endif
    7966                 :            : #if defined(_DYNAMIC)
    7967                 :            : #if defined(_DERIVATE)
    7968                 :          0 : qgdo_Vbulk_sourcep=(T3_Vbulk_sourcep*vgd-((T3_Vbulk_sourcep*(T2+((0.5*ckappa)*(T4-1.0))))+(T3*(T2_Vbulk_sourcep+((0.5*ckappa)*T4_Vbulk_sourcep)))));
    7969                 :          0 : qgdo_Vgate_sourcep=(((T3_Vgate_sourcep*vgd)+((cgdo_param+T3)*vgd_Vgate_sourcep))-((T3_Vgate_sourcep*(T2+((0.5*ckappa)*(T4-1.0))))+(T3*(T2_Vgate_sourcep+((0.5*ckappa)*T4_Vgate_sourcep)))));
    7970                 :          0 : qgdo_Vdrainp_sourcep=(((T3_Vdrainp_sourcep*vgd)+((cgdo_param+T3)*vgd_Vdrainp_sourcep))-((T3_Vdrainp_sourcep*(T2+((0.5*ckappa)*(T4-1.0))))+(T3*(T2_Vdrainp_sourcep+((0.5*ckappa)*T4_Vdrainp_sourcep)))));
    7971                 :            : #endif
    7972                 :          0 : qgdo=(((cgdo_param+T3)*vgd)-(T3*(T2+((0.5*ckappa)*(T4-1.0)))));
    7973                 :            : #endif
    7974                 :            : #if defined(_DYNAMIC)
    7975                 :            : #if defined(_DERIVATE)
    7976                 :          0 : T_0_Vgate_sourcep=vgs_Vgate_sourcep;
    7977                 :          0 : T_0_Vdrainp_sourcep=0.0;
    7978                 :          0 : T_0_Vbulk_sourcep=0.0;
    7979                 :            : #endif
    7980                 :          0 : T_0=(vgs+0.02);
    7981                 :            : #endif
    7982                 :            : #if defined(_DYNAMIC)
    7983                 :            : {
    7984                 :          0 : double m00_sqrt(d00_sqrt0,((T_0*T_0)+(4.0*0.02)))
    7985                 :            : #if defined(_DERIVATE)
    7986                 :          0 : double m10_sqrt(d10_sqrt0,d00_sqrt0,((T_0*T_0)+(4.0*0.02)))
    7987                 :            : #endif
    7988                 :            : #if defined(_DERIVATE)
    7989                 :          0 : T1_Vgate_sourcep=((T_0_Vgate_sourcep*T_0)+(T_0*T_0_Vgate_sourcep))*d10_sqrt0;
    7990                 :          0 : T1_Vdrainp_sourcep=((T_0_Vdrainp_sourcep*T_0)+(T_0*T_0_Vdrainp_sourcep))*d10_sqrt0;
    7991                 :          0 : T1_Vbulk_sourcep=((T_0_Vbulk_sourcep*T_0)+(T_0*T_0_Vbulk_sourcep))*d10_sqrt0;
    7992                 :            : #endif
    7993                 :          0 : T1=d00_sqrt0;
    7994                 :            : }
    7995                 :            : #endif
    7996                 :            : #if defined(_DYNAMIC)
    7997                 :            : #if defined(_DERIVATE)
    7998                 :          0 : T2_Vgate_sourcep=(0.5*(T_0_Vgate_sourcep-T1_Vgate_sourcep));
    7999                 :          0 : T2_Vdrainp_sourcep=(0.5*(T_0_Vdrainp_sourcep-T1_Vdrainp_sourcep));
    8000                 :          0 : T2_Vbulk_sourcep=(0.5*(T_0_Vbulk_sourcep-T1_Vbulk_sourcep));
    8001                 :            : #endif
    8002                 :          0 : T2=(0.5*(T_0-T1));
    8003                 :            : #endif
    8004                 :            : #if defined(_DYNAMIC)
    8005                 :            : #if defined(_DERIVATE)
    8006                 :          0 : T3_Vgate_sourcep=0.0;
    8007                 :          0 : T3_Vdrainp_sourcep=0.0;
    8008                 :          0 : T3_Vbulk_sourcep=0.0;
    8009                 :            : #endif
    8010                 :          0 : T3=(weffCV*cgsl);
    8011                 :            : #endif
    8012                 :            : #if defined(_DYNAMIC)
    8013                 :            : {
    8014                 :          0 : double m00_sqrt(d00_sqrt0,(1.0-((4.0*T2)/ckappa)))
    8015                 :            : #if defined(_DERIVATE)
    8016                 :          0 : double m10_sqrt(d10_sqrt0,d00_sqrt0,(1.0-((4.0*T2)/ckappa)))
    8017                 :            : #endif
    8018                 :            : #if defined(_DERIVATE)
    8019                 :          0 : T4_Vgate_sourcep=(-((4.0*T2_Vgate_sourcep)/ckappa))*d10_sqrt0;
    8020                 :          0 : T4_Vdrainp_sourcep=(-((4.0*T2_Vdrainp_sourcep)/ckappa))*d10_sqrt0;
    8021                 :          0 : T4_Vbulk_sourcep=(-((4.0*T2_Vbulk_sourcep)/ckappa))*d10_sqrt0;
    8022                 :            : #endif
    8023                 :          0 : T4=d00_sqrt0;
    8024                 :            : }
    8025                 :            : #endif
    8026                 :            : #if defined(_DYNAMIC)
    8027                 :            : #if defined(_DERIVATE)
    8028                 :          0 : qgso_Vdrainp_sourcep=(T3_Vdrainp_sourcep*vgs-((T3_Vdrainp_sourcep*(T2+((0.5*ckappa)*(T4-1.0))))+(T3*(T2_Vdrainp_sourcep+((0.5*ckappa)*T4_Vdrainp_sourcep)))));
    8029                 :          0 : qgso_Vbulk_sourcep=(T3_Vbulk_sourcep*vgs-((T3_Vbulk_sourcep*(T2+((0.5*ckappa)*(T4-1.0))))+(T3*(T2_Vbulk_sourcep+((0.5*ckappa)*T4_Vbulk_sourcep)))));
    8030                 :          0 : qgso_Vgate_sourcep=(((T3_Vgate_sourcep*vgs)+((cgso_param+T3)*vgs_Vgate_sourcep))-((T3_Vgate_sourcep*(T2+((0.5*ckappa)*(T4-1.0))))+(T3*(T2_Vgate_sourcep+((0.5*ckappa)*T4_Vgate_sourcep)))));
    8031                 :            : #endif
    8032                 :          0 : qgso=(((cgso_param+T3)*vgs)-(T3*(T2+((0.5*ckappa)*(T4-1.0)))));
    8033                 :            : #endif
    8034                 :            : }
    8035                 :            : #endif /* if (...) */
    8036                 :            : }
    8037                 :            : #endif /* if (...) */
    8038                 :            : #ifdef _DYNAMIC
    8039         [ #  # ]:          0 : if
    8040                 :            : (mode>0)
    8041                 :            : {
    8042                 :            : #ifdef _DYNAMIC
    8043         [ #  # ]:          0 : if
    8044                 :            : (NQSMOD==0)
    8045                 :            : {
    8046                 :            : #if defined(_DYNAMIC)
    8047                 :            : #if defined(_DERIVATE)
    8048                 :          0 : qgd_Vbulk_sourcep=qgdo_Vbulk_sourcep;
    8049                 :          0 : qgd_Vgate_sourcep=qgdo_Vgate_sourcep;
    8050                 :          0 : qgd_Vdrainp_sourcep=qgdo_Vdrainp_sourcep;
    8051                 :            : #endif
    8052                 :          0 : qgd=qgdo;
    8053                 :            : #endif
    8054                 :            : #if defined(_DYNAMIC)
    8055                 :            : #if defined(_DERIVATE)
    8056                 :          0 : qgs_Vdrainp_sourcep=qgso_Vdrainp_sourcep;
    8057                 :          0 : qgs_Vbulk_sourcep=qgso_Vbulk_sourcep;
    8058                 :          0 : qgs_Vgate_sourcep=qgso_Vgate_sourcep;
    8059                 :            : #endif
    8060                 :          0 : qgs=qgso;
    8061                 :            : #endif
    8062                 :            : #if defined(_DYNAMIC)
    8063                 :            : #if defined(_DERIVATE)
    8064                 :          0 : qgb_Vgate_sourcep=(cgbo_param*vgb_Vgate_sourcep);
    8065                 :          0 : qgb_Vbulk_sourcep=(cgbo_param*vgb_Vbulk_sourcep);
    8066                 :            : #endif
    8067                 :          0 : qgb=(cgbo_param*vgb);
    8068                 :            : #endif
    8069                 :            : #if defined(_DYNAMIC)
    8070                 :            : #if defined(_DERIVATE)
    8071                 :          0 : qgate_Vdrainp_sourcep=((qgate_Vdrainp_sourcep+qgd_Vdrainp_sourcep)+qgs_Vdrainp_sourcep);
    8072                 :          0 : qgate_Vgate_sourcep=(((qgate_Vgate_sourcep+qgd_Vgate_sourcep)+qgs_Vgate_sourcep)+qgb_Vgate_sourcep);
    8073                 :          0 : qgate_Vbulk_sourcep=(((qgate_Vbulk_sourcep+qgd_Vbulk_sourcep)+qgs_Vbulk_sourcep)+qgb_Vbulk_sourcep);
    8074                 :            : #endif
    8075                 :          0 : qgate=(((qgate+qgd)+qgs)+qgb);
    8076                 :            : #endif
    8077                 :            : #if defined(_DYNAMIC)
    8078                 :            : #if defined(_DERIVATE)
    8079                 :          0 : qbulk_Vdrainp_sourcep=qbulk_Vdrainp_sourcep;
    8080                 :          0 : qbulk_Vgate_sourcep=(qbulk_Vgate_sourcep-qgb_Vgate_sourcep);
    8081                 :          0 : qbulk_Vbulk_sourcep=(qbulk_Vbulk_sourcep-qgb_Vbulk_sourcep);
    8082                 :            : #endif
    8083                 :          0 : qbulk=(qbulk-qgb);
    8084                 :            : #endif
    8085                 :            : #if defined(_DYNAMIC)
    8086                 :            : #if defined(_DERIVATE)
    8087                 :          0 : qdrn_Vgate_sourcep=(qdrn_Vgate_sourcep-qgd_Vgate_sourcep);
    8088                 :          0 : qdrn_Vdrainp_sourcep=(qdrn_Vdrainp_sourcep-qgd_Vdrainp_sourcep);
    8089                 :          0 : qdrn_Vbulk_sourcep=(qdrn_Vbulk_sourcep-qgd_Vbulk_sourcep);
    8090                 :            : #endif
    8091                 :          0 : qdrn=(qdrn-qgd);
    8092                 :            : #endif
    8093                 :            : #if defined(_DYNAMIC)
    8094                 :            : #if defined(_DERIVATE)
    8095                 :          0 : qsrc_Vgate_sourcep=(-((qgate_Vgate_sourcep+qbulk_Vgate_sourcep)+qdrn_Vgate_sourcep));
    8096                 :          0 : qsrc_Vdrainp_sourcep=(-((qgate_Vdrainp_sourcep+qbulk_Vdrainp_sourcep)+qdrn_Vdrainp_sourcep));
    8097                 :          0 : qsrc_Vbulk_sourcep=(-((qgate_Vbulk_sourcep+qbulk_Vbulk_sourcep)+qdrn_Vbulk_sourcep));
    8098                 :            : #endif
    8099                 :          0 : qsrc=(-((qgate+qbulk)+qdrn));
    8100                 :            : #endif
    8101                 :            : }
    8102                 :            : else
    8103                 :            : {
    8104                 :            : #if defined(_DYNAMIC)
    8105                 :          0 : CoxWL=((cox*weffCV)*leffCV);
    8106                 :            : #endif
    8107                 :            : #if defined(_DYNAMIC)
    8108                 :            : #if defined(_DERIVATE)
    8109                 :          0 : qgd_Vbulk_sourcep=qgdo_Vbulk_sourcep;
    8110                 :          0 : qgd_Vgate_sourcep=qgdo_Vgate_sourcep;
    8111                 :          0 : qgd_Vdrainp_sourcep=qgdo_Vdrainp_sourcep;
    8112                 :            : #endif
    8113                 :          0 : qgd=qgdo;
    8114                 :            : #endif
    8115                 :            : #if defined(_DYNAMIC)
    8116                 :            : #if defined(_DERIVATE)
    8117                 :          0 : qgs_Vdrainp_sourcep=qgso_Vdrainp_sourcep;
    8118                 :          0 : qgs_Vbulk_sourcep=qgso_Vbulk_sourcep;
    8119                 :          0 : qgs_Vgate_sourcep=qgso_Vgate_sourcep;
    8120                 :            : #endif
    8121                 :          0 : qgs=qgso;
    8122                 :            : #endif
    8123                 :            : #if defined(_DYNAMIC)
    8124                 :            : #if defined(_DERIVATE)
    8125                 :          0 : qgb_Vgate_sourcep=(cgbo_param*vgb_Vgate_sourcep);
    8126                 :          0 : qgb_Vbulk_sourcep=(cgbo_param*vgb_Vbulk_sourcep);
    8127                 :            : #endif
    8128                 :          0 : qgb=(cgbo_param*vgb);
    8129                 :            : #endif
    8130                 :            : #if defined(_DYNAMIC)
    8131                 :            : #if defined(_DERIVATE)
    8132                 :          0 : qgate_Vdrainp_sourcep=(qgd_Vdrainp_sourcep+qgs_Vdrainp_sourcep);
    8133                 :          0 : qgate_Vgate_sourcep=((qgd_Vgate_sourcep+qgs_Vgate_sourcep)+qgb_Vgate_sourcep);
    8134                 :          0 : qgate_Vbulk_sourcep=((qgd_Vbulk_sourcep+qgs_Vbulk_sourcep)+qgb_Vbulk_sourcep);
    8135                 :            : #endif
    8136                 :          0 : qgate=((qgd+qgs)+qgb);
    8137                 :            : #endif
    8138                 :            : #if defined(_DYNAMIC)
    8139                 :            : #if defined(_DERIVATE)
    8140                 :          0 : qbulk_Vdrainp_sourcep=0.0;
    8141                 :          0 : qbulk_Vgate_sourcep=(-qgb_Vgate_sourcep);
    8142                 :          0 : qbulk_Vbulk_sourcep=(-qgb_Vbulk_sourcep);
    8143                 :            : #endif
    8144                 :          0 : qbulk=(-qgb);
    8145                 :            : #endif
    8146                 :            : #if defined(_DYNAMIC)
    8147                 :            : #if defined(_DERIVATE)
    8148                 :          0 : qdrn_Vgate_sourcep=(-qgd_Vgate_sourcep);
    8149                 :          0 : qdrn_Vdrainp_sourcep=(-qgd_Vdrainp_sourcep);
    8150                 :          0 : qdrn_Vbulk_sourcep=(-qgd_Vbulk_sourcep);
    8151                 :            : #endif
    8152                 :          0 : qdrn=(-qgd);
    8153                 :            : #endif
    8154                 :            : #if defined(_DYNAMIC)
    8155                 :            : #if defined(_DERIVATE)
    8156                 :          0 : qsrc_Vgate_sourcep=(-((qgate_Vgate_sourcep+qbulk_Vgate_sourcep)+qdrn_Vgate_sourcep));
    8157                 :          0 : qsrc_Vdrainp_sourcep=(-((qgate_Vdrainp_sourcep+qbulk_Vdrainp_sourcep)+qdrn_Vdrainp_sourcep));
    8158                 :          0 : qsrc_Vbulk_sourcep=(-((qgate_Vbulk_sourcep+qbulk_Vbulk_sourcep)+qdrn_Vbulk_sourcep));
    8159                 :            : #endif
    8160                 :          0 : qsrc=(-((qgate+qbulk)+qdrn));
    8161                 :            : #endif
    8162                 :            : }
    8163                 :            : #endif /* if (...) */
    8164                 :            : }
    8165                 :            : else
    8166                 :            : {
    8167                 :            : #ifdef _DYNAMIC
    8168         [ #  # ]:          0 : if
    8169                 :            : (NQSMOD==0)
    8170                 :            : {
    8171                 :            : #if defined(_DYNAMIC)
    8172                 :            : #if defined(_DERIVATE)
    8173                 :          0 : qgd_Vbulk_sourcep=qgdo_Vbulk_sourcep;
    8174                 :          0 : qgd_Vgate_sourcep=qgdo_Vgate_sourcep;
    8175                 :          0 : qgd_Vdrainp_sourcep=qgdo_Vdrainp_sourcep;
    8176                 :            : #endif
    8177                 :          0 : qgd=qgdo;
    8178                 :            : #endif
    8179                 :            : #if defined(_DYNAMIC)
    8180                 :            : #if defined(_DERIVATE)
    8181                 :          0 : qgs_Vdrainp_sourcep=qgso_Vdrainp_sourcep;
    8182                 :          0 : qgs_Vbulk_sourcep=qgso_Vbulk_sourcep;
    8183                 :          0 : qgs_Vgate_sourcep=qgso_Vgate_sourcep;
    8184                 :            : #endif
    8185                 :          0 : qgs=qgso;
    8186                 :            : #endif
    8187                 :            : #if defined(_DYNAMIC)
    8188                 :            : #if defined(_DERIVATE)
    8189                 :          0 : qgb_Vgate_sourcep=(cgbo_param*vgb_Vgate_sourcep);
    8190                 :          0 : qgb_Vbulk_sourcep=(cgbo_param*vgb_Vbulk_sourcep);
    8191                 :            : #endif
    8192                 :          0 : qgb=(cgbo_param*vgb);
    8193                 :            : #endif
    8194                 :            : #if defined(_DYNAMIC)
    8195                 :            : #if defined(_DERIVATE)
    8196                 :          0 : qgate_Vdrainp_sourcep=((qgate_Vdrainp_sourcep+qgd_Vdrainp_sourcep)+qgs_Vdrainp_sourcep);
    8197                 :          0 : qgate_Vgate_sourcep=(((qgate_Vgate_sourcep+qgd_Vgate_sourcep)+qgs_Vgate_sourcep)+qgb_Vgate_sourcep);
    8198                 :          0 : qgate_Vbulk_sourcep=(((qgate_Vbulk_sourcep+qgd_Vbulk_sourcep)+qgs_Vbulk_sourcep)+qgb_Vbulk_sourcep);
    8199                 :            : #endif
    8200                 :          0 : qgate=(((qgate+qgd)+qgs)+qgb);
    8201                 :            : #endif
    8202                 :            : #if defined(_DYNAMIC)
    8203                 :            : #if defined(_DERIVATE)
    8204                 :          0 : qbulk_Vdrainp_sourcep=qbulk_Vdrainp_sourcep;
    8205                 :          0 : qbulk_Vgate_sourcep=(qbulk_Vgate_sourcep-qgb_Vgate_sourcep);
    8206                 :          0 : qbulk_Vbulk_sourcep=(qbulk_Vbulk_sourcep-qgb_Vbulk_sourcep);
    8207                 :            : #endif
    8208                 :          0 : qbulk=(qbulk-qgb);
    8209                 :            : #endif
    8210                 :            : #if defined(_DYNAMIC)
    8211                 :            : #if defined(_DERIVATE)
    8212                 :          0 : qsrc_Vgate_sourcep=(qdrn_Vgate_sourcep-qgs_Vgate_sourcep);
    8213                 :          0 : qsrc_Vdrainp_sourcep=(qdrn_Vdrainp_sourcep-qgs_Vdrainp_sourcep);
    8214                 :          0 : qsrc_Vbulk_sourcep=(qdrn_Vbulk_sourcep-qgs_Vbulk_sourcep);
    8215                 :            : #endif
    8216                 :          0 : qsrc=(qdrn-qgs);
    8217                 :            : #endif
    8218                 :            : #if defined(_DYNAMIC)
    8219                 :            : #if defined(_DERIVATE)
    8220                 :          0 : qdrn_Vgate_sourcep=(-((qgate_Vgate_sourcep+qbulk_Vgate_sourcep)+qsrc_Vgate_sourcep));
    8221                 :          0 : qdrn_Vdrainp_sourcep=(-((qgate_Vdrainp_sourcep+qbulk_Vdrainp_sourcep)+qsrc_Vdrainp_sourcep));
    8222                 :          0 : qdrn_Vbulk_sourcep=(-((qgate_Vbulk_sourcep+qbulk_Vbulk_sourcep)+qsrc_Vbulk_sourcep));
    8223                 :            : #endif
    8224                 :          0 : qdrn=(-((qgate+qbulk)+qsrc));
    8225                 :            : #endif
    8226                 :            : }
    8227                 :            : else
    8228                 :            : {
    8229                 :            : #if defined(_DYNAMIC)
    8230                 :          0 : CoxWL=((cox*weffCV)*leffCV);
    8231                 :            : #endif
    8232                 :            : #if defined(_DYNAMIC)
    8233                 :            : #if defined(_DERIVATE)
    8234                 :          0 : qgd_Vbulk_sourcep=qgdo_Vbulk_sourcep;
    8235                 :          0 : qgd_Vgate_sourcep=qgdo_Vgate_sourcep;
    8236                 :          0 : qgd_Vdrainp_sourcep=qgdo_Vdrainp_sourcep;
    8237                 :            : #endif
    8238                 :          0 : qgd=qgdo;
    8239                 :            : #endif
    8240                 :            : #if defined(_DYNAMIC)
    8241                 :            : #if defined(_DERIVATE)
    8242                 :          0 : qgs_Vdrainp_sourcep=qgso_Vdrainp_sourcep;
    8243                 :          0 : qgs_Vbulk_sourcep=qgso_Vbulk_sourcep;
    8244                 :          0 : qgs_Vgate_sourcep=qgso_Vgate_sourcep;
    8245                 :            : #endif
    8246                 :          0 : qgs=qgso;
    8247                 :            : #endif
    8248                 :            : #if defined(_DYNAMIC)
    8249                 :            : #if defined(_DERIVATE)
    8250                 :          0 : qgb_Vgate_sourcep=(cgbo_param*vgb_Vgate_sourcep);
    8251                 :          0 : qgb_Vbulk_sourcep=(cgbo_param*vgb_Vbulk_sourcep);
    8252                 :            : #endif
    8253                 :          0 : qgb=(cgbo_param*vgb);
    8254                 :            : #endif
    8255                 :            : #if defined(_DYNAMIC)
    8256                 :            : #if defined(_DERIVATE)
    8257                 :          0 : qgate_Vdrainp_sourcep=(qgd_Vdrainp_sourcep+qgs_Vdrainp_sourcep);
    8258                 :          0 : qgate_Vgate_sourcep=((qgd_Vgate_sourcep+qgs_Vgate_sourcep)+qgb_Vgate_sourcep);
    8259                 :          0 : qgate_Vbulk_sourcep=((qgd_Vbulk_sourcep+qgs_Vbulk_sourcep)+qgb_Vbulk_sourcep);
    8260                 :            : #endif
    8261                 :          0 : qgate=((qgd+qgs)+qgb);
    8262                 :            : #endif
    8263                 :            : #if defined(_DYNAMIC)
    8264                 :            : #if defined(_DERIVATE)
    8265                 :          0 : qbulk_Vdrainp_sourcep=0.0;
    8266                 :          0 : qbulk_Vgate_sourcep=(-qgb_Vgate_sourcep);
    8267                 :          0 : qbulk_Vbulk_sourcep=(-qgb_Vbulk_sourcep);
    8268                 :            : #endif
    8269                 :          0 : qbulk=(-qgb);
    8270                 :            : #endif
    8271                 :            : #if defined(_DYNAMIC)
    8272                 :            : #if defined(_DERIVATE)
    8273                 :          0 : qsrc_Vgate_sourcep=(-qgs_Vgate_sourcep);
    8274                 :          0 : qsrc_Vdrainp_sourcep=(-qgs_Vdrainp_sourcep);
    8275                 :          0 : qsrc_Vbulk_sourcep=(-qgs_Vbulk_sourcep);
    8276                 :            : #endif
    8277                 :          0 : qsrc=(-qgs);
    8278                 :            : #endif
    8279                 :            : #if defined(_DYNAMIC)
    8280                 :            : #if defined(_DERIVATE)
    8281                 :          0 : qdrn_Vgate_sourcep=(-((qgate_Vgate_sourcep+qbulk_Vgate_sourcep)+qsrc_Vgate_sourcep));
    8282                 :          0 : qdrn_Vdrainp_sourcep=(-((qgate_Vdrainp_sourcep+qbulk_Vdrainp_sourcep)+qsrc_Vdrainp_sourcep));
    8283                 :          0 : qdrn_Vbulk_sourcep=(-((qgate_Vbulk_sourcep+qbulk_Vbulk_sourcep)+qsrc_Vbulk_sourcep));
    8284                 :            : #endif
    8285                 :          0 : qdrn=(-((qgate+qbulk)+qsrc));
    8286                 :            : #endif
    8287                 :            : }
    8288                 :            : #endif /* if (...) */
    8289                 :            : }
    8290                 :            : #endif /* if (...) */
    8291                 :            : #if defined(_DYNAMIC)
    8292                 :            : #if defined(_DERIVATE)
    8293                 :          0 : Qdrn_Vgate_sourcep=(qdrn_Vgate_sourcep-qbd_Vgate_sourcep);
    8294                 :          0 : Qdrn_Vdrainp_sourcep=(qdrn_Vdrainp_sourcep-qbd_Vdrainp_sourcep);
    8295                 :          0 : Qdrn_Vbulk_sourcep=(qdrn_Vbulk_sourcep-qbd_Vbulk_sourcep);
    8296                 :            : #endif
    8297                 :          0 : Qdrn=(qdrn-qbd);
    8298                 :            : #endif
    8299                 :            : #if defined(_DYNAMIC)
    8300                 :          0 : Qsrc=(qsrc-qbs);
    8301                 :            : #endif
    8302                 :            : #if defined(_DYNAMIC)
    8303                 :            : #if defined(_DERIVATE)
    8304                 :          0 : Qbulk_Vdrainp_sourcep=((qbulk_Vdrainp_sourcep+qbd_Vdrainp_sourcep)+qbs_Vdrainp_sourcep);
    8305                 :          0 : Qbulk_Vgate_sourcep=((qbulk_Vgate_sourcep+qbd_Vgate_sourcep)+qbs_Vgate_sourcep);
    8306                 :          0 : Qbulk_Vbulk_sourcep=((qbulk_Vbulk_sourcep+qbd_Vbulk_sourcep)+qbs_Vbulk_sourcep);
    8307                 :            : #endif
    8308                 :          0 : Qbulk=((qbulk+qbd)+qbs);
    8309                 :            : #endif
    8310                 :            : #if defined(_DYNAMIC)
    8311                 :            : #if defined(_DERIVATE)
    8312                 :          0 : Qgate_Vdrainp_sourcep=qgate_Vdrainp_sourcep;
    8313                 :          0 : Qgate_Vgate_sourcep=qgate_Vgate_sourcep;
    8314                 :          0 : Qgate_Vbulk_sourcep=qgate_Vbulk_sourcep;
    8315                 :            : #endif
    8316                 :          0 : Qgate=qgate;
    8317                 :            : #endif
    8318         [ #  # ]:          0 : if
    8319                 :            : (mode>0)
    8320                 :            : {
    8321                 :          0 : _load_static_residual2(drainp,sourcep,(TYPE*cdrain));
    8322                 :            : #if defined(_DERIVATE)
    8323 [ #  # ][ #  # ]:          0 : _load_static_jacobian4(drainp,sourcep,bulk,sourcep,(TYPE*cdrain_Vbulk_sourcep));
         [ #  # ][ #  # ]
                 [ #  # ]
    8324 [ #  # ][ #  # ]:          0 : _load_static_jacobian4(drainp,sourcep,drainp,sourcep,(TYPE*cdrain_Vdrainp_sourcep));
         [ #  # ][ #  # ]
                 [ #  # ]
    8325 [ #  # ][ #  # ]:          0 : _load_static_jacobian4(drainp,sourcep,gate,sourcep,(TYPE*cdrain_Vgate_sourcep));
         [ #  # ][ #  # ]
                 [ #  # ]
    8326                 :            : #endif
    8327                 :          0 : _load_static_residual2(bulk,drainp,(TYPE*(cbd-csub)));
    8328                 :            : #if defined(_DERIVATE)
    8329 [ #  # ][ #  # ]:          0 : _load_static_jacobian4(bulk,drainp,gate,sourcep,(TYPE*(-csub_Vgate_sourcep)));
         [ #  # ][ #  # ]
                 [ #  # ]
    8330 [ #  # ][ #  # ]:          0 : _load_static_jacobian4(bulk,drainp,drainp,sourcep,(TYPE*(cbd_Vdrainp_sourcep-csub_Vdrainp_sourcep)));
         [ #  # ][ #  # ]
                 [ #  # ]
    8331 [ #  # ][ #  # ]:          0 : _load_static_jacobian4(bulk,drainp,bulk,sourcep,(TYPE*(cbd_Vbulk_sourcep-csub_Vbulk_sourcep)));
         [ #  # ][ #  # ]
                 [ #  # ]
    8332                 :            : #endif
    8333                 :          0 : _load_static_residual2(bulk,sourcep,(TYPE*cbs));
    8334                 :            : #if defined(_DERIVATE)
    8335 [ #  # ][ #  # ]:          0 : _load_static_jacobian4(bulk,sourcep,bulk,sourcep,(TYPE*cbs_Vbulk_sourcep));
         [ #  # ][ #  # ]
                 [ #  # ]
    8336                 :            : #endif
    8337                 :            : }
    8338                 :            : else
    8339                 :            : {
    8340                 :          0 : _load_static_residual2(drainp,sourcep,(TYPE*(-cdrain)));
    8341                 :            : #if defined(_DERIVATE)
    8342 [ #  # ][ #  # ]:          0 : _load_static_jacobian4(drainp,sourcep,bulk,sourcep,(TYPE*(-cdrain_Vbulk_sourcep)));
         [ #  # ][ #  # ]
                 [ #  # ]
    8343 [ #  # ][ #  # ]:          0 : _load_static_jacobian4(drainp,sourcep,drainp,sourcep,(TYPE*(-cdrain_Vdrainp_sourcep)));
         [ #  # ][ #  # ]
                 [ #  # ]
    8344 [ #  # ][ #  # ]:          0 : _load_static_jacobian4(drainp,sourcep,gate,sourcep,(TYPE*(-cdrain_Vgate_sourcep)));
         [ #  # ][ #  # ]
                 [ #  # ]
    8345                 :            : #endif
    8346                 :          0 : _load_static_residual2(bulk,drainp,(TYPE*cbd));
    8347                 :            : #if defined(_DERIVATE)
    8348 [ #  # ][ #  # ]:          0 : _load_static_jacobian4(bulk,drainp,drainp,sourcep,(TYPE*cbd_Vdrainp_sourcep));
         [ #  # ][ #  # ]
                 [ #  # ]
    8349 [ #  # ][ #  # ]:          0 : _load_static_jacobian4(bulk,drainp,bulk,sourcep,(TYPE*cbd_Vbulk_sourcep));
         [ #  # ][ #  # ]
                 [ #  # ]
    8350                 :            : #endif
    8351                 :          0 : _load_static_residual2(bulk,sourcep,(TYPE*(cbs-csub)));
    8352                 :            : #if defined(_DERIVATE)
    8353 [ #  # ][ #  # ]:          0 : _load_static_jacobian4(bulk,sourcep,drainp,sourcep,(TYPE*(-csub_Vdrainp_sourcep)));
         [ #  # ][ #  # ]
                 [ #  # ]
    8354 [ #  # ][ #  # ]:          0 : _load_static_jacobian4(bulk,sourcep,gate,sourcep,(TYPE*(-csub_Vgate_sourcep)));
         [ #  # ][ #  # ]
                 [ #  # ]
    8355 [ #  # ][ #  # ]:          0 : _load_static_jacobian4(bulk,sourcep,bulk,sourcep,(TYPE*(cbs_Vbulk_sourcep-csub_Vbulk_sourcep)));
         [ #  # ][ #  # ]
                 [ #  # ]
    8356                 :            : #endif
    8357                 :            : }
    8358         [ #  # ]:          0 : if
    8359                 :            : (drainConductance>0.0)
    8360                 :            : {
    8361 [ #  # ][ #  # ]:          0 : _load_static_residual2(drain,drainp,(drainConductance*BP(drain,drainp)));
    8362                 :            : #if defined(_DERIVATE)
    8363 [ #  # ][ #  # ]:          0 : _load_static_jacobian4(drain,drainp,drain,drainp,(drainConductance));
         [ #  # ][ #  # ]
                 [ #  # ]
    8364                 :            : #endif
    8365                 :            : }
    8366                 :            : else
    8367                 :            : {
    8368 [ #  # ][ #  # ]:          0 : _load_static_residual2(drain,drainp,(BP(drain,drainp)*1e3));
    8369                 :            : #if defined(_DERIVATE)
    8370 [ #  # ][ #  # ]:          0 : _load_static_jacobian4(drain,drainp,drain,drainp,(1e3));
         [ #  # ][ #  # ]
                 [ #  # ]
    8371                 :            : #endif
    8372                 :            : }
    8373         [ #  # ]:          0 : if
    8374                 :            : (sourceConductance>0.0)
    8375                 :            : {
    8376 [ #  # ][ #  # ]:          0 : _load_static_residual2(source,sourcep,(sourceConductance*BP(source,sourcep)));
    8377                 :            : #if defined(_DERIVATE)
    8378 [ #  # ][ #  # ]:          0 : _load_static_jacobian4(source,sourcep,source,sourcep,(sourceConductance));
         [ #  # ][ #  # ]
                 [ #  # ]
    8379                 :            : #endif
    8380                 :            : }
    8381                 :            : else
    8382                 :            : {
    8383 [ #  # ][ #  # ]:          0 : _load_static_residual2(source,sourcep,(BP(source,sourcep)*1e3));
    8384                 :            : #if defined(_DERIVATE)
    8385 [ #  # ][ #  # ]:          0 : _load_static_jacobian4(source,sourcep,source,sourcep,(1e3));
         [ #  # ][ #  # ]
                 [ #  # ]
    8386                 :            : #endif
    8387                 :            : }
    8388                 :            : #if defined(_DYNAMIC)
    8389                 :          0 : cqgate=(TYPE*_DDT(Qgate));
    8390                 :            : #endif
    8391                 :            : #if defined(_DYNAMIC)
    8392                 :          0 : cqdrn=(TYPE*_DDT(Qdrn));
    8393                 :            : #endif
    8394                 :            : #if defined(_DYNAMIC)
    8395                 :          0 : cqbulk=(TYPE*_DDT(Qbulk));
    8396                 :            : #endif
    8397                 :            : #if defined(_DYNAMIC)
    8398 [ #  # ][ #  # ]:          0 : _load_dynamic_residual1(gate,(TYPE*_DDT(Qgate)));
    8399                 :            : #if defined(_DERIVATE)
    8400 [ #  # ][ #  # ]:          0 : _load_dynamic_jacobian2p(gate,bulk,sourcep,(TYPE*Qgate_Vbulk_sourcep));
         [ #  # ][ #  # ]
    8401 [ #  # ][ #  # ]:          0 : _load_dynamic_jacobian2p(gate,gate,sourcep,(TYPE*Qgate_Vgate_sourcep));
         [ #  # ][ #  # ]
    8402 [ #  # ][ #  # ]:          0 : _load_dynamic_jacobian2p(gate,drainp,sourcep,(TYPE*Qgate_Vdrainp_sourcep));
         [ #  # ][ #  # ]
    8403                 :            : #endif
    8404                 :            : #endif
    8405                 :            : #if defined(_DYNAMIC)
    8406 [ #  # ][ #  # ]:          0 : _load_dynamic_residual1(drainp,(TYPE*_DDT(Qdrn)));
    8407                 :            : #if defined(_DERIVATE)
    8408 [ #  # ][ #  # ]:          0 : _load_dynamic_jacobian2p(drainp,bulk,sourcep,(TYPE*Qdrn_Vbulk_sourcep));
         [ #  # ][ #  # ]
    8409 [ #  # ][ #  # ]:          0 : _load_dynamic_jacobian2p(drainp,drainp,sourcep,(TYPE*Qdrn_Vdrainp_sourcep));
         [ #  # ][ #  # ]
    8410 [ #  # ][ #  # ]:          0 : _load_dynamic_jacobian2p(drainp,gate,sourcep,(TYPE*Qdrn_Vgate_sourcep));
         [ #  # ][ #  # ]
    8411                 :            : #endif
    8412                 :            : #endif
    8413                 :            : #if defined(_DYNAMIC)
    8414 [ #  # ][ #  # ]:          0 : _load_dynamic_residual1(bulk,(TYPE*_DDT(Qbulk)));
    8415                 :            : #if defined(_DERIVATE)
    8416 [ #  # ][ #  # ]:          0 : _load_dynamic_jacobian2p(bulk,bulk,sourcep,(TYPE*Qbulk_Vbulk_sourcep));
         [ #  # ][ #  # ]
    8417 [ #  # ][ #  # ]:          0 : _load_dynamic_jacobian2p(bulk,gate,sourcep,(TYPE*Qbulk_Vgate_sourcep));
         [ #  # ][ #  # ]
    8418 [ #  # ][ #  # ]:          0 : _load_dynamic_jacobian2p(bulk,drainp,sourcep,(TYPE*Qbulk_Vdrainp_sourcep));
         [ #  # ][ #  # ]
    8419                 :            : #endif
    8420                 :            : #endif
    8421                 :            : #if defined(_DYNAMIC)
    8422 [ #  # ][ #  # ]:          0 : _load_dynamic_residual1(sourcep,(-(((TYPE*_DDT(Qgate))+(TYPE*_DDT(Qdrn)))+(TYPE*_DDT(Qbulk)))));
    8423                 :            : #if defined(_DERIVATE)
    8424 [ #  # ][ #  # ]:          0 : _load_dynamic_jacobian2p(sourcep,bulk,sourcep,(-(((TYPE*Qgate_Vbulk_sourcep)+(TYPE*Qdrn_Vbulk_sourcep))+(TYPE*Qbulk_Vbulk_sourcep))));
         [ #  # ][ #  # ]
    8425 [ #  # ][ #  # ]:          0 : _load_dynamic_jacobian2p(sourcep,gate,sourcep,(-(((TYPE*Qgate_Vgate_sourcep)+(TYPE*Qdrn_Vgate_sourcep))+(TYPE*Qbulk_Vgate_sourcep))));
         [ #  # ][ #  # ]
    8426 [ #  # ][ #  # ]:          0 : _load_dynamic_jacobian2p(sourcep,drainp,sourcep,(-(((TYPE*Qgate_Vdrainp_sourcep)+(TYPE*Qdrn_Vdrainp_sourcep))+(TYPE*Qbulk_Vdrainp_sourcep))));
         [ #  # ][ #  # ]
    8427                 :            : #endif
    8428                 :            : #endif
    8429         [ #  # ]:          0 : if
    8430                 :            : (NOIMOD==4)
    8431                 :            : {
    8432                 :          0 : fourkt=(5.5226012e-23*Temp);
    8433                 :          0 : leffx2=(leff*leff);
    8434                 :          0 : _save_flickernoise2(drainp,sourcep,((KF*pow(cdrain,AF))/(cox*leffx2)),EF,"flicker");
    8435                 :          0 : _save_whitenoise2(drainp,sourcep,(((fourkt*ueff)*abs(qinv))/leffx2),"channel");
    8436                 :          0 : _save_whitenoise2(drain,drainp,abs((fourkt*drainConductance)),"thermal");
    8437                 :          0 : _save_whitenoise2(sourcep,source,abs((fourkt*sourceConductance)),"thermal");
    8438                 :            : }
    8439                 :            : 
    8440                 :            : /* ------------------ end of verilog analog equations --------------------- */
    8441                 :            : 
    8442                 :            : /* ------------------ evaluate verilog noise equations -------------------- */
    8443                 :            : 
    8444                 :            : /* ------------------- end of verilog noise equations --------------------- */
    8445                 :          0 : }
    8446                 :            : 
    8447                 :            : /* Perform DC iteration. */
    8448                 :          0 : void bsim3v34nMOS::calcDC (void)
    8449                 :            : {
    8450                 :            :   // evaluate Verilog code
    8451                 :          0 :   initVerilog ();
    8452                 :          0 :   calcVerilog ();
    8453                 :            : 
    8454                 :            :   // fill right hand side and static jacobian
    8455         [ #  # ]:          0 :   for (int i1 = 0; i1 < 6; i1++) {
    8456         [ #  # ]:          0 :     setI (i1, _rhs[i1]);
    8457         [ #  # ]:          0 :     for (int i2 = 0; i2 < 6; i2++) {
    8458         [ #  # ]:          0 :       setY (i1, i2, _jstat[i1][i2]);
    8459                 :            :     }
    8460                 :            :   }
    8461                 :          0 : }
    8462                 :            : 
    8463                 :            : /* Save operating points. */
    8464                 :          0 : void bsim3v34nMOS::saveOperatingPoints (void)
    8465                 :            : {
    8466                 :            :   // save global instance operating points
    8467                 :          0 :   setOperatingPoint ("TYPE", TYPE);
    8468                 :          0 :   setOperatingPoint ("tox", tox);
    8469                 :          0 :   setOperatingPoint ("cox", cox);
    8470                 :          0 :   setOperatingPoint ("vth0", vth0);
    8471                 :          0 :   setOperatingPoint ("ngate", ngate);
    8472                 :          0 :   setOperatingPoint ("uc", uc);
    8473                 :          0 :   setOperatingPoint ("tnom", tnom);
    8474                 :          0 :   setOperatingPoint ("pdiblb", pdiblb);
    8475                 :          0 :   setOperatingPoint ("bulkJctBotGradingCoeff", bulkJctBotGradingCoeff);
    8476                 :          0 :   setOperatingPoint ("bulkJctSideGradingCoeff", bulkJctSideGradingCoeff);
    8477                 :          0 :   setOperatingPoint ("bulkJctGateSideGradingCoeff", bulkJctGateSideGradingCoeff);
    8478                 :          0 :   setOperatingPoint ("unitAreaJctCap", unitAreaJctCap);
    8479                 :          0 :   setOperatingPoint ("unitAreaTempJctCap", unitAreaTempJctCap);
    8480                 :          0 :   setOperatingPoint ("unitLengthSidewallJctCap", unitLengthSidewallJctCap);
    8481                 :          0 :   setOperatingPoint ("unitLengthSidewallTempJctCap", unitLengthSidewallTempJctCap);
    8482                 :          0 :   setOperatingPoint ("unitLengthGateSidewallJctCap", unitLengthGateSidewallJctCap);
    8483                 :          0 :   setOperatingPoint ("unitLengthGateSidewallTempJctCap", unitLengthGateSidewallTempJctCap);
    8484                 :          0 :   setOperatingPoint ("Temp", Temp);
    8485                 :          0 :   setOperatingPoint ("factor1", factor1);
    8486                 :          0 :   setOperatingPoint ("vtm", vtm);
    8487                 :          0 :   setOperatingPoint ("T_0", T_0);
    8488                 :          0 :   setOperatingPoint ("T1", T1);
    8489                 :          0 :   setOperatingPoint ("T2", T2);
    8490                 :          0 :   setOperatingPoint ("T3", T3);
    8491                 :          0 :   setOperatingPoint ("T4", T4);
    8492                 :          0 :   setOperatingPoint ("T5", T5);
    8493                 :          0 :   setOperatingPoint ("PhiB", PhiB);
    8494                 :          0 :   setOperatingPoint ("PhiBSW", PhiBSW);
    8495                 :          0 :   setOperatingPoint ("PhiBSWG", PhiBSWG);
    8496                 :          0 :   setOperatingPoint ("tmp", tmp);
    8497                 :          0 :   setOperatingPoint ("tmp1", tmp1);
    8498                 :          0 :   setOperatingPoint ("tmp2", tmp2);
    8499                 :          0 :   setOperatingPoint ("tmp3", tmp3);
    8500                 :          0 :   setOperatingPoint ("leff", leff);
    8501                 :          0 :   setOperatingPoint ("weff", weff);
    8502                 :          0 :   setOperatingPoint ("leffCV", leffCV);
    8503                 :          0 :   setOperatingPoint ("weffCV", weffCV);
    8504                 :          0 :   setOperatingPoint ("cdsc", cdsc);
    8505                 :          0 :   setOperatingPoint ("cdscb", cdscb);
    8506                 :          0 :   setOperatingPoint ("cdscd", cdscd);
    8507                 :          0 :   setOperatingPoint ("cit", cit);
    8508                 :          0 :   setOperatingPoint ("nfactor", nfactor);
    8509                 :          0 :   setOperatingPoint ("xj", xj);
    8510                 :          0 :   setOperatingPoint ("a0", a0);
    8511                 :          0 :   setOperatingPoint ("ags", ags);
    8512                 :          0 :   setOperatingPoint ("a1", a1);
    8513                 :          0 :   setOperatingPoint ("a2", a2);
    8514                 :          0 :   setOperatingPoint ("keta", keta);
    8515                 :          0 :   setOperatingPoint ("vfb", vfb);
    8516                 :          0 :   setOperatingPoint ("k1", k1);
    8517                 :          0 :   setOperatingPoint ("kt1", kt1);
    8518                 :          0 :   setOperatingPoint ("kt1l", kt1l);
    8519                 :          0 :   setOperatingPoint ("kt2", kt2);
    8520                 :          0 :   setOperatingPoint ("k3", k3);
    8521                 :          0 :   setOperatingPoint ("k3b", k3b);
    8522                 :          0 :   setOperatingPoint ("w0", w0);
    8523                 :          0 :   setOperatingPoint ("nlx", nlx);
    8524                 :          0 :   setOperatingPoint ("dvt0", dvt0);
    8525                 :          0 :   setOperatingPoint ("dvt1", dvt1);
    8526                 :          0 :   setOperatingPoint ("dvt2", dvt2);
    8527                 :          0 :   setOperatingPoint ("dvt0w", dvt0w);
    8528                 :          0 :   setOperatingPoint ("dvt1w", dvt1w);
    8529                 :          0 :   setOperatingPoint ("dvt2w", dvt2w);
    8530                 :          0 :   setOperatingPoint ("ua", ua);
    8531                 :          0 :   setOperatingPoint ("ub", ub);
    8532                 :          0 :   setOperatingPoint ("voff", voff);
    8533                 :          0 :   setOperatingPoint ("delta", delta);
    8534                 :          0 :   setOperatingPoint ("prwg", prwg);
    8535                 :          0 :   setOperatingPoint ("prwb", prwb);
    8536                 :          0 :   setOperatingPoint ("eta0", eta0);
    8537                 :          0 :   setOperatingPoint ("etab", etab);
    8538                 :          0 :   setOperatingPoint ("pclm", pclm);
    8539                 :          0 :   setOperatingPoint ("pscbe1", pscbe1);
    8540                 :          0 :   setOperatingPoint ("pscbe2", pscbe2);
    8541                 :          0 :   setOperatingPoint ("pvag", pvag);
    8542                 :          0 :   setOperatingPoint ("dwg", dwg);
    8543                 :          0 :   setOperatingPoint ("dwb", dwb);
    8544                 :          0 :   setOperatingPoint ("b0", b0);
    8545                 :          0 :   setOperatingPoint ("b1", b1);
    8546                 :          0 :   setOperatingPoint ("alpha0", alpha0);
    8547                 :          0 :   setOperatingPoint ("alpha1", alpha1);
    8548                 :          0 :   setOperatingPoint ("beta0", beta0);
    8549                 :          0 :   setOperatingPoint ("cgsl", cgsl);
    8550                 :          0 :   setOperatingPoint ("cgdl", cgdl);
    8551                 :          0 :   setOperatingPoint ("ckappa", ckappa);
    8552                 :          0 :   setOperatingPoint ("vfbcv", vfbcv);
    8553                 :          0 :   setOperatingPoint ("acde", acde);
    8554                 :          0 :   setOperatingPoint ("moin", moin);
    8555                 :          0 :   setOperatingPoint ("noff_param", noff_param);
    8556                 :          0 :   setOperatingPoint ("voffcv_param", voffcv_param);
    8557                 :          0 :   setOperatingPoint ("abulkCVfactor", abulkCVfactor);
    8558                 :          0 :   setOperatingPoint ("u0temp", u0temp);
    8559                 :          0 :   setOperatingPoint ("vsattemp", vsattemp);
    8560                 :          0 :   setOperatingPoint ("rds0", rds0);
    8561                 :          0 :   setOperatingPoint ("phi", phi);
    8562                 :          0 :   setOperatingPoint ("sqrtPhi", sqrtPhi);
    8563                 :          0 :   setOperatingPoint ("phis3", phis3);
    8564                 :          0 :   setOperatingPoint ("Xdep0", Xdep0);
    8565                 :          0 :   setOperatingPoint ("litl", litl);
    8566                 :          0 :   setOperatingPoint ("vbi", vbi);
    8567                 :          0 :   setOperatingPoint ("cdep0", cdep0);
    8568                 :          0 :   setOperatingPoint ("ldeb", ldeb);
    8569                 :          0 :   setOperatingPoint ("vbsc", vbsc);
    8570                 :          0 :   setOperatingPoint ("k1ox", k1ox);
    8571                 :          0 :   setOperatingPoint ("k2ox", k2ox);
    8572                 :          0 :   setOperatingPoint ("theta0vb0", theta0vb0);
    8573                 :          0 :   setOperatingPoint ("thetaRout", thetaRout);
    8574                 :          0 :   setOperatingPoint ("vfbzb", vfbzb);
    8575                 :          0 :   setOperatingPoint ("sourceArea", sourceArea);
    8576                 :          0 :   setOperatingPoint ("drainArea", drainArea);
    8577                 :          0 :   setOperatingPoint ("sourcePerimeter", sourcePerimeter);
    8578                 :          0 :   setOperatingPoint ("drainPerimeter", drainPerimeter);
    8579                 :          0 :   setOperatingPoint ("SourceSatCurrent", SourceSatCurrent);
    8580                 :          0 :   setOperatingPoint ("DrainSatCurrent", DrainSatCurrent);
    8581                 :          0 :   setOperatingPoint ("sourceConductance", sourceConductance);
    8582                 :          0 :   setOperatingPoint ("drainConductance", drainConductance);
    8583                 :          0 :   setOperatingPoint ("Nvtm", Nvtm);
    8584                 :          0 :   setOperatingPoint ("vjsm", vjsm);
    8585                 :          0 :   setOperatingPoint ("vjdm", vjdm);
    8586                 :          0 :   setOperatingPoint ("IsEvjsm", IsEvjsm);
    8587                 :          0 :   setOperatingPoint ("IsEvjdm", IsEvjdm);
    8588                 :          0 :   setOperatingPoint ("cgso_param", cgso_param);
    8589                 :          0 :   setOperatingPoint ("cgdo_param", cgdo_param);
    8590                 :          0 :   setOperatingPoint ("cgbo_param", cgbo_param);
    8591                 :          0 : }
    8592                 :            : 
    8593                 :            : /* Load operating points. */
    8594                 :          0 : void bsim3v34nMOS::loadOperatingPoints (void)
    8595                 :            : {
    8596                 :          0 : }
    8597                 :            : 
    8598                 :            : /* Calculate operating points. */
    8599                 :          0 : void bsim3v34nMOS::calcOperatingPoints (void)
    8600                 :            : {
    8601                 :          0 : }
    8602                 :            : 
    8603                 :            : /* Initialization of AC analysis. */
    8604                 :          0 : void bsim3v34nMOS::initAC (void)
    8605                 :            : {
    8606                 :          0 :   allocMatrixMNA ();
    8607                 :          0 : }
    8608                 :            : 
    8609                 :            : /* Perform AC calculations. */
    8610                 :          0 : void bsim3v34nMOS::calcAC (nr_double_t frequency)
    8611                 :            : {
    8612         [ #  # ]:          0 :   setMatrixY (calcMatrixY (frequency));
    8613                 :          0 : }
    8614                 :            : 
    8615                 :            : /* Compute Y-matrix for AC analysis. */
    8616                 :          0 : matrix bsim3v34nMOS::calcMatrixY (nr_double_t frequency)
    8617                 :            : {
    8618                 :          0 :   _freq = frequency;
    8619                 :          0 :   saveOperatingPoints ();
    8620                 :          0 :   matrix y (6);
    8621                 :            : 
    8622         [ #  # ]:          0 :   for (int i1 = 0; i1 < 6; i1++) {
    8623         [ #  # ]:          0 :     for (int i2 = 0; i2 < 6; i2++) {
    8624                 :          0 :       y (i1,i2) = nr_complex_t (_jstat[i1][i2], _jdyna[i1][i2] * 2 * M_PI * _freq);
    8625                 :            :     }
    8626                 :            :   }
    8627                 :            : 
    8628                 :          0 :   return y;
    8629                 :            : }
    8630                 :            : 
    8631                 :            : /* Initialization of S-parameter analysis. */
    8632                 :          0 : void bsim3v34nMOS::initSP (void)
    8633                 :            : {
    8634                 :          0 :   allocMatrixS ();
    8635                 :          0 : }
    8636                 :            : 
    8637                 :            : /* Perform S-parameter calculations. */
    8638                 :          0 : void bsim3v34nMOS::calcSP (nr_double_t frequency)
    8639                 :            : {
    8640 [ #  # ][ #  # ]:          0 :   setMatrixS (ytos (calcMatrixY (frequency)));
         [ #  # ][ #  # ]
                 [ #  # ]
    8641                 :          0 : }
    8642                 :            : 
    8643                 :            : /* Initialization of transient analysis. */
    8644                 :          0 : void bsim3v34nMOS::initTR (void)
    8645                 :            : {
    8646                 :          0 :   setStates (2 * 6 * 6);
    8647                 :          0 :   initDC ();
    8648                 :          0 : }
    8649                 :            : 
    8650                 :            : /* Perform transient analysis iteration step. */
    8651                 :          0 : void bsim3v34nMOS::calcTR (nr_double_t)
    8652                 :            : {
    8653                 :          0 :   doHB = 0;
    8654                 :          0 :   doAC = 1;
    8655                 :          0 :   doTR = 1;
    8656                 :          0 :   calcDC ();
    8657                 :            : 
    8658                 :            :   int i1, i2, i3, i4, state;
    8659                 :            : 
    8660                 :            :   // 2-node charge integrations
    8661         [ #  # ]:          0 :   for (i1 = 0; i1 < 6; i1++) {
    8662         [ #  # ]:          0 :   for (i2 = 0; i2 < 6; i2++) {
    8663                 :          0 :     state = 2 * (i2 + 6 * i1);
    8664         [ #  # ]:          0 :     if (i1 != i2)
    8665         [ #  # ]:          0 :     if (_charges[i1][i2] != 0.0)
    8666                 :          0 :       transientCapacitanceQ (state, i1, i2, _charges[i1][i2]);
    8667                 :            :   } }
    8668                 :            : 
    8669                 :            :   // 1-node charge integrations
    8670         [ #  # ]:          0 :   for (i1 = 0; i1 < 6; i1++) {
    8671                 :          0 :     state = 2 * (i1 + 6 * i1);
    8672         [ #  # ]:          0 :     if (_charges[i1][i1] != 0.0)
    8673                 :          0 :       transientCapacitanceQ (state, i1, _charges[i1][i1]);
    8674                 :            :   }
    8675                 :            : 
    8676                 :            :   // charge: 2-node, voltage: 2-node
    8677         [ #  # ]:          0 :   for (i1 = 0; i1 < 6; i1++) {
    8678         [ #  # ]:          0 :   for (i2 = 0; i2 < 6; i2++) {
    8679         [ #  # ]:          0 :   if (i1 != i2)
    8680         [ #  # ]:          0 :   for (i3 = 0; i3 < 6; i3++) {
    8681         [ #  # ]:          0 :   for (i4 = 0; i4 < 6; i4++) {
    8682         [ #  # ]:          0 :     if (i3 != i4)
    8683         [ #  # ]:          0 :     if (_caps[i1][i2][i3][i4] != 0.0)
    8684 [ #  # ][ #  # ]:          0 :       transientCapacitanceC (i1, i2, i3, i4, _caps[i1][i2][i3][i4], BP(i3,i4));
    8685                 :            :   } } } }
    8686                 :            : 
    8687                 :            :   // charge: 2-node, voltage: 1-node
    8688         [ #  # ]:          0 :   for (i1 = 0; i1 < 6; i1++) {
    8689         [ #  # ]:          0 :   for (i2 = 0; i2 < 6; i2++) {
    8690         [ #  # ]:          0 :   if (i1 != i2)
    8691         [ #  # ]:          0 :   for (i3 = 0; i3 < 6; i3++) {
    8692         [ #  # ]:          0 :     if (_caps[i1][i2][i3][i3] != 0.0)
    8693         [ #  # ]:          0 :       transientCapacitanceC2Q (i1, i2, i3, _caps[i1][i2][i3][i3], NP(i3));
    8694                 :            :   } } }
    8695                 :            : 
    8696                 :            :   // charge: 1-node, voltage: 2-node
    8697         [ #  # ]:          0 :   for (i1 = 0; i1 < 6; i1++) {
    8698         [ #  # ]:          0 :   for (i3 = 0; i3 < 6; i3++) {
    8699         [ #  # ]:          0 :   for (i4 = 0; i4 < 6; i4++) {
    8700         [ #  # ]:          0 :     if (i3 != i4)
    8701         [ #  # ]:          0 :     if (_caps[i1][i1][i3][i4] != 0.0)
    8702 [ #  # ][ #  # ]:          0 :       transientCapacitanceC2V (i1, i3, i4, _caps[i1][i1][i3][i4], BP(i3,i4));
    8703                 :            :   } } }
    8704                 :            : 
    8705                 :            :   // charge: 1-node, voltage: 1-node
    8706         [ #  # ]:          0 :   for (i1 = 0; i1 < 6; i1++) {
    8707         [ #  # ]:          0 :   for (i3 = 0; i3 < 6; i3++) {
    8708         [ #  # ]:          0 :     if (_caps[i1][i1][i3][i3] != 0.0)
    8709         [ #  # ]:          0 :       transientCapacitanceC (i1, i3, _caps[i1][i1][i3][i3], NP(i3));
    8710                 :            :   } }
    8711                 :          0 : }
    8712                 :            : 
    8713                 :            : /* Compute Cy-matrix for AC noise analysis. */
    8714                 :          0 : matrix bsim3v34nMOS::calcMatrixCy (nr_double_t frequency) 
    8715                 :            : {
    8716                 :          0 :   _freq = frequency;
    8717                 :          0 :   matrix cy (6);
    8718                 :            : 
    8719                 :          0 :   _load_flickernoise2 (drainp,sourcep,_flicker_pwr[drainp][sourcep],_flicker_exp[drainp][sourcep]);
    8720                 :          0 :   _load_whitenoise2 (sourcep,source,_white_pwr[sourcep][source]);
    8721                 :          0 :   _load_whitenoise2 (drain,drainp,_white_pwr[drain][drainp]);
    8722                 :          0 :   _load_whitenoise2 (drainp,sourcep,_white_pwr[drainp][sourcep]);
    8723                 :            : 
    8724                 :          0 :   return cy;
    8725                 :            : }
    8726                 :            : 
    8727                 :            : /* Perform AC noise computations. */
    8728                 :          0 : void bsim3v34nMOS::calcNoiseAC (nr_double_t frequency) 
    8729                 :            : {
    8730         [ #  # ]:          0 :   setMatrixN (calcMatrixCy (frequency));
    8731                 :          0 : }
    8732                 :            : 
    8733                 :            : /* Perform S-parameter noise computations. */
    8734                 :          0 : void bsim3v34nMOS::calcNoiseSP (nr_double_t frequency) 
    8735                 :            : {
    8736 [ #  # ][ #  # ]:          0 :   setMatrixN (cytocs (calcMatrixCy (frequency) * z0, getMatrixS ()));
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
    8737                 :          0 : }
    8738                 :            : 
    8739                 :            : /* Initialization of HB analysis. */
    8740                 :          0 : void bsim3v34nMOS::initHB (int)
    8741                 :            : {
    8742                 :          0 :   initDC ();
    8743                 :          0 :   allocMatrixHB ();
    8744                 :          0 : }
    8745                 :            : 
    8746                 :            : /* Perform HB analysis. */
    8747                 :          0 : void bsim3v34nMOS::calcHB (int)
    8748                 :            : {
    8749                 :          0 :   doHB = 1;
    8750                 :          0 :   doAC = 1;
    8751                 :          0 :   doTR = 0;
    8752                 :            : 
    8753                 :            :   // jacobian dI/dV and currents get filled
    8754                 :          0 :   calcDC ();
    8755                 :          0 :   saveOperatingPoints ();
    8756                 :            : 
    8757                 :            :   // fill in HB matrices
    8758         [ #  # ]:          0 :   for (int i1 = 0; i1 < 6; i1++) {
    8759         [ #  # ]:          0 :     setQ  (i1, _qhs[i1]); // charges
    8760         [ #  # ]:          0 :     setCV (i1, _chs[i1]); // jacobian dQ/dV * V
    8761         [ #  # ]:          0 :     setGV (i1, _ghs[i1]); // jacobian dI/dV * V
    8762         [ #  # ]:          0 :     for (int i2 = 0; i2 < 6; i2++) {
    8763         [ #  # ]:          0 :       setQV (i1, i2, _jdyna[i1][i2]); // jacobian dQ/dV
    8764                 :            :     }
    8765                 :            :   }
    8766                 :          0 : }
    8767                 :            : 
    8768                 :            : #include "bsim3v34nMOS.defs.h"
    8769                 :            : 

Generated by: LCOV version 1.11