diff --git a/src/spicelib/devices/hicum2/hicum2acld.c b/src/spicelib/devices/hicum2/hicum2acld.c index 7e8062c76..15aab5dc8 100644 --- a/src/spicelib/devices/hicum2/hicum2acld.c +++ b/src/spicelib/devices/hicum2/hicum2acld.c @@ -101,13 +101,19 @@ HICUMacLoad(GENmodel *inModel, CKTcircuit *ckt) double Ixf1_Vbiei; double Ixf1_Vbici; double Ixf1_Vxf2 ; + double Ixf1_Vxf1 ; + double Ixf1_Vrth ; double Ixf2_Vbiei; double Ixf2_Vbici; double Ixf2_Vxf2 ; + double Ixf2_Vxf1 ; + double Ixf2_Vrth ; double Ixf_Vbiei ; double Ixf_Vbici ; + double Ixf_Vxf ; + double Ixf_Vrth ; double Ith_Vrth, Ith_Vbiei, Ith_Vbici, Ith_Vbpbi, Ith_Vbpci, Ith_Vbpei, Ith_Vciei, Ith_Vsici, Ith_Vcic, Ith_Vbbp, Ith_Veie; @@ -177,13 +183,19 @@ HICUMacLoad(GENmodel *inModel, CKTcircuit *ckt) Ixf1_Vbiei = *(ckt->CKTstate0 + here->HICUMixf1_Vbiei); Ixf1_Vbici = *(ckt->CKTstate0 + here->HICUMixf1_Vbici); Ixf1_Vxf2 = *(ckt->CKTstate0 + here->HICUMixf1_Vxf2); + Ixf1_Vxf1 = *(ckt->CKTstate0 + here->HICUMixf1_Vxf1); + Ixf1_Vrth = *(ckt->CKTstate0 + here->HICUMixf1_Vrth); Ixf2_Vbiei = *(ckt->CKTstate0 + here->HICUMixf1_Vbiei); Ixf2_Vbici = *(ckt->CKTstate0 + here->HICUMixf1_Vbici); Ixf2_Vxf2 = *(ckt->CKTstate0 + here->HICUMixf1_Vxf2); + Ixf2_Vxf1 = *(ckt->CKTstate0 + here->HICUMixf1_Vxf1); + Ixf2_Vrth = *(ckt->CKTstate0 + here->HICUMixf1_Vrth); - Ixf_Vbiei = *(ckt->CKTstate0 + here->HICUMixf1_Vbiei); - Ixf_Vbici = *(ckt->CKTstate0 + here->HICUMixf1_Vbici); + Ixf_Vbiei = *(ckt->CKTstate0 + here->HICUMixf_Vbiei); + Ixf_Vbici = *(ckt->CKTstate0 + here->HICUMixf_Vbici); + Ixf_Vxf = *(ckt->CKTstate0 + here->HICUMixf_Vxf); + Ixf_Vrth = *(ckt->CKTstate0 + here->HICUMixf_Vrth); //////////////////////////////////// ////////// The real part ///////// @@ -293,6 +305,7 @@ HICUMacLoad(GENmodel *inModel, CKTcircuit *ckt) *(here->HICUMxf1BaseBIPtr) += +Ixf1_Vbici; *(here->HICUMxf1CollCIPtr) += -Ixf1_Vbici; *(here->HICUMxf1Xf2Ptr) += +Ixf1_Vxf2; + *(here->HICUMxf1Xf1Ptr) += +Ixf1_Vxf1; //Ixf2 *(here->HICUMxf2BaseBIPtr) += +Ixf2_Vbiei; @@ -300,12 +313,14 @@ HICUMacLoad(GENmodel *inModel, CKTcircuit *ckt) *(here->HICUMxf2BaseBIPtr) += +Ixf2_Vbici; *(here->HICUMxf2CollCIPtr) += -Ixf2_Vbici; *(here->HICUMxf2Xf2Ptr) += +Ixf2_Vxf2; + *(here->HICUMxf2Xf1Ptr) += +Ixf2_Vxf1; //Ixf *(here->HICUMxfBaseBIPtr) += +Ixf_Vbiei; *(here->HICUMxfEmitEIPtr) += -Ixf_Vbiei; *(here->HICUMxfBaseBIPtr) += +Ixf_Vbici; *(here->HICUMxfCollCIPtr) += -Ixf_Vbici; + *(here->HICUMxfXfPtr) += +Ixf_Vxf; //////////////////////////////////// ////////// The complex part ////// @@ -421,11 +436,10 @@ HICUMacLoad(GENmodel *inModel, CKTcircuit *ckt) *(here->HICUMcollCICollCIPtr +1) += XQdsu_Vbpci; *(here->HICUMbaseBPCollCIPtr +1) += -XQdsu_Vbpci; *(here->HICUMcollCIBaseBPPtr +1) += -XQdsu_Vbpci; - // these matrix entries are not implemented - // *(here->HICUMbaseBPsubsSIPtr +1) += XQdsu_Vsici; - // *(here->HICUMcollCIcollCIPtr +1) += XQdsu_Vsici; - // *(here->HICUMcollCIsubsSIPtr +1) += -XQdsu_Vsici; - // *(here->HICUMsubsSIbaseBPPtr +1) += -XQdsu_Vsici; + *(here->HICUMbaseBPBaseBPPtr +1) += XQdsu_Vsici; + *(here->HICUMsubsSISubsSIPtr +1) += XQdsu_Vsici; + *(here->HICUMbaseBPSubsSIPtr +1) += -XQdsu_Vsici; + *(here->HICUMsubsSIBaseBPPtr +1) += -XQdsu_Vsici; //Qjs *(here->HICUMsubsSISubsSIPtr +1) += XQjs_Vsici; *(here->HICUMcollCICollCIPtr +1) += XQjs_Vsici; @@ -504,6 +518,12 @@ HICUMacLoad(GENmodel *inModel, CKTcircuit *ckt) // Branch: bpsi, Stamp element: Its *(here->HICUMbaseBPtempPtr) += Ibpsi_Vrth; *(here->HICUMsubsSItempPtr) += -Ibpsi_Vrth; +// Stamp element: Ixf f_xf = + + *(here->HICUMxfTempPtr) += Ixf_Vrth; +// Stamp element: Ixf1 f_xf1 = + + *(here->HICUMxf1TempPtr) += Ixf1_Vrth; +// Stamp element: Ixf2 f_xf2 = + + *(here->HICUMxf2TempPtr) += Ixf2_Vrth; // Stamp element: Ith f_T = - Ith // with respect to Potential Vrth @@ -572,9 +592,8 @@ HICUMacLoad(GENmodel *inModel, CKTcircuit *ckt) *(here->HICUMsubsSItempPtr + 1) += -XQjs_Vrth; *(here->HICUMcollCItempPtr + 1) += +XQjs_Vrth; //Qscp from S to C f_S =- f_C =+ - // Jacobian entry not implemented - // *(here->HICUMsubsTempPtr + 1) += -XQscp_Vrth; - // *(here->HICUMcollTempPtr + 1) += +XQscp_Vrth; + *(here->HICUMsubsTempPtr + 1) += -XQscp_Vrth; + *(here->HICUMcollTempPtr + 1) += +XQscp_Vrth; //Qcth from 0 to T f_0=- f_T=+ *(here->HICUMtempTempPtr + 1) += -XQcth_Vrth; diff --git a/src/spicelib/devices/hicum2/hicum2defs.h b/src/spicelib/devices/hicum2/hicum2defs.h index 7b71cfaaf..704b6938e 100644 --- a/src/spicelib/devices/hicum2/hicum2defs.h +++ b/src/spicelib/devices/hicum2/hicum2defs.h @@ -229,6 +229,9 @@ typedef struct sHICUMinstance { * (substrate,base) */ double *HICUMemitEIBaseBIPtr; /* pointer to sparse matrix at * (emitter prime,base prime) */ + double *HICUMsubsTempPtr; /* pointer to sparse matrix at + * (subs ,T) */ + double *HICUMcollCIBasePtr; double *HICUMbaseCollCIPtr; @@ -479,32 +482,33 @@ typedef struct sHICUMinstance { #define HICUMixf1_Vbiei HICUMstate+98 #define HICUMixf1_Vbici HICUMstate+99 #define HICUMixf1_Vxf2 HICUMstate+100 -#define HICUMixf1_Vrth HICUMstate+101 +#define HICUMixf1_Vxf1 HICUMstate+101 +#define HICUMixf1_Vrth HICUMstate+102 -#define HICUMqxf2 HICUMstate+102 -#define HICUMcqxf2 HICUMstate+103 -#define HICUMgqxf2 HICUMstate+104 -#define HICUMixf2 HICUMstate+105 -#define HICUMixf2_Vbiei HICUMstate+106 -#define HICUMixf2_Vbici HICUMstate+107 -#define HICUMixf2_Vxf1 HICUMstate+108 -#define HICUMixf2_Vxf2 HICUMstate+109 -#define HICUMixf2_Vrth HICUMstate+110 +#define HICUMqxf2 HICUMstate+103 +#define HICUMcqxf2 HICUMstate+104 +#define HICUMgqxf2 HICUMstate+105 +#define HICUMixf2 HICUMstate+106 +#define HICUMixf2_Vbiei HICUMstate+108 +#define HICUMixf2_Vbici HICUMstate+108 +#define HICUMixf2_Vxf1 HICUMstate+109 +#define HICUMixf2_Vxf2 HICUMstate+110 +#define HICUMixf2_Vrth HICUMstate+111 -#define HICUMith HICUMstate+111 -#define HICUMith_Vrth HICUMstate+112 -#define HICUMith_Vbiei HICUMstate+113 -#define HICUMith_Vbici HICUMstate+114 -#define HICUMith_Vbpbi HICUMstate+115 -#define HICUMith_Vbpci HICUMstate+116 -#define HICUMith_Vbpei HICUMstate+117 -#define HICUMith_Vciei HICUMstate+118 -#define HICUMith_Vsici HICUMstate+119 -#define HICUMith_Vcic HICUMstate+120 -#define HICUMith_Vbbp HICUMstate+121 -#define HICUMith_Veie HICUMstate+122 +#define HICUMith HICUMstate+112 +#define HICUMith_Vrth HICUMstate+113 +#define HICUMith_Vbiei HICUMstate+114 +#define HICUMith_Vbici HICUMstate+115 +#define HICUMith_Vbpbi HICUMstate+116 +#define HICUMith_Vbpci HICUMstate+117 +#define HICUMith_Vbpei HICUMstate+118 +#define HICUMith_Vciei HICUMstate+119 +#define HICUMith_Vsici HICUMstate+120 +#define HICUMith_Vcic HICUMstate+121 +#define HICUMith_Vbbp HICUMstate+122 +#define HICUMith_Veie HICUMstate+123 -#define HICUMnumStates 123 +#define HICUMnumStates 124 /* per model data */ typedef struct sHICUMmodel { /* model structure for a hicum */ diff --git a/src/spicelib/devices/hicum2/hicum2setup.c b/src/spicelib/devices/hicum2/hicum2setup.c index a2740e6c3..dfe43dcea 100644 --- a/src/spicelib/devices/hicum2/hicum2setup.c +++ b/src/spicelib/devices/hicum2/hicum2setup.c @@ -684,6 +684,9 @@ do { if((here->ptr = SMPmakeElt(matrix, here->first, here->second)) == NULL){\ TSTALLOC(HICUMxfCollCIPtr ,HICUMxfNode,HICUMcollCINode); TSTALLOC(HICUMxfBaseBIPtr ,HICUMxfNode,HICUMbaseBINode); + TSTALLOC(HICUMbaseBPSubsSIPtr ,HICUMbaseBPNode,HICUMsubsSINode); + TSTALLOC(HICUMsubsSIBaseBPPtr ,HICUMsubsSINode,HICUMbaseBPNode); + if (selfheat) { TSTALLOC(HICUMcollTempPtr, HICUMcollNode, HICUMtempNode); TSTALLOC(HICUMbaseTempPtr,HICUMbaseNode,HICUMtempNode); @@ -694,6 +697,8 @@ do { if((here->ptr = SMPmakeElt(matrix, here->first, here->second)) == NULL){\ TSTALLOC(HICUMbaseBPtempPtr,HICUMbaseBPNode,HICUMtempNode); TSTALLOC(HICUMemitEItempPtr,HICUMemitEINode,HICUMtempNode); TSTALLOC(HICUMsubsSItempPtr,HICUMsubsSINode,HICUMtempNode); + TSTALLOC(HICUMsubsTempPtr ,HICUMsubsNode ,HICUMtempNode); + TSTALLOC(HICUMcollTempPtr ,HICUMcollNode ,HICUMtempNode); TSTALLOC(HICUMtempCollPtr,HICUMtempNode,HICUMcollNode); TSTALLOC(HICUMtempBasePtr,HICUMtempNode,HICUMbaseNode); diff --git a/src/spicelib/devices/hicum2/hicumL2.cpp b/src/spicelib/devices/hicum2/hicumL2.cpp index 9876a303b..0c4cb09d9 100644 --- a/src/spicelib/devices/hicum2/hicumL2.cpp +++ b/src/spicelib/devices/hicum2/hicumL2.cpp @@ -1532,6 +1532,7 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt) *(ckt->CKTstate0+here->HICUMixf1_Vbiei)=*(ckt->CKTstate1+here->HICUMixf1_Vbiei); *(ckt->CKTstate0+here->HICUMixf1_Vbici)=*(ckt->CKTstate1+here->HICUMixf1_Vbici); *(ckt->CKTstate0+here->HICUMixf1_Vxf2)=*(ckt->CKTstate1+here->HICUMixf1_Vxf2); + *(ckt->CKTstate0+here->HICUMixf1_Vxf1)=*(ckt->CKTstate1+here->HICUMixf1_Vxf1); *(ckt->CKTstate0+here->HICUMixf1_Vrth)=*(ckt->CKTstate1+here->HICUMixf1_Vrth); *(ckt->CKTstate0+here->HICUMvxf2)=*(ckt->CKTstate1+here->HICUMvxf2); *(ckt->CKTstate0+here->HICUMqxf2)=*(ckt->CKTstate1+here->HICUMqxf2); @@ -1847,6 +1848,7 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt) Ixf1_Vbiei = *(ckt->CKTstate0 + here->HICUMixf1_Vbiei) ; Ixf1_Vbici = *(ckt->CKTstate0 + here->HICUMixf1_Vbici) ; Ixf1_Vxf2 = *(ckt->CKTstate0 + here->HICUMixf1_Vxf2) ; + Ixf1_Vxf1 = *(ckt->CKTstate0 + here->HICUMixf1_Vxf1) ; Ixf1_dT = *(ckt->CKTstate0 + here->HICUMixf1_Vrth) ; Ixf2 = *(ckt->CKTstate0 + here->HICUMixf2) ; Ixf2_Vbiei = *(ckt->CKTstate0 + here->HICUMixf2_Vbiei) ; @@ -3361,6 +3363,7 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt) *(ckt->CKTstate0 + here->HICUMixf1_Vbiei) = Ixf1_Vbiei; *(ckt->CKTstate0 + here->HICUMixf1_Vbici) = Ixf1_Vbici; *(ckt->CKTstate0 + here->HICUMixf1_Vxf2) = Ixf1_Vxf2; + *(ckt->CKTstate0 + here->HICUMixf1_Vxf1) = Ixf1_Vxf1; *(ckt->CKTstate0 + here->HICUMixf1_Vrth) = Ixf1_dT; *(ckt->CKTstate0 + here->HICUMixf2) = Ixf2;