diff --git a/src/spicelib/devices/vbic/vbicacld.c b/src/spicelib/devices/vbic/vbicacld.c index 244ea1561..dd99a2da2 100644 --- a/src/spicelib/devices/vbic/vbicacld.c +++ b/src/spicelib/devices/vbic/vbicacld.c @@ -49,11 +49,8 @@ VBICacLoad(GENmodel *inModel, CKTcircuit *ckt) double Ixf1_Vxf1; double Ixf1_Vrth; - double Ixf2_Vbei; - double Ixf2_Vbci; double Ixf2_Vxf2; double Ixf2_Vxf1; - double Ixf2_Vrth; /* loop through all the models */ for( ; model != NULL; model = VBICnextModel(model)) { @@ -91,15 +88,12 @@ VBICacLoad(GENmodel *inModel, CKTcircuit *ckt) Ixf1_Vbei = *(ckt->CKTstate0 + here->VBICixf1_Vbei); Ixf1_Vbci = *(ckt->CKTstate0 + here->VBICixf1_Vbci); - Ixf1_Vxf2 = *(ckt->CKTstate0 + here->VBICixf1_Vxf2); Ixf1_Vxf1 = *(ckt->CKTstate0 + here->VBICixf1_Vxf1); + Ixf1_Vxf2 = *(ckt->CKTstate0 + here->VBICixf1_Vxf2); Ixf1_Vrth = *(ckt->CKTstate0 + here->VBICixf1_Vrth); - Ixf2_Vbei = *(ckt->CKTstate0 + here->VBICixf2_Vbei); - Ixf2_Vbci = *(ckt->CKTstate0 + here->VBICixf2_Vbci); - Ixf2_Vxf2 = *(ckt->CKTstate0 + here->VBICixf2_Vxf2); Ixf2_Vxf1 = *(ckt->CKTstate0 + here->VBICixf2_Vxf1); - Ixf2_Vrth = *(ckt->CKTstate0 + here->VBICixf2_Vrth); + Ixf2_Vxf2 = *(ckt->CKTstate0 + here->VBICixf2_Vxf2); /* c The real part @@ -247,6 +241,19 @@ c Stamp element: Rs *(here->VBICsubsSISubsPtr) += -Irs_Vrs; *(here->VBICsubsSubsSIPtr) += -Irs_Vrs; + if (here->VBIC_excessPhase) { + //Ixf1 + *(here->VBICxf1BaseBIPtr) += +Ixf1_Vbei; + *(here->VBICxf1EmitEIPtr) += -Ixf1_Vbei; + *(here->VBICxf1BaseBIPtr) += +Ixf1_Vbci; + *(here->VBICxf1CollCIPtr) += -Ixf1_Vbci; + *(here->VBICxf1Xf2Ptr) += +Ixf1_Vxf2; + *(here->VBICxf1Xf1Ptr) += +Ixf1_Vxf1; + //Ixf2 + *(here->VBICxf2Xf2Ptr) += +Ixf2_Vxf2; + *(here->VBICxf2Xf1Ptr) += +Ixf2_Vxf1; + } + if (here->VBIC_selfheat) { Ibe_Vrth = here->VBICibe_Vrth; @@ -350,6 +357,11 @@ c Stamp element: Rs */ *(here->VBICsubsTempPtr) += Irs_Vrth; *(here->VBICsubsSItempPtr) += -Irs_Vrth; + + if (here->VBIC_excessPhase) { +// Stamp element: Ixf1 f_xf1 = + + *(here->VBICxf1TempPtr) += Ixf1_Vrth; + } /* c Stamp element: Rth */ @@ -390,22 +402,6 @@ c Stamp element: Ith *(here->VBICtempSubsPtr) += -Ith_Vrs; *(here->VBICtempSubsSIPtr) += +Ith_Vrs; } - if (here->VBIC_excessPhase) { - //Ixf1 - *(here->VBICxf1BaseBIPtr) += +Ixf1_Vbei; - *(here->VBICxf1EmitEIPtr) += -Ixf1_Vbei; - *(here->VBICxf1BaseBIPtr) += +Ixf1_Vbci; - *(here->VBICxf1CollCIPtr) += -Ixf1_Vbci; - *(here->VBICxf1Xf2Ptr) += +Ixf1_Vxf2; - *(here->VBICxf1Xf1Ptr) += +Ixf1_Vxf1; - //Ixf2 - *(here->VBICxf2BaseBIPtr) += +Ixf2_Vbei; - *(here->VBICxf2EmitEIPtr) += -Ixf2_Vbei; - *(here->VBICxf2BaseBIPtr) += +Ixf2_Vbci; - *(here->VBICxf2CollCIPtr) += -Ixf2_Vbci; - *(here->VBICxf2Xf2Ptr) += +Ixf2_Vxf2; - *(here->VBICxf2Xf1Ptr) += +Ixf2_Vxf1; - } /* c The complex part @@ -517,12 +513,6 @@ c Stamp element: Qbco *(here->VBICbaseBPtempPtr + 1) += -XQbep_Vrth; *(here->VBICsubsSItempPtr + 1) += XQbcp_Vrth; *(here->VBICbaseBPtempPtr + 1) += -XQbcp_Vrth; - if (here->VBIC_excessPhase) { -// Stamp element: Ixf1 f_xf1 = + - *(here->VBICxf1TempPtr) += Ixf1_Vrth; -// Stamp element: Ixf2 f_xf2 = + - *(here->VBICxf2TempPtr) += Ixf2_Vrth; - } } } diff --git a/src/spicelib/devices/vbic/vbicbindCSC.c b/src/spicelib/devices/vbic/vbicbindCSC.c index a5a4721a5..922b36119 100644 --- a/src/spicelib/devices/vbic/vbicbindCSC.c +++ b/src/spicelib/devices/vbic/vbicbindCSC.c @@ -104,7 +104,6 @@ VBICbindCSC (GENmodel *inModel, CKTcircuit *ckt) CREATE_KLU_BINDING_TABLE(VBICtempSubsSIPtr, VBICtempSubsSIBinding, VBICtempNode, VBICsubsSINode); CREATE_KLU_BINDING_TABLE(VBICtempTempPtr, VBICtempTempBinding, VBICtempNode, VBICtempNode); if (here->VBIC_excessPhase) { - CREATE_KLU_BINDING_TABLE(VBICxf2TempPtr, VBICxf2TempBinding, VBICxf2Node, VBICtempNode); CREATE_KLU_BINDING_TABLE(VBICxf1TempPtr, VBICxf1TempBinding, VBICxf1Node, VBICtempNode); } } @@ -117,9 +116,6 @@ VBICbindCSC (GENmodel *inModel, CKTcircuit *ckt) CREATE_KLU_BINDING_TABLE(VBICxf1Xf2Ptr, VBICxf1Xf2Binding, VBICxf1Node, VBICxf2Node); CREATE_KLU_BINDING_TABLE(VBICxf2Xf1Ptr, VBICxf2Xf1Binding, VBICxf2Node, VBICxf1Node); - CREATE_KLU_BINDING_TABLE(VBICxf2BaseBIPtr, VBICxf2BaseBIBinding, VBICxf2Node, VBICbaseBINode); - CREATE_KLU_BINDING_TABLE(VBICxf2EmitEIPtr, VBICxf2EmitEIBinding, VBICxf2Node, VBICemitEINode); - CREATE_KLU_BINDING_TABLE(VBICxf2CollCIPtr, VBICxf2CollCIBinding, VBICxf2Node, VBICcollCINode); CREATE_KLU_BINDING_TABLE(VBICxf2Xf2Ptr, VBICxf2Xf2Binding, VBICxf2Node, VBICxf2Node); CREATE_KLU_BINDING_TABLE(VBICemitEIXf2Ptr, VBICemitEIXf2Binding, VBICemitEINode, VBICxf2Node); CREATE_KLU_BINDING_TABLE(VBICcollCIXf2Ptr, VBICcollCIXf2Binding, VBICcollCINode, VBICxf2Node); @@ -222,7 +218,6 @@ VBICbindCSCComplex (GENmodel *inModel, CKTcircuit *ckt) CONVERT_KLU_BINDING_TABLE_TO_COMPLEX(VBICtempSubsSIPtr, VBICtempSubsSIBinding, VBICtempNode, VBICsubsSINode); CONVERT_KLU_BINDING_TABLE_TO_COMPLEX(VBICtempTempPtr, VBICtempTempBinding, VBICtempNode, VBICtempNode); if (here->VBIC_excessPhase) { - CONVERT_KLU_BINDING_TABLE_TO_REAL(VBICxf2TempPtr, VBICxf2TempBinding, VBICxf2Node, VBICtempNode); CONVERT_KLU_BINDING_TABLE_TO_REAL(VBICxf1TempPtr, VBICxf1TempBinding, VBICxf1Node, VBICtempNode); } } @@ -234,9 +229,6 @@ VBICbindCSCComplex (GENmodel *inModel, CKTcircuit *ckt) CONVERT_KLU_BINDING_TABLE_TO_REAL(VBICxf1Xf2Ptr, VBICxf1Xf2Binding, VBICxf1Node, VBICxf2Node); CONVERT_KLU_BINDING_TABLE_TO_REAL(VBICxf2Xf1Ptr, VBICxf2Xf1Binding, VBICxf2Node, VBICxf1Node); - CONVERT_KLU_BINDING_TABLE_TO_REAL(VBICxf2BaseBIPtr, VBICxf2BaseBIBinding, VBICxf2Node, VBICbaseBINode); - CONVERT_KLU_BINDING_TABLE_TO_REAL(VBICxf2EmitEIPtr, VBICxf2EmitEIBinding, VBICxf2Node, VBICemitEINode); - CONVERT_KLU_BINDING_TABLE_TO_REAL(VBICxf2CollCIPtr, VBICxf2CollCIBinding, VBICxf2Node, VBICcollCINode); CONVERT_KLU_BINDING_TABLE_TO_REAL(VBICxf2Xf2Ptr, VBICxf2Xf2Binding, VBICxf2Node, VBICxf2Node); CONVERT_KLU_BINDING_TABLE_TO_REAL(VBICemitEIXf2Ptr, VBICemitEIXf2Binding, VBICemitEINode, VBICxf2Node); CONVERT_KLU_BINDING_TABLE_TO_REAL(VBICcollCIXf2Ptr, VBICcollCIXf2Binding, VBICcollCINode, VBICxf2Node); @@ -338,7 +330,6 @@ VBICbindCSCComplexToReal (GENmodel *inModel, CKTcircuit *ckt) CONVERT_KLU_BINDING_TABLE_TO_REAL(VBICtempSubsSIPtr, VBICtempSubsSIBinding, VBICtempNode, VBICsubsSINode); CONVERT_KLU_BINDING_TABLE_TO_REAL(VBICtempTempPtr, VBICtempTempBinding, VBICtempNode, VBICtempNode); if (here->VBIC_excessPhase) { - CONVERT_KLU_BINDING_TABLE_TO_REAL(VBICxf2TempPtr, VBICxf2TempBinding, VBICxf2Node, VBICtempNode); CONVERT_KLU_BINDING_TABLE_TO_REAL(VBICxf1TempPtr, VBICxf1TempBinding, VBICxf1Node, VBICtempNode); } } @@ -351,9 +342,6 @@ VBICbindCSCComplexToReal (GENmodel *inModel, CKTcircuit *ckt) CONVERT_KLU_BINDING_TABLE_TO_REAL(VBICxf1Xf2Ptr, VBICxf1Xf2Binding, VBICxf1Node, VBICxf2Node); CONVERT_KLU_BINDING_TABLE_TO_REAL(VBICxf2Xf1Ptr, VBICxf2Xf1Binding, VBICxf2Node, VBICxf1Node); - CONVERT_KLU_BINDING_TABLE_TO_REAL(VBICxf2BaseBIPtr, VBICxf2BaseBIBinding, VBICxf2Node, VBICbaseBINode); - CONVERT_KLU_BINDING_TABLE_TO_REAL(VBICxf2EmitEIPtr, VBICxf2EmitEIBinding, VBICxf2Node, VBICemitEINode); - CONVERT_KLU_BINDING_TABLE_TO_REAL(VBICxf2CollCIPtr, VBICxf2CollCIBinding, VBICxf2Node, VBICcollCINode); CONVERT_KLU_BINDING_TABLE_TO_REAL(VBICxf2Xf2Ptr, VBICxf2Xf2Binding, VBICxf2Node, VBICxf2Node); CONVERT_KLU_BINDING_TABLE_TO_REAL(VBICemitEIXf2Ptr, VBICemitEIXf2Binding, VBICemitEINode, VBICxf2Node); CONVERT_KLU_BINDING_TABLE_TO_REAL(VBICcollCIXf2Ptr, VBICcollCIXf2Binding, VBICcollCINode, VBICxf2Node); diff --git a/src/spicelib/devices/vbic/vbicdefs.h b/src/spicelib/devices/vbic/vbicdefs.h index e0edf1248..1f841e9af 100644 --- a/src/spicelib/devices/vbic/vbicdefs.h +++ b/src/spicelib/devices/vbic/vbicdefs.h @@ -412,10 +412,6 @@ typedef struct sVBICinstance { BindElement *VBICxf1TempBinding ; BindElement *VBICxf1Xf1Binding ; BindElement *VBICxf1Xf2Binding ; - BindElement *VBICxf2BaseBIBinding ; - BindElement *VBICxf2CollCIBinding ; - BindElement *VBICxf2EmitEIBinding ; - BindElement *VBICxf2TempBinding ; BindElement *VBICxf2Xf1Binding ; BindElement *VBICxf2Xf2Binding ; #endif @@ -517,31 +513,26 @@ typedef struct sVBICinstance { #define VBICvrth VBICstate+69 #define VBICicth_Vrth VBICstate+70 -#define VBICqcxf VBICstate+71 -#define VBICcqcxf VBICstate+72 -#define VBICgqcxf VBICstate+73 +#define VBICqxf1 VBICstate+71 +#define VBICcqxf1 VBICstate+72 +#define VBICgqxf1 VBICstate+73 -#define VBICqxf1 VBICstate+74 -#define VBICcqxf1 VBICstate+75 -#define VBICgqxf1 VBICstate+76 -#define VBICixf1 VBICstate+77 -#define VBICixf1_Vbei VBICstate+78 -#define VBICixf1_Vbci VBICstate+79 -#define VBICixf1_Vxf2 VBICstate+80 -#define VBICixf1_Vxf1 VBICstate+81 -#define VBICixf1_Vrth VBICstate+82 +#define VBICixf1 VBICstate+74 +#define VBICixf1_Vbei VBICstate+75 +#define VBICixf1_Vbci VBICstate+76 +#define VBICixf1_Vxf1 VBICstate+77 +#define VBICixf1_Vxf2 VBICstate+78 +#define VBICixf1_Vrth VBICstate+79 -#define VBICqxf2 VBICstate+83 -#define VBICcqxf2 VBICstate+84 -#define VBICgqxf2 VBICstate+85 -#define VBICixf2 VBICstate+86 -#define VBICixf2_Vbei VBICstate+87 -#define VBICixf2_Vbci VBICstate+88 -#define VBICixf2_Vxf1 VBICstate+89 -#define VBICixf2_Vxf2 VBICstate+90 -#define VBICixf2_Vrth VBICstate+91 +#define VBICqxf2 VBICstate+80 +#define VBICcqxf2 VBICstate+81 +#define VBICgqxf2 VBICstate+82 -#define VBICnumStates 92 +#define VBICixf2 VBICstate+83 +#define VBICixf2_Vxf1 VBICstate+84 +#define VBICixf2_Vxf2 VBICstate+85 + +#define VBICnumStates 86 /* per model data */ typedef struct sVBICmodel { /* model structure for a vbic */ diff --git a/src/spicelib/devices/vbic/vbicload.c b/src/spicelib/devices/vbic/vbicload.c index 708d86c82..26851d6ee 100644 --- a/src/spicelib/devices/vbic/vbicload.c +++ b/src/spicelib/devices/vbic/vbicload.c @@ -36,9 +36,7 @@ int vbic_4T_et_cf_fj( double *,double *,double *,double *,double *,double *,double *, double *,double *,double *,double *,double *,double *,double *, double *,double *,double *,double *,double *,double *,double *, - double *, - double *, double *, double *, double *, - double *); + double *,double *); int VBICload(GENmodel *inModel, CKTcircuit *ckt) @@ -66,9 +64,7 @@ VBICload(GENmodel *inModel, CKTcircuit *ckt) ,Qbcp_Vbcp=0.0,Irth,Irth_Vrth=0.0,Ith=0.0,Ith_Vrth=0.0,Ith_Vbei=0.0,Ith_Vbci=0.0 ,Ith_Vcei=0.0,Ith_Vbex=0.0,Ith_Vbep=0.0,Ith_Vrs=0.0,Ith_Vbcp=0.0,Ith_Vcep=0.0,Ith_Vrcx=0.0 ,Ith_Vrci=0.0,Ith_Vbcx=0.0,Ith_Vrbx=0.0,Ith_Vrbi=0.0,Ith_Vre=0.0,Ith_Vrbp=0.0,Qcth=0.0 - ,Qcth_Vrth=0.0 - ,Tf=0.0, Tf_Vbei=0.0, Tf_Vbci=0.0, Tf_Vrth=0.0 - ,SCALE; + ,Qcth_Vrth=0.0,SCALE; int iret; double Vce; @@ -104,9 +100,9 @@ VBICload(GENmodel *inModel, CKTcircuit *ckt) double Iciei, Iciei_Vbei, Iciei_Vbci, Iciei_Vrth, Iciei_Vxf2; //NQS double Ixf1=0.0, Ixf2=0.0, Qxf1=0.0, Qxf2=0.0, Qxf1_Vxf1=0.0, Qxf2_Vxf2=0.0; - double Ixf1_Vxf1=0.0, Ixf1_Vxf2=0.0, Ixf1_ditf=0.0, Ixf1_dTf=0.0, Ixf1_Vbei=0.0, Ixf1_Vbci=0.0, Ixf1_Vrth=0.0; - double Ixf2_Vxf1=0.0, Ixf2_Vbei=0.0, Ixf2_Vbci=0.0, Ixf2_Vrth=0.0; - double Ixf2_Vxf2=0.0, Ixf2_dTf=0.0; + double Ixf1_Vxf1=0.0, Ixf1_Vxf2=0.0, Ixf1_ditf=0.0, Ixf1_Vbei=0.0, Ixf1_Vbci=0.0, Ixf1_Vrth=0.0; + double Ixf2_Vxf1=0.0; + double Ixf2_Vxf2=0.0; double Itxf=0.0; double Itxf_Vxf2=0.0, Itxf_Vbci=0.0, Itxf_Vbei=0.0, Itxf_Vrth=0.0; double Vxf1=0.0, Vxf2=0.0; @@ -409,13 +405,10 @@ VBICload(GENmodel *inModel, CKTcircuit *ckt) *(ckt->CKTstate0+here->VBICqxf2)=*(ckt->CKTstate1+here->VBICqxf2); *(ckt->CKTstate0+here->VBICcqxf2)=*(ckt->CKTstate1+here->VBICcqxf2); *(ckt->CKTstate0+here->VBICgqxf2)=*(ckt->CKTstate1+here->VBICgqxf2); - *(ckt->CKTstate0+here->VBICixf2_Vbei)=*(ckt->CKTstate1+here->VBICixf2_Vbei); - *(ckt->CKTstate0+here->VBICixf2_Vbci)=*(ckt->CKTstate1+here->VBICixf2_Vbci); *(ckt->CKTstate0+here->VBICixf2_Vxf1)=*(ckt->CKTstate1+here->VBICixf2_Vxf1); *(ckt->CKTstate0+here->VBICixf2_Vxf2)=*(ckt->CKTstate1+here->VBICixf2_Vxf2); if (here->VBIC_selfheat) { *(ckt->CKTstate0+here->VBICixf1_Vrth)=*(ckt->CKTstate1+here->VBICixf1_Vrth); - *(ckt->CKTstate0+here->VBICixf2_Vrth)=*(ckt->CKTstate1+here->VBICixf2_Vrth); } } } else { @@ -453,8 +446,6 @@ VBICload(GENmodel *inModel, CKTcircuit *ckt) if (here->VBIC_selfheat) Vrth = *(ckt->CKTrhsOld + here->VBICtempNode); if (here->VBIC_excessPhase) { - // not needed because convergence in NQS network is not checked here - //Vxf1 = *(ckt->CKTrhsOld + here->VBICxf1Node); Vxf2 = *(ckt->CKTrhsOld + here->VBICxf2Node); } #ifndef PREDICTOR @@ -653,11 +644,8 @@ VBICload(GENmodel *inModel, CKTcircuit *ckt) Ixf1_Vxf1 = *(ckt->CKTstate0 + here->VBICixf1_Vxf1); Ixf1_Vrth = *(ckt->CKTstate0 + here->VBICixf1_Vrth); Ixf2 = *(ckt->CKTstate0 + here->VBICixf2); - Ixf2_Vbei = *(ckt->CKTstate0 + here->VBICixf2_Vbei); - Ixf2_Vbci = *(ckt->CKTstate0 + here->VBICixf2_Vbci); Ixf2_Vxf1 = *(ckt->CKTstate0 + here->VBICixf2_Vxf1); Ixf2_Vxf2 = *(ckt->CKTstate0 + here->VBICixf2_Vxf2); - Ixf2_Vrth = *(ckt->CKTstate0 + here->VBICixf2_Vrth); } goto load; } @@ -706,30 +694,24 @@ VBICload(GENmodel *inModel, CKTcircuit *ckt) ,&Iccp_Vbci, &Iccp_Vbcp, &Irs, &Irs_Vrs, &Irs_Vrth, &Qbcp, &Qbcp_Vrth ,&Qbcp_Vbcp, &Irth, &Irth_Vrth, &Ith, &Ith_Vrth, &Ith_Vbei, &Ith_Vbci ,&Ith_Vcei, &Ith_Vbex, &Ith_Vbep, &Ith_Vrs, &Ith_Vbcp, &Ith_Vcep, &Ith_Vrcx - ,&Ith_Vrci, &Ith_Vbcx, &Ith_Vrbx, &Ith_Vrbi, &Ith_Vre, &Ith_Vrbp, &Qcth, &Qcth_Vrth - ,&Tf, &Tf_Vbei, &Tf_Vbci, &Tf_Vrth - ,&SCALE); + ,&Ith_Vrci, &Ith_Vbcx, &Ith_Vrbx, &Ith_Vrbi, &Ith_Vre, &Ith_Vrbp, &Qcth + ,&Qcth_Vrth, &SCALE); here->VBICpower = Ith; // Excess Phase calculation if (here->VBIC_excessPhase) { - Ixf1 = (Vxf2-Itzf)/Tf*model->VBICdelayTimeF; + Ixf1 = Vxf2-Itzf; Ixf1_Vxf1 = 0.0; - Ixf1_Vxf2 = 1.0/Tf*model->VBICdelayTimeF; - Ixf1_ditf = -Ixf1_Vxf2; - Ixf1_dTf = -Ixf1/Tf; - Ixf1_Vbei = Ixf1_ditf*Itzf_Vbei + Ixf1_dTf*Tf_Vbei; - Ixf1_Vbci = Ixf1_ditf*Itzf_Vbci + Ixf1_dTf*Tf_Vbci; - Ixf1_Vrth = Ixf1_ditf*Itzf_Vrth + Ixf1_dTf*Tf_Vrth; + Ixf1_Vxf2 = 1.0; + Ixf1_ditf = -1.0; + Ixf1_Vbei = Ixf1_ditf*Itzf_Vbei; + Ixf1_Vbci = Ixf1_ditf*Itzf_Vbci; + Ixf1_Vrth = Ixf1_ditf*Itzf_Vrth; - Ixf2 = (Vxf2-Vxf1)/Tf*model->VBICdelayTimeF; - Ixf2_Vxf2 = 1.0/Tf*model->VBICdelayTimeF; - Ixf2_Vxf1 = -Ixf2_Vxf2; - Ixf2_dTf = -Ixf2/Tf; - Ixf2_Vbei = Ixf2_dTf*Tf_Vbei; - Ixf2_Vbci = Ixf2_dTf*Tf_Vbci; - Ixf2_Vrth = Ixf2_dTf*Tf_Vrth; + Ixf2 = Vxf2-Vxf1; + Ixf2_Vxf2 = 1.0; + Ixf2_Vxf1 = -1.0; Qxf1 = model->VBICdelayTimeF*Vxf1; Qxf1_Vxf1 = model->VBICdelayTimeF; @@ -737,35 +719,32 @@ VBICload(GENmodel *inModel, CKTcircuit *ckt) Qxf2_Vxf2 = model->VBICdelayTimeF/3; Itxf = Vxf2; - Itxf_Vbei = 0; - Itxf_Vbci = 0; - Itxf_Vrth = 0; + Itxf_Vbei = 0.0; + Itxf_Vbci = 0.0; + Itxf_Vrth = 0.0; Itxf_Vxf2 = 1.0; } else { Ixf1 = Vxf1; Ixf1_Vxf1 = 1.0; - Ixf1_Vxf2 = 0; - Ixf1_Vbei = 0; - Ixf1_Vbci = 0; - Ixf1_Vrth = 0; + Ixf1_Vxf2 = 0.0; + Ixf1_Vbei = 0.0; + Ixf1_Vbci = 0.0; + Ixf1_Vrth = 0.0; Ixf2 = Vxf2; Ixf2_Vxf2 = 1.0; - Ixf2_Vxf1 = 0; - Ixf2_Vbei = 0; - Ixf2_Vbci = 0; - Ixf2_Vrth = 0; + Ixf2_Vxf1 = 0.0; - Qxf1 = 0; - Qxf1_Vxf1 = 0; - Qxf2 = 0; - Qxf2_Vxf2 = 0; + Qxf1 = 0.0; + Qxf1_Vxf1 = 0.0; + Qxf2 = 0.0; + Qxf2_Vxf2 = 0.0; Itxf = Itzf; Itxf_Vbei = Itzf_Vbei; Itxf_Vbci = Itzf_Vbci; Itxf_Vrth = Itzf_Vrth; - Itxf_Vxf2 = 0; + Itxf_Vxf2 = 0.0; } Iciei = Itxf - Itzr; @@ -1049,11 +1028,8 @@ VBICload(GENmodel *inModel, CKTcircuit *ckt) *(ckt->CKTstate0 + here->VBICixf1_Vrth) = Ixf1_Vrth; *(ckt->CKTstate0 + here->VBICixf2) = Ixf2; - *(ckt->CKTstate0 + here->VBICixf2_Vbei) = Ixf2_Vbei; - *(ckt->CKTstate0 + here->VBICixf2_Vbci) = Ixf2_Vbci; *(ckt->CKTstate0 + here->VBICixf2_Vxf1) = Ixf2_Vxf1; *(ckt->CKTstate0 + here->VBICixf2_Vxf2) = Ixf2_Vxf2; - *(ckt->CKTstate0 + here->VBICixf2_Vrth) = Ixf2_Vrth; if (here->VBIC_selfheat) { @@ -1145,7 +1121,7 @@ c Stamp element: Ibex /* c Stamp element: Iciei */ - rhs_current = model->VBICtype * (Iciei - Iciei_Vbei*Vbei - Iciei_Vbci*Vbci - Iciei_Vxf2*Vxf2); + rhs_current = model->VBICtype * (Iciei - Iciei_Vbei*Vbei - Iciei_Vbci*Vbci); *(ckt->CKTrhs + here->VBICcollCINode) += -rhs_current; *(here->VBICcollCIBaseBIPtr) += Iciei_Vbei; *(here->VBICcollCIEmitEIPtr) += -Iciei_Vbei; @@ -1157,6 +1133,9 @@ c Stamp element: Iciei *(here->VBICemitEIBaseBIPtr) += -Iciei_Vbci; *(here->VBICemitEICollCIPtr) += Iciei_Vbci; if (here->VBIC_excessPhase) { + rhs_current = model->VBICtype * (-Iciei_Vxf2*Vxf2); + *(ckt->CKTrhs + here->VBICcollCINode) += -rhs_current; + *(ckt->CKTrhs + here->VBICemitEINode) += rhs_current; // with respect to Vxf2 *(here->VBICcollCIXf2Ptr) += Iciei_Vxf2; *(here->VBICemitEIXf2Ptr) += -Iciei_Vxf2; @@ -1300,7 +1279,7 @@ c Stamp element: Rs if (here->VBIC_excessPhase) { // Branch: xf1-ground, Stamp element: Ixf1 f_xf1=+ rhs_current = Ixf1 - Ixf1_Vbci*Vbci - Ixf1_Vbei*Vbei -Ixf1_Vxf1*Vxf1 - Ixf1_Vxf2*Vxf2; - *(ckt->CKTrhs + here->VBICxf1Node) += -rhs_current; // rhs_current; // into xf1 node + *(ckt->CKTrhs + here->VBICxf1Node) += -rhs_current; // into xf1 node *(here->VBICxf1BaseBIPtr) += +Ixf1_Vbei; *(here->VBICxf1EmitEIPtr) += -Ixf1_Vbei; *(here->VBICxf1BaseBIPtr) += +Ixf1_Vbci; @@ -1309,12 +1288,8 @@ c Stamp element: Rs *(here->VBICxf1Xf1Ptr) += +Ixf1_Vxf1; // Branch: xf2-ground, Stamp element: Ixf2 f_xf2=+ - rhs_current = Ixf2 - Ixf2_Vbci*Vbci - Ixf2_Vbei*Vbei - Ixf2_Vxf1*Vxf1 - Ixf2_Vxf2*Vxf2; - *(ckt->CKTrhs + here->VBICxf2Node) += -rhs_current; // rhs_current; // into xf2 node - *(here->VBICxf2BaseBIPtr) += +Ixf2_Vbei; - *(here->VBICxf2EmitEIPtr) += -Ixf2_Vbei; - *(here->VBICxf2BaseBIPtr) += +Ixf2_Vbci; - *(here->VBICxf2CollCIPtr) += -Ixf2_Vbci; + rhs_current = Ixf2 - Ixf2_Vxf1*Vxf1 - Ixf2_Vxf2*Vxf2; + *(ckt->CKTrhs + here->VBICxf2Node) += -rhs_current; // into xf2 node *(here->VBICxf2Xf2Ptr) += +Ixf2_Vxf2; *(here->VBICxf2Xf1Ptr) += +Ixf2_Vxf1; } @@ -1493,12 +1468,6 @@ c Stamp element: Ith *(ckt->CKTrhs + here->VBICxf1Node) += -rhs_current; // with respect to Potential Vxf1 *(here->VBICxf1TempPtr) += Ixf1_Vrth; - -// Stamp element: Ixf2 f_xf2 = + - rhs_current = -Ixf2_Vrth*Vrth; - *(ckt->CKTrhs + here->VBICxf2Node) += -rhs_current; - // with respect to Potential Vxf2 - *(here->VBICxf2TempPtr) += Ixf2_Vrth; } } } @@ -1524,9 +1493,8 @@ int vbic_4T_et_cf_fj(double *p ,double *Iccp_Vbci, double *Iccp_Vbcp, double *Irs, double *Irs_Vrs, double *Irs_Vrth, double *Qbcp, double *Qbcp_Vrth ,double *Qbcp_Vbcp, double *Irth, double *Irth_Vrth, double *Ith, double *Ith_Vrth, double *Ith_Vbei, double *Ith_Vbci ,double *Ith_Vcei, double *Ith_Vbex, double *Ith_Vbep, double *Ith_Vrs, double *Ith_Vbcp, double *Ith_Vcep, double *Ith_Vrcx - ,double *Ith_Vrci, double *Ith_Vbcx, double *Ith_Vrbx, double *Ith_Vrbi, double *Ith_Vre, double *Ith_Vrbp, double *Qcth, double *Qcth_Vrth - ,double *tff, double *tff_Vbei, double *tff_Vbci, double *tff_Vrth - ,double *SCALE) + ,double *Ith_Vrci, double *Ith_Vbcx, double *Ith_Vrbx, double *Ith_Vrbi, double *Ith_Vre, double *Ith_Vrbp, double *Qcth + ,double *Qcth_Vrth, double *SCALE) { double Tini,Tdev,Tdev_Vrth,Vtv,Vtv_Tdev,Vtv_Vrth,rT; double rT_Tdev,rT_Vrth,dT,dT_Tdev,dT_Vrth,xvar1,xvar1_rT; @@ -1611,13 +1579,12 @@ double derf_IVO,derf_Vrth,derf_RCIatT,derf_Iohm,derf_Vrci,derf_Vbci,derf_Vbcx; double Irci_Iohm,Irci_derf,Irbx_RBXatT,Irbi_qb,Irbi_RBIatT,Ire_REatT,Irbp_qbp; double Irbp_RBPatT,argn_Vbcp,expn_Vbcp,Ibcp_IBCIPatT,Ibcp_expi,Ibcp_IBCNPatT,Ibcp_expn; double Irs_RSatT,sgIf,rIf,rIf_Ifi,rIf_Vrth,rIf_Vbei,mIf; -double mIf_rIf,mIf_Vrth,mIf_Vbei,tff_q1; -double tff_xvar2,tff_mIf,Qbe_CJEatT,Qbe_qdbe,Qbe_tff,Qbe_Ifi; +double mIf_rIf,mIf_Vrth,mIf_Vbei,tff,tff_q1,tff_Vrth,tff_Vbei; +double tff_Vbci,tff_xvar2,tff_mIf,Qbe_CJEatT,Qbe_qdbe,Qbe_tff,Qbe_Ifi; double Qbe_qb,Qbex_CJEatT,Qbex_qdbex,Qbc_CJCatT,Qbc_qdbc,Qbc_Iri,Qbc_Kbci; double Qbcx_Kbcx,Qbep_CJEPatT,Qbep_qdbep,Qbep_Ifp,Qbcp_CJCPatT,Qbcp_qdbcp,Ith_Ibe; double Ith_Ibc,Ith_Itzf,Ith_Itzr,Ith_Ibex,Ith_Ibep,Ith_Irs,Ith_Ibcp; double Ith_Iccp,Ith_Ircx,Ith_Irci,Ith_Irbx,Ith_Irbi,Ith_Ire,Ith_Irbp; -//double tff, tff_Vbei, tff_Vbci, tff_Vrth; /* Function and derivative code */ @@ -3891,28 +3858,28 @@ double Ith_Iccp,Ith_Ircx,Ith_Irci,Ith_Irbx,Ith_Irbi,Ith_Ire,Ith_Irbp; xvar2=exp(xvar1); xvar2_xvar1=xvar2; xvar2_Vbci=xvar2_xvar1*xvar1_Vbci; - *tff=p[56]*(1.0+p[57]*q1)*(1.0+p[58]*xvar2*(slTF+mIf*mIf)*sgIf); + tff=p[56]*(1.0+p[57]*q1)*(1.0+p[58]*xvar2*(slTF+mIf*mIf)*sgIf); tff_q1=p[57]*p[56]*(sgIf*(slTF+(mIf*mIf))*p[58]*xvar2+1.0); tff_xvar2=(q1*p[57]+1.0)*sgIf*(slTF+(mIf*mIf))*p[56]*p[58]; tff_mIf=2.0*mIf*(q1*p[57]+1.0)*sgIf*p[56]*p[58]*xvar2; - *tff_Vrth=tff_q1*q1_Vrth; - *tff_Vbei=tff_q1*q1_Vbei; - *tff_Vbci=tff_q1*q1_Vbci; - *tff_Vbci=*tff_Vbci+tff_xvar2*xvar2_Vbci; - *tff_Vrth=*tff_Vrth+tff_mIf*mIf_Vrth; - *tff_Vbei=*tff_Vbei+tff_mIf*mIf_Vbei; - (*Qbe)=CJEatT*qdbe*p[32]+*tff*Ifi/qb; + tff_Vrth=tff_q1*q1_Vrth; + tff_Vbei=tff_q1*q1_Vbei; + tff_Vbci=tff_q1*q1_Vbci; + tff_Vbci=tff_Vbci+tff_xvar2*xvar2_Vbci; + tff_Vrth=tff_Vrth+tff_mIf*mIf_Vrth; + tff_Vbei=tff_Vbei+tff_mIf*mIf_Vbei; + (*Qbe)=CJEatT*qdbe*p[32]+tff*Ifi/qb; Qbe_CJEatT=qdbe*p[32]; Qbe_qdbe=CJEatT*p[32]; Qbe_tff=Ifi/qb; - Qbe_Ifi=*tff/qb; - Qbe_qb=-Ifi* *tff/(qb*qb); + Qbe_Ifi=tff/qb; + Qbe_qb=-Ifi*tff/(qb*qb); *Qbe_Vrth=Qbe_CJEatT*CJEatT_Vrth; *Qbe_Vrth=(*Qbe_Vrth)+Qbe_qdbe*qdbe_Vrth; *Qbe_Vbei=Qbe_qdbe*qdbe_Vbei; - *Qbe_Vrth=(*Qbe_Vrth)+Qbe_tff* *tff_Vrth; - *Qbe_Vbei=(*Qbe_Vbei)+Qbe_tff* *tff_Vbei; - *Qbe_Vbci=Qbe_tff* *tff_Vbci; + *Qbe_Vrth=(*Qbe_Vrth)+Qbe_tff*tff_Vrth; + *Qbe_Vbei=(*Qbe_Vbei)+Qbe_tff*tff_Vbei; + *Qbe_Vbci=Qbe_tff*tff_Vbci; *Qbe_Vrth=(*Qbe_Vrth)+Qbe_Ifi*Ifi_Vrth; *Qbe_Vbei=(*Qbe_Vbei)+Qbe_Ifi*Ifi_Vbei; *Qbe_Vrth=(*Qbe_Vrth)+Qbe_qb*qb_Vrth; diff --git a/src/spicelib/devices/vbic/vbicpzld.c b/src/spicelib/devices/vbic/vbicpzld.c index aae665655..153e49618 100644 --- a/src/spicelib/devices/vbic/vbicpzld.c +++ b/src/spicelib/devices/vbic/vbicpzld.c @@ -49,11 +49,8 @@ VBICpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s) double Ixf1_Vxf1; double Ixf1_Vrth; - double Ixf2_Vbei; - double Ixf2_Vbci; double Ixf2_Vxf2; double Ixf2_Vxf1; - double Ixf2_Vrth; /* loop through all the models */ for( ; model != NULL; model = VBICnextModel(model)) { @@ -95,11 +92,8 @@ VBICpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s) Ixf1_Vxf1 = *(ckt->CKTstate0 + here->VBICixf1_Vxf1); Ixf1_Vrth = *(ckt->CKTstate0 + here->VBICixf1_Vrth); - Ixf2_Vbei = *(ckt->CKTstate0 + here->VBICixf2_Vbei); - Ixf2_Vbci = *(ckt->CKTstate0 + here->VBICixf2_Vbci); Ixf2_Vxf2 = *(ckt->CKTstate0 + here->VBICixf2_Vxf2); Ixf2_Vxf1 = *(ckt->CKTstate0 + here->VBICixf2_Vxf1); - Ixf2_Vrth = *(ckt->CKTstate0 + here->VBICixf2_Vrth); /* c The real part @@ -400,10 +394,6 @@ c Stamp element: Ith *(here->VBICxf1Xf2Ptr) += +Ixf1_Vxf2; *(here->VBICxf1Xf1Ptr) += +Ixf1_Vxf1; //Ixf2 - *(here->VBICxf2BaseBIPtr) += +Ixf2_Vbei; - *(here->VBICxf2EmitEIPtr) += -Ixf2_Vbei; - *(here->VBICxf2BaseBIPtr) += +Ixf2_Vbci; - *(here->VBICxf2CollCIPtr) += -Ixf2_Vbci; *(here->VBICxf2Xf2Ptr) += +Ixf2_Vxf2; *(here->VBICxf2Xf1Ptr) += +Ixf2_Vxf1; } @@ -576,8 +566,6 @@ c Stamp element: Qbco if (here->VBIC_excessPhase) { // Stamp element: Ixf1 f_xf1 = + *(here->VBICxf1TempPtr) += Ixf1_Vrth; -// Stamp element: Ixf2 f_xf2 = + - *(here->VBICxf2TempPtr) += Ixf2_Vrth; } } diff --git a/src/spicelib/devices/vbic/vbicsetup.c b/src/spicelib/devices/vbic/vbicsetup.c index 097bfa469..cd16520c2 100644 --- a/src/spicelib/devices/vbic/vbicsetup.c +++ b/src/spicelib/devices/vbic/vbicsetup.c @@ -606,7 +606,6 @@ do { if((here->ptr = SMPmakeElt(matrix, here->first, here->second)) == NULL){\ TSTALLOC(VBICtempSubsSIPtr,VBICtempNode,VBICsubsSINode); TSTALLOC(VBICtempTempPtr,VBICtempNode,VBICtempNode); if (here->VBIC_excessPhase) { - TSTALLOC(VBICxf2TempPtr ,VBICxf2Node ,VBICtempNode); TSTALLOC(VBICxf1TempPtr ,VBICxf1Node ,VBICtempNode); } } @@ -619,9 +618,6 @@ do { if((here->ptr = SMPmakeElt(matrix, here->first, here->second)) == NULL){\ TSTALLOC(VBICxf1Xf2Ptr ,VBICxf1Node ,VBICxf2Node); TSTALLOC(VBICxf2Xf1Ptr ,VBICxf2Node ,VBICxf1Node); - TSTALLOC(VBICxf2BaseBIPtr,VBICxf2Node ,VBICbaseBINode); - TSTALLOC(VBICxf2EmitEIPtr,VBICxf2Node ,VBICemitEINode); - TSTALLOC(VBICxf2CollCIPtr,VBICxf2Node ,VBICcollCINode); TSTALLOC(VBICxf2Xf2Ptr ,VBICxf2Node ,VBICxf2Node); TSTALLOC(VBICemitEIXf2Ptr,VBICemitEINode,VBICxf2Node); TSTALLOC(VBICcollCIXf2Ptr,VBICcollCINode,VBICxf2Node); @@ -686,8 +682,8 @@ VBICunsetup( if(here->VBICxf2Node > 0) CKTdltNNum(ckt, here->VBICxf2Node); here->VBICxf2Node = 0; - } + } } return OK;