extending state vector
This commit is contained in:
parent
0f37a7e943
commit
f2ddbf8211
|
|
@ -41,11 +41,6 @@ VBICacLoad(GENmodel *inModel, CKTcircuit *ckt)
|
|||
|
||||
if (here->VBICowner != ARCHme) continue;
|
||||
|
||||
Ircx_Vrcx = 1.0 / here->VBICtextCollResist * here->VBICarea * here->VBICm;
|
||||
Irbx_Vrbx = 1.0 / here->VBICtextBaseResist * here->VBICarea * here->VBICm;
|
||||
Ire_Vre = 1.0 / here->VBICtemitterResist * here->VBICarea * here->VBICm;
|
||||
Irs_Vrs = 1.0 / here->VBICtsubstrateResist * here->VBICarea * here->VBICm;
|
||||
|
||||
Ibe_Vbei = *(ckt->CKTstate0 + here->VBICibe_Vbei);
|
||||
Ibex_Vbex = *(ckt->CKTstate0 + here->VBICibex_Vbex);
|
||||
Itzf_Vbei = *(ckt->CKTstate0 + here->VBICitzf_Vbei);
|
||||
|
|
@ -68,6 +63,10 @@ VBICacLoad(GENmodel *inModel, CKTcircuit *ckt)
|
|||
Iccp_Vbep = *(ckt->CKTstate0 + here->VBICiccp_Vbep);
|
||||
Iccp_Vbci = *(ckt->CKTstate0 + here->VBICiccp_Vbci);
|
||||
Iccp_Vbcp = *(ckt->CKTstate0 + here->VBICiccp_Vbcp);
|
||||
Ircx_Vrcx = *(ckt->CKTstate0 + here->VBICircx_Vrcx);
|
||||
Irbx_Vrbx = *(ckt->CKTstate0 + here->VBICirbx_Vrbx);
|
||||
Irs_Vrs = *(ckt->CKTstate0 + here->VBICirs_Vrs);
|
||||
Ire_Vre = *(ckt->CKTstate0 + here->VBICire_Vre);
|
||||
|
||||
/*
|
||||
c The real part
|
||||
|
|
|
|||
|
|
@ -331,15 +331,20 @@ typedef struct sVBICinstance {
|
|||
#define VBICqbcp VBICstate+60
|
||||
#define VBICcqbcp VBICstate+61
|
||||
|
||||
#define VBICnumStates 62
|
||||
#define VBICircx_Vrcx VBICstate+62
|
||||
#define VBICirbx_Vrbx VBICstate+63
|
||||
#define VBICirs_Vrs VBICstate+64
|
||||
#define VBICire_Vre VBICstate+65
|
||||
|
||||
#define VBICsensxpbe VBICstate+62 /* charge sensitivities and their
|
||||
derivatives. +63 for the derivatives -
|
||||
pointer to the beginning of the array */
|
||||
#define VBICsensxpbex VBICstate+64
|
||||
#define VBICsensxpbc VBICstate+66
|
||||
#define VBICsensxpbcx VBICstate+68
|
||||
#define VBICsensxpbep VBICstate+70
|
||||
#define VBICnumStates 66
|
||||
|
||||
#define VBICsensxpbe VBICstate+66 /* charge sensitivities and their
|
||||
derivatives. +67 for the derivatives -
|
||||
pointer to the beginning of the array */
|
||||
#define VBICsensxpbex VBICstate+68
|
||||
#define VBICsensxpbc VBICstate+70
|
||||
#define VBICsensxpbcx VBICstate+72
|
||||
#define VBICsensxpbep VBICstate+74
|
||||
|
||||
#define VBICnumSenStates 10
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ Spice3 Implementation: 2003 Dietmar Warning DAnalyse GmbH
|
|||
#include "trandefs.h"
|
||||
#include "sperror.h"
|
||||
#include "devdefs.h"
|
||||
#include "suffix.h"
|
||||
|
||||
int
|
||||
VBICload(GENmodel *inModel, CKTcircuit *ckt)
|
||||
|
|
@ -505,6 +504,18 @@ VBICload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
*(ckt->CKTstate1 + here->VBICiccp_Vbci);
|
||||
*(ckt->CKTstate0 + here->VBICiccp_Vbcp) =
|
||||
*(ckt->CKTstate1 + here->VBICiccp_Vbcp);
|
||||
*(ckt->CKTstate0 + here->VBICgqbeo) =
|
||||
*(ckt->CKTstate1 + here->VBICgqbeo);
|
||||
*(ckt->CKTstate0 + here->VBICgqbco) =
|
||||
*(ckt->CKTstate1 + here->VBICgqbco);
|
||||
*(ckt->CKTstate0 + here->VBICircx_Vrcx) =
|
||||
*(ckt->CKTstate1 + here->VBICircx_Vrcx);
|
||||
*(ckt->CKTstate0 + here->VBICirbx_Vrbx) =
|
||||
*(ckt->CKTstate1 + here->VBICirbx_Vrbx);
|
||||
*(ckt->CKTstate0 + here->VBICirs_Vrs) =
|
||||
*(ckt->CKTstate1 + here->VBICirs_Vrs);
|
||||
*(ckt->CKTstate0 + here->VBICire_Vre) =
|
||||
*(ckt->CKTstate1 + here->VBICire_Vre);
|
||||
} else {
|
||||
#endif /* PREDICTOR */
|
||||
/*
|
||||
|
|
@ -717,6 +728,10 @@ VBICload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
Iccp_Vbcp = *(ckt->CKTstate0 + here->VBICiccp_Vbcp);
|
||||
gqbeo = *(ckt->CKTstate0 + here->VBICgqbeo);
|
||||
gqbco = *(ckt->CKTstate0 + here->VBICgqbco);
|
||||
Ircx_Vrcx = *(ckt->CKTstate0 + here->VBICircx_Vrcx);
|
||||
Irbx_Vrbx = *(ckt->CKTstate0 + here->VBICirbx_Vrbx);
|
||||
Irs_Vrs = *(ckt->CKTstate0 + here->VBICirs_Vrs);
|
||||
Ire_Vre = *(ckt->CKTstate0 + here->VBICire_Vre);
|
||||
goto load;
|
||||
}
|
||||
/*
|
||||
|
|
@ -844,6 +859,10 @@ next1:
|
|||
*(ckt->CKTstate0 + here->VBICiccp_Vbcp) = Iccp_Vbcp;
|
||||
*(ckt->CKTstate0 + here->VBICgqbeo) = gqbeo;
|
||||
*(ckt->CKTstate0 + here->VBICgqbco) = gqbco;
|
||||
*(ckt->CKTstate0 + here->VBICircx_Vrcx) = Ircx_Vrcx;
|
||||
*(ckt->CKTstate0 + here->VBICirbx_Vrbx) = Irbx_Vrbx;
|
||||
*(ckt->CKTstate0 + here->VBICirs_Vrs) = Irs_Vrs;
|
||||
*(ckt->CKTstate0 + here->VBICire_Vre) = Ire_Vre;
|
||||
}
|
||||
#ifdef SENSDEBUG
|
||||
printf("storing small signal parameters for op\n");
|
||||
|
|
@ -1011,9 +1030,12 @@ next2:
|
|||
*(ckt->CKTstate0 + here->VBICiccp_Vbep) = Iccp_Vbep;
|
||||
*(ckt->CKTstate0 + here->VBICiccp_Vbci) = Iccp_Vbci;
|
||||
*(ckt->CKTstate0 + here->VBICiccp_Vbcp) = Iccp_Vbcp;
|
||||
|
||||
*(ckt->CKTstate0 + here->VBICgqbeo) = gqbeo;
|
||||
*(ckt->CKTstate0 + here->VBICgqbco) = gqbco;
|
||||
*(ckt->CKTstate0 + here->VBICircx_Vrcx) = Ircx_Vrcx;
|
||||
*(ckt->CKTstate0 + here->VBICirbx_Vrbx) = Irbx_Vrbx;
|
||||
*(ckt->CKTstate0 + here->VBICirs_Vrs) = Irs_Vrs;
|
||||
*(ckt->CKTstate0 + here->VBICire_Vre) = Ire_Vre;
|
||||
|
||||
/* Do not load the Jacobian and the rhs if
|
||||
perturbation is being carried out */
|
||||
|
|
@ -1022,8 +1044,7 @@ load:
|
|||
/*
|
||||
* load current excitation vector and matrix
|
||||
*/
|
||||
rhs_current = model->VBICtype * (*(ckt->CKTstate0 + here->VBICcqbeo) -
|
||||
Vbe * gqbeo);
|
||||
rhs_current = model->VBICtype * (*(ckt->CKTstate0 + here->VBICcqbeo) - Vbe * gqbeo);
|
||||
*(ckt->CKTrhs + here->VBICbaseNode) += -rhs_current;
|
||||
*(ckt->CKTrhs + here->VBICemitNode) += rhs_current;
|
||||
*(here->VBICbaseBasePtr) += gqbeo;
|
||||
|
|
@ -1031,8 +1052,7 @@ load:
|
|||
*(here->VBICbaseEmitPtr) += -gqbeo;
|
||||
*(here->VBICemitBasePtr) += -gqbeo;
|
||||
|
||||
rhs_current = model->VBICtype * (*(ckt->CKTstate0 + here->VBICcqbco) -
|
||||
Vbc * gqbco);
|
||||
rhs_current = model->VBICtype * (*(ckt->CKTstate0 + here->VBICcqbco) - Vbc * gqbco);
|
||||
*(ckt->CKTrhs + here->VBICbaseNode) += -rhs_current;
|
||||
*(ckt->CKTrhs + here->VBICcollNode) += rhs_current;
|
||||
*(here->VBICbaseBasePtr) += gqbco;
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ if (!data->namelist) return(E_NOMEM);
|
|||
case N_DENS:
|
||||
NevalSrc(&noizDens[VBICRCNOIZ],&lnNdens[VBICRCNOIZ],
|
||||
ckt,THERMNOISE,inst->VBICcollCXNode,inst->VBICcollNode,
|
||||
model->VBICcollectorConduct * inst->VBICarea * inst->VBICm);
|
||||
*(ckt->CKTstate0 + inst->VBICircx_Vrcx));
|
||||
|
||||
NevalSrc(&noizDens[VBICRCINOIZ],&lnNdens[VBICRCINOIZ],
|
||||
ckt,THERMNOISE,inst->VBICcollCXNode,inst->VBICcollCINode,
|
||||
|
|
@ -135,7 +135,7 @@ if (!data->namelist) return(E_NOMEM);
|
|||
|
||||
NevalSrc(&noizDens[VBICRBNOIZ],&lnNdens[VBICRBNOIZ],
|
||||
ckt,THERMNOISE,inst->VBICbaseBXNode,inst->VBICbaseNode,
|
||||
model->VBICbaseConduct * inst->VBICarea * inst->VBICm);
|
||||
*(ckt->CKTstate0 + inst->VBICirbx_Vrbx));
|
||||
|
||||
NevalSrc(&noizDens[VBICRBINOIZ],&lnNdens[VBICRBINOIZ],
|
||||
ckt,THERMNOISE,inst->VBICbaseBXNode,inst->VBICbaseBINode,
|
||||
|
|
@ -143,7 +143,7 @@ if (!data->namelist) return(E_NOMEM);
|
|||
|
||||
NevalSrc(&noizDens[VBICRENOIZ],&lnNdens[VBICRENOIZ],
|
||||
ckt,THERMNOISE,inst->VBICemitEINode,inst->VBICemitNode,
|
||||
model->VBICemitterConduct * inst->VBICarea * inst->VBICm);
|
||||
*(ckt->CKTstate0 + inst->VBICire_Vre));
|
||||
|
||||
NevalSrc(&noizDens[VBICRBPNOIZ],&lnNdens[VBICRBPNOIZ],
|
||||
ckt,THERMNOISE,inst->VBICemitEINode,inst->VBICemitNode,
|
||||
|
|
@ -151,7 +151,7 @@ if (!data->namelist) return(E_NOMEM);
|
|||
|
||||
NevalSrc(&noizDens[VBICRSNOIZ],&lnNdens[VBICRSNOIZ],
|
||||
ckt,THERMNOISE,inst->VBICsubsSINode,inst->VBICsubsNode,
|
||||
model->VBICsubstrateConduct * inst->VBICarea * inst->VBICm);
|
||||
*(ckt->CKTstate0 + inst->VBICirs_Vrs));
|
||||
|
||||
|
||||
NevalSrc(&noizDens[VBICICNOIZ],&lnNdens[VBICICNOIZ],
|
||||
|
|
|
|||
|
|
@ -41,12 +41,6 @@ VBICpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s)
|
|||
|
||||
if (here->VBICowner != ARCHme) continue;
|
||||
|
||||
|
||||
Ircx_Vrcx = 1.0 / here->VBICtextCollResist * here->VBICarea * here->VBICm;
|
||||
Irbx_Vrbx = 1.0 / here->VBICtextBaseResist * here->VBICarea * here->VBICm;
|
||||
Ire_Vre = 1.0 / here->VBICtemitterResist * here->VBICarea * here->VBICm;
|
||||
Irs_Vrs = 1.0 / here->VBICtsubstrateResist * here->VBICarea * here->VBICm;
|
||||
|
||||
Ibe_Vbei = *(ckt->CKTstate0 + here->VBICibe_Vbei);
|
||||
Ibex_Vbex = *(ckt->CKTstate0 + here->VBICibex_Vbex);
|
||||
Itzf_Vbei = *(ckt->CKTstate0 + here->VBICitzf_Vbei);
|
||||
|
|
@ -69,6 +63,10 @@ VBICpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s)
|
|||
Iccp_Vbep = *(ckt->CKTstate0 + here->VBICiccp_Vbep);
|
||||
Iccp_Vbci = *(ckt->CKTstate0 + here->VBICiccp_Vbci);
|
||||
Iccp_Vbcp = *(ckt->CKTstate0 + here->VBICiccp_Vbcp);
|
||||
Ircx_Vrcx = *(ckt->CKTstate0 + here->VBICircx_Vrcx);
|
||||
Irbx_Vrbx = *(ckt->CKTstate0 + here->VBICirbx_Vrbx);
|
||||
Irs_Vrs = *(ckt->CKTstate0 + here->VBICirs_Vrs);
|
||||
Ire_Vre = *(ckt->CKTstate0 + here->VBICire_Vre);
|
||||
|
||||
/*
|
||||
c The real part
|
||||
|
|
|
|||
Loading…
Reference in New Issue