Changeset 1039 for trunk/Modelica/Electrical/Analog/Semiconductors.mo
- Timestamp:
- 02/07/08 20:24:26 (10 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modelica/Electrical/Analog/Semiconductors.mo
r1024 r1039 116 116 height=0.63)); 117 117 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)); 120 120 end Diode; 121 121 … … 238 238 gds = if (RDS < 1.e-20 and RDS > -1.e-20) then 1.e20 else 1/RDS; 239 239 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); 242 242 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); 244 244 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); 247 247 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); 250 250 B.i = 0; 251 251 end PMOS; … … 374 374 gds = if (RDS < 1.e-20 and RDS > -1.e-20) then 1.e20 else 1/RDS; 375 375 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); 377 377 us = if (D.v < S.v) then D.v else S.v; 378 378 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); 380 380 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*(ugst382 - 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); 383 383 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); 386 386 B.i = 0; 387 387 end NMOS; … … 514 514 qbk = 1 - vbc*Vak; 515 515 516 ibc = noEvent(smooth(1,if (vbc/Vt < EMin) then Is*(ExMin*(vbc/Vt - EMin + 1) - 1) + vbc*Gbc else516 ibc = smooth(1,if (vbc/Vt < EMin) then Is*(ExMin*(vbc/Vt - EMin + 1) - 1) + vbc*Gbc else 517 517 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 else518 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 520 520 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 - vbc523 /Phic, -Mc))) );524 Capcje = noEvent(smooth(1,(if (vbe/Phie > 0) then Cje*(1 + Me*vbe/Phie) else Cje*pow(1 - vbe525 /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) + 527 527 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) + 530 530 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)); 532 532 C.i = (ibe - ibc)*qbk - ibc/Br - cbc*der(vbc) + Ccs*der(C.v); 533 533 B.i = ibe/Bf + ibc/Br + cbc*der(vbc) + cbe*der(vbe); … … 656 656 qbk = 1 - vbc*Vak; 657 657 658 ibc = noEvent(smooth(1,(if (vbc/Vt < EMin) then Is*(ExMin*(vbc/Vt - EMin + 1) - 1) + vbc*Gbc else658 ibc = smooth(1,(if (vbc/Vt < EMin) then Is*(ExMin*(vbc/Vt - EMin + 1) - 1) + vbc*Gbc else 659 659 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 else660 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 663 663 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 - vbc667 /Phic, -Mc))) );668 Capcje = noEvent(smooth(1,if (vbe/Phie > 0) then Cje*(1 + Me*vbe/Phie) else Cje*pow(1 - vbe669 /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) + 671 671 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) + 674 674 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)); 676 676 C.i = -((ibe - ibc)*qbk - ibc/Br - cbc*der(vbc) - Ccs*der(C.v)); 677 677 B.i = -(ibe/Bf + ibc/Br + cbe*der(vbe) + cbc*der(vbc)); … … 935 935 gds = if (RDS < 1.e-20 and RDS > -1.e-20) then 1.e20 else 1/RDS; 936 936 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); 939 939 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); 941 941 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); 944 944 945 945 beta_t = Beta*pow((heatPort.T/Tnom), -1.5); … … 948 948 949 949 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); 952 952 B.i = 0; 953 953 heatPort.Q_flow = -D.i*(D.v - S.v); … … 1099 1099 gds = if (RDS < 1.e-20 and RDS > -1.e-20) then 1.e20 else 1/RDS; 1100 1100 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); 1103 1103 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); 1105 1105 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); 1108 1108 1109 1109 beta_t = Beta*pow((heatPort.T/Tnom), -1.5); … … 1112 1112 1113 1113 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); 1116 1116 B.i = 0; 1117 1117 heatPort.Q_flow = -D.i*(D.v - S.v); … … 1278 1278 1279 1279 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)); 1282 1282 1283 1283 is_t = Is*pow((heatPort.T/Tnom), XTI)*htempexp; … … 1286 1286 vt_t = (K/q)*heatPort.T; 1287 1287 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) - 1289 1289 EMin + 1) - 1) + vbc*Gbc else if (vbc/(NR*vt_t) > EMax) then is_t*( 1290 1290 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) - 1293 1293 EMin + 1) - 1) + vbe*Gbe else if (vbe/(NF*vt_t) > EMax) then is_t*( 1294 1294 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(11297 - vbc/Phic, -Mc))) );1298 Capcje = noEvent(smooth(1,(if (vbe/Phie > 0) then Cje*(1 + Me*vbe/Phie) else Cje*pow(11299 - 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/( 1301 1301 NR*vt_t) - EMin + 1) + Capcjc else if (vbc/(NR*vt_t) > EMax) then 1302 1302 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/( 1305 1305 NF*vt_t) - EMin + 1) + Capcje else if (vbe/(NF*vt_t) > EMax) then 1306 1306 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)); 1308 1308 C.i = (ibe - ibc)*qbk - ibc/br_t - cbc*der(vbc) + Ccs*der(C.v); 1309 1309 B.i = ibe/bf_t + ibc/br_t + cbc*der(vbc) + cbe*der(vbe); … … 1468 1468 1469 1469 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)); 1472 1472 1473 1473 is_t = Is*pow((heatPort.T/Tnom), XTI)*htempexp; … … 1476 1476 vt_t = (K/q)*heatPort.T; 1477 1477 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) - 1479 1479 EMin + 1) - 1) + vcb*Gbc else if (vcb/(NR*vt_t) > EMax) then is_t*( 1480 1480 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) - 1484 1484 EMin + 1) - 1) + veb*Gbe else if (veb/(NF*vt_t) > EMax) then is_t*( 1485 1485 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(11489 - vcb/Phic, -Mc))) );1490 Capcje = noEvent(smooth(1,(if (veb/Phie > 0) then Cje*(1 + Me*veb/Phie) else Cje*pow(11491 - 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/( 1493 1493 NR*vt_t) - EMin + 1) + Capcjc else if (vcb/(NR*vt_t) > EMax) then 1494 1494 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/( 1497 1497 NF*vt_t) - EMin + 1) + Capcje else if (veb/(NF*vt_t) > EMax) then 1498 1498 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)); 1500 1500 C.i = icb/br_t + ccb*der(vcb) + Ccs*der(C.v) + (icb - ieb)*qbk; 1501 1501 B.i = -ieb/bf_t - icb/br_t - ceb*der(veb) - ccb*der(vcb);
