From 7f5f8ac69f373a92b1b3f8d8d4badfebe1f957b3 Mon Sep 17 00:00:00 2001 From: dwarning Date: Wed, 20 May 2020 11:27:18 +0200 Subject: [PATCH] correct peripheral resistor current temperature dependency --- src/spicelib/devices/vbic/vbicdefs.h | 4 +++ src/spicelib/devices/vbic/vbicload.c | 47 +++++++++++++++++++-------- src/spicelib/devices/vbic/vbicsetup.c | 4 +++ 3 files changed, 41 insertions(+), 14 deletions(-) diff --git a/src/spicelib/devices/vbic/vbicdefs.h b/src/spicelib/devices/vbic/vbicdefs.h index 3b8bf3587..1ed3f31f1 100644 --- a/src/spicelib/devices/vbic/vbicdefs.h +++ b/src/spicelib/devices/vbic/vbicdefs.h @@ -220,13 +220,17 @@ typedef struct sVBICinstance { double *VBICbaseBPtempPtr; double *VBICemitEItempPtr; double *VBICsubsSItempPtr; + double *VBICtempCollPtr; double *VBICtempCollCIPtr; double *VBICtempCollCXPtr; + double *VBICtempBasePtr; double *VBICtempBaseBIPtr; double *VBICtempBaseBXPtr; double *VBICtempBaseBPPtr; + double *VBICtempEmitPtr; double *VBICtempEmitEIPtr; double *VBICtempSubsPtr; + double *VBICtempSubsSIPtr; double *VBICtempTempPtr; unsigned VBICareaGiven :1; /* flag to indicate area was specified */ diff --git a/src/spicelib/devices/vbic/vbicload.c b/src/spicelib/devices/vbic/vbicload.c index 76f96424a..6b5813c48 100644 --- a/src/spicelib/devices/vbic/vbicload.c +++ b/src/spicelib/devices/vbic/vbicload.c @@ -1240,7 +1240,11 @@ c Stamp element: Ibep /* c Stamp element: Rcx */ - *(here->VBICcollTempPtr) += Ircx_Vrth; + rhs_current = -Ircx_Vrth * Vrth; + *(ckt->CKTrhs + here->VBICcollNode) += -rhs_current; + *(here->VBICcollTempPtr) += Ircx_Vrth; + *(ckt->CKTrhs + here->VBICcollCXNode) += rhs_current; + *(here->VBICcollCXtempPtr) += -Ircx_Vrth; /* c Stamp element: Irci */ @@ -1252,7 +1256,11 @@ c Stamp element: Irci /* c Stamp element: Rbx */ - *(here->VBICbaseTempPtr) += Irbx_Vrth; + rhs_current = -Irbx_Vrth * Vrth; + *(ckt->CKTrhs + here->VBICbaseNode) += -rhs_current; + *(here->VBICbaseTempPtr) += Irbx_Vrth; + *(ckt->CKTrhs + here->VBICbaseBXNode) += rhs_current; + *(here->VBICbaseBXtempPtr) += -Irbx_Vrth; /* c Stamp element: Irbi */ @@ -1264,7 +1272,11 @@ c Stamp element: Irbi /* c Stamp element: Re */ - *(here->VBICemitTempPtr) += Ire_Vrth; + rhs_current = -Ire_Vrth * Vrth; + *(ckt->CKTrhs + here->VBICemitNode) += -rhs_current; + *(here->VBICemitTempPtr) += Ire_Vrth; + *(ckt->CKTrhs + here->VBICemitEINode) += rhs_current; + *(here->VBICemitEItempPtr) += -Ire_Vrth; /* c Stamp element: Irbp */ @@ -1292,7 +1304,11 @@ c Stamp element: Iccp /* c Stamp element: Rs */ - *(here->VBICsubsTempPtr) += Irs_Vrth; + rhs_current = -Irs_Vrth * Vrth; + *(ckt->CKTrhs + here->VBICsubsNode) += -rhs_current; + *(here->VBICsubsTempPtr) += Irs_Vrth; + *(ckt->CKTrhs + here->VBICsubsSINode) += rhs_current; + *(here->VBICsubsSItempPtr) += -Irs_Vrth; /* c Stamp element: Rth */ @@ -1302,16 +1318,16 @@ c Stamp element: Cth */ *(here->VBICtempTempPtr) += Icth_Vrth; /* -c Stamp element: Ith +c Stamp element: Ith (all values are delivered with (-) sign) */ - rhs_current = - Ith + Ith_Vrth*Vrth + Icth - Icth_Vrth*Vrth - + Ith_Vbei*Vbei + Ith_Vbci*Vbci + Ith_Vcei*Vcei - + Ith_Vbex*Vbex + Ith_Vbep*Vbep + Ith_Vbcp*Vbcp - + Ith_Vcep*Vcep + Ith_Vrci*Vrci + Ith_Vbcx*Vbcx - + Ith_Vrbi*Vrbi + Ith_Vrbp*Vrbp - + Ith_Vrcx*Vrcx + Ith_Vrbx*Vrbx + Ith_Vre*Vre + Ith_Vrs*Vrs; + rhs_current = -Ith - Ith_Vrth*Vrth + Icth - Icth_Vrth*Vrth + - Ith_Vbei*Vbei - Ith_Vbci*Vbci - Ith_Vcei*Vcei + - Ith_Vbex*Vbex - Ith_Vbep*Vbep - Ith_Vbcp*Vbcp + - Ith_Vcep*Vcep - Ith_Vrci*Vrci - Ith_Vbcx*Vbcx + - Ith_Vrbi*Vrbi - Ith_Vrbp*Vrbp + - Ith_Vrcx*Vrcx - Ith_Vrbx*Vrbx - Ith_Vre*Vre - Ith_Vrs*Vrs; - *(ckt->CKTrhs + here->VBICtempNode) -= rhs_current; + *(ckt->CKTrhs + here->VBICtempNode) += rhs_current; *(here->VBICtempTempPtr) += -Ith_Vrth; @@ -1337,11 +1353,14 @@ c Stamp element: Ith *(here->VBICtempBaseBIPtr) += +Ith_Vrbi; *(here->VBICtempBaseBPPtr) += -Ith_Vrbp; *(here->VBICtempCollCXPtr) += +Ith_Vrbp; - + *(here->VBICtempCollPtr) += -Ith_Vrcx; *(here->VBICtempCollCXPtr) += +Ith_Vrcx; + *(here->VBICtempBasePtr) += -Ith_Vrbx; *(here->VBICtempBaseBXPtr) += +Ith_Vrbx; + *(here->VBICtempEmitPtr) += -Ith_Vre; *(here->VBICtempEmitEIPtr) += +Ith_Vre; - *(here->VBICtempSubsPtr) += +Ith_Vrs; + *(here->VBICtempSubsPtr) += -Ith_Vrs; + *(here->VBICtempSubsSIPtr) += +Ith_Vrs; } } diff --git a/src/spicelib/devices/vbic/vbicsetup.c b/src/spicelib/devices/vbic/vbicsetup.c index 1a97c2d54..ef6b238ea 100644 --- a/src/spicelib/devices/vbic/vbicsetup.c +++ b/src/spicelib/devices/vbic/vbicsetup.c @@ -570,13 +570,17 @@ do { if((here->ptr = SMPmakeElt(matrix, here->first, here->second)) == NULL){\ TSTALLOC(VBICbaseBPtempPtr,VBICbaseBPNode,VBICtempNode); TSTALLOC(VBICemitEItempPtr,VBICemitEINode,VBICtempNode); TSTALLOC(VBICsubsSItempPtr,VBICsubsSINode,VBICtempNode); + TSTALLOC(VBICtempCollPtr,VBICtempNode,VBICcollNode); TSTALLOC(VBICtempCollCIPtr,VBICtempNode,VBICcollCINode); TSTALLOC(VBICtempCollCXPtr,VBICtempNode,VBICcollCXNode); TSTALLOC(VBICtempBaseBIPtr,VBICtempNode,VBICbaseBINode); + TSTALLOC(VBICtempBasePtr,VBICtempNode,VBICbaseNode); TSTALLOC(VBICtempBaseBXPtr,VBICtempNode,VBICbaseBXNode); TSTALLOC(VBICtempBaseBPPtr,VBICtempNode,VBICbaseBPNode); + TSTALLOC(VBICtempEmitPtr,VBICtempNode,VBICemitNode); TSTALLOC(VBICtempEmitEIPtr,VBICtempNode,VBICemitEINode); TSTALLOC(VBICtempSubsPtr,VBICtempNode,VBICsubsNode); + TSTALLOC(VBICtempSubsSIPtr,VBICtempNode,VBICsubsSINode); TSTALLOC(VBICtempTempPtr,VBICtempNode,VBICtempNode); }