prevent false branch because of rounding error for flcomp

This commit is contained in:
dwarning 2020-07-06 21:37:04 +02:00
parent 4bb09b35c3
commit 4c34e54c7b
5 changed files with 7 additions and 7 deletions

View File

@ -121,7 +121,7 @@ HICUMacLoad(GENmodel *inModel, CKTcircuit *ckt)
for( ; model != NULL; model = HICUMnextModel(model)) {
int selfheat = ( (model->HICUMflsh > 0) && (model->HICUMrthGiven) && (model->HICUMrth > 0.0));
int nqs = ( (model->HICUMflnqs != 0 || model->HICUMflcomp == 0.0 || model->HICUMflcomp == 2.1) && (model->HICUMalit > 0 || model->HICUMalqf > 0));
int nqs = ( (model->HICUMflnqs != 0 || model->HICUMflcomp < 2.3) && (model->HICUMalit > 0 || model->HICUMalqf > 0));
/* loop through all the instances of the model */
for( here = HICUMinstances(model); here!= NULL;

View File

@ -123,7 +123,7 @@ HICUMpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s)
for( ; model != NULL; model = HICUMnextModel(model)) {
int selfheat = ( (model->HICUMflsh > 0) && (model->HICUMrthGiven) && (model->HICUMrth > 0.0));
int nqs = ( (model->HICUMflnqs != 0 || model->HICUMflcomp == 0.0 || model->HICUMflcomp == 2.1) && (model->HICUMalit > 0 || model->HICUMalqf > 0));
int nqs = ( (model->HICUMflnqs != 0 || model->HICUMflcomp < 2.3) && (model->HICUMalit > 0 || model->HICUMalqf > 0));
/* loop through all the instances of the model */
for( here = HICUMinstances(model); here!= NULL;

View File

@ -38,7 +38,7 @@ HICUMsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
for( ; model != NULL; model = HICUMnextModel(model)) {
int selfheat = (((model->HICUMflsh == 1) || (model->HICUMflsh == 2)) && (model->HICUMrthGiven) && (model->HICUMrth > 0.0));
int nqs = ( (model->HICUMflnqs != 0 || model->HICUMflcomp == 0.0 || model->HICUMflcomp == 2.1) && (model->HICUMalit > 0 || model->HICUMalqf > 0));
int nqs = ( (model->HICUMflnqs != 0 || model->HICUMflcomp < 2.3) && (model->HICUMalit > 0 || model->HICUMalqf > 0));
//Circuit simulator specific parameters
if(model->HICUMtype != NPN && model->HICUMtype != PNP)

View File

@ -629,7 +629,7 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
FCdfc_dw = FCf_CT*(FCa1*FCdf1_dw+FCda1_dw*FCf1-FCdf2_dw+FCdf3_dw);
FCdw_ditf = FCdw_daick*FCdaick_ditf;
FCdfc_ditf = FCdfc_dw*FCdw_ditf;
if(model->HICUMflcomp == 0.0 || model->HICUMflcomp == 2.1) {
if(model->HICUMflcomp < 2.3) {
HICFCT(model->HICUMlatb,FCw,&FCf2,&FCdf2_dw);
HICFCT(model->HICUMlatl,FCw,&FCf3,&FCdf3_dw);
FCf_CT = FCf_CT*(FCf2-FCf3);
@ -656,7 +656,7 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
FCdfc_dw = 2.0*FCw*(FCz_1+FCz*FCz/3.0)*FCd_f*FCd_f;
FCdw_ditf = FCdw_daick*FCdaick_ditf;
FCdfc_ditf = FCdfc_dw*FCdw_ditf;
if(model->HICUMflcomp == 0.0 || model->HICUMflcomp == 2.1){
if(model->HICUMflcomp < 2.3){
if (FCz > 0.001){
FCf_CT = 2.0*(FCz_1*log(FCz_1)-FCz)/(model->HICUMlatb*model->HICUMlatb*FCz_1);
FCdfCT_dw = 2.0*FCw*FCd_f*FCd_f;
@ -1197,7 +1197,7 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
// Model_initialization
int selfheat = ((model->HICUMflsh > 0) && (model->HICUMrthGiven) && (model->HICUMrth > 0.0));
int nqs = ((model->HICUMflnqs != 0 || model->HICUMflcomp == 0.0 || model->HICUMflcomp == 2.1) && (model->HICUMalit > 0 || model->HICUMalqf > 0));
int nqs = ((model->HICUMflnqs != 0 || model->HICUMflcomp < 2.3) && (model->HICUMalit > 0 || model->HICUMalqf > 0));
// Avoid divide-by-zero and define infinity other way
// High current correction for 2D and 3D effects

View File

@ -197,7 +197,7 @@ int hicum_thermal_update(HICUMmodel *inModel, HICUMinstance *inInstance, double
vdei_t.rpart(here->HICUMvdei_t.rpart);
vdei_t.dpart(here->HICUMvdei_t.dpart);
if (model->HICUMflcomp == 0.0 || model->HICUMflcomp == 2.1) {
if (model->HICUMflcomp < 2.3) {
duals::duald V_gT, r_VgVT, k;
V_gT = 3.0*vt*ln_qtt0 + model->HICUMvgb*(qtt0-1.0);
r_VgVT = V_gT/vt;