more complete vbic dc/tran nqs effect

This commit is contained in:
dwarning 2024-07-09 15:45:49 +02:00 committed by Holger Vogt
parent 6e6e2fb203
commit 065b1c817c
8 changed files with 485 additions and 473 deletions

View File

@ -46,32 +46,32 @@ VBICacLoad(GENmodel *inModel, CKTcircuit *ckt)
for( here = VBICinstances(model); here!= NULL;
here = VBICnextInstance(here)) {
Ibe_Vbei = *(ckt->CKTstate0 + here->VBICibe_vbei);
Ibex_Vbex = *(ckt->CKTstate0 + here->VBICibex_vbex);
Itzf_Vbei = *(ckt->CKTstate0 + here->VBICitzf_vbei);
Itzf_Vbci = *(ckt->CKTstate0 + here->VBICitzf_vbci);
Itzr_Vbci = *(ckt->CKTstate0 + here->VBICitzr_vbci);
Itzr_Vbei = *(ckt->CKTstate0 + here->VBICitzr_vbei);
Ibc_Vbci = *(ckt->CKTstate0 + here->VBICibc_vbci);
Ibc_Vbei = *(ckt->CKTstate0 + here->VBICibc_vbei);
Ibep_Vbep = *(ckt->CKTstate0 + here->VBICibep_vbep);
Irci_Vrci = *(ckt->CKTstate0 + here->VBICirci_vrci);
Irci_Vbci = *(ckt->CKTstate0 + here->VBICirci_vbci);
Irci_Vbcx = *(ckt->CKTstate0 + here->VBICirci_vbcx);
Irbi_Vrbi = *(ckt->CKTstate0 + here->VBICirbi_vrbi);
Irbi_Vbei = *(ckt->CKTstate0 + here->VBICirbi_vbei);
Irbi_Vbci = *(ckt->CKTstate0 + here->VBICirbi_vbci);
Irbp_Vrbp = *(ckt->CKTstate0 + here->VBICirbp_vrbp);
Irbp_Vbep = *(ckt->CKTstate0 + here->VBICirbp_vbep);
Irbp_Vbci = *(ckt->CKTstate0 + here->VBICirbp_vbci);
Ibcp_Vbcp = *(ckt->CKTstate0 + here->VBICibcp_vbcp);
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);
Ibe_Vbei = *(ckt->CKTstate0 + here->VBICibe_Vbei);
Ibex_Vbex = *(ckt->CKTstate0 + here->VBICibex_Vbex);
Itzf_Vbei = *(ckt->CKTstate0 + here->VBICitzf_Vbei);
Itzf_Vbci = *(ckt->CKTstate0 + here->VBICitzf_Vbci);
Itzr_Vbci = *(ckt->CKTstate0 + here->VBICitzr_Vbci);
Itzr_Vbei = *(ckt->CKTstate0 + here->VBICitzr_Vbei);
Ibc_Vbci = *(ckt->CKTstate0 + here->VBICibc_Vbci);
Ibc_Vbei = *(ckt->CKTstate0 + here->VBICibc_Vbei);
Ibep_Vbep = *(ckt->CKTstate0 + here->VBICibep_Vbep);
Irci_Vrci = *(ckt->CKTstate0 + here->VBICirci_Vrci);
Irci_Vbci = *(ckt->CKTstate0 + here->VBICirci_Vbci);
Irci_Vbcx = *(ckt->CKTstate0 + here->VBICirci_Vbcx);
Irbi_Vrbi = *(ckt->CKTstate0 + here->VBICirbi_Vrbi);
Irbi_Vbei = *(ckt->CKTstate0 + here->VBICirbi_Vbei);
Irbi_Vbci = *(ckt->CKTstate0 + here->VBICirbi_Vbci);
Irbp_Vrbp = *(ckt->CKTstate0 + here->VBICirbp_Vrbp);
Irbp_Vbep = *(ckt->CKTstate0 + here->VBICirbp_Vbep);
Irbp_Vbci = *(ckt->CKTstate0 + here->VBICirbp_Vbci);
Ibcp_Vbcp = *(ckt->CKTstate0 + here->VBICibcp_Vbcp);
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
@ -230,7 +230,7 @@ c Stamp element: Rs
Ibe_Vrth = here->VBICibe_Vrth;
Ibex_Vrth = here->VBICibex_Vrth;
Itzf_Vrth = here->VBICitzf_Vrth;
Itzf_Vrth = here->VBICitzf_vrth;
Itzr_Vrth = here->VBICitzr_Vrth;
Ibc_Vrth = here->VBICibc_Vrth;
Ibep_Vrth = here->VBICibep_Vrth;

View File

@ -122,19 +122,19 @@ VBICask(CKTcircuit *ckt, GENinstance *instPtr, int which, IFvalue *value, IFvalu
fabs(IS.rValue * *(ckt->CKTstate0 + here->VBICvrbp));
return(OK);
case VBIC_QUEST_GM:
value->rValue = *(ckt->CKTstate0 + here->VBICitzf_vbei);
value->rValue = *(ckt->CKTstate0 + here->VBICitzf_Vbei);
return(OK);
case VBIC_QUEST_GO:
value->rValue = *(ckt->CKTstate0 + here->VBICitzf_vbci);
value->rValue = *(ckt->CKTstate0 + here->VBICitzf_Vbci);
return(OK);
case VBIC_QUEST_GPI:
value->rValue = *(ckt->CKTstate0 + here->VBICibe_vbei);
value->rValue = *(ckt->CKTstate0 + here->VBICibe_Vbei);
return(OK);
case VBIC_QUEST_GMU:
value->rValue = *(ckt->CKTstate0 + here->VBICibc_vbci);
value->rValue = *(ckt->CKTstate0 + here->VBICibc_Vbci);
return(OK);
case VBIC_QUEST_GX:
value->rValue = *(ckt->CKTstate0 + here->VBICirbi_vrbi);
value->rValue = *(ckt->CKTstate0 + here->VBICirbi_Vrbi);
return(OK);
case VBIC_QUEST_CBE:
value->rValue = here->VBICcapbe;

View File

@ -85,27 +85,27 @@ VBICconvTest(GENmodel *inModel, CKTcircuit *ckt)
delvrbp = Vrbp - *(ckt->CKTstate0 + here->VBICvrbp);
delvbcp = Vbcp - *(ckt->CKTstate0 + here->VBICvbcp);
ibehat = *(ckt->CKTstate0 + here->VBICibe) +
*(ckt->CKTstate0 + here->VBICibe_vbei)*delvbei;
*(ckt->CKTstate0 + here->VBICibe_Vbei)*delvbei;
ibexhat = *(ckt->CKTstate0 + here->VBICibex) +
*(ckt->CKTstate0 + here->VBICibex_vbex)*delvbex;
*(ckt->CKTstate0 + here->VBICibex_Vbex)*delvbex;
itzfhat = *(ckt->CKTstate0 + here->VBICitzf) +
*(ckt->CKTstate0 + here->VBICitzf_vbei)*delvbei + *(ckt->CKTstate0 + here->VBICitzf_vbci)*delvbci;
*(ckt->CKTstate0 + here->VBICitzf_Vbei)*delvbei + *(ckt->CKTstate0 + here->VBICitzf_Vbci)*delvbci;
itzrhat = *(ckt->CKTstate0 + here->VBICitzr) +
*(ckt->CKTstate0 + here->VBICitzr_vbei)*delvbei + *(ckt->CKTstate0 + here->VBICitzr_vbci)*delvbci;
*(ckt->CKTstate0 + here->VBICitzr_Vbei)*delvbei + *(ckt->CKTstate0 + here->VBICitzr_Vbci)*delvbci;
ibchat = *(ckt->CKTstate0 + here->VBICibc) +
*(ckt->CKTstate0 + here->VBICibc_vbei)*delvbei + *(ckt->CKTstate0 + here->VBICibc_vbci)*delvbci;
*(ckt->CKTstate0 + here->VBICibc_Vbei)*delvbei + *(ckt->CKTstate0 + here->VBICibc_Vbci)*delvbci;
ibephat = *(ckt->CKTstate0 + here->VBICibep) +
*(ckt->CKTstate0 + here->VBICibep_vbep)*delvbep;
ircihat = *(ckt->CKTstate0 + here->VBICirci) + *(ckt->CKTstate0 + here->VBICirci_vrci)*delvrci +
*(ckt->CKTstate0 + here->VBICirci_vbcx)*delvbcx + *(ckt->CKTstate0 + here->VBICirci_vbci)*delvbci;
irbihat = *(ckt->CKTstate0 + here->VBICirbi) + *(ckt->CKTstate0 + here->VBICirbi_vrbi)*delvrbi +
*(ckt->CKTstate0 + here->VBICirbi_vbei)*delvbei + *(ckt->CKTstate0 + here->VBICirbi_vbci)*delvbci;
irbphat = *(ckt->CKTstate0 + here->VBICirbp) + *(ckt->CKTstate0 + here->VBICirbp_vrbp)*delvrbp +
*(ckt->CKTstate0 + here->VBICirbp_vbep)*delvbep + *(ckt->CKTstate0 + here->VBICirbp_vbci)*delvbci;
*(ckt->CKTstate0 + here->VBICibep_Vbep)*delvbep;
ircihat = *(ckt->CKTstate0 + here->VBICirci) + *(ckt->CKTstate0 + here->VBICirci_Vrci)*delvrci +
*(ckt->CKTstate0 + here->VBICirci_Vbcx)*delvbcx + *(ckt->CKTstate0 + here->VBICirci_Vbci)*delvbci;
irbihat = *(ckt->CKTstate0 + here->VBICirbi) + *(ckt->CKTstate0 + here->VBICirbi_Vrbi)*delvrbi +
*(ckt->CKTstate0 + here->VBICirbi_Vbei)*delvbei + *(ckt->CKTstate0 + here->VBICirbi_Vbci)*delvbci;
irbphat = *(ckt->CKTstate0 + here->VBICirbp) + *(ckt->CKTstate0 + here->VBICirbp_Vrbp)*delvrbp +
*(ckt->CKTstate0 + here->VBICirbp_Vbep)*delvbep + *(ckt->CKTstate0 + here->VBICirbp_Vbci)*delvbci;
ibcphat = *(ckt->CKTstate0 + here->VBICibcp) +
*(ckt->CKTstate0 + here->VBICibcp_vbcp)*delvbcp;
iccphat = *(ckt->CKTstate0 + here->VBICiccp) + *(ckt->CKTstate0 + here->VBICiccp_vbep)*delvbep +
*(ckt->CKTstate0 + here->VBICiccp_vbci)*delvbci + *(ckt->CKTstate0 + here->VBICiccp_vbcp)*delvbcp;
*(ckt->CKTstate0 + here->VBICibcp_Vbcp)*delvbcp;
iccphat = *(ckt->CKTstate0 + here->VBICiccp) + *(ckt->CKTstate0 + here->VBICiccp_Vbep)*delvbep +
*(ckt->CKTstate0 + here->VBICiccp_Vbci)*delvbci + *(ckt->CKTstate0 + here->VBICiccp_Vbcp)*delvbcp;
Ibe = *(ckt->CKTstate0 + here->VBICibe);
Ibex = *(ckt->CKTstate0 + here->VBICibex);
Itzf = *(ckt->CKTstate0 + here->VBICitzf);

View File

@ -241,30 +241,26 @@ typedef struct sVBICinstance {
double *VBICtempTempPtr;
/* excess phase */
double *VBICxf1Xf1Ptr; //
double *VBICtempXf2Ptr;
double *VBICxf1TempPtr;
double *VBICxf1BaseBIPtr; //
double *VBICxf1EmitEIPtr; //
double *VBICxf1CollCIPtr; //
double *VBICxf1Xf2Ptr; //
double *VBICxf2Xf1Ptr;
double *VBICtempXf2Ptr; //
double *VBICxf2BaseBIPtr;
double *VBICxf2EmitEIPtr;
double *VBICxf2CollCIPtr;
double *VBICxf1Xf1Ptr;
double *VBICxf1Xf2Ptr;
double *VBICxf1CollCIPtr;
double *VBICxf1BaseBIPtr;
double *VBICxf1EmitEIPtr;
double *VBICxf2Xf2Ptr;
double *VBICemitXf2Ptr;
double *VBICemitEIXf2Ptr; //
double *VBICbaseBIXf2Ptr; //
double *VBICcollCIXf2Ptr; //
double *VBICxf2Xf1Ptr;
double *VBICcollCIXf2Ptr;
double *VBICbaseBIXf2Ptr;
double *VBICemitEIXf2Ptr;
double *VBICxf1IbrPtr; //
double *VBICxf2IbrPtr; //
double *VBICibrXf1Ptr; //
double *VBICibrXf2Ptr; //
double *VBICibrIbrPtr; //
double *VBICxf1IbrPtr;
double *VBICxf2IbrPtr;
double *VBICibrXf1Ptr;
double *VBICibrXf2Ptr;
double *VBICibrIbrPtr;
unsigned VBICareaGiven :1; /* flag to indicate area was specified */
unsigned VBICoff :1; /* 'off' flag for vbic */
@ -291,7 +287,7 @@ typedef struct sVBICinstance {
double VBICibe_Vrth;
double VBICibex_Vrth;
double VBICitzf_Vrth;
double VBICitzf_vrth;
double VBICitzr_Vrth;
double VBICibc_Vrth;
double VBICibep_Vrth;
@ -324,10 +320,10 @@ typedef struct sVBICinstance {
double VBICith_Vre;
double VBICith_Vrs;
double VBICcapxf;
double VBICindInduct;
int VBIC_selfheat; /* self-heating enabled */
int VBIC_selfheat; /* self-heating enabled */
int VBIC_excessPhase; /* excess phase enabled */
#ifndef NONOISE
double VBICnVar[NSTATVARS][VBICNSRCS];
@ -345,7 +341,6 @@ typedef struct sVBICinstance {
BindElement *VBICcollCICollCIBinding ;
BindElement *VBICbaseBXBaseBXBinding ;
BindElement *VBICbaseBIBaseBIBinding ;
BindElement *VBICbaseBIXfBinding ;
BindElement *VBICemitEIEmitEIBinding ;
BindElement *VBICbaseBPBaseBPBinding ;
BindElement *VBICsubsSISubsSIBinding ;
@ -394,14 +389,11 @@ typedef struct sVBICinstance {
BindElement *VBICemitTempBinding ;
BindElement *VBICsubsTempBinding ;
BindElement *VBICcollCItempBinding ;
BindElement *VBICcollCIXf2Binding ;
BindElement *VBICcollCXtempBinding ;
BindElement *VBICbaseBItempBinding ;
BindElement *VBICbaseBXtempBinding ;
BindElement *VBICbaseBPtempBinding ;
BindElement *VBICemitEItempBinding ;
BindElement *VBICemitEIXf2Binding ;
BindElement *VBICemitEIXfBinding ;
BindElement *VBICsubsSItempBinding ;
BindElement *VBICtempCollBinding ;
BindElement *VBICtempCollCIBinding ;
@ -415,18 +407,23 @@ typedef struct sVBICinstance {
BindElement *VBICtempSubsBinding ;
BindElement *VBICtempSubsSIBinding ;
BindElement *VBICtempTempBinding ;
BindElement *VBICxf1BaseBIBinding ;
BindElement *VBICxf1CollCIBinding ;
BindElement *VBICxf1EmitEIBinding ;
BindElement *VBICtempXf2Binding ;
BindElement *VBICxf1TempBinding ;
BindElement *VBICxf1Xf1Binding ;
BindElement *VBICxf1Xf2Binding ;
BindElement *VBICxf2BaseBIBinding ;
BindElement *VBICxf2CollCIBinding ;
BindElement *VBICxf2EmitEIBinding ;
BindElement *VBICxf2TempBinding ;
BindElement *VBICxf2Xf1Binding ;
BindElement *VBICxf1CollCIBinding ;
BindElement *VBICxf1BaseBIBinding ;
BindElement *VBICxf1EmitEIBinding ;
BindElement *VBICxf2Xf2Binding ;
BindElement *VBICxf2Xf1Binding ;
BindElement *VBICcollCIXf2Binding ;
BindElement *VBICbaseBIXf2Binding ;
BindElement *VBICemitEIXf2Binding ;
BindElement *VBICxf1IbrBinding ;
BindElement *VBICxf2IbrBinding ;
BindElement *VBICibrXf2Binding ;
BindElement *VBICibrXf1Binding ;
BindElement *VBICibrIbrBinding ;
#endif
} VBICinstance ;
@ -442,116 +439,114 @@ typedef struct sVBICinstance {
#define VBICvrbi VBICstate+6
#define VBICvrbp VBICstate+7
#define VBICvbcp VBICstate+8
#define VBICvxf1 VBICstate+9
#define VBICvxf2 VBICstate+10
#define VBICibe VBICstate+11
#define VBICibe_vbei VBICstate+12
#define VBICibe VBICstate+9
#define VBICibe_Vbei VBICstate+10
#define VBICibex VBICstate+13
#define VBICibex_vbex VBICstate+14
#define VBICibex VBICstate+11
#define VBICibex_Vbex VBICstate+12
#define VBICitzf VBICstate+15
#define VBICitzf_vbei VBICstate+16
#define VBICitzf_vbci VBICstate+17
#define VBICitzf_vrth VBICstate+18
#define VBICitzf VBICstate+13
#define VBICitzf_Vbei VBICstate+14
#define VBICitzf_Vbci VBICstate+15
#define VBICitzf_Vrth VBICstate+16
#define VBICitzr VBICstate+19
#define VBICitzr_vbci VBICstate+20
#define VBICitzr_vbei VBICstate+21
#define VBICitzr VBICstate+17
#define VBICitzr_Vbci VBICstate+18
#define VBICitzr_Vbei VBICstate+19
#define VBICibc VBICstate+22
#define VBICibc_vbci VBICstate+23
#define VBICibc_vbei VBICstate+24
#define VBICibc VBICstate+20
#define VBICibc_Vbci VBICstate+21
#define VBICibc_Vbei VBICstate+22
#define VBICibep VBICstate+25
#define VBICibep_vbep VBICstate+26
#define VBICibep VBICstate+23
#define VBICibep_Vbep VBICstate+24
#define VBICirci VBICstate+27
#define VBICirci_vrci VBICstate+28
#define VBICirci_vbci VBICstate+29
#define VBICirci_vbcx VBICstate+30
#define VBICirci VBICstate+25
#define VBICirci_Vrci VBICstate+26
#define VBICirci_Vbci VBICstate+27
#define VBICirci_Vbcx VBICstate+28
#define VBICirbi VBICstate+31
#define VBICirbi_vrbi VBICstate+32
#define VBICirbi_vbei VBICstate+33
#define VBICirbi_vbci VBICstate+34
#define VBICirbi VBICstate+29
#define VBICirbi_Vrbi VBICstate+30
#define VBICirbi_Vbei VBICstate+31
#define VBICirbi_Vbci VBICstate+32
#define VBICirbp VBICstate+35
#define VBICirbp_vrbp VBICstate+36
#define VBICirbp_vbep VBICstate+37
#define VBICirbp_vbci VBICstate+38
#define VBICirbp VBICstate+33
#define VBICirbp_Vrbp VBICstate+34
#define VBICirbp_Vbep VBICstate+35
#define VBICirbp_Vbci VBICstate+36
#define VBICqbe VBICstate+39
#define VBICcqbe VBICstate+40
#define VBICcqbeci VBICstate+41
#define VBICqbe VBICstate+37
#define VBICcqbe VBICstate+38
#define VBICcqbeci VBICstate+39
#define VBICqbex VBICstate+42
#define VBICcqbex VBICstate+43
#define VBICqbex VBICstate+40
#define VBICcqbex VBICstate+41
#define VBICqbc VBICstate+44
#define VBICcqbc VBICstate+45
#define VBICqbc VBICstate+42
#define VBICcqbc VBICstate+43
#define VBICqbcx VBICstate+46
#define VBICcqbcx VBICstate+47
#define VBICqbcx VBICstate+44
#define VBICcqbcx VBICstate+45
#define VBICqbep VBICstate+48
#define VBICcqbep VBICstate+49
#define VBICcqbepci VBICstate+50
#define VBICqbep VBICstate+46
#define VBICcqbep VBICstate+47
#define VBICcqbepci VBICstate+48
#define VBICqbeo VBICstate+51
#define VBICcqbeo VBICstate+52
#define VBICgqbeo VBICstate+53
#define VBICqbeo VBICstate+49
#define VBICcqbeo VBICstate+50
#define VBICgqbeo VBICstate+51
#define VBICqbco VBICstate+54
#define VBICcqbco VBICstate+55
#define VBICgqbco VBICstate+56
#define VBICqbco VBICstate+52
#define VBICcqbco VBICstate+53
#define VBICgqbco VBICstate+54
#define VBICibcp VBICstate+57
#define VBICibcp_vbcp VBICstate+58
#define VBICibcp VBICstate+55
#define VBICibcp_Vbcp VBICstate+56
#define VBICiccp VBICstate+59
#define VBICiccp_vbep VBICstate+60
#define VBICiccp_vbci VBICstate+61
#define VBICiccp_vbcp VBICstate+62
#define VBICiccp VBICstate+57
#define VBICiccp_Vbep VBICstate+58
#define VBICiccp_Vbci VBICstate+59
#define VBICiccp_Vbcp VBICstate+60
#define VBICqbcp VBICstate+63
#define VBICcqbcp VBICstate+64
#define VBICqbcp VBICstate+61
#define VBICcqbcp VBICstate+62
#define VBICircx_vrcx VBICstate+65
#define VBICirbx_vrbx VBICstate+66
#define VBICirs_vrs VBICstate+67
#define VBICire_vre VBICstate+68
#define VBICircx_Vrcx VBICstate+63
#define VBICirbx_Vrbx VBICstate+64
#define VBICirs_Vrs VBICstate+65
#define VBICire_Vre VBICstate+66
#define VBICqcth VBICstate+69 /* thermal capacitor charge */
#define VBICcqcth VBICstate+70 /* thermal capacitor current */
#define VBICqcth VBICstate+67 /* thermal capacitor charge */
#define VBICcqcth VBICstate+68 /* thermal capacitor current */
#define VBICvrth VBICstate+71
#define VBICicth_vrth VBICstate+72
#define VBICvrth VBICstate+69
#define VBICicth_Vrth VBICstate+70
#define VBICqcxf VBICstate+73
#define VBICcqcxf VBICstate+74
#define VBICgqxf VBICstate+75
#define VBICqcxf VBICstate+71
#define VBICcqcxf VBICstate+72
#define VBICgqcxf VBICstate+73
#define VBICibc_vrxf VBICstate+76
#define VBICibc_Vrxf VBICstate+74
#define VBICixzf VBICstate+77
#define VBICixzf_vbei VBICstate+78
#define VBICixzf_vbci VBICstate+79
#define VBICixzf_vrth VBICstate+80
#define VBICixzf VBICstate+75
#define VBICixzf_Vbei VBICstate+76
#define VBICixzf_Vbci VBICstate+77
#define VBICixzf_Vrth VBICstate+78
#define VBICixxf VBICstate+81
#define VBICixxf_vrxf VBICstate+82
#define VBICixxf VBICstate+79
#define VBICixxf_Vrxf VBICstate+80
#define VBICitxf VBICstate+83
#define VBICitxf_vrxf VBICstate+84
#define VBICith_vrxf VBICstate+85
#define VBICitxf VBICstate+81
#define VBICitxf_Vrxf VBICstate+82
#define VBICith_Vrxf VBICstate+83
#define VBICindFlux VBICstate+86
#define VBICindVolt VBICstate+87
#define VBICindFlux VBICstate+84
#define VBICindVolt VBICstate+85
#define VBICnumStates 88
#define VBICnumStates 86
/* per model data */
typedef struct sVBICmodel { /* model structure for a vbic */

View File

@ -100,7 +100,7 @@ VBICload(GENmodel *inModel, CKTcircuit *ckt)
//NQS
double Vrxf, Vcxf, Itxf, Itxf_Vrxf, Ibc_Vrxf, Ith_Vrxf, Ixzf_Vrth,
Ixxf_Vrxf, Qcxf, Qcxf_Vcxf, Flxf, Flxf_Vrxf;
double veq, req;
double Vxf1xf2, Rxf1xf2, newmind, req, veq;
int iret;
double vce;
@ -117,7 +117,6 @@ VBICload(GENmodel *inModel, CKTcircuit *ckt)
double delvrbi;
double delvrbp;
double delvbcp;
double delvxf2;
double ibehat;
double ibexhat;
double itzfhat;
@ -141,8 +140,6 @@ VBICload(GENmodel *inModel, CKTcircuit *ckt)
double Ixzf,Ixxf;
double Ixzf_Vbei, Ixzf_Vbci;
double Icxf, Icxf_Vcxf;
double Vxf1, Vxf2;
/* loop through all the models */
for( ; model != NULL; model = VBICnextModel(model)) {
@ -207,11 +204,13 @@ VBICload(GENmodel *inModel, CKTcircuit *ckt)
/*
* initialization
*/
if(!(ckt->CKTmode & (MODEDC|MODEINITPRED))) {
if(ckt->CKTmode & MODEUIC && ckt->CKTmode & MODEINITTRAN) {
*(ckt->CKTstate0 + here->VBICindFlux) = here->VBICindInduct;
} else {
*(ckt->CKTstate0 + here->VBICindFlux) = here->VBICindInduct * *(ckt->CKTrhsOld + here->VBICbrEq);
if (here->VBIC_excessPhase) {
if(!(ckt->CKTmode & (MODEDC|MODEINITPRED))) {
if(ckt->CKTmode & MODEUIC && ckt->CKTmode & MODEINITTRAN) {
*(ckt->CKTstate0 + here->VBICindFlux) = here->VBICindInduct; // no init current available
} else {
*(ckt->CKTstate0 + here->VBICindFlux) = here->VBICindInduct * *(ckt->CKTrhsOld + here->VBICbrEq);
}
}
}
icheck=1;
@ -245,8 +244,8 @@ VBICload(GENmodel *inModel, CKTcircuit *ckt)
*(ckt->CKTrhsOld+here->VBICsubsSINode));
if (here->VBIC_selfheat)
Vrth = *(ckt->CKTstate0 + here->VBICvrth);
Vxf1 = *(ckt->CKTrhsOld + here->VBICxf1Node);
Vxf2 = *(ckt->CKTrhsOld + here->VBICxf2Node);
Rxf1xf2 = 0.0;
Vxf1xf2 = 0.0;
} else if(ckt->CKTmode & MODEINITTRAN) {
Vbe = model->VBICtype*(
*(ckt->CKTrhsOld+here->VBICbaseNode)-
@ -277,8 +276,8 @@ VBICload(GENmodel *inModel, CKTcircuit *ckt)
*(ckt->CKTrhsOld+here->VBICsubsSINode));
if (here->VBIC_selfheat)
Vrth = *(ckt->CKTstate1 + here->VBICvrth);
Vxf1 = *(ckt->CKTrhsOld + here->VBICxf1Node);
Vxf2 = *(ckt->CKTrhsOld + here->VBICxf2Node);
Rxf1xf2 = 0.0;
Vxf1xf2 = 0.0;
} else if((ckt->CKTmode & MODEINITJCT) &&
(ckt->CKTmode & MODETRANOP) && (ckt->CKTmode & MODEUIC)){
Vbe=model->VBICtype*here->VBICicVBE;
@ -290,9 +289,9 @@ VBICload(GENmodel *inModel, CKTcircuit *ckt)
Vrci=Vrbi=Vrbp=0.0;
Vrcx=Vrbx=Vre=Vrs=0.0;
Vrth = 0.0, Icth = 0.0, Icth_Vrth = 0.0;
Vxf1=Vxf2=0.0, Icxf=0.0, Icxf_Vcxf=0.0;
req = 0.0;
veq = 0.0;
Icxf=0.0, Icxf_Vcxf=0.0;
Rxf1xf2 = 0.0;
Vxf1xf2 = 0.0;
} else if((ckt->CKTmode & MODEINITJCT) && (here->VBICoff==0)) {
Vbe=Vbei=Vbex=model->VBICtype*here->VBICtVcrit;
Vbc=Vbcx=Vbep=0.0;
@ -301,9 +300,9 @@ VBICload(GENmodel *inModel, CKTcircuit *ckt)
Vrci=Vrbi=Vrbp=0.0;
Vrcx=Vrbx=Vre=Vrs=0.0;
Vrth = 0.0, Icth = 0.0, Icth_Vrth = 0.0;
Vxf1=Vxf2=0.0, Icxf=0.0, Icxf_Vcxf=0.0;
req = 0.0;
veq = 0.0;
Icxf=0.0, Icxf_Vcxf=0.0;
Rxf1xf2 = 0.0;
Vxf1xf2 = 0.0;
} else if((ckt->CKTmode & MODEINITJCT) ||
( (ckt->CKTmode & MODEINITFIX) && (here->VBICoff!=0))) {
Vbe=0.0;
@ -314,9 +313,9 @@ VBICload(GENmodel *inModel, CKTcircuit *ckt)
Vrci=Vrbi=Vrbp=0.0;
Vrcx=Vrbx=Vre=Vrs=0.0;
Vrth = 0.0, Icth = 0.0, Icth_Vrth = 0.0;
Vxf1=Vxf2=0.0, Icxf=0.0, Icxf_Vcxf=0.0;
req = 0.0;
veq = 0.0;
Icxf=0.0, Icxf_Vcxf=0.0;
Rxf1xf2 = 0.0;
Vxf1xf2 = 0.0;
} else {
#ifndef PREDICTOR
if(ckt->CKTmode & MODEINITPRED) {
@ -345,12 +344,6 @@ VBICload(GENmodel *inModel, CKTcircuit *ckt)
*(ckt->CKTstate0 + here->VBICvrth) =
*(ckt->CKTstate1 + here->VBICvrth);
}
// dead assign:
Vxf1 = (1+xfact) * *(ckt->CKTstate1 + here->VBICvxf1)-
xfact * *(ckt->CKTstate2 + here->VBICvxf1);
Vxf2 = (1+xfact) * *(ckt->CKTstate1 + here->VBICvxf2)-
xfact * *(ckt->CKTstate2 + here->VBICvxf2);
*(ckt->CKTstate0 + here->VBICvbei) =
*(ckt->CKTstate1 + here->VBICvbei);
*(ckt->CKTstate0 + here->VBICvbex) =
@ -371,109 +364,105 @@ VBICload(GENmodel *inModel, CKTcircuit *ckt)
*(ckt->CKTstate1 + here->VBICvbcp);
*(ckt->CKTstate0 + here->VBICibe) =
*(ckt->CKTstate1 + here->VBICibe);
*(ckt->CKTstate0 + here->VBICibe_vbei) =
*(ckt->CKTstate1 + here->VBICibe_vbei);
*(ckt->CKTstate0 + here->VBICibe_Vbei) =
*(ckt->CKTstate1 + here->VBICibe_Vbei);
*(ckt->CKTstate0 + here->VBICibex) =
*(ckt->CKTstate1 + here->VBICibex);
*(ckt->CKTstate0 + here->VBICibex_vbex) =
*(ckt->CKTstate1 + here->VBICibex_vbex);
if (!model->VBICdelayTimeFGiven) {
*(ckt->CKTstate0 + here->VBICibex_Vbex) =
*(ckt->CKTstate1 + here->VBICibex_Vbex);
if (!here->VBIC_excessPhase) {
*(ckt->CKTstate0 + here->VBICitzf) =
*(ckt->CKTstate1 + here->VBICitzf);
*(ckt->CKTstate0 + here->VBICitzf_vbei) =
*(ckt->CKTstate1 + here->VBICitzf_vbei);
*(ckt->CKTstate0 + here->VBICitzf_vbci) =
*(ckt->CKTstate1 + here->VBICitzf_vbci);
} else {
*(ckt->CKTstate0+here->VBICixzf_vbei)=*(ckt->CKTstate1+here->VBICixzf_vbei);
*(ckt->CKTstate0+here->VBICixzf_vbci)=*(ckt->CKTstate1+here->VBICixzf_vbci);
*(ckt->CKTstate0+here->VBICixzf_vrth)=*(ckt->CKTstate1+here->VBICixzf_vrth);
*(ckt->CKTstate0 + here->VBICitzf_Vbei) =
*(ckt->CKTstate1 + here->VBICitzf_Vbei);
*(ckt->CKTstate0 + here->VBICitzf_Vbci) =
*(ckt->CKTstate1 + here->VBICitzf_Vbci);
}
*(ckt->CKTstate0 + here->VBICitzr) =
*(ckt->CKTstate1 + here->VBICitzr);
*(ckt->CKTstate0 + here->VBICitzr_vbei) =
*(ckt->CKTstate1 + here->VBICitzf_vbei);
*(ckt->CKTstate0 + here->VBICitzr_vbci) =
*(ckt->CKTstate1 + here->VBICitzr_vbci);
*(ckt->CKTstate0 + here->VBICitzr_Vbei) =
*(ckt->CKTstate1 + here->VBICitzf_Vbei);
*(ckt->CKTstate0 + here->VBICitzr_Vbci) =
*(ckt->CKTstate1 + here->VBICitzr_Vbci);
*(ckt->CKTstate0 + here->VBICibc) =
*(ckt->CKTstate1 + here->VBICibc);
*(ckt->CKTstate0 + here->VBICibc_vbci) =
*(ckt->CKTstate1 + here->VBICibc_vbci);
*(ckt->CKTstate0 + here->VBICibc_vbei) =
*(ckt->CKTstate1 + here->VBICibc_vbei);
*(ckt->CKTstate0 + here->VBICibc_Vbci) =
*(ckt->CKTstate1 + here->VBICibc_Vbci);
*(ckt->CKTstate0 + here->VBICibc_Vbei) =
*(ckt->CKTstate1 + here->VBICibc_Vbei);
*(ckt->CKTstate0 + here->VBICibep) =
*(ckt->CKTstate1 + here->VBICibep);
*(ckt->CKTstate0 + here->VBICibep_vbep) =
*(ckt->CKTstate1 + here->VBICibep_vbep);
*(ckt->CKTstate0 + here->VBICibep_Vbep) =
*(ckt->CKTstate1 + here->VBICibep_Vbep);
*(ckt->CKTstate0 + here->VBICirci) =
*(ckt->CKTstate1 + here->VBICirci);
*(ckt->CKTstate0 + here->VBICirci_vrci) =
*(ckt->CKTstate1 + here->VBICirci_vrci);
*(ckt->CKTstate0 + here->VBICirci_vbci) =
*(ckt->CKTstate1 + here->VBICirci_vbci);
*(ckt->CKTstate0 + here->VBICirci_vbcx) =
*(ckt->CKTstate1 + here->VBICirci_vbcx);
*(ckt->CKTstate0 + here->VBICirci_Vrci) =
*(ckt->CKTstate1 + here->VBICirci_Vrci);
*(ckt->CKTstate0 + here->VBICirci_Vbci) =
*(ckt->CKTstate1 + here->VBICirci_Vbci);
*(ckt->CKTstate0 + here->VBICirci_Vbcx) =
*(ckt->CKTstate1 + here->VBICirci_Vbcx);
*(ckt->CKTstate0 + here->VBICirbi) =
*(ckt->CKTstate1 + here->VBICirbi);
*(ckt->CKTstate0 + here->VBICirbi_vrbi) =
*(ckt->CKTstate1 + here->VBICirbi_vrbi);
*(ckt->CKTstate0 + here->VBICirbi_vbei) =
*(ckt->CKTstate1 + here->VBICirbi_vbei);
*(ckt->CKTstate0 + here->VBICirbi_vbci) =
*(ckt->CKTstate1 + here->VBICirbi_vbci);
*(ckt->CKTstate0 + here->VBICirbi_Vrbi) =
*(ckt->CKTstate1 + here->VBICirbi_Vrbi);
*(ckt->CKTstate0 + here->VBICirbi_Vbei) =
*(ckt->CKTstate1 + here->VBICirbi_Vbei);
*(ckt->CKTstate0 + here->VBICirbi_Vbci) =
*(ckt->CKTstate1 + here->VBICirbi_Vbci);
*(ckt->CKTstate0 + here->VBICirbp) =
*(ckt->CKTstate1 + here->VBICirbp);
*(ckt->CKTstate0 + here->VBICirbp_vrbp) =
*(ckt->CKTstate1 + here->VBICirbp_vrbp);
*(ckt->CKTstate0 + here->VBICirbp_vbep) =
*(ckt->CKTstate1 + here->VBICirbp_vbep);
*(ckt->CKTstate0 + here->VBICirbp_vbci) =
*(ckt->CKTstate1 + here->VBICirbp_vbci);
*(ckt->CKTstate0 + here->VBICirbp_Vrbp) =
*(ckt->CKTstate1 + here->VBICirbp_Vrbp);
*(ckt->CKTstate0 + here->VBICirbp_Vbep) =
*(ckt->CKTstate1 + here->VBICirbp_Vbep);
*(ckt->CKTstate0 + here->VBICirbp_Vbci) =
*(ckt->CKTstate1 + here->VBICirbp_Vbci);
*(ckt->CKTstate0 + here->VBICibcp) =
*(ckt->CKTstate1 + here->VBICibcp);
*(ckt->CKTstate0 + here->VBICibcp_vbcp) =
*(ckt->CKTstate1 + here->VBICibcp_vbcp);
*(ckt->CKTstate0 + here->VBICibcp_Vbcp) =
*(ckt->CKTstate1 + here->VBICibcp_Vbcp);
*(ckt->CKTstate0 + here->VBICiccp) =
*(ckt->CKTstate1 + here->VBICiccp);
*(ckt->CKTstate0 + here->VBICiccp_vbep) =
*(ckt->CKTstate1 + here->VBICiccp_vbep);
*(ckt->CKTstate0 + here->VBICiccp_vbci) =
*(ckt->CKTstate1 + here->VBICiccp_vbci);
*(ckt->CKTstate0 + here->VBICiccp_vbcp) =
*(ckt->CKTstate1 + here->VBICiccp_vbcp);
*(ckt->CKTstate0 + here->VBICiccp_Vbep) =
*(ckt->CKTstate1 + here->VBICiccp_Vbep);
*(ckt->CKTstate0 + here->VBICiccp_Vbci) =
*(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);
*(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);
if (here->VBIC_selfheat)
*(ckt->CKTstate0 + here->VBICqcth) =
*(ckt->CKTstate1 + here->VBICqcth);
*(ckt->CKTstate0+here->VBICvxf)=*(ckt->CKTstate1+here->VBICvxf);
*(ckt->CKTstate0+here->VBICqxf)=*(ckt->CKTstate1+here->VBICqxf);
*(ckt->CKTstate0+here->VBICcqxf)=*(ckt->CKTstate1+here->VBICcqxf);
*(ckt->CKTstate0+here->VBICgqxf)=*(ckt->CKTstate1+here->VBICgqxf);
*(ckt->CKTstate0+here->VBICixf_vbei)=*(ckt->CKTstate1+here->VBICixf_vbei);
*(ckt->CKTstate0+here->VBICixf_vbci)=*(ckt->CKTstate1+here->VBICixf_vbci);
*(ckt->CKTstate0+here->VBICixf_vxf)=*(ckt->CKTstate1+here->VBICixf_vxf);
*(ckt->CKTstate0+here->VBICixf_vrth)=*(ckt->CKTstate1+here->VBICixf_vrth);
*(ckt->CKTstate0+here->VBICvxf1)=*(ckt->CKTstate1+here->VBICvxf1);
*(ckt->CKTstate0+here->VBICqxf1)=*(ckt->CKTstate1+here->VBICqxf1);
*(ckt->CKTstate0+here->VBICcqxf1)=*(ckt->CKTstate1+here->VBICcqxf1);
*(ckt->CKTstate0+here->VBICgqxf1)=*(ckt->CKTstate1+here->VBICgqxf1);
*(ckt->CKTstate0+here->VBICvxf2)=*(ckt->CKTstate1+here->VBICvxf2);
*(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->VBICindFlux) =
*(ckt->CKTstate1 + here->VBICindFlux);
if (here->VBIC_excessPhase) {
*(ckt->CKTstate0+here->VBICqcxf)=*(ckt->CKTstate1+here->VBICqcxf);
*(ckt->CKTstate0+here->VBICcqcxf)=*(ckt->CKTstate1+here->VBICcqcxf);
*(ckt->CKTstate0+here->VBICgqcxf)=*(ckt->CKTstate1+here->VBICgqcxf);
*(ckt->CKTstate0+here->VBICibc_Vrxf)=*(ckt->CKTstate1+here->VBICibc_Vrxf;
*(ckt->CKTstate0+here->VBICixzf)=*(ckt->CKTstate1+here->VBICixzf;
*(ckt->CKTstate0+here->VBICixzf_Vbei)=*(ckt->CKTstate1+here->VBICixzf_Vbei);
*(ckt->CKTstate0+here->VBICixzf_Vbci)=*(ckt->CKTstate1+here->VBICixzf_Vbci);
*(ckt->CKTstate0+here->VBICixzf_Vrth)=*(ckt->CKTstate1+here->VBICixzf_Vrth);
*(ckt->CKTstate0+here->VBICixxf)=*(ckt->CKTstate1+here->VBICixxf;
*(ckt->CKTstate0+here->VBICixxf_Vrxf)=*(ckt->CKTstate1+here->VBICixxf_Vrxf);
*(ckt->CKTstate0+here->VBICitxf)=*(ckt->CKTstate1+here->VBICitxf;
*(ckt->CKTstate0+here->VBICitxf_Vrxf)=*(ckt->CKTstate1+here->VBICitxf_Vrxf);
*(ckt->CKTstate0+here->VBICith_Vrxf)=*(ckt->CKTstate1+here->VBICitxf_Vrxf);
if (here->VBIC_selfheat)
*(ckt->CKTstate0+here->VBICith_Vrxf)=*(ckt->CKTstate1+here->VBICith_Vrxf);
*(ckt->CKTstate0+here->VBICindFlux)=*(ckt->CKTstate1+here->VBICindFlux);
}
} else {
#endif /* PREDICTOR */
/*
@ -508,9 +497,12 @@ VBICload(GENmodel *inModel, CKTcircuit *ckt)
*(ckt->CKTrhsOld+here->VBICbaseBPNode));
if (here->VBIC_selfheat)
Vrth = *(ckt->CKTrhsOld + here->VBICtempNode);
// not needed because convergence in NQS network is not checked here
Vxf1 = *(ckt->CKTrhsOld + here->VBICxf1Node);
Vxf2 = *(ckt->CKTrhsOld + here->VBICxf2Node);
if (here->VBIC_excessPhase) {
if (ckt->CKTmode & MODEINITTRAN) {
*(ckt->CKTstate1 + here->VBICindFlux) =
*(ckt->CKTstate0 + here->VBICindFlux);
}
}
#ifndef PREDICTOR
}
#endif /* PREDICTOR */
@ -523,7 +515,6 @@ VBICload(GENmodel *inModel, CKTcircuit *ckt)
delvrbi = Vrbi - *(ckt->CKTstate0 + here->VBICvrbi);
delvrbp = Vrbp - *(ckt->CKTstate0 + here->VBICvrbp);
delvbcp = Vbcp - *(ckt->CKTstate0 + here->VBICvbcp);
delvxf2 = Vxf2 - *(ckt->CKTstate0 + here->VBICvxf2);
Vbe = model->VBICtype*(
*(ckt->CKTrhsOld+here->VBICbaseNode)-
@ -545,38 +536,36 @@ VBICload(GENmodel *inModel, CKTcircuit *ckt)
*(ckt->CKTrhsOld+here->VBICsubsSINode));
if (here->VBIC_selfheat)
Vrth = *(ckt->CKTrhsOld + here->VBICtempNode);
Vxf1 = *(ckt->CKTrhsOld + here->VBICxf1Node);
Vxf2 = *(ckt->CKTrhsOld + here->VBICxf2Node);
ibehat = *(ckt->CKTstate0 + here->VBICibe) +
*(ckt->CKTstate0 + here->VBICibe_vbei)*delvbei;
*(ckt->CKTstate0 + here->VBICibe_Vbei)*delvbei;
ibexhat = *(ckt->CKTstate0 + here->VBICibex) +
*(ckt->CKTstate0 + here->VBICibex_vbex)*delvbex;
if (!model->VBICdelayTimeFGiven) {
*(ckt->CKTstate0 + here->VBICibex_Vbex)*delvbex;
if (!here->VBIC_excessPhase) {
itzfhat = *(ckt->CKTstate0 + here->VBICitzf) +
*(ckt->CKTstate0 + here->VBICitzf_vbei)*delvbei +
*(ckt->CKTstate0 + here->VBICitzf_vbci)*delvbci;
*(ckt->CKTstate0 + here->VBICitzf_Vbei)*delvbei +
*(ckt->CKTstate0 + here->VBICitzf_Vbci)*delvbci;
} else {
ixzfhat = *(ckt->CKTstate0 + here->VBICixzf) +
*(ckt->CKTstate0 + here->VBICixzf_vbei)*delvbei +
*(ckt->CKTstate0 + here->VBICixzf_vbci)*delvbci;
*(ckt->CKTstate0 + here->VBICixzf_Vbei)*delvbei +
*(ckt->CKTstate0 + here->VBICixzf_Vbci)*delvbci;
}
itzrhat = *(ckt->CKTstate0 + here->VBICitzr) +
*(ckt->CKTstate0 + here->VBICitzr_vbei)*delvbei + *(ckt->CKTstate0 + here->VBICitzr_vbci)*delvbci;
*(ckt->CKTstate0 + here->VBICitzr_Vbei)*delvbei + *(ckt->CKTstate0 + here->VBICitzr_Vbci)*delvbci;
ibchat = *(ckt->CKTstate0 + here->VBICibc) +
*(ckt->CKTstate0 + here->VBICibc_vbei)*delvbei + *(ckt->CKTstate0 + here->VBICibc_vbci)*delvbci;
*(ckt->CKTstate0 + here->VBICibc_Vbei)*delvbei + *(ckt->CKTstate0 + here->VBICibc_Vbci)*delvbci;
ibephat = *(ckt->CKTstate0 + here->VBICibep) +
*(ckt->CKTstate0 + here->VBICibep_vbep)*delvbep;
ircihat = *(ckt->CKTstate0 + here->VBICirci) + *(ckt->CKTstate0 + here->VBICirci_vrci)*delvrci +
*(ckt->CKTstate0 + here->VBICirci_vbcx)*delvbcx + *(ckt->CKTstate0 + here->VBICirci_vbci)*delvbci;
irbihat = *(ckt->CKTstate0 + here->VBICirbi) + *(ckt->CKTstate0 + here->VBICirbi_vrbi)*delvrbi +
*(ckt->CKTstate0 + here->VBICirbi_vbei)*delvbei + *(ckt->CKTstate0 + here->VBICirbi_vbci)*delvbci;
irbphat = *(ckt->CKTstate0 + here->VBICirbp) + *(ckt->CKTstate0 + here->VBICirbp_vrbp)*delvrbp +
*(ckt->CKTstate0 + here->VBICirbp_vbep)*delvbep + *(ckt->CKTstate0 + here->VBICirbp_vbci)*delvbci;
*(ckt->CKTstate0 + here->VBICibep_Vbep)*delvbep;
ircihat = *(ckt->CKTstate0 + here->VBICirci) + *(ckt->CKTstate0 + here->VBICirci_Vrci)*delvrci +
*(ckt->CKTstate0 + here->VBICirci_Vbcx)*delvbcx + *(ckt->CKTstate0 + here->VBICirci_Vbci)*delvbci;
irbihat = *(ckt->CKTstate0 + here->VBICirbi) + *(ckt->CKTstate0 + here->VBICirbi_Vrbi)*delvrbi +
*(ckt->CKTstate0 + here->VBICirbi_Vbei)*delvbei + *(ckt->CKTstate0 + here->VBICirbi_Vbci)*delvbci;
irbphat = *(ckt->CKTstate0 + here->VBICirbp) + *(ckt->CKTstate0 + here->VBICirbp_Vrbp)*delvrbp +
*(ckt->CKTstate0 + here->VBICirbp_Vbep)*delvbep + *(ckt->CKTstate0 + here->VBICirbp_Vbci)*delvbci;
ibcphat = *(ckt->CKTstate0 + here->VBICibcp) +
*(ckt->CKTstate0 + here->VBICibcp_vbcp)*delvbcp;
iccphat = *(ckt->CKTstate0 + here->VBICiccp) + *(ckt->CKTstate0 + here->VBICiccp_vbep)*delvbep +
*(ckt->CKTstate0 + here->VBICiccp_vbci)*delvbci + *(ckt->CKTstate0 + here->VBICiccp_vbcp)*delvbcp;
*(ckt->CKTstate0 + here->VBICibcp_Vbcp)*delvbcp;
iccphat = *(ckt->CKTstate0 + here->VBICiccp) + *(ckt->CKTstate0 + here->VBICiccp_Vbep)*delvbep +
*(ckt->CKTstate0 + here->VBICiccp_Vbci)*delvbci + *(ckt->CKTstate0 + here->VBICiccp_Vbcp)*delvbcp;
/*
* bypass if solution has not changed
*/
@ -622,12 +611,12 @@ VBICload(GENmodel *inModel, CKTcircuit *ckt)
fabs(*(ckt->CKTstate0 + here->VBICibex)))+
ckt->CKTabstol) )
if (!model->VBICdelayTimeFGiven)
if (!here->VBIC_excessPhase)
if( (fabs(itzfhat-*(ckt->CKTstate0 + here->VBICitzf)) <
ckt->CKTreltol* MAX(fabs(itzfhat),
fabs(*(ckt->CKTstate0 + here->VBICitzf)))+
ckt->CKTabstol) )
if (model->VBICdelayTimeFGiven)
if (here->VBIC_excessPhase)
if( (fabs(ixzfhat-*(ckt->CKTstate0 + here->VBICixzf)) <
ckt->CKTreltol* MAX(fabs(ixzfhat),
fabs(*(ckt->CKTstate0 + here->VBICixzf)))+
@ -677,62 +666,67 @@ VBICload(GENmodel *inModel, CKTcircuit *ckt)
Vrbi = *(ckt->CKTstate0 + here->VBICvrbi);
Vrbp = *(ckt->CKTstate0 + here->VBICvrbp);
Vbcp = *(ckt->CKTstate0 + here->VBICvbcp);
Vxf1 = *(ckt->CKTstate0 + here->VBICvxf1);
Vxf2 = *(ckt->CKTstate0 + here->VBICvxf2);
Ibe = *(ckt->CKTstate0 + here->VBICibe);
Ibe_Vbei = *(ckt->CKTstate0 + here->VBICibe_vbei);
Ibe_Vbei = *(ckt->CKTstate0 + here->VBICibe_Vbei);
Ibex = *(ckt->CKTstate0 + here->VBICibex);
Ibex_Vbex = *(ckt->CKTstate0 + here->VBICibex_vbex);
if (!model->VBICdelayTimeFGiven) {
Ibex_Vbex = *(ckt->CKTstate0 + here->VBICibex_Vbex);
if (!here->VBIC_excessPhase) {
Itzf = *(ckt->CKTstate0 + here->VBICitzf);
Itzf_Vbei = *(ckt->CKTstate0 + here->VBICitzf_vbei);
Itzf_Vbci = *(ckt->CKTstate0 + here->VBICitzf_vbci);
Itzf_Vrth = *(ckt->CKTstate0 + here->VBICitzf_vrth);
} else {
Ixzf = *(ckt->CKTstate0 + here->VBICixzf);
Ixzf_Vbei = *(ckt->CKTstate0 + here->VBICixzf_vbei);
Ixzf_Vbci = *(ckt->CKTstate0 + here->VBICixzf_vbci);
Ixzf_Vrth = *(ckt->CKTstate0 + here->VBICixzf_vrth);
Itzf_Vbei = *(ckt->CKTstate0 + here->VBICitzf_Vbei);
Itzf_Vbci = *(ckt->CKTstate0 + here->VBICitzf_Vbci);
Itzf_Vrth = *(ckt->CKTstate0 + here->VBICitzf_Vrth);
}
Itzr = *(ckt->CKTstate0 + here->VBICitzr);
Itzr_Vbci = *(ckt->CKTstate0 + here->VBICitzr_vbci);
Itzr_Vbei = *(ckt->CKTstate0 + here->VBICitzr_vbei);
Itzr_Vbci = *(ckt->CKTstate0 + here->VBICitzr_Vbci);
Itzr_Vbei = *(ckt->CKTstate0 + here->VBICitzr_Vbei);
Ibc = *(ckt->CKTstate0 + here->VBICibc);
Ibc_Vbci = *(ckt->CKTstate0 + here->VBICibc_vbci);
Ibc_Vbei = *(ckt->CKTstate0 + here->VBICibc_vbei);
Ibc_Vrxf = *(ckt->CKTstate0 + here->VBICibc_vrxf);
Ibc_Vbci = *(ckt->CKTstate0 + here->VBICibc_Vbci);
Ibc_Vbei = *(ckt->CKTstate0 + here->VBICibc_Vbei);
Ibc_Vrxf = *(ckt->CKTstate0 + here->VBICibc_Vrxf);
Ibep = *(ckt->CKTstate0 + here->VBICibep);
Ibep_Vbep = *(ckt->CKTstate0 + here->VBICibep_vbep);
Ibep_Vbep = *(ckt->CKTstate0 + here->VBICibep_Vbep);
Irci = *(ckt->CKTstate0 + here->VBICirci);
Irci_Vrci = *(ckt->CKTstate0 + here->VBICirci_vrci);
Irci_Vbci = *(ckt->CKTstate0 + here->VBICirci_vbci);
Irci_Vbcx = *(ckt->CKTstate0 + here->VBICirci_vbcx);
Irci_Vrci = *(ckt->CKTstate0 + here->VBICirci_Vrci);
Irci_Vbci = *(ckt->CKTstate0 + here->VBICirci_Vbci);
Irci_Vbcx = *(ckt->CKTstate0 + here->VBICirci_Vbcx);
Irbi = *(ckt->CKTstate0 + here->VBICirbi);
Irbi_Vrbi = *(ckt->CKTstate0 + here->VBICirbi_vrbi);
Irbi_Vbei = *(ckt->CKTstate0 + here->VBICirbi_vbei);
Irbi_Vbci = *(ckt->CKTstate0 + here->VBICirbi_vbci);
Irbi_Vrbi = *(ckt->CKTstate0 + here->VBICirbi_Vrbi);
Irbi_Vbei = *(ckt->CKTstate0 + here->VBICirbi_Vbei);
Irbi_Vbci = *(ckt->CKTstate0 + here->VBICirbi_Vbci);
Irbp = *(ckt->CKTstate0 + here->VBICirbp);
Irbp_Vrbp = *(ckt->CKTstate0 + here->VBICirbp_vrbp);
Irbp_Vbep = *(ckt->CKTstate0 + here->VBICirbp_vbep);
Irbp_Vbci = *(ckt->CKTstate0 + here->VBICirbp_vbci);
Irbp_Vrbp = *(ckt->CKTstate0 + here->VBICirbp_Vrbp);
Irbp_Vbep = *(ckt->CKTstate0 + here->VBICirbp_Vbep);
Irbp_Vbci = *(ckt->CKTstate0 + here->VBICirbp_Vbci);
Ibcp = *(ckt->CKTstate0 + here->VBICibcp);
Ibcp_Vbcp = *(ckt->CKTstate0 + here->VBICibcp_vbcp);
Ibcp_Vbcp = *(ckt->CKTstate0 + here->VBICibcp_Vbcp);
Iccp = *(ckt->CKTstate0 + here->VBICiccp);
Iccp_Vbep = *(ckt->CKTstate0 + here->VBICiccp_vbep);
Iccp_Vbci = *(ckt->CKTstate0 + here->VBICiccp_vbci);
Iccp_Vbcp = *(ckt->CKTstate0 + here->VBICiccp_vbcp);
Iccp_Vbep = *(ckt->CKTstate0 + here->VBICiccp_Vbep);
Iccp_Vbci = *(ckt->CKTstate0 + here->VBICiccp_Vbci);
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);
Itxf = *(ckt->CKTstate0 + here->VBICitxf) ;
Itxf_Vrxf = *(ckt->CKTstate0 + here->VBICitxf_vrxf) ;
Ixxf = *(ckt->CKTstate0 + here->VBICixxf) ;
Ixxf_Vrxf = *(ckt->CKTstate0 + here->VBICixxf_vrxf) ;
Ith_Vrxf = *(ckt->CKTstate0 + here->VBICith_vrxf) ;
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);
if (here->VBIC_excessPhase) {
Itxf = *(ckt->CKTstate0 + here->VBICitxf);
Itxf_Vrxf = *(ckt->CKTstate0 + here->VBICitxf_Vrxf);
Ixxf = *(ckt->CKTstate0 + here->VBICixxf);
Ixxf_Vrxf = *(ckt->CKTstate0 + here->VBICixxf_Vrxf);
Ith_Vrxf = *(ckt->CKTstate0 + here->VBICith_Vrxf);
Qcxf = *(ckt->CKTstate0 + here->VBICqcxf);
Icxf = *(ckt->CKTstate0 + here->VBICcqcxf);
Icxf_Vcxf = *(ckt->CKTstate0 + here->VBICgqcxf);
Ibc_Vrxf = *(ckt->CKTstate0 + here->VBICibc_Vrxf);
Ixzf = *(ckt->CKTstate0 + here->VBICixzf);
Ixzf_Vbei = *(ckt->CKTstate0 + here->VBICixzf_Vbei);
Ixzf_Vbci = *(ckt->CKTstate0 + here->VBICixzf_Vbci);
Ixzf_Vrth = *(ckt->CKTstate0 + here->VBICixzf_Vrth);
if (here->VBIC_selfheat)
Ith_Vrxf = *(ckt->CKTstate0 + here->VBICith_Vrxf);
Flxf = *(ckt->CKTstate0 + here->VBICindFlux);
}
goto load;
}
/*
@ -763,7 +757,7 @@ VBICload(GENmodel *inModel, CKTcircuit *ckt)
*/
Vcei = Vbei - Vbci;
Vcep = Vbep - Vbcp;
if ((!here->VBIC_selfheat) && (!model->VBICdelayTimeFGiven)) {
if ((!here->VBIC_selfheat) && (!here->VBIC_excessPhase)) {
iret = vbic_4T_it_cf_fj(p
,&Vbei, &Vbex, &Vbci, &Vbep, &Vbcp, &Vrcx
,&Vbcx, &Vrci, &Vrbx, &Vrbi, &Vre, &Vrbp, &Vrs
@ -776,7 +770,7 @@ VBICload(GENmodel *inModel, CKTcircuit *ckt)
,&Qbcx, &Qbcx_Vbcx, &Qbep, &Qbep_Vbep, &Qbep_Vbci, &Qbeo, &Qbeo_Vbe
,&Qbco, &Qbco_Vbc, &Ibcp, &Ibcp_Vbcp, &Iccp, &Iccp_Vbep, &Iccp_Vbci
,&Iccp_Vbcp, &Irs, &Irs_Vrs, &Qbcp, &Qbcp_Vbcp, &SCALE);
} else if ((here->VBIC_selfheat) && (!model->VBICdelayTimeFGiven)) {
} else if ((here->VBIC_selfheat) && (!here->VBIC_excessPhase)) {
iret = vbic_4T_et_cf_fj(p
,&Vrth, &Vbei, &Vbex, &Vbci, &Vbep, &Vbcp
,&Vrcx, &Vbcx, &Vrci, &Vrbx, &Vrbi, &Vre, &Vrbp
@ -853,6 +847,10 @@ VBICload(GENmodel *inModel, CKTcircuit *ckt)
if (here->VBIC_selfheat) {
*(ckt->CKTstate0 + here->VBICqcth) = Qcth;
}
if (here->VBIC_excessPhase) {
*(ckt->CKTstate0 + here->VBICqcxf) = Qcxf;
*(ckt->CKTstate0 + here->VBICindFlux) = Flxf;
}
here->VBICcapbe = Qbe_Vbei;
here->VBICcapbex = Qbex_Vbex;
@ -888,6 +886,9 @@ VBICload(GENmodel *inModel, CKTcircuit *ckt)
here->VBICcapqbepth = Qbep_Vrth;
here->VBICcapqbcpth = Qbcp_Vrth;
}
if (here->VBIC_excessPhase) {
*(ckt->CKTstate0 + here->VBICcqcxf) = Qcxf_Vcxf;
}
continue; /* go to 1000 */
}
/*
@ -914,8 +915,12 @@ VBICload(GENmodel *inModel, CKTcircuit *ckt)
if (here->VBIC_selfheat)
*(ckt->CKTstate1 + here->VBICqcth) =
*(ckt->CKTstate0 + here->VBICqcth) ;
*(ckt->CKTstate1 + here->VBICindFlux) =
*(ckt->CKTstate0 + here->VBICindFlux);
if (here->VBIC_excessPhase) {
*(ckt->CKTstate1 + here->VBICqcxf) =
*(ckt->CKTstate0 + here->VBICqcxf) ;
*(ckt->CKTstate1 + here->VBICindFlux) =
*(ckt->CKTstate0 + here->VBICindFlux);
}
}
error = NIintegrate(ckt,&geq,&ceq,Qbe_Vbei,here->VBICqbe);
if(error) return(error);
@ -954,14 +959,17 @@ VBICload(GENmodel *inModel, CKTcircuit *ckt)
Icth_Vrth = geq;
Icth = *(ckt->CKTstate0 + here->VBICcqcth);
}
if (model->VBICdelayTimeFGiven) {
if (here->VBIC_excessPhase) {
error = NIintegrate(ckt,&geq,&ceq,Qcxf_Vcxf,here->VBICqcxf);
if(error) return(error);
Icxf_Vcxf = geq;
Icxf = *(ckt->CKTstate0 + here->VBICcqcxf);
error = NIintegrate(ckt,&req,&veq,Flxf,here->VBICindFlux);
newmind = here->VBICindInduct/here->VBICm;
error = NIintegrate(ckt,&req,&veq,newmind,here->VBICindFlux);
if(error) return(error);
Rxf1xf2 = req;
Vxf1xf2 = *(ckt->CKTstate0 + here->VBICindVolt);
}
if(ckt->CKTmode & MODEINITTRAN) {
@ -980,8 +988,12 @@ VBICload(GENmodel *inModel, CKTcircuit *ckt)
if (here->VBIC_selfheat)
*(ckt->CKTstate1 + here->VBICcqcth) =
*(ckt->CKTstate0 + here->VBICcqcth);
*(ckt->CKTstate1+here->VBICindVolt) =
*(ckt->CKTstate0+here->VBICindVolt);
if (here->VBIC_excessPhase) {
*(ckt->CKTstate1 + here->VBICcqcxf) =
*(ckt->CKTstate0 + here->VBICcqcxf);
*(ckt->CKTstate1 + here->VBICindVolt) =
*(ckt->CKTstate0 + here->VBICindVolt);
}
}
}
}
@ -1024,60 +1036,55 @@ VBICload(GENmodel *inModel, CKTcircuit *ckt)
*(ckt->CKTstate0 + here->VBICvbcp) = Vbcp;
*(ckt->CKTstate0 + here->VBICibe) = Ibe;
*(ckt->CKTstate0 + here->VBICibe_vbei) = Ibe_Vbei;
*(ckt->CKTstate0 + here->VBICibe_Vbei) = Ibe_Vbei;
*(ckt->CKTstate0 + here->VBICibex) = Ibex;
*(ckt->CKTstate0 + here->VBICibex_vbex) = Ibex_Vbex;
if (!model->VBICdelayTimeFGiven) {
*(ckt->CKTstate0 + here->VBICibex_Vbex) = Ibex_Vbex;
if (!here->VBIC_excessPhase) {
*(ckt->CKTstate0 + here->VBICitzf) = Itzf;
*(ckt->CKTstate0 + here->VBICitzf_vbei) = Itzf_Vbei;
*(ckt->CKTstate0 + here->VBICitzf_vbci) = Itzf_Vbci;
*(ckt->CKTstate0 + here->VBICitzf_vrth) = Itzf_Vrth;
} else {
*(ckt->CKTstate0 + here->VBICixzf) = Ixzf;
*(ckt->CKTstate0 + here->VBICixzf_vbei) = Ixzf_Vbei;
*(ckt->CKTstate0 + here->VBICixzf_vbci) = Ixzf_Vbci;
*(ckt->CKTstate0 + here->VBICixzf_vrth) = Ixzf_Vrth;
*(ckt->CKTstate0 + here->VBICitzf_Vbei) = Itzf_Vbei;
*(ckt->CKTstate0 + here->VBICitzf_Vbci) = Itzf_Vbci;
*(ckt->CKTstate0 + here->VBICitzf_Vrth) = Itzf_Vrth;
}
*(ckt->CKTstate0 + here->VBICitzr) = Itzr;
*(ckt->CKTstate0 + here->VBICitzr_vbci) = Itzr_Vbci;
*(ckt->CKTstate0 + here->VBICitzr_vbei) = Itzr_Vbei;
*(ckt->CKTstate0 + here->VBICitzr_Vbci) = Itzr_Vbci;
*(ckt->CKTstate0 + here->VBICitzr_Vbei) = Itzr_Vbei;
*(ckt->CKTstate0 + here->VBICibc) = Ibc;
*(ckt->CKTstate0 + here->VBICibc_vbci) = Ibc_Vbci;
*(ckt->CKTstate0 + here->VBICibc_vbei) = Ibc_Vbei;
*(ckt->CKTstate0 + here->VBICibc_Vbci) = Ibc_Vbci;
*(ckt->CKTstate0 + here->VBICibc_Vbei) = Ibc_Vbei;
*(ckt->CKTstate0 + here->VBICibep) = Ibep;
*(ckt->CKTstate0 + here->VBICibep_vbep) = Ibep_Vbep;
*(ckt->CKTstate0 + here->VBICibep_Vbep) = Ibep_Vbep;
*(ckt->CKTstate0 + here->VBICirci) = Irci;
*(ckt->CKTstate0 + here->VBICirci_vrci) = Irci_Vrci;
*(ckt->CKTstate0 + here->VBICirci_vbci) = Irci_Vbci;
*(ckt->CKTstate0 + here->VBICirci_vbcx) = Irci_Vbcx;
*(ckt->CKTstate0 + here->VBICirci_Vrci) = Irci_Vrci;
*(ckt->CKTstate0 + here->VBICirci_Vbci) = Irci_Vbci;
*(ckt->CKTstate0 + here->VBICirci_Vbcx) = Irci_Vbcx;
*(ckt->CKTstate0 + here->VBICirbi) = Irbi;
*(ckt->CKTstate0 + here->VBICirbi_vrbi) = Irbi_Vrbi;
*(ckt->CKTstate0 + here->VBICirbi_vbei) = Irbi_Vbei;
*(ckt->CKTstate0 + here->VBICirbi_vbci) = Irbi_Vbci;
*(ckt->CKTstate0 + here->VBICirbi_Vrbi) = Irbi_Vrbi;
*(ckt->CKTstate0 + here->VBICirbi_Vbei) = Irbi_Vbei;
*(ckt->CKTstate0 + here->VBICirbi_Vbci) = Irbi_Vbci;
*(ckt->CKTstate0 + here->VBICirbp) = Irbp;
*(ckt->CKTstate0 + here->VBICirbp_vrbp) = Irbp_Vrbp;
*(ckt->CKTstate0 + here->VBICirbp_vbep) = Irbp_Vbep;
*(ckt->CKTstate0 + here->VBICirbp_vbci) = Irbp_Vbci;
*(ckt->CKTstate0 + here->VBICirbp_Vrbp) = Irbp_Vrbp;
*(ckt->CKTstate0 + here->VBICirbp_Vbep) = Irbp_Vbep;
*(ckt->CKTstate0 + here->VBICirbp_Vbci) = Irbp_Vbci;
*(ckt->CKTstate0 + here->VBICibcp) = Ibcp;
*(ckt->CKTstate0 + here->VBICibcp_vbcp) = Ibcp_Vbcp;
*(ckt->CKTstate0 + here->VBICibcp_Vbcp) = Ibcp_Vbcp;
*(ckt->CKTstate0 + here->VBICiccp) = Iccp;
*(ckt->CKTstate0 + here->VBICiccp_vbep) = Iccp_Vbep;
*(ckt->CKTstate0 + here->VBICiccp_vbci) = Iccp_Vbci;
*(ckt->CKTstate0 + here->VBICiccp_vbcp) = Iccp_Vbcp;
*(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;
*(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;
if (here->VBIC_selfheat)
{
*(ckt->CKTstate0 + here->VBICcqcth) = Icth;
*(ckt->CKTstate0 + here->VBICicth_vrth) = Icth_Vrth;
*(ckt->CKTstate0 + here->VBICicth_Vrth) = Icth_Vrth;
here->VBICibe_Vrth = Ibe_Vrth;
here->VBICibex_Vrth = Ibex_Vrth;
here->VBICitzf_Vrth = Itzf_Vrth;
here->VBICitzf_vrth = Itzf_Vrth;
here->VBICitzr_Vrth = Itzr_Vrth;
here->VBICibc_Vrth = Ibc_Vrth;
here->VBICibep_Vrth = Ibep_Vrth;
@ -1109,6 +1116,25 @@ VBICload(GENmodel *inModel, CKTcircuit *ckt)
here->VBICith_Vrs = Ith_Vrs;
}
if (here->VBIC_excessPhase) {
*(ckt->CKTstate0 + here->VBICitxf) = Itxf;
*(ckt->CKTstate0 + here->VBICitxf_Vrxf) = Itxf_Vrxf;
*(ckt->CKTstate0 + here->VBICixxf) = Ixxf;
*(ckt->CKTstate0 + here->VBICixxf_Vrxf) = Ixxf_Vrxf;
*(ckt->CKTstate0 + here->VBICith_Vrxf) = Ith_Vrxf;
*(ckt->CKTstate0 + here->VBICqcxf) = Qcxf;
*(ckt->CKTstate0 + here->VBICcqcxf) = Icxf;
*(ckt->CKTstate0 + here->VBICgqcxf) = Icxf_Vcxf;
*(ckt->CKTstate0 + here->VBICibc_Vrxf) = Ibc_Vrxf;
*(ckt->CKTstate0 + here->VBICixzf) = Ixzf;
*(ckt->CKTstate0 + here->VBICixzf_Vbei) = Ixzf_Vbei;
*(ckt->CKTstate0 + here->VBICixzf_Vbci) = Ixzf_Vbci;
*(ckt->CKTstate0 + here->VBICixzf_Vrth) = Ixzf_Vrth;
if (here->VBIC_selfheat)
*(ckt->CKTstate0 + here->VBICith_Vrxf) = Ith_Vrxf;
*(ckt->CKTstate0 + here->VBICindFlux) = Flxf;
}
load:
/*
* load current excitation vector and matrix
@ -1160,10 +1186,10 @@ c Stamp element: Ibex
*(here->VBICemitEIBaseBXPtr) += -Ibex_Vbex;
*(here->VBICemitEIEmitEIPtr) += Ibex_Vbex;
if (!here->VBIC_excessPhase) {
/*
c Stamp element: Itzf
*/
if (!model->VBICdelayTimeFGiven) {
rhs_current = model->VBICtype * (Itzf - Itzf_Vbei*Vbei - Itzf_Vbci*Vbci);
*(ckt->CKTrhs + here->VBICcollCINode) += -rhs_current;
*(here->VBICcollCIBaseBIPtr) += Itzf_Vbei;
@ -1175,18 +1201,11 @@ c Stamp element: Itzf
*(here->VBICemitEIEmitEIPtr) += Itzf_Vbei;
*(here->VBICemitEIBaseBIPtr) += -Itzf_Vbci;
*(here->VBICemitEICollCIPtr) += Itzf_Vbci;
} else {
*(ckt->CKTrhs + here->VBICcollCINode) += -rhs_current;
*(here->VBICcollCIBaseBIPtr) += Ixzf_Vbei;
*(here->VBICcollCIEmitEIPtr) += -Ixzf_Vbei;
*(here->VBICcollCIBaseBIPtr) += Ixzf_Vbci;
*(here->VBICcollCICollCIPtr) += -Ixzf_Vbci;
*(ckt->CKTrhs + here->VBICemitEINode) += rhs_current;
*(here->VBICemitEIBaseBIPtr) += -Ixzf_Vbei;
*(here->VBICemitEIEmitEIPtr) += Ixzf_Vbei;
*(here->VBICemitEIBaseBIPtr) += -Ixzf_Vbci;
*(here->VBICemitEICollCIPtr) += Ixzf_Vbci;
// with respect to Vxf2
}
if (here->VBIC_excessPhase) {
/*
c Stamp element: Itxf
*/
rhs_current = model->VBICtype * (Itxf - Itxf_Vrxf*Vrxf);
*(ckt->CKTrhs + here->VBICcollCINode) += -rhs_current;
*(ckt->CKTrhs + here->VBICemitEINode) += rhs_current;
@ -1198,15 +1217,15 @@ c Stamp element: Itzr
*/
rhs_current = model->VBICtype * (Itzr - Itzr_Vbei*Vbei - Itzr_Vbci*Vbci);
*(ckt->CKTrhs + here->VBICemitEINode) += -rhs_current;
*(here->VBICemitEIBaseBIPtr) += Itzr_Vbei;
*(here->VBICemitEIEmitEIPtr) += -Itzr_Vbei;
*(here->VBICemitEIBaseBIPtr) += Itzr_Vbci;
*(here->VBICemitEICollCIPtr) += -Itzr_Vbci;
*(here->VBICemitEIBaseBIPtr) += Itzr_Vbei;
*(here->VBICemitEIEmitEIPtr) += -Itzr_Vbei;
*(ckt->CKTrhs + here->VBICcollCINode) += rhs_current;
*(here->VBICcollCIBaseBIPtr) += -Itzr_Vbei;
*(here->VBICcollCIEmitEIPtr) += Itzr_Vbei;
*(here->VBICcollCIBaseBIPtr) += -Itzr_Vbci;
*(here->VBICcollCICollCIPtr) += Itzr_Vbci;
*(here->VBICcollCIBaseBIPtr) += -Itzr_Vbei;
*(here->VBICcollCIEmitEIPtr) += Itzr_Vbei;
/*
c Stamp element: Ibc
*/
@ -1221,8 +1240,8 @@ c Stamp element: Ibc
*(here->VBICcollCICollCIPtr) += Ibc_Vbci;
*(here->VBICcollCIBaseBIPtr) += -Ibc_Vbei;
*(here->VBICcollCIEmitEIPtr) += Ibc_Vbei;
if (model->VBICdelayTimeFGiven) {
rhs_current = model->VBICtype * (Ibc - Ibc_Vrxf*Vrxf);
if (here->VBIC_excessPhase) {
rhs_current = model->VBICtype * -Ibc_Vrxf*Vrxf;
*(ckt->CKTrhs + here->VBICbaseBINode) += -rhs_current;
*(ckt->CKTrhs + here->VBICcollCINode) += rhs_current;
*(here->VBICbaseBIXf2Ptr) += Ibc_Vrxf;
@ -1367,22 +1386,17 @@ c Stamp element: Ibex
*(here->VBICbaseBXtempPtr) += Ibex_Vrth;
*(ckt->CKTrhs + here->VBICemitEINode) += rhs_current;
*(here->VBICemitEItempPtr) += -Ibex_Vrth;
if (!here->VBIC_excessPhase) {
/*
c Stamp element: Itzf
*/
if (!model->VBICdelayTimeFGiven) {
rhs_current = -Itzf_Vrth*Vrth;
*(ckt->CKTrhs + here->VBICcollCINode) += -rhs_current;
*(here->VBICcollCItempPtr) += Itzf_Vrth;
*(ckt->CKTrhs + here->VBICemitEINode) += rhs_current;
*(here->VBICemitEItempPtr) += -Itzf_Vrth;
} else {
rhs_current = -Ixzf_Vrth*Vrth;
*(ckt->CKTrhs + here->VBICcollCINode) += -rhs_current;
*(here->VBICcollCItempPtr) += Ixzf_Vrth;
*(ckt->CKTrhs + here->VBICemitEINode) += rhs_current;
*(here->VBICemitEItempPtr) += -Ixzf_Vrth;
}
}
/*
c Stamp element: Itzr
*/
@ -1533,27 +1547,33 @@ c Stamp element: Ith
*(here->VBICtempEmitEIPtr) += +Ith_Vre;
*(here->VBICtempSubsPtr) += -Ith_Vrs;
*(here->VBICtempSubsSIPtr) += +Ith_Vrs;
if (model->VBICdelayTimeFGiven) {
if (here->VBIC_excessPhase) {
rhs_current = -Ith_Vrxf*Vrxf;
*(ckt->CKTrhs + here->VBICxf2Node) += -rhs_current;
*(here->VBICtempXf2Ptr) += +Ith_Vrxf;
}
}
if (model->VBICdelayTimeFGiven) {
// Branch: xf1-ground, Stamp element: Ixzf f_xf1=+
rhs_current = Ixzf - Ixzf_Vbci*Vbci - Ixzf_Vbei*Vbei;
*(ckt->CKTrhs + here->VBICxf1Node) += -rhs_current; // rhs_current; // into xf1 node
if (here->VBIC_excessPhase) {
/*
c Stamp element: Ixzf, Branch: xf1-ground
*/
rhs_current = Ixzf - Ixzf_Vbci*Vbci - Ixzf_Vbei*Vbei;
*(ckt->CKTrhs + here->VBICxf1Node) += -rhs_current; // into xf1 node
*(here->VBICxf1BaseBIPtr) += +Ixzf_Vbei;
*(here->VBICxf1EmitEIPtr) += -Ixzf_Vbei;
*(here->VBICxf1BaseBIPtr) += +Ixzf_Vbci;
*(here->VBICxf1CollCIPtr) += -Ixzf_Vbci;
// Branch: xf2-ground, Stamp element: Ixxf f_xf2=+
rhs_current = Ixxf - Ixxf_Vrxf*Vrxf;
*(ckt->CKTrhs + here->VBICxf2Node) += -rhs_current; // rhs_current; // into xf2 node
if (here->VBIC_selfheat) {
rhs_current = -Ixzf_Vrth*Vrth;
*(ckt->CKTrhs + here->VBICxf1Node) += -rhs_current;
*(here->VBICxf1TempPtr) += Ixzf_Vrth;
}
/*
c Stamp element: Ixxf, Branch: xf2-ground
*/
rhs_current = Ixxf - Ixxf_Vrxf*Vrxf;
*(ckt->CKTrhs + here->VBICxf2Node) += -rhs_current; // into xf2 node
*(here->VBICxf2Xf2Ptr) += +Ixxf_Vrxf;
*(here->VBICxf2Xf1Ptr) += -Ixxf_Vrxf;
/*
c Stamp element: Qcxf
*/
@ -1563,19 +1583,12 @@ c Stamp element: Qcxf
/*
c Stamp element: L = TD/3
*/
// rhs_current = Ixzf - Ixxf;
// *(ckt->CKTrhs + here->VBICxf1Node) += -rhs_current;
// *(here->VBICxf1Xf2Ptr) += -1.0;
// rhs_current = Ixxf + Ixzf;
// *(ckt->CKTrhs + here->VBICxf2Node) += -rhs_current;
// *(here->VBICxf2Xf1Ptr) += 1.0;
*(ckt->CKTrhs+here->VBICbrEq) += veq;
*(ckt->CKTrhs+here->VBICbrEq) += Vxf1xf2;
*(here->VBICxf1IbrPtr) += 1;
*(here->VBICxf2IbrPtr) -= 1;
*(here->VBICibrXf1Ptr) += 1;
*(here->VBICibrXf2Ptr) -= 1;
*(here->VBICibrIbrPtr) -= req;
*(here->VBICibrIbrPtr) -= Rxf1xf2;
}
}

View File

@ -101,31 +101,31 @@ VBICnoise (int mode, int operation, GENmodel *genmodel, CKTcircuit *ckt, Ndata *
NevalSrcInstanceTemp(&noizDens[VBICRCNOIZ],&lnNdens[VBICRCNOIZ],
ckt,THERMNOISE,inst->VBICcollCXNode,inst->VBICcollNode,
*(ckt->CKTstate0 + inst->VBICircx_vrcx), dtemp);
*(ckt->CKTstate0 + inst->VBICircx_Vrcx), dtemp);
NevalSrcInstanceTemp(&noizDens[VBICRCINOIZ],&lnNdens[VBICRCINOIZ],
ckt,THERMNOISE,inst->VBICcollCXNode,inst->VBICcollCINode,
*(ckt->CKTstate0 + inst->VBICirci_vrci), dtemp);
*(ckt->CKTstate0 + inst->VBICirci_Vrci), dtemp);
NevalSrcInstanceTemp(&noizDens[VBICRBNOIZ],&lnNdens[VBICRBNOIZ],
ckt,THERMNOISE,inst->VBICbaseBXNode,inst->VBICbaseNode,
*(ckt->CKTstate0 + inst->VBICirbx_vrbx), dtemp);
*(ckt->CKTstate0 + inst->VBICirbx_Vrbx), dtemp);
NevalSrcInstanceTemp(&noizDens[VBICRBINOIZ],&lnNdens[VBICRBINOIZ],
ckt,THERMNOISE,inst->VBICbaseBXNode,inst->VBICbaseBINode,
*(ckt->CKTstate0 + inst->VBICirbi_vrbi), dtemp);
*(ckt->CKTstate0 + inst->VBICirbi_Vrbi), dtemp);
NevalSrcInstanceTemp(&noizDens[VBICRENOIZ],&lnNdens[VBICRENOIZ],
ckt,THERMNOISE,inst->VBICemitEINode,inst->VBICemitNode,
*(ckt->CKTstate0 + inst->VBICire_vre), dtemp);
*(ckt->CKTstate0 + inst->VBICire_Vre), dtemp);
NevalSrcInstanceTemp(&noizDens[VBICRBPNOIZ],&lnNdens[VBICRBPNOIZ],
ckt,THERMNOISE,inst->VBICemitEINode,inst->VBICemitNode,
*(ckt->CKTstate0 + inst->VBICirbp_vrbp), dtemp);
*(ckt->CKTstate0 + inst->VBICirbp_Vrbp), dtemp);
NevalSrcInstanceTemp(&noizDens[VBICRSNOIZ],&lnNdens[VBICRSNOIZ],
ckt,THERMNOISE,inst->VBICsubsSINode,inst->VBICsubsNode,
*(ckt->CKTstate0 + inst->VBICirs_vrs), dtemp);
*(ckt->CKTstate0 + inst->VBICirs_Vrs), dtemp);
NevalSrc(&noizDens[VBICICNOIZ],&lnNdens[VBICICNOIZ],

View File

@ -39,32 +39,32 @@ VBICpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s)
for( here = VBICinstances(model); here!= NULL;
here = VBICnextInstance(here)) {
Ibe_Vbei = *(ckt->CKTstate0 + here->VBICibe_vbei);
Ibex_Vbex = *(ckt->CKTstate0 + here->VBICibex_vbex);
Itzf_Vbei = *(ckt->CKTstate0 + here->VBICitzf_vbei);
Itzf_Vbci = *(ckt->CKTstate0 + here->VBICitzf_vbci);
Itzr_Vbci = *(ckt->CKTstate0 + here->VBICitzr_vbci);
Itzr_Vbei = *(ckt->CKTstate0 + here->VBICitzr_vbei);
Ibc_Vbci = *(ckt->CKTstate0 + here->VBICibc_vbci);
Ibc_Vbei = *(ckt->CKTstate0 + here->VBICibc_vbei);
Ibep_Vbep = *(ckt->CKTstate0 + here->VBICibep_vbep);
Irci_Vrci = *(ckt->CKTstate0 + here->VBICirci_vrci);
Irci_Vbci = *(ckt->CKTstate0 + here->VBICirci_vbci);
Irci_Vbcx = *(ckt->CKTstate0 + here->VBICirci_vbcx);
Irbi_Vrbi = *(ckt->CKTstate0 + here->VBICirbi_vrbi);
Irbi_Vbei = *(ckt->CKTstate0 + here->VBICirbi_vbei);
Irbi_Vbci = *(ckt->CKTstate0 + here->VBICirbi_vbci);
Irbp_Vrbp = *(ckt->CKTstate0 + here->VBICirbp_vrbp);
Irbp_Vbep = *(ckt->CKTstate0 + here->VBICirbp_vbep);
Irbp_Vbci = *(ckt->CKTstate0 + here->VBICirbp_vbci);
Ibcp_Vbcp = *(ckt->CKTstate0 + here->VBICibcp_vbcp);
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);
Ibe_Vbei = *(ckt->CKTstate0 + here->VBICibe_Vbei);
Ibex_Vbex = *(ckt->CKTstate0 + here->VBICibex_Vbex);
Itzf_Vbei = *(ckt->CKTstate0 + here->VBICitzf_Vbei);
Itzf_Vbci = *(ckt->CKTstate0 + here->VBICitzf_Vbci);
Itzr_Vbci = *(ckt->CKTstate0 + here->VBICitzr_Vbci);
Itzr_Vbei = *(ckt->CKTstate0 + here->VBICitzr_Vbei);
Ibc_Vbci = *(ckt->CKTstate0 + here->VBICibc_Vbci);
Ibc_Vbei = *(ckt->CKTstate0 + here->VBICibc_Vbei);
Ibep_Vbep = *(ckt->CKTstate0 + here->VBICibep_Vbep);
Irci_Vrci = *(ckt->CKTstate0 + here->VBICirci_Vrci);
Irci_Vbci = *(ckt->CKTstate0 + here->VBICirci_Vbci);
Irci_Vbcx = *(ckt->CKTstate0 + here->VBICirci_Vbcx);
Irbi_Vrbi = *(ckt->CKTstate0 + here->VBICirbi_Vrbi);
Irbi_Vbei = *(ckt->CKTstate0 + here->VBICirbi_Vbei);
Irbi_Vbci = *(ckt->CKTstate0 + here->VBICirbi_Vbci);
Irbp_Vrbp = *(ckt->CKTstate0 + here->VBICirbp_Vrbp);
Irbp_Vbep = *(ckt->CKTstate0 + here->VBICirbp_Vbep);
Irbp_Vbci = *(ckt->CKTstate0 + here->VBICirbp_Vbci);
Ibcp_Vbcp = *(ckt->CKTstate0 + here->VBICibcp_Vbcp);
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

View File

@ -482,6 +482,12 @@ VBICsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
if((model->VBICthermalResistGiven) && (model->VBICthermalCapacitance < 1e-12))
model->VBICthermalCapacitance = 1e-12;
if((model->VBICdelayTimeFGiven) && (model->VBICdelayTimeF > 0.0)) {
here->VBICindInduct = model->VBICdelayTimeF / 3.0 / here->VBICm;
here->VBIC_excessPhase = 1;
} else {
here->VBIC_excessPhase = 0;
}
if(here->VBICcollCINode == 0) {
error = CKTmkVolt(ckt, &tmp, here->VBICname, "collCI");
@ -501,7 +507,7 @@ VBICsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
here->VBICbaseBINode = tmp->number;
}
if (model->VBICdelayTimeFGiven) {
if (here->VBIC_excessPhase) {
if(here->VBICxf1Node == 0) {
error = CKTmkVolt(ckt, &tmp, here->VBICname, "xf1");
if(error) return(error);
@ -605,26 +611,24 @@ do { if((here->ptr = SMPmakeElt(matrix, here->first, here->second)) == NULL){\
TSTALLOC(VBICtempSubsPtr,VBICtempNode,VBICsubsNode);
TSTALLOC(VBICtempSubsSIPtr,VBICtempNode,VBICsubsSINode);
TSTALLOC(VBICtempTempPtr,VBICtempNode,VBICtempNode);
if (model->VBICdelayTimeFGiven) {
if (here->VBIC_excessPhase) {
TSTALLOC(VBICtempXf2Ptr, VBICtempNode, VBICxf2Node);
TSTALLOC(VBICxf1TempPtr, VBICxf1Node ,VBICtempNode);
}
}
if (model->VBICdelayTimeFGiven) {
TSTALLOC(VBICxf1Xf1Ptr ,VBICxf1Node ,VBICxf1Node);
TSTALLOC(VBICxf1BaseBIPtr,VBICxf1Node ,VBICbaseBINode);
TSTALLOC(VBICxf1EmitEIPtr,VBICxf1Node ,VBICemitEINode);
TSTALLOC(VBICxf1CollCIPtr,VBICxf1Node ,VBICcollCINode);
TSTALLOC(VBICxf1Xf2Ptr ,VBICxf1Node ,VBICxf2Node);
if (here->VBIC_excessPhase) {
TSTALLOC(VBICxf1Xf1Ptr , VBICxf1Node , VBICxf1Node);
TSTALLOC(VBICxf1Xf2Ptr , VBICxf1Node , VBICxf2Node);
TSTALLOC(VBICxf1CollCIPtr, VBICxf1Node , VBICcollCINode);
TSTALLOC(VBICxf1BaseBIPtr, VBICxf1Node , VBICbaseBINode);
TSTALLOC(VBICxf1EmitEIPtr, VBICxf1Node , VBICemitEINode);
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);
TSTALLOC(VBICxf2Xf2Ptr , VBICxf2Node , VBICxf2Node);
TSTALLOC(VBICxf2Xf1Ptr , VBICxf2Node , VBICxf1Node);
TSTALLOC(VBICcollCIXf2Ptr, VBICcollCINode, VBICxf2Node);
TSTALLOC(VBICbaseBIXf2Ptr, VBICbaseBINode, VBICxf2Node);
TSTALLOC(VBICemitEIXf2Ptr, VBICemitEINode, VBICxf2Node);
TSTALLOC(VBICxf1IbrPtr, VBICxf1Node, VBICbrEq);
TSTALLOC(VBICxf2IbrPtr, VBICxf2Node, VBICbrEq);
@ -684,7 +688,7 @@ VBICunsetup(
CKTdltNNum(ckt, here->VBICcollCXNode);
here->VBICcollCXNode = 0;
if (model->VBICdelayTimeFGiven) {
if (here->VBIC_excessPhase) {
if(here->VBICxf1Node > 0)
CKTdltNNum(ckt, here->VBICxf1Node);
here->VBICxf1Node = 0;