fix a small inconsistency in temperature dependent charge calculation

This commit is contained in:
dwarning 2018-07-19 14:08:35 +02:00
parent a2b52b588e
commit 3bae0e371c
4 changed files with 18 additions and 14 deletions

View File

@ -73,6 +73,10 @@ typedef struct sBJTinstance {
double BJTtf1; /* temperature adjusted polynomial coefficient */
double BJTtf4; /* temperature adjusted polynomial coefficient */
double BJTtf5; /* temperature adjusted polynomial coefficient */
double BJTtf2; /* temperature adjusted polynomial coefficient */
double BJTtf3; /* temperature adjusted polynomial coefficient */
double BJTtf6; /* temperature adjusted polynomial coefficient */
double BJTtf7; /* temperature adjusted polynomial coefficient */
double BJTtVcrit; /* temperature adjusted critical voltage */
double BJTtSubVcrit; /* temperature adjusted substrate critical voltage */
double BJTtSubSatCur; /* temperature adjusted subst. saturation current */

View File

@ -580,8 +580,8 @@ int BJTdSetup(GENmodel *inModel, CKTcircuit *ckt)
czbe*xme*(xme+1)*sarg/(arg*arg*pe*pe*6);
} else {
f1=here->BJTtf1;
f2=model->BJTf2;
f3=model->BJTf3;
f2=here->BJTtf2;
f3=here->BJTtf3;
czbef2=czbe/f2;
lcapbe1 = czbef2*(f3+xme*vbe/pe);
lcapbe2 = 0.5*xme*czbef2/pe;
@ -594,8 +594,8 @@ int BJTdSetup(GENmodel *inModel, CKTcircuit *ckt)
fcpc=here->BJTtf4;
f1=here->BJTtf5;
f2=model->BJTf6;
f3=model->BJTf7;
f2=here->BJTtf6;
f3=here->BJTtf7;
if (vbc < fcpc) {
arg=1-vbc/pc;
sarg=exp(-xmc*log(arg));

View File

@ -593,8 +593,8 @@ next1: vtn=vt*here->BJTtemissionCoeffF;
capbe=tf*gbe+czbe*sarg;
} else {
f1=here->BJTtf1;
f2=model->BJTf2;
f3=model->BJTf3;
f2=here->BJTtf2;
f3=here->BJTtf3;
czbef2=czbe/f2;
*(ckt->CKTstate0 + here->BJTqbe) = tf*cbe+czbe*f1+czbef2*
(f3*(vbe-fcpe) +(xme/(pe+pe))*(vbe*vbe-fcpe*fcpe));
@ -602,8 +602,8 @@ next1: vtn=vt*here->BJTtemissionCoeffF;
}
fcpc=here->BJTtf4;
f1=here->BJTtf5;
f2=model->BJTf6;
f3=model->BJTf7;
f2=here->BJTtf6;
f3=here->BJTtf7;
if (vbc < fcpc) {
arg=1-vbc/pc;
sarg=exp(-xmc*log(arg));

View File

@ -92,12 +92,6 @@ BJTtemp(GENmodel *inModel, CKTcircuit *ckt)
model->BJTdepletionCapCoeff=.5;
}
xfc = log(1-model->BJTdepletionCapCoeff);
model->BJTf2 = exp((1 + model->BJTjunctionExpBE) * xfc);
model->BJTf3 = 1 - model->BJTdepletionCapCoeff *
(1 + model->BJTjunctionExpBE);
model->BJTf6 = exp((1+model->BJTjunctionExpBC)*xfc);
model->BJTf7 = 1 - model->BJTdepletionCapCoeff *
(1 + model->BJTjunctionExpBC);
/* loop through all the instances of the model */
for (here = BJTinstances(model); here != NULL ;
@ -265,6 +259,12 @@ BJTtemp(GENmodel *inModel, CKTcircuit *ckt)
log(vt / (CONSTroot2*here->BJTtSatCur*here->BJTarea));
here->BJTtSubVcrit = vt *
log(vt / (CONSTroot2*here->BJTtSubSatCur*here->BJTarea));
here->BJTtf2 = exp((1 + here->BJTtjunctionExpBE) * xfc);
here->BJTtf3 = 1 - model->BJTdepletionCapCoeff *
(1 + here->BJTtjunctionExpBE);
here->BJTtf6 = exp((1 + here->BJTtjunctionExpBC)*xfc);
here->BJTtf7 = 1 - model->BJTdepletionCapCoeff *
(1 + here->BJTtjunctionExpBC);
}
}