Changeset 1039 for trunk

Show
Ignore:
Timestamp:
02/07/08 20:24:26 (8 months ago)
Author:
otter
Message:

Removed "noEvent" from the construct "noEvent(smooth(..))" in the Electrical.Analog library
(see discussion in Modelica-design email list)

Location:
trunk/Modelica/Electrical/Analog
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/Modelica/Electrical/Analog/Basic.mo

    r1023 r1039  
    13561356    vin = in_p.v - in_n.v; 
    13571357    f = 2/(VMax.v - VMin.v); 
    1358     absSlope = noEvent(smooth(0,(if (Slope < 0) then -Slope else Slope))); 
    1359     out.v = (VMax.v + VMin.v)/2 + absSlope*vin/(1 + absSlope*noEvent(smooth(0,(if (f*vin 
    1360        < 0) then -f*vin else f*vin)))); 
     1358    absSlope = smooth(0,(if (Slope < 0) then -Slope else Slope)); 
     1359    out.v = (VMax.v + VMin.v)/2 + absSlope*vin/(1 + absSlope*smooth(0,(if (f*vin 
     1360       < 0) then -f*vin else f*vin))); 
    13611361  end OpAmp; 
    13621362   
  • trunk/Modelica/Electrical/Analog/Ideal.mo

    r1024 r1039  
    10961096    VMin.i = 0; 
    10971097    vin = in_p.v - in_n.v; 
    1098     in_p.v - in_n.v = unitVoltage*noEvent(smooth(0,(if s < -1 then s + 1 else if s > 1 then s - 1 else 0))); 
    1099     out.v = noEvent(smooth(0,if s < -1 then VMin.v else if s > 1 then VMax.v else (VMax.v - VMin.v)*s/2 + (VMax.v + VMin.v)/2)); 
     1098    in_p.v - in_n.v = unitVoltage*smooth(0,(if s < -1 then s + 1 else if s > 1 then s - 1 else 0)); 
     1099    out.v = smooth(0,if s < -1 then VMin.v else if s > 1 then VMax.v else (VMax.v - VMin.v)*s/2 + (VMax.v + VMin.v)/2); 
    11001100  end IdealOpAmpLimited; 
    11011101   
  • trunk/Modelica/Electrical/Analog/Semiconductors.mo

    r1024 r1039  
    116116        height=0.63)); 
    117117  equation  
    118     i = noEvent(smooth(1,(if (v/Vt > Maxexp) then Ids*(exp(Maxexp)*(1 + v/Vt - Maxexp) - 1) + 
    119       v/R else Ids*(exp(v/Vt) - 1) + v/R))); 
     118    i = smooth(1,(if (v/Vt > Maxexp) then Ids*(exp(Maxexp)*(1 + v/Vt - Maxexp) - 1) + 
     119      v/R else Ids*(exp(v/Vt) - 1) + v/R)); 
    120120  end Diode; 
    121121   
     
    238238    gds = if (RDS < 1.e-20 and RDS > -1.e-20) then 1.e20 else 1/RDS; 
    239239    v = Beta*(W + dW)/(L + dL); 
    240     ud = noEvent(smooth(0,if (D.v > S.v) then S.v else D.v)); 
    241     us = noEvent(smooth(0,if (D.v > S.v) then D.v else S.v)); 
     240    ud = smooth(0,if (D.v > S.v) then S.v else D.v); 
     241    us = smooth(0,if (D.v > S.v) then D.v else S.v); 
    242242    uds = ud - us; 
    243     ubs = noEvent(smooth(0,if (B.v < us) then 0 else B.v - us)); 
     243    ubs = smooth(0,if (B.v < us) then 0 else B.v - us); 
    244244    ugst = (G.v - us - Vt + K2*ubs)*K5; 
    245     id = noEvent(smooth(0,if (ugst >= 0) then uds*gds else if (ugst < uds) then -v*uds*( 
    246       ugst - uds/2) + uds*gds else -v*ugst*ugst/2 + uds*gds)); 
     245    id = smooth(0,if (ugst >= 0) then uds*gds else if (ugst < uds) then -v*uds*( 
     246      ugst - uds/2) + uds*gds else -v*ugst*ugst/2 + uds*gds); 
    247247    G.i = 0; 
    248     D.i = noEvent(smooth(0,if (D.v > S.v) then -id else id)); 
    249     S.i = noEvent(smooth(0,if (D.v > S.v) then id else -id)); 
     248    D.i = smooth(0,if (D.v > S.v) then -id else id); 
     249    S.i = smooth(0,if (D.v > S.v) then id else -id); 
    250250    B.i = 0; 
    251251  end PMOS; 
     
    374374    gds = if (RDS < 1.e-20 and RDS > -1.e-20) then 1.e20 else 1/RDS; 
    375375    v = Beta*(W + dW)/(L + dL); 
    376     ud = noEvent(smooth(0,if (D.v < S.v) then S.v else D.v)); 
     376    ud = smooth(0,if (D.v < S.v) then S.v else D.v); 
    377377    us = if (D.v < S.v) then D.v else S.v; 
    378378    uds = ud - us; 
    379     ubs = noEvent(smooth(0,if (B.v > us) then 0 else B.v - us)); 
     379    ubs = smooth(0,if (B.v > us) then 0 else B.v - us); 
    380380    ugst = (G.v - us - Vt + K2*ubs)*K5; 
    381     id = noEvent(smooth(0,if (ugst <= 0) then uds*gds else if (ugst > uds) then v*uds*(ugst 
    382        - uds/2) + uds*gds else v*ugst*ugst/2 + uds*gds)); 
     381    id = smooth(0,if (ugst <= 0) then uds*gds else if (ugst > uds) then v*uds*(ugst 
     382       - uds/2) + uds*gds else v*ugst*ugst/2 + uds*gds); 
    383383    G.i = 0; 
    384     D.i = noEvent(smooth(0,if (D.v < S.v) then -id else id)); 
    385     S.i = noEvent(smooth(0,if (D.v < S.v) then id else -id)); 
     384    D.i = smooth(0,if (D.v < S.v) then -id else id); 
     385    S.i = smooth(0,if (D.v < S.v) then id else -id); 
    386386    B.i = 0; 
    387387  end NMOS; 
     
    514514    qbk = 1 - vbc*Vak; 
    515515     
    516     ibc = noEvent(smooth(1,if (vbc/Vt < EMin) then Is*(ExMin*(vbc/Vt - EMin + 1) - 1) + vbc*Gbc else  
     516    ibc = smooth(1,if (vbc/Vt < EMin) then Is*(ExMin*(vbc/Vt - EMin + 1) - 1) + vbc*Gbc else  
    517517            if (vbc/Vt > EMax) then Is*(ExMax*(vbc/Vt - EMax + 1) - 1) + vbc* 
    518       Gbc else Is*(exp(vbc/Vt) - 1) + vbc*Gbc)); 
    519     ibe = noEvent(smooth(1,if (vbe/Vt < EMin) then Is*(ExMin*(vbe/Vt - EMin + 1) - 1) + vbe*Gbe else  
     518      Gbc else Is*(exp(vbc/Vt) - 1) + vbc*Gbc); 
     519    ibe = smooth(1,if (vbe/Vt < EMin) then Is*(ExMin*(vbe/Vt - EMin + 1) - 1) + vbe*Gbe else  
    520520            if (vbe/Vt > EMax) then Is*(ExMax*(vbe/Vt - EMax + 1) - 1) + vbe* 
    521       Gbe else Is*(exp(vbe/Vt) - 1) + vbe*Gbe)); 
    522     Capcjc = noEvent(smooth(1,(if (vbc/Phic > 0) then Cjc*(1 + Mc*vbc/Phic) else Cjc*pow(1 - vbc 
    523       /Phic, -Mc)))); 
    524     Capcje = noEvent(smooth(1,(if (vbe/Phie > 0) then Cje*(1 + Me*vbe/Phie) else Cje*pow(1 - vbe 
    525       /Phie, -Me)))); 
    526     cbc = noEvent(smooth(1,(if (vbc/Vt < EMin) then Taur*Is/Vt*ExMin*(vbc/Vt - EMin + 1) + 
     521      Gbe else Is*(exp(vbe/Vt) - 1) + vbe*Gbe); 
     522    Capcjc = smooth(1,(if (vbc/Phic > 0) then Cjc*(1 + Mc*vbc/Phic) else Cjc*pow(1 - vbc 
     523      /Phic, -Mc))); 
     524    Capcje = smooth(1,(if (vbe/Phie > 0) then Cje*(1 + Me*vbe/Phie) else Cje*pow(1 - vbe 
     525      /Phie, -Me))); 
     526    cbc = smooth(1,(if (vbc/Vt < EMin) then Taur*Is/Vt*ExMin*(vbc/Vt - EMin + 1) + 
    527527      Capcjc else if (vbc/Vt > EMax) then Taur*Is/Vt*ExMax*(vbc/Vt - EMax + 1) 
    528        + Capcjc else Taur*Is/Vt*exp(vbc/Vt) + Capcjc))); 
    529     cbe = noEvent(smooth(1,(if (vbe/Vt < EMin) then Tauf*Is/Vt*ExMin*(vbe/Vt - EMin + 1) + 
     528       + Capcjc else Taur*Is/Vt*exp(vbc/Vt) + Capcjc)); 
     529    cbe = smooth(1,(if (vbe/Vt < EMin) then Tauf*Is/Vt*ExMin*(vbe/Vt - EMin + 1) + 
    530530      Capcje else if (vbe/Vt > EMax) then Tauf*Is/Vt*ExMax*(vbe/Vt - EMax + 1) 
    531        + Capcje else Tauf*Is/Vt*exp(vbe/Vt) + Capcje))); 
     531       + Capcje else Tauf*Is/Vt*exp(vbe/Vt) + Capcje)); 
    532532    C.i = (ibe - ibc)*qbk - ibc/Br - cbc*der(vbc) + Ccs*der(C.v); 
    533533    B.i = ibe/Bf + ibc/Br + cbc*der(vbc) + cbe*der(vbe); 
     
    656656    qbk = 1 - vbc*Vak; 
    657657     
    658     ibc = noEvent(smooth(1,(if (vbc/Vt < EMin) then Is*(ExMin*(vbc/Vt - EMin + 1) - 1) + vbc*Gbc else  
     658    ibc = smooth(1,(if (vbc/Vt < EMin) then Is*(ExMin*(vbc/Vt - EMin + 1) - 1) + vbc*Gbc else  
    659659            if (vbc/Vt > EMax) then Is*(ExMax*(vbc/Vt - EMax + 1) - 1) + vbc* 
    660       Gbc else Is*(exp(vbc/Vt) - 1) + vbc*Gbc))); 
    661      
    662     ibe = noEvent(smooth(1,(if (vbe/Vt < EMin) then Is*(ExMin*(vbe/Vt - EMin + 1) - 1) + vbe*Gbe else  
     660      Gbc else Is*(exp(vbc/Vt) - 1) + vbc*Gbc)); 
     661     
     662    ibe = smooth(1,(if (vbe/Vt < EMin) then Is*(ExMin*(vbe/Vt - EMin + 1) - 1) + vbe*Gbe else  
    663663            if (vbe/Vt > EMax) then Is*(ExMax*(vbe/Vt - EMax + 1) - 1) + vbe* 
    664       Gbe else Is*(exp(vbe/Vt) - 1) + vbe*Gbe))); 
    665      
    666     Capcjc = noEvent(smooth(1,(if (vbc/Phic > 0) then Cjc*(1 + Mc*vbc/Phic) else Cjc*pow(1 - vbc 
    667       /Phic, -Mc)))); 
    668     Capcje = noEvent(smooth(1,if (vbe/Phie > 0) then Cje*(1 + Me*vbe/Phie) else Cje*pow(1 - vbe 
    669       /Phie, -Me))); 
    670     cbc = noEvent(smooth(1,(if (vbc/Vt < EMin) then Taur*Is/Vt*ExMin*(vbc/Vt - EMin + 1) + 
     664      Gbe else Is*(exp(vbe/Vt) - 1) + vbe*Gbe)); 
     665     
     666    Capcjc = smooth(1,(if (vbc/Phic > 0) then Cjc*(1 + Mc*vbc/Phic) else Cjc*pow(1 - vbc 
     667      /Phic, -Mc))); 
     668    Capcje = smooth(1,if (vbe/Phie > 0) then Cje*(1 + Me*vbe/Phie) else Cje*pow(1 - vbe 
     669      /Phie, -Me)); 
     670    cbc = smooth(1,(if (vbc/Vt < EMin) then Taur*Is/Vt*ExMin*(vbc/Vt - EMin + 1) + 
    671671      Capcjc else if (vbc/Vt > EMax) then Taur*Is/Vt*ExMax*(vbc/Vt - EMax + 1) 
    672        + Capcjc else Taur*Is/Vt*exp(vbc/Vt) + Capcjc))); 
    673     cbe = noEvent(smooth(1,(if (vbe/Vt < EMin) then Tauf*Is/Vt*ExMin*(vbe/Vt - EMin + 1) + 
     672       + Capcjc else Taur*Is/Vt*exp(vbc/Vt) + Capcjc)); 
     673    cbe = smooth(1,(if (vbe/Vt < EMin) then Tauf*Is/Vt*ExMin*(vbe/Vt - EMin + 1) + 
    674674      Capcje else if (vbe/Vt > EMax) then Tauf*Is/Vt*ExMax*(vbe/Vt - EMax + 1) 
    675        + Capcje else Tauf*Is/Vt*exp(vbe/Vt) + Capcje))); 
     675       + Capcje else Tauf*Is/Vt*exp(vbe/Vt) + Capcje)); 
    676676    C.i = -((ibe - ibc)*qbk - ibc/Br - cbc*der(vbc) - Ccs*der(C.v)); 
    677677    B.i = -(ibe/Bf + ibc/Br + cbe*der(vbe) + cbc*der(vbc)); 
     
    935935          gds = if (RDS < 1.e-20 and RDS > -1.e-20) then 1.e20 else 1/RDS; 
    936936          v = beta_t*(W + dW)/(L + dL); 
    937           ud = noEvent(smooth(0,if (D.v < S.v) then S.v else D.v)); 
    938           us = noEvent(smooth(0,if (D.v < S.v) then D.v else S.v)); 
     937          ud = smooth(0,if (D.v < S.v) then S.v else D.v); 
     938          us = smooth(0,if (D.v < S.v) then D.v else S.v); 
    939939          uds = ud - us; 
    940           ubs = noEvent(smooth(0,if (B.v > us) then 0 else B.v - us)); 
     940          ubs = smooth(0,if (B.v > us) then 0 else B.v - us); 
    941941          ugst = (G.v - us - vt_t + k2_t*ubs)*K5; 
    942           id = noEvent(smooth(0,if (ugst <= 0) then uds*gds else if (ugst > uds) then v*uds*( 
    943             ugst - uds/2) + uds*gds else v*ugst*ugst/2 + uds*gds)); 
     942          id = smooth(0,if (ugst <= 0) then uds*gds else if (ugst > uds) then v*uds*( 
     943            ugst - uds/2) + uds*gds else v*ugst*ugst/2 + uds*gds); 
    944944     
    945945          beta_t = Beta*pow((heatPort.T/Tnom), -1.5); 
     
    948948     
    949949          G.i = 0; 
    950           D.i = noEvent(smooth(0,if (D.v < S.v) then -id else id)); 
    951           S.i = noEvent(smooth(0,if (D.v < S.v) then id else -id)); 
     950          D.i = smooth(0,if (D.v < S.v) then -id else id); 
     951          S.i = smooth(0,if (D.v < S.v) then id else -id); 
    952952          B.i = 0; 
    953953          heatPort.Q_flow = -D.i*(D.v - S.v); 
     
    10991099          gds = if (RDS < 1.e-20 and RDS > -1.e-20) then 1.e20 else 1/RDS; 
    11001100          v = beta_t*(W + dW)/(L + dL); 
    1101           ud = noEvent(smooth(0,if (D.v > S.v) then S.v else D.v)); 
    1102           us = noEvent(smooth(0,if (D.v > S.v) then D.v else S.v)); 
     1101          ud = smooth(0,if (D.v > S.v) then S.v else D.v); 
     1102          us = smooth(0,if (D.v > S.v) then D.v else S.v); 
    11031103          uds = ud - us; 
    1104           ubs = noEvent(smooth(0,if (B.v < us) then 0 else B.v - us)); 
     1104          ubs = smooth(0,if (B.v < us) then 0 else B.v - us); 
    11051105          ugst = (G.v - us - vt_t + k2_t*ubs)*K5; 
    1106           id = noEvent(smooth(0,if (ugst >= 0) then uds*gds else if (ugst < uds) then -v*uds*( 
    1107             ugst - uds/2) + uds*gds else -v*ugst*ugst/2 + uds*gds)); 
     1106          id = smooth(0,if (ugst >= 0) then uds*gds else if (ugst < uds) then -v*uds*( 
     1107            ugst - uds/2) + uds*gds else -v*ugst*ugst/2 + uds*gds); 
    11081108     
    11091109          beta_t = Beta*pow((heatPort.T/Tnom), -1.5); 
     
    11121112     
    11131113          G.i = 0; 
    1114           D.i = noEvent(smooth(0,if (D.v > S.v) then -id else id)); 
    1115           S.i = noEvent(smooth(0,if (D.v > S.v) then id else -id)); 
     1114          D.i = smooth(0,if (D.v > S.v) then -id else id); 
     1115          S.i = smooth(0,if (D.v > S.v) then id else -id); 
    11161116          B.i = 0; 
    11171117          heatPort.Q_flow = -D.i*(D.v - S.v); 
     
    12781278     
    12791279          hexp = (heatPort.T/Tnom - 1)*EG/vt_t; 
    1280           htempexp = noEvent(smooth(1,if (hexp < EMin) then ExMin*(hexp - EMin + 1) else if ( 
    1281             hexp > EMax) then ExMax*(hexp - EMax + 1) else exp(hexp))); 
     1280          htempexp = smooth(1,if (hexp < EMin) then ExMin*(hexp - EMin + 1) else if ( 
     1281            hexp > EMax) then ExMax*(hexp - EMax + 1) else exp(hexp)); 
    12821282     
    12831283          is_t = Is*pow((heatPort.T/Tnom), XTI)*htempexp; 
     
    12861286          vt_t = (K/q)*heatPort.T; 
    12871287     
    1288           ibc = noEvent(smooth(1,(if (vbc/(NR*vt_t) < EMin) then is_t*(ExMin*(vbc/(NR*vt_t) - 
     1288          ibc = smooth(1,(if (vbc/(NR*vt_t) < EMin) then is_t*(ExMin*(vbc/(NR*vt_t) - 
    12891289            EMin + 1) - 1) + vbc*Gbc else if (vbc/(NR*vt_t) > EMax) then is_t*( 
    12901290            ExMax*(vbc/(NR*vt_t) - EMax + 1) - 1) + vbc*Gbc else is_t*(exp(vbc/ 
    1291             (NR*vt_t)) - 1) + vbc*Gbc))); 
    1292           ibe = noEvent(smooth(1,(if (vbe/(NF*vt_t) < EMin) then is_t*(ExMin*(vbe/(NF*vt_t) - 
     1291            (NR*vt_t)) - 1) + vbc*Gbc)); 
     1292          ibe = smooth(1,(if (vbe/(NF*vt_t) < EMin) then is_t*(ExMin*(vbe/(NF*vt_t) - 
    12931293            EMin + 1) - 1) + vbe*Gbe else if (vbe/(NF*vt_t) > EMax) then is_t*( 
    12941294            ExMax*(vbe/(NF*vt_t) - EMax + 1) - 1) + vbe*Gbe else is_t*(exp(vbe/ 
    1295             (NF*vt_t)) - 1) + vbe*Gbe))); 
    1296           Capcjc = noEvent(smooth(1,(if (vbc/Phic > 0) then Cjc*(1 + Mc*vbc/Phic) else Cjc*pow(1 
    1297              - vbc/Phic, -Mc)))); 
    1298           Capcje = noEvent(smooth(1,(if (vbe/Phie > 0) then Cje*(1 + Me*vbe/Phie) else Cje*pow(1 
    1299              - vbe/Phie, -Me)))); 
    1300           cbc = noEvent(smooth(1,(if (vbc/(NR*vt_t) < EMin) then Taur*is_t/(NR*vt_t)*ExMin*(vbc/( 
     1295            (NF*vt_t)) - 1) + vbe*Gbe)); 
     1296          Capcjc = smooth(1,(if (vbc/Phic > 0) then Cjc*(1 + Mc*vbc/Phic) else Cjc*pow(1 
     1297             - vbc/Phic, -Mc))); 
     1298          Capcje = smooth(1,(if (vbe/Phie > 0) then Cje*(1 + Me*vbe/Phie) else Cje*pow(1 
     1299             - vbe/Phie, -Me))); 
     1300          cbc = smooth(1,(if (vbc/(NR*vt_t) < EMin) then Taur*is_t/(NR*vt_t)*ExMin*(vbc/( 
    13011301            NR*vt_t) - EMin + 1) + Capcjc else if (vbc/(NR*vt_t) > EMax) then  
    13021302            Taur*is_t/(NR*vt_t)*ExMax*(vbc/(NR*vt_t) - EMax + 1) + Capcjc else  
    1303             Taur*is_t/(NR*vt_t)*exp(vbc/(NR*vt_t)) + Capcjc))); 
    1304           cbe = noEvent(smooth(1,(if (vbe/(NF*vt_t) < EMin) then Tauf*is_t/(NF*vt_t)*ExMin*(vbe/( 
     1303            Taur*is_t/(NR*vt_t)*exp(vbc/(NR*vt_t)) + Capcjc)); 
     1304          cbe = smooth(1,(if (vbe/(NF*vt_t) < EMin) then Tauf*is_t/(NF*vt_t)*ExMin*(vbe/( 
    13051305            NF*vt_t) - EMin + 1) + Capcje else if (vbe/(NF*vt_t) > EMax) then  
    13061306            Tauf*is_t/(NF*vt_t)*ExMax*(vbe/(NF*vt_t) - EMax + 1) + Capcje else  
    1307             Tauf*is_t/(NF*vt_t)*exp(vbe/(NF*vt_t)) + Capcje))); 
     1307            Tauf*is_t/(NF*vt_t)*exp(vbe/(NF*vt_t)) + Capcje)); 
    13081308          C.i = (ibe - ibc)*qbk - ibc/br_t - cbc*der(vbc) + Ccs*der(C.v); 
    13091309          B.i = ibe/bf_t + ibc/br_t + cbc*der(vbc) + cbe*der(vbe); 
     
    14681468     
    14691469          hexp = (heatPort.T/Tnom - 1)*EG/vt_t; 
    1470           htempexp = noEvent(smooth(1,if (hexp < EMin) then ExMin*(hexp - EMin + 1) else if ( 
    1471             hexp > EMax) then ExMax*(hexp - EMax + 1) else exp(hexp))); 
     1470          htempexp = smooth(1,if (hexp < EMin) then ExMin*(hexp - EMin + 1) else if ( 
     1471            hexp > EMax) then ExMax*(hexp - EMax + 1) else exp(hexp)); 
    14721472     
    14731473          is_t = Is*pow((heatPort.T/Tnom), XTI)*htempexp; 
     
    14761476          vt_t = (K/q)*heatPort.T; 
    14771477     
    1478           icb = noEvent(smooth(1,(if (vcb/(NR*vt_t) < EMin) then is_t*(ExMin*(vcb/(NR*vt_t) - 
     1478          icb = smooth(1,(if (vcb/(NR*vt_t) < EMin) then is_t*(ExMin*(vcb/(NR*vt_t) - 
    14791479            EMin + 1) - 1) + vcb*Gbc else if (vcb/(NR*vt_t) > EMax) then is_t*( 
    14801480            ExMax*(vcb/(NR*vt_t) - EMax + 1) - 1) + vcb*Gbc else is_t*(exp(vcb/ 
    1481             (NR*vt_t)) - 1) + vcb*Gbc))); 
    1482      
    1483           ieb = noEvent(smooth(1,(if (veb/(NF*vt_t) < EMin) then is_t*(ExMin*(veb/(NF*vt_t) - 
     1481            (NR*vt_t)) - 1) + vcb*Gbc)); 
     1482     
     1483          ieb = smooth(1,(if (veb/(NF*vt_t) < EMin) then is_t*(ExMin*(veb/(NF*vt_t) - 
    14841484            EMin + 1) - 1) + veb*Gbe else if (veb/(NF*vt_t) > EMax) then is_t*( 
    14851485            ExMax*(veb/(NF*vt_t) - EMax + 1) - 1) + veb*Gbe else is_t*(exp(veb/ 
    1486             (NF*vt_t)) - 1) + veb*Gbe))); 
    1487      
    1488           Capcjc = noEvent(smooth(1,(if (vcb/Phic > 0) then Cjc*(1 + Mc*vcb/Phic) else Cjc*pow(1 
    1489              - vcb/Phic, -Mc)))); 
    1490           Capcje = noEvent(smooth(1,(if (veb/Phie > 0) then Cje*(1 + Me*veb/Phie) else Cje*pow(1 
    1491              - veb/Phie, -Me)))); 
    1492           ccb = noEvent(smooth(1,(if (vcb/(NR*vt_t) < EMin) then Taur*is_t/(NR*vt_t)*ExMin*(vcb/( 
     1486            (NF*vt_t)) - 1) + veb*Gbe)); 
     1487     
     1488          Capcjc = smooth(1,(if (vcb/Phic > 0) then Cjc*(1 + Mc*vcb/Phic) else Cjc*pow(1 
     1489             - vcb/Phic, -Mc))); 
     1490          Capcje = smooth(1,(if (veb/Phie > 0) then Cje*(1 + Me*veb/Phie) else Cje*pow(1 
     1491             - veb/Phie, -Me))); 
     1492          ccb = smooth(1,(if (vcb/(NR*vt_t) < EMin) then Taur*is_t/(NR*vt_t)*ExMin*(vcb/( 
    14931493            NR*vt_t) - EMin + 1) + Capcjc else if (vcb/(NR*vt_t) > EMax) then  
    14941494            Taur*is_t/(NR*vt_t)*ExMax*(vcb/(NR*vt_t) - EMax + 1) + Capcjc else  
    1495             Taur*is_t/(NR*vt_t)*exp(vcb/(NR*vt_t)) + Capcjc))); 
    1496           ceb = noEvent(smooth(1,(if (veb/(NF*vt_t) < EMin) then Tauf*is_t/(NF*vt_t)*ExMin*(veb/( 
     1495            Taur*is_t/(NR*vt_t)*exp(vcb/(NR*vt_t)) + Capcjc)); 
     1496          ceb = smooth(1,(if (veb/(NF*vt_t) < EMin) then Tauf*is_t/(NF*vt_t)*ExMin*(veb/( 
    14971497            NF*vt_t) - EMin + 1) + Capcje else if (veb/(NF*vt_t) > EMax) then  
    14981498            Tauf*is_t/(NF*vt_t)*ExMax*(veb/(NF*vt_t) - EMax + 1) + Capcje else  
    1499             Tauf*is_t/(NF*vt_t)*exp(veb/(NF*vt_t)) + Capcje))); 
     1499            Tauf*is_t/(NF*vt_t)*exp(veb/(NF*vt_t)) + Capcje)); 
    15001500          C.i = icb/br_t + ccb*der(vcb) + Ccs*der(C.v) + (icb - ieb)*qbk; 
    15011501          B.i = -ieb/bf_t - icb/br_t - ceb*der(veb) - ccb*der(vcb);