completed all del voltages
This commit is contained in:
parent
d32ff77aef
commit
55367a44a5
|
|
@ -29,6 +29,10 @@ HICUMconvTest(GENmodel *inModel, CKTcircuit *ckt)
|
|||
double delvbpci;
|
||||
double delvsici;
|
||||
double delvrth;
|
||||
double delvciei;
|
||||
double delvcic;
|
||||
double delvbbp;
|
||||
double delveie;
|
||||
|
||||
double ibieihat;
|
||||
double ibicihat;
|
||||
|
|
@ -40,7 +44,7 @@ HICUMconvTest(GENmodel *inModel, CKTcircuit *ckt)
|
|||
double isicihat;
|
||||
double volatile ithhat;
|
||||
|
||||
double Vbiei, Vbici, Vciei, Vbpei, Vbpbi, Vbpci, Vbci, Vsici, Vrth;
|
||||
double Vbiei, Vbici, Vciei, Vbpei, Vbpbi, Vbpci, Vbci, Vsici, Vrth, Vcic, Vbbp, Veie;
|
||||
double Ibiei, Ibici, Iciei, Ibpei, Ibpbi, Ibpci, Ibpsi, Isici, Ith;
|
||||
|
||||
for( ; model != NULL; model = HICUMnextModel(model)) {
|
||||
|
|
@ -67,6 +71,16 @@ HICUMconvTest(GENmodel *inModel, CKTcircuit *ckt)
|
|||
Vsici = model->HICUMtype*(
|
||||
*(ckt->CKTrhsOld+here->HICUMsubsSINode)-
|
||||
*(ckt->CKTrhsOld+here->HICUMcollCINode));
|
||||
Vcic = model->HICUMtype*(
|
||||
*(ckt->CKTrhsOld+here->HICUMcollCINode)-
|
||||
*(ckt->CKTrhsOld+here->HICUMcollNode));
|
||||
Vbbp = model->HICUMtype*(
|
||||
*(ckt->CKTrhsOld+here->HICUMbaseNode)-
|
||||
*(ckt->CKTrhsOld+here->HICUMbaseBPNode));
|
||||
Veie = model->HICUMtype*(
|
||||
*(ckt->CKTrhsOld+here->HICUMemitNode)-
|
||||
*(ckt->CKTrhsOld+here->HICUMemitEINode));
|
||||
|
||||
Vciei = Vbiei - Vbici;
|
||||
Vrth = model->HICUMtype*(*(ckt->CKTrhsOld+here->HICUMtempNode));
|
||||
|
||||
|
|
@ -77,6 +91,10 @@ HICUMconvTest(GENmodel *inModel, CKTcircuit *ckt)
|
|||
delvbpci = Vbpci - *(ckt->CKTstate0 + here->HICUMvbpci);
|
||||
delvsici = Vsici - *(ckt->CKTstate0 + here->HICUMvsici);
|
||||
delvrth = Vrth - *(ckt->CKTstate0 + here->HICUMvrth);
|
||||
delvciei = delvbiei-delvbici;
|
||||
delvcic = Vcic - *(ckt->CKTstate0 + here->HICUMvcic);
|
||||
delvbbp = Vbbp - *(ckt->CKTstate0 + here->HICUMvbbp);
|
||||
delveie = Veie - *(ckt->CKTstate0 + here->HICUMveie);
|
||||
|
||||
ibieihat = *(ckt->CKTstate0 + here->HICUMibiei) +
|
||||
*(ckt->CKTstate0 + here->HICUMibiei_Vbiei)*delvbiei +
|
||||
|
|
@ -108,7 +126,17 @@ HICUMconvTest(GENmodel *inModel, CKTcircuit *ckt)
|
|||
*(ckt->CKTstate0 + here->HICUMisici_Vrth)*delvrth+
|
||||
*(ckt->CKTstate0 + here->HICUMisici_Vsici)*delvsici;
|
||||
ithhat = *(ckt->CKTstate0 + here->HICUMith) +
|
||||
*(ckt->CKTstate0 + here->HICUMith_Vrth)*delvrth;
|
||||
*(ckt->CKTstate0 + here->HICUMith_Vrth)*delvrth+
|
||||
*(ckt->CKTstate0 + here->HICUMith_Vbiei)*delvbiei+
|
||||
*(ckt->CKTstate0 + here->HICUMith_Vbici)*delvbici+
|
||||
*(ckt->CKTstate0 + here->HICUMith_Vbpbi)*delvbpbi+
|
||||
*(ckt->CKTstate0 + here->HICUMith_Vbpci)*delvbpci+
|
||||
*(ckt->CKTstate0 + here->HICUMith_Vbpei)*delvbpei+
|
||||
*(ckt->CKTstate0 + here->HICUMith_Vciei)*delvciei+
|
||||
*(ckt->CKTstate0 + here->HICUMith_Vsici)*delvsici+
|
||||
*(ckt->CKTstate0 + here->HICUMith_Vcic)*delvcic+
|
||||
*(ckt->CKTstate0 + here->HICUMith_Vbbp)*delvbbp+
|
||||
*(ckt->CKTstate0 + here->HICUMith_Veie)*delveie;
|
||||
|
||||
Ibiei = *(ckt->CKTstate0 + here->HICUMibiei);
|
||||
Ibici = *(ckt->CKTstate0 + here->HICUMibici);
|
||||
|
|
|
|||
|
|
@ -310,136 +310,149 @@ typedef struct sHICUMinstance {
|
|||
#define HICUMvbpbi HICUMstate+3
|
||||
#define HICUMvbpci HICUMstate+4
|
||||
#define HICUMvsici HICUMstate+5
|
||||
#define HICUMvcic HICUMstate+6
|
||||
#define HICUMvbbp HICUMstate+7
|
||||
#define HICUMveie HICUMstate+8
|
||||
|
||||
#define HICUMibiei HICUMstate+6
|
||||
#define HICUMibiei_Vbiei HICUMstate+7
|
||||
#define HICUMibiei_Vbici HICUMstate+8
|
||||
#define HICUMibiei_Vrth HICUMstate+9
|
||||
#define HICUMibiei HICUMstate+9
|
||||
#define HICUMibiei_Vbiei HICUMstate+10
|
||||
#define HICUMibiei_Vbici HICUMstate+11
|
||||
#define HICUMibiei_Vrth HICUMstate+12
|
||||
|
||||
#define HICUMibpei HICUMstate+10
|
||||
#define HICUMibpei_Vbpei HICUMstate+11
|
||||
#define HICUMibpei_Vrth HICUMstate+12
|
||||
#define HICUMibpei HICUMstate+13
|
||||
#define HICUMibpei_Vbpei HICUMstate+14
|
||||
#define HICUMibpei_Vrth HICUMstate+15
|
||||
|
||||
#define HICUMiciei HICUMstate+13
|
||||
#define HICUMiciei_Vbiei HICUMstate+14
|
||||
#define HICUMiciei_Vbici HICUMstate+15
|
||||
#define HICUMiciei_Vrth HICUMstate+16
|
||||
#define HICUMiciei HICUMstate+16
|
||||
#define HICUMiciei_Vbiei HICUMstate+17
|
||||
#define HICUMiciei_Vbici HICUMstate+18
|
||||
#define HICUMiciei_Vrth HICUMstate+19
|
||||
|
||||
#define HICUMibici HICUMstate+17
|
||||
#define HICUMibici_Vbici HICUMstate+18
|
||||
#define HICUMibici_Vbiei HICUMstate+19
|
||||
#define HICUMibici_Vrth HICUMstate+20
|
||||
#define HICUMibici HICUMstate+20
|
||||
#define HICUMibici_Vbici HICUMstate+21
|
||||
#define HICUMibici_Vbiei HICUMstate+22
|
||||
#define HICUMibici_Vrth HICUMstate+23
|
||||
|
||||
#define HICUMibpbi HICUMstate+21
|
||||
#define HICUMibpbi_Vbpbi HICUMstate+22
|
||||
#define HICUMibpbi_Vbiei HICUMstate+23
|
||||
#define HICUMibpbi_Vbici HICUMstate+24
|
||||
#define HICUMibpbi_Vrth HICUMstate+25
|
||||
#define HICUMibpbi HICUMstate+24
|
||||
#define HICUMibpbi_Vbpbi HICUMstate+25
|
||||
#define HICUMibpbi_Vbiei HICUMstate+26
|
||||
#define HICUMibpbi_Vbici HICUMstate+27
|
||||
#define HICUMibpbi_Vrth HICUMstate+28
|
||||
|
||||
#define HICUMibpci HICUMstate+26
|
||||
#define HICUMibpci_Vbpci HICUMstate+27
|
||||
#define HICUMibpci_Vrth HICUMstate+28
|
||||
#define HICUMibpci HICUMstate+29
|
||||
#define HICUMibpci_Vbpci HICUMstate+30
|
||||
#define HICUMibpci_Vrth HICUMstate+31
|
||||
|
||||
#define HICUMisici HICUMstate+29
|
||||
#define HICUMisici_Vsici HICUMstate+30
|
||||
#define HICUMisici_Vrth HICUMstate+31
|
||||
#define HICUMisici HICUMstate+32
|
||||
#define HICUMisici_Vsici HICUMstate+33
|
||||
#define HICUMisici_Vrth HICUMstate+34
|
||||
|
||||
#define HICUMibpsi HICUMstate+32
|
||||
#define HICUMibpsi_Vbpci HICUMstate+33
|
||||
#define HICUMibpsi_Vsici HICUMstate+34
|
||||
#define HICUMibpsi_Vrth HICUMstate+35
|
||||
#define HICUMibpsi HICUMstate+35
|
||||
#define HICUMibpsi_Vbpci HICUMstate+36
|
||||
#define HICUMibpsi_Vsici HICUMstate+37
|
||||
#define HICUMibpsi_Vrth HICUMstate+38
|
||||
|
||||
#define HICUMisis_Vsis HICUMstate+36
|
||||
#define HICUMisis_Vsis HICUMstate+39
|
||||
|
||||
#define HICUMieie HICUMstate+39 // needed for re-flicker noise
|
||||
#define HICUMieie_Vrth HICUMstate+40
|
||||
#define HICUMieie HICUMstate+40 // needed for re-flicker noise
|
||||
#define HICUMieie_Vrth HICUMstate+41
|
||||
|
||||
#define HICUMqrbi HICUMstate+41
|
||||
#define HICUMcqrbi HICUMstate+42
|
||||
#define HICUMqrbi HICUMstate+42
|
||||
#define HICUMcqrbi HICUMstate+43
|
||||
|
||||
#define HICUMqjei HICUMstate+43
|
||||
#define HICUMcqjei HICUMstate+44
|
||||
#define HICUMqjei HICUMstate+44
|
||||
#define HICUMcqjei HICUMstate+45
|
||||
|
||||
#define HICUMqdeix HICUMstate+45
|
||||
#define HICUMcqdeix HICUMstate+46
|
||||
#define HICUMqdeix HICUMstate+46
|
||||
#define HICUMcqdeix HICUMstate+47
|
||||
|
||||
#define HICUMqjci HICUMstate+47
|
||||
#define HICUMcqjci HICUMstate+48
|
||||
#define HICUMqjci HICUMstate+48
|
||||
#define HICUMcqjci HICUMstate+49
|
||||
|
||||
#define HICUMqdci HICUMstate+49
|
||||
#define HICUMcqdci HICUMstate+50
|
||||
#define HICUMqdci HICUMstate+50
|
||||
#define HICUMcqdci HICUMstate+51
|
||||
|
||||
#define HICUMqjep HICUMstate+51
|
||||
#define HICUMcqjep HICUMstate+52
|
||||
#define HICUMqjep HICUMstate+52
|
||||
#define HICUMcqjep HICUMstate+53
|
||||
|
||||
#define HICUMqjcx0_i HICUMstate+53
|
||||
#define HICUMcqcx0_t_i HICUMstate+54
|
||||
#define HICUMqjcx0_i HICUMstate+54
|
||||
#define HICUMcqcx0_t_i HICUMstate+55
|
||||
|
||||
#define HICUMqjcx0_ii HICUMstate+55
|
||||
#define HICUMcqcx0_t_ii HICUMstate+56
|
||||
#define HICUMqjcx0_ii HICUMstate+56
|
||||
#define HICUMcqcx0_t_ii HICUMstate+57
|
||||
|
||||
#define HICUMqdsu HICUMstate+57
|
||||
#define HICUMcqdsu HICUMstate+58
|
||||
#define HICUMqdsu HICUMstate+58
|
||||
#define HICUMcqdsu HICUMstate+59
|
||||
|
||||
#define HICUMqjs HICUMstate+59
|
||||
#define HICUMcqjs HICUMstate+60
|
||||
#define HICUMqjs HICUMstate+60
|
||||
#define HICUMcqjs HICUMstate+61
|
||||
|
||||
#define HICUMqscp HICUMstate+61
|
||||
#define HICUMcqscp HICUMstate+62
|
||||
#define HICUMqscp HICUMstate+62
|
||||
#define HICUMcqscp HICUMstate+63
|
||||
|
||||
#define HICUMqbepar1 HICUMstate+63
|
||||
#define HICUMcqbepar1 HICUMstate+64
|
||||
#define HICUMgqbepar1 HICUMstate+65
|
||||
#define HICUMqbepar1 HICUMstate+64
|
||||
#define HICUMcqbepar1 HICUMstate+65
|
||||
#define HICUMgqbepar1 HICUMstate+66
|
||||
|
||||
#define HICUMqbepar2 HICUMstate+66
|
||||
#define HICUMcqbepar2 HICUMstate+66
|
||||
#define HICUMgqbepar2 HICUMstate+67
|
||||
#define HICUMqbepar2 HICUMstate+67
|
||||
#define HICUMcqbepar2 HICUMstate+68
|
||||
#define HICUMgqbepar2 HICUMstate+69
|
||||
|
||||
#define HICUMqbcpar1 HICUMstate+68
|
||||
#define HICUMcqbcpar1 HICUMstate+69
|
||||
#define HICUMgqbcpar1 HICUMstate+70
|
||||
#define HICUMqbcpar1 HICUMstate+70
|
||||
#define HICUMcqbcpar1 HICUMstate+71
|
||||
#define HICUMgqbcpar1 HICUMstate+72
|
||||
|
||||
#define HICUMqbcpar2 HICUMstate+71
|
||||
#define HICUMcqbcpar2 HICUMstate+72
|
||||
#define HICUMgqbcpar2 HICUMstate+73
|
||||
#define HICUMqbcpar2 HICUMstate+73
|
||||
#define HICUMcqbcpar2 HICUMstate+74
|
||||
#define HICUMgqbcpar2 HICUMstate+75
|
||||
|
||||
#define HICUMqsu HICUMstate+74
|
||||
#define HICUMcqsu HICUMstate+75
|
||||
#define HICUMgqsu HICUMstate+76
|
||||
#define HICUMqsu HICUMstate+76
|
||||
#define HICUMcqsu HICUMstate+77
|
||||
#define HICUMgqsu HICUMstate+78
|
||||
|
||||
#define HICUMqcth HICUMstate+77 /* thermal capacitor charge */
|
||||
#define HICUMcqcth HICUMstate+78 /* thermal capacitor current */
|
||||
#define HICUMqcth HICUMstate+79 /* thermal capacitor charge */
|
||||
#define HICUMcqcth HICUMstate+80 /* thermal capacitor current */
|
||||
|
||||
#define HICUMvrth HICUMstate+79
|
||||
#define HICUMicth_dT HICUMstate+80
|
||||
#define HICUMvrth HICUMstate+81
|
||||
#define HICUMicth_dT HICUMstate+82
|
||||
|
||||
#define HICUMvxf HICUMstate+81
|
||||
#define HICUMqxf HICUMstate+82
|
||||
#define HICUMcqxf HICUMstate+83
|
||||
#define HICUMgqxf HICUMstate+84
|
||||
#define HICUMixf_Vbiei HICUMstate+85
|
||||
#define HICUMixf_Vbici HICUMstate+86
|
||||
#define HICUMvxf HICUMstate+83
|
||||
#define HICUMqxf HICUMstate+84
|
||||
#define HICUMcqxf HICUMstate+85
|
||||
#define HICUMgqxf HICUMstate+86
|
||||
#define HICUMixf_Vbiei HICUMstate+87
|
||||
#define HICUMixf_Vbici HICUMstate+88
|
||||
|
||||
#define HICUMvxf1 HICUMstate+87
|
||||
#define HICUMqxf1 HICUMstate+88
|
||||
#define HICUMcqxf1 HICUMstate+89
|
||||
#define HICUMgqxf1 HICUMstate+90
|
||||
#define HICUMixf1_Vbiei HICUMstate+91
|
||||
#define HICUMixf1_Vbici HICUMstate+92
|
||||
#define HICUMixf1_Vfx2 HICUMstate+93
|
||||
#define HICUMvxf1 HICUMstate+89
|
||||
#define HICUMqxf1 HICUMstate+90
|
||||
#define HICUMcqxf1 HICUMstate+91
|
||||
#define HICUMgqxf1 HICUMstate+92
|
||||
#define HICUMixf1_Vbiei HICUMstate+93
|
||||
#define HICUMixf1_Vbici HICUMstate+94
|
||||
#define HICUMixf1_Vfx2 HICUMstate+95
|
||||
|
||||
#define HICUMvxf2 HICUMstate+94
|
||||
#define HICUMqxf2 HICUMstate+95
|
||||
#define HICUMcqxf2 HICUMstate+96
|
||||
#define HICUMgqxf2 HICUMstate+97
|
||||
#define HICUMixf2_Vbiei HICUMstate+98
|
||||
#define HICUMixf2_Vbici HICUMstate+99
|
||||
#define HICUMixf2_Vfx1 HICUMstate+100
|
||||
#define HICUMvxf2 HICUMstate+96
|
||||
#define HICUMqxf2 HICUMstate+97
|
||||
#define HICUMcqxf2 HICUMstate+98
|
||||
#define HICUMgqxf2 HICUMstate+99
|
||||
#define HICUMixf2_Vbiei HICUMstate+100
|
||||
#define HICUMixf2_Vbici HICUMstate+101
|
||||
#define HICUMixf2_Vfx1 HICUMstate+102
|
||||
|
||||
#define HICUMith HICUMstate+101
|
||||
#define HICUMith_Vrth HICUMstate+102
|
||||
#define HICUMith HICUMstate+103
|
||||
#define HICUMith_Vrth HICUMstate+104
|
||||
#define HICUMith_Vbiei HICUMstate+105
|
||||
#define HICUMith_Vbici HICUMstate+106
|
||||
#define HICUMith_Vbpbi HICUMstate+107
|
||||
#define HICUMith_Vbpci HICUMstate+108
|
||||
#define HICUMith_Vbpei HICUMstate+109
|
||||
#define HICUMith_Vciei HICUMstate+110
|
||||
#define HICUMith_Vsici HICUMstate+111
|
||||
#define HICUMith_Vcic HICUMstate+112
|
||||
#define HICUMith_Vbbp HICUMstate+113
|
||||
#define HICUMith_Veie HICUMstate+114
|
||||
|
||||
#define HICUMnumStates 103
|
||||
#define HICUMnumStates 115
|
||||
|
||||
/* per model data */
|
||||
typedef struct sHICUMmodel { /* model structure for a hicum */
|
||||
|
|
|
|||
|
|
@ -462,7 +462,7 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
#ifndef PREDICTOR
|
||||
double xfact;
|
||||
#endif
|
||||
double delvbiei=0.0, delvbici=0.0, delvbpei=0.0, delvbpbi=0.0, delvbpci=0.0, delvsici=0.0;
|
||||
double delvbiei=0.0, delvbici=0.0, delvbpei=0.0, delvbpbi=0.0, delvbpci=0.0, delvsici=0.0, delvbbp=0.0, delveie=0.0, delvciei=0.0, delvcic=0.0;
|
||||
double ibieihat;
|
||||
double ibpeihat;
|
||||
double icieihat;
|
||||
|
|
@ -1483,13 +1483,16 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
// *(ckt->CKTstate0 + here->HICUMqcth) =
|
||||
// *(ckt->CKTstate1 + here->HICUMqcth);
|
||||
// }
|
||||
|
||||
//done with copy&paste plus VIM macro ... thank god for VIM.
|
||||
*(ckt->CKTstate0+here->HICUMvbiei)=*(ckt->CKTstate1+here->HICUMvbiei);
|
||||
*(ckt->CKTstate0+here->HICUMvbici)=*(ckt->CKTstate1+here->HICUMvbici);
|
||||
*(ckt->CKTstate0+here->HICUMvbpei)=*(ckt->CKTstate1+here->HICUMvbpei);
|
||||
*(ckt->CKTstate0+here->HICUMvbpbi)=*(ckt->CKTstate1+here->HICUMvbpbi);
|
||||
*(ckt->CKTstate0+here->HICUMvbpci)=*(ckt->CKTstate1+here->HICUMvbpci);
|
||||
*(ckt->CKTstate0+here->HICUMvsici)=*(ckt->CKTstate1+here->HICUMvsici);
|
||||
*(ckt->CKTstate0+here->HICUMvcic)=*(ckt->CKTstate1+here->HICUMvcic);
|
||||
*(ckt->CKTstate0+here->HICUMvbbp)=*(ckt->CKTstate1+here->HICUMvbbp);
|
||||
*(ckt->CKTstate0+here->HICUMveie)=*(ckt->CKTstate1+here->HICUMveie);
|
||||
*(ckt->CKTstate0+here->HICUMibiei)=*(ckt->CKTstate1+here->HICUMibiei);
|
||||
*(ckt->CKTstate0+here->HICUMibiei_Vbiei)=*(ckt->CKTstate1+here->HICUMibiei_Vbiei);
|
||||
*(ckt->CKTstate0+here->HICUMibiei_Vbici)=*(ckt->CKTstate1+here->HICUMibiei_Vbici);
|
||||
|
|
@ -1586,6 +1589,17 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
*(ckt->CKTstate0+here->HICUMixf2_Vfx1)=*(ckt->CKTstate1+here->HICUMixf2_Vfx1);
|
||||
*(ckt->CKTstate0+here->HICUMith)=*(ckt->CKTstate1+here->HICUMith);
|
||||
*(ckt->CKTstate0+here->HICUMith_Vrth)=*(ckt->CKTstate1+here->HICUMith_Vrth);
|
||||
*(ckt->CKTstate0+here->HICUMith_Vbiei)=*(ckt->CKTstate1+here->HICUMith_Vbiei);
|
||||
*(ckt->CKTstate0+here->HICUMith_Vbici)=*(ckt->CKTstate1+here->HICUMith_Vbici);
|
||||
*(ckt->CKTstate0+here->HICUMith_Vbpci)=*(ckt->CKTstate1+here->HICUMith_Vbpci);
|
||||
*(ckt->CKTstate0+here->HICUMith_Vbpei)=*(ckt->CKTstate1+here->HICUMith_Vbpei);
|
||||
*(ckt->CKTstate0+here->HICUMith_Vciei)=*(ckt->CKTstate1+here->HICUMith_Vciei);
|
||||
*(ckt->CKTstate0+here->HICUMith_Vsici)=*(ckt->CKTstate1+here->HICUMith_Vsici);
|
||||
*(ckt->CKTstate0+here->HICUMith_Vcic)=*(ckt->CKTstate1+here->HICUMith_Vcic);
|
||||
*(ckt->CKTstate0+here->HICUMith_Vbbp)=*(ckt->CKTstate1+here->HICUMith_Vbbp);
|
||||
*(ckt->CKTstate0+here->HICUMith_Veie)=*(ckt->CKTstate1+here->HICUMith_Veie);
|
||||
|
||||
|
||||
|
||||
/////////////////////////
|
||||
// end copy state vector
|
||||
|
|
@ -1631,7 +1645,15 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
delvbpbi = Vbpbi - *(ckt->CKTstate0 + here->HICUMvbpbi);
|
||||
delvbpci = Vbpci - *(ckt->CKTstate0 + here->HICUMvbpci);
|
||||
delvsici = Vsici - *(ckt->CKTstate0 + here->HICUMvsici);
|
||||
delvrth = Vrth - *(ckt->CKTstate0 + here->HICUMvrth);
|
||||
delvcic = Vcic - *(ckt->CKTstate0 + here->HICUMvcic);
|
||||
delvbbp = Vcic - *(ckt->CKTstate0 + here->HICUMvbbp);
|
||||
delveie = Vcic - *(ckt->CKTstate0 + here->HICUMveie);
|
||||
delvciei = delvbiei-delvbici;
|
||||
if (model->HICUMflsh) {
|
||||
delvrth = Vrth - *(ckt->CKTstate0 + here->HICUMvrth);
|
||||
} else {
|
||||
delvrth = 0;
|
||||
}
|
||||
Vbe = model->HICUMtype*(
|
||||
*(ckt->CKTrhsOld+here->HICUMbaseNode)-
|
||||
*(ckt->CKTrhsOld+here->HICUMemitNode));
|
||||
|
|
@ -1692,7 +1714,17 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
*(ckt->CKTstate0 + here->HICUMibpsi_Vrth)*delvrth +
|
||||
*(ckt->CKTstate0 + here->HICUMibpsi_Vsici)*delvsici;
|
||||
ithhat = *(ckt->CKTstate0 + here->HICUMith) +
|
||||
*(ckt->CKTstate0 + here->HICUMith_Vrth)*delvrth; //other dels are missing here... great :/
|
||||
*(ckt->CKTstate0 + here->HICUMith_Vbiei)*delvbiei+
|
||||
*(ckt->CKTstate0 + here->HICUMith_Vbici)*delvbici+
|
||||
*(ckt->CKTstate0 + here->HICUMith_Vbpbi)*delvbpbi+
|
||||
*(ckt->CKTstate0 + here->HICUMith_Vbpci)*delvbpci+
|
||||
*(ckt->CKTstate0 + here->HICUMith_Vbpei)*delvbpei+
|
||||
*(ckt->CKTstate0 + here->HICUMith_Vciei)*delvciei+
|
||||
*(ckt->CKTstate0 + here->HICUMith_Vsici)*delvsici+
|
||||
*(ckt->CKTstate0 + here->HICUMith_Vcic)*delvcic+
|
||||
*(ckt->CKTstate0 + here->HICUMith_Vbbp)*delvbbp+
|
||||
*(ckt->CKTstate0 + here->HICUMith_Veie)*delveie+
|
||||
*(ckt->CKTstate0 + here->HICUMith_Vrth)*delvrth;
|
||||
/*
|
||||
* bypass if solution has not changed
|
||||
*/
|
||||
|
|
@ -1717,6 +1749,15 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
if( (fabs(delvsici) < ckt->CKTreltol*MAX(fabs(Vsici),
|
||||
fabs(*(ckt->CKTstate0 + here->HICUMvsici)))+
|
||||
ckt->CKTvoltTol) )
|
||||
if( (fabs(delvcic) < ckt->CKTreltol*MAX(fabs(Vcic),
|
||||
fabs(*(ckt->CKTstate0 + here->HICUMvcic)))+
|
||||
ckt->CKTvoltTol) )
|
||||
if( (fabs(delvbbp) < ckt->CKTreltol*MAX(fabs(Vbbp),
|
||||
fabs(*(ckt->CKTstate0 + here->HICUMvbbp)))+
|
||||
ckt->CKTvoltTol) )
|
||||
if( (fabs(delveie) < ckt->CKTreltol*MAX(fabs(Veie),
|
||||
fabs(*(ckt->CKTstate0 + here->HICUMveie)))+
|
||||
ckt->CKTvoltTol) )
|
||||
if( (fabs(ibieihat-*(ckt->CKTstate0 + here->HICUMibiei)) <
|
||||
ckt->CKTreltol* MAX(fabs(ibieihat),
|
||||
fabs(*(ckt->CKTstate0 + here->HICUMibiei)))+
|
||||
|
|
@ -1762,15 +1803,19 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
Vbpbi = *(ckt->CKTstate0 + here->HICUMvbpbi);
|
||||
Vbpci = *(ckt->CKTstate0 + here->HICUMvbpci);
|
||||
Vsici = *(ckt->CKTstate0 + here->HICUMvsici);
|
||||
Vcic = *(ckt->CKTstate0 + here->HICUMvcic);
|
||||
Vbbp = *(ckt->CKTstate0 + here->HICUMvbbp);
|
||||
Veie = *(ckt->CKTstate0 + here->HICUMveie);
|
||||
Vrth = *(ckt->CKTstate0 + here->HICUMvrth);
|
||||
|
||||
Ibiei = *(ckt->CKTstate0 + here->HICUMibiei);
|
||||
Ibiei_Vbiei = *(ckt->CKTstate0 + here->HICUMibiei_Vbiei);
|
||||
Ibiei_Vbici = *(ckt->CKTstate0 + here->HICUMibiei_Vbici);
|
||||
Ibiei_Vrth = *(ckt->CKTstate0 + here->HICUMibiei_Vrth);
|
||||
Ibiei_Vrth = *(ckt->CKTstate0 + here->HICUMibiei_Vrth);
|
||||
|
||||
Ibpei = *(ckt->CKTstate0 + here->HICUMibpei);
|
||||
Ibpei_Vbpei = *(ckt->CKTstate0 + here->HICUMibpei_Vbpei);
|
||||
Ibpei_Vrth = *(ckt->CKTstate0 + here->HICUMibpei_Vrth);
|
||||
Ibpei_Vrth = *(ckt->CKTstate0 + here->HICUMibpei_Vrth);
|
||||
|
||||
Iciei = *(ckt->CKTstate0 + here->HICUMiciei);
|
||||
Iciei_Vbiei = *(ckt->CKTstate0 + here->HICUMiciei_Vbiei);
|
||||
|
|
@ -1780,7 +1825,7 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
Ibici = *(ckt->CKTstate0 + here->HICUMibici);
|
||||
Ibici_Vbici = *(ckt->CKTstate0 + here->HICUMibici_Vbici);
|
||||
Ibici_Vbiei = *(ckt->CKTstate0 + here->HICUMibici_Vbiei);
|
||||
Ibici_Vrth = *(ckt->CKTstate0 + here->HICUMibici_Vrth);
|
||||
Ibici_Vrth = *(ckt->CKTstate0 + here->HICUMibici_Vrth);
|
||||
|
||||
Ibpbi = *(ckt->CKTstate0 + here->HICUMibpbi);
|
||||
Ibpbi_Vbpbi = *(ckt->CKTstate0 + here->HICUMibpbi_Vbpbi);
|
||||
|
|
@ -1795,14 +1840,14 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
Ibpsi = *(ckt->CKTstate0 + here->HICUMibpsi);
|
||||
Ibpsi_Vbpci = *(ckt->CKTstate0 + here->HICUMibpsi_Vbpci);
|
||||
Ibpsi_Vsici = *(ckt->CKTstate0 + here->HICUMibpsi_Vsici);
|
||||
Ibpsi_Vrth = *(ckt->CKTstate0 + here->HICUMibpsi_Vrth);
|
||||
Ibpsi_Vrth = *(ckt->CKTstate0 + here->HICUMibpsi_Vrth);
|
||||
|
||||
Ibpci = *(ckt->CKTstate0 + here->HICUMibpci);
|
||||
Ibpci_Vbpci = *(ckt->CKTstate0 + here->HICUMibpci_Vbpci);
|
||||
Ibpci_Vrth = *(ckt->CKTstate0 + here->HICUMibpci_Vrth);
|
||||
Ibpci_Vrth = *(ckt->CKTstate0 + here->HICUMibpci_Vrth);
|
||||
|
||||
Ieie = *(ckt->CKTstate0 + here->HICUMieie);
|
||||
Ieie_Vrth = *(ckt->CKTstate0 + here->HICUMieie_Vrth);
|
||||
Ieie_Vrth = *(ckt->CKTstate0 + here->HICUMieie_Vrth);
|
||||
|
||||
Isis_Vsis = *(ckt->CKTstate0 + here->HICUMisis_Vsis);
|
||||
|
||||
|
|
@ -1839,13 +1884,12 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
//todo: check for double multiplication on pnp's
|
||||
Vbiei = model->HICUMtype*Vbiei;
|
||||
Vbici = model->HICUMtype*Vbici;
|
||||
Vciei = model->HICUMtype*(Vbiei-Vbici);
|
||||
Vciei = (Vbiei-Vbici);
|
||||
Vbpei = model->HICUMtype*Vbpei;
|
||||
Vbpci = model->HICUMtype*Vbpci;
|
||||
Vbci = model->HICUMtype*Vbci;
|
||||
Vsici = model->HICUMtype*Vsici;
|
||||
Vsc = model->HICUMtype*Vsc;
|
||||
Vrth = model->HICUMtype*Vrth;
|
||||
|
||||
if (model->HICUMflsh!=0 && model->HICUMrth >= MIN_R) { // Thermal_update_with_self_heating
|
||||
//here->HICUMtemp = ckt->CKTtemp+Vrth;
|
||||
|
|
@ -2422,8 +2466,8 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
|
||||
// TODO derivatives of Ixf1 and Ixf2
|
||||
|
||||
Vxf = Vbxf; //for RC nw
|
||||
Ixf = (Vxf - Qdei)*model->HICUMt0/Tf; //for RC nw
|
||||
Vxf = Vbxf; //for RC nw
|
||||
Ixf = (Vxf - Qdei)*model->HICUMt0/Tf; //for RC nw
|
||||
Qxf = model->HICUMalqf*model->HICUMt0*Vxf; //for RC nw
|
||||
Qxf_Vxf = model->HICUMalqf*model->HICUMt0; //for RC nw
|
||||
Qdeix = Vxf; //for RC nw
|
||||
|
|
@ -2435,8 +2479,8 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
Qxf1_Vxf1 = 0;
|
||||
Qxf2_Vxf2 = 0;
|
||||
|
||||
Ixf = Vbxf;
|
||||
Qxf = 0;
|
||||
Ixf = Vbxf;
|
||||
Qxf = 0;
|
||||
Qxf_Vxf = 0;
|
||||
}
|
||||
|
||||
|
|
@ -2450,50 +2494,50 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
Icic_Vcic = 1/here->HICUMrcx_t.rpart;
|
||||
Icic_dT = -here->HICUMrcx_t.dpart*Vcic/here->HICUMrcx_t.rpart/here->HICUMrcx_t.rpart;
|
||||
Ieie_Veie = 1/here->HICUMre_t.rpart;
|
||||
Ieie_Vrth = -here->HICUMre_t.dpart*Veie/here->HICUMre_t.rpart/here->HICUMre_t.rpart;
|
||||
Ieie_Vrth = -here->HICUMre_t.dpart*Veie/here->HICUMre_t.rpart/here->HICUMre_t.rpart;
|
||||
Isis_Vsis = 1/model->HICUMrsu;
|
||||
|
||||
Ibpei = model->HICUMtype*ibep;
|
||||
Ibpei += model->HICUMtype*irep;
|
||||
Ibpei_Vbpei = model->HICUMtype*ibep_Vbpei;
|
||||
Ibpei_Vbpei += model->HICUMtype*irep_Vbpei;
|
||||
Ibpei_Vrth = model->HICUMtype*ibep_dT;
|
||||
Ibpei_Vrth += model->HICUMtype*irep_dT;
|
||||
Ibpei_Vrth = model->HICUMtype*ibep_dT;
|
||||
Ibpei_Vrth += model->HICUMtype*irep_dT;
|
||||
|
||||
Ibiei = model->HICUMtype*ibei;
|
||||
Ibiei_Vbiei = model->HICUMtype*ibei_Vbiei;
|
||||
Ibiei_Vrth = model->HICUMtype*ibei_dT;
|
||||
Ibiei_Vrth = model->HICUMtype*ibei_dT;
|
||||
Ibiei += model->HICUMtype*irei;
|
||||
Ibiei_Vbiei += model->HICUMtype*irei_Vbiei;
|
||||
Ibiei_Vrth += model->HICUMtype*irei_dT;
|
||||
Ibiei_Vrth += model->HICUMtype*irei_dT;
|
||||
Ibiei += model->HICUMtype*ibh_rec;
|
||||
Ibiei_Vbiei += model->HICUMtype*ibh_rec_Vbiei;
|
||||
Ibiei_Vrth += model->HICUMtype*ibh_rec_dT;
|
||||
Ibiei_Vrth += model->HICUMtype*ibh_rec_dT;
|
||||
Ibiei_Vbici = model->HICUMtype*ibh_rec_Vbici;
|
||||
|
||||
if (model->HICUMtunode==1.0) {
|
||||
Ibpei += -model->HICUMtype*ibet;
|
||||
Ibpei += -model->HICUMtype*ibet;
|
||||
Ibpei_Vbpei += -model->HICUMtype*ibet_Vbpei;
|
||||
Ibpei_Vrth += -model->HICUMtype*ibet_dT;
|
||||
Ibpei_Vrth += -model->HICUMtype*ibet_dT;
|
||||
} else {
|
||||
Ibiei += -model->HICUMtype*ibet;
|
||||
Ibiei += -model->HICUMtype*ibet;
|
||||
Ibiei_Vbiei += -model->HICUMtype*ibet_Vbiei;
|
||||
Ibiei_Vrth += -model->HICUMtype*ibet_dT;
|
||||
Ibiei_Vrth += -model->HICUMtype*ibet_dT;
|
||||
}
|
||||
//printf("Vbiei: %f ibei: %g irei: %g ibh_rec: %g ibet: %g\n",Vbiei,ibei,irei,ibh_rec,ibet);
|
||||
Ibpsi = model->HICUMtype*HSI_Tsu;
|
||||
Ibpsi_Vbpci = model->HICUMtype*HSI_Tsu_Vbpci;
|
||||
Ibpsi_Vsici = model->HICUMtype*HSI_Tsu_Vsici;
|
||||
Ibpsi_Vrth = model->HICUMtype*HSI_Tsu_dT;
|
||||
Ibpsi_Vrth = model->HICUMtype*HSI_Tsu_dT;
|
||||
|
||||
Ibpci = model->HICUMtype*ijbcx;
|
||||
Ibpci_Vbpci = model->HICUMtype*ijbcx_Vbpci;
|
||||
Ibpci_Vrth = model->HICUMtype*ijbcx_dT;
|
||||
Ibpci_Vrth = model->HICUMtype*ijbcx_dT;
|
||||
|
||||
Ibici = model->HICUMtype*(ibci - iavl);
|
||||
Ibici_Vbici = model->HICUMtype*(ibci_Vbici - iavl_Vbici);
|
||||
Ibici_Vbiei = model->HICUMtype*( - iavl_Vbiei);
|
||||
Ibici_Vrth = model->HICUMtype*(ibci_dT - iavl_dT);
|
||||
Ibici_Vrth = model->HICUMtype*(ibci_dT - iavl_dT);
|
||||
|
||||
Isici = model->HICUMtype*ijsc;
|
||||
Isici_Vsici = model->HICUMtype*ijsc_Vsici;
|
||||
|
|
@ -2501,7 +2545,7 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
Iciei = model->HICUMtype*it;
|
||||
Iciei_Vbiei = model->HICUMtype*it_Vbiei;
|
||||
Iciei_Vbici = model->HICUMtype*it_Vbici;
|
||||
Iciei_Vrth = model->HICUMtype*it_dT;
|
||||
Iciei_Vrth = model->HICUMtype*it_dT;
|
||||
|
||||
if (rbi >= MIN_R) {
|
||||
Ibpbi = Vbpbi / rbi;
|
||||
|
|
@ -2564,7 +2608,7 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
Ith_Vcic = 0.0;
|
||||
Ith_Vbbp = 0.0;
|
||||
Ith_Veie = 0.0;
|
||||
Ith_Vrth = 0.0;
|
||||
Ith_Vrth = 0.0;
|
||||
if(model->HICUMflsh == 0 || model->HICUMrth < MIN_R) {
|
||||
Ith = 0.0;
|
||||
} else {
|
||||
|
|
@ -2933,6 +2977,9 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
*(ckt->CKTstate0 + here->HICUMvbpbi) = Vbpbi;
|
||||
*(ckt->CKTstate0 + here->HICUMvbpci) = Vbpci;
|
||||
*(ckt->CKTstate0 + here->HICUMvsici) = Vsici;
|
||||
*(ckt->CKTstate0 + here->HICUMvcic) = Vcic;
|
||||
*(ckt->CKTstate0 + here->HICUMvbbp) = Vbbp;
|
||||
*(ckt->CKTstate0 + here->HICUMveie) = Veie;
|
||||
|
||||
*(ckt->CKTstate0 + here->HICUMibiei) = Ibiei;
|
||||
*(ckt->CKTstate0 + here->HICUMibiei_Vbiei) = Ibiei_Vbiei;
|
||||
|
|
@ -2990,6 +3037,18 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
|
||||
*(ckt->CKTstate0 + here->HICUMith) = Ith;
|
||||
*(ckt->CKTstate0 + here->HICUMith_Vrth) = Ith_Vrth;
|
||||
*(ckt->CKTstate0 + here->HICUMith_Vbiei) = Ith_Vbiei;
|
||||
*(ckt->CKTstate0 + here->HICUMith_Vbici) = Ith_Vbici;
|
||||
*(ckt->CKTstate0 + here->HICUMith_Vbpbi) = Ith_Vbpbi;
|
||||
*(ckt->CKTstate0 + here->HICUMith_Vbpci) = Ith_Vbpci;
|
||||
*(ckt->CKTstate0 + here->HICUMith_Vbpei) = Ith_Vbpei;
|
||||
*(ckt->CKTstate0 + here->HICUMith_Vciei) = Ith_Vciei;
|
||||
*(ckt->CKTstate0 + here->HICUMith_Vsici) = Ith_Vsici;
|
||||
*(ckt->CKTstate0 + here->HICUMith_Vcic) = Ith_Vcic;
|
||||
*(ckt->CKTstate0 + here->HICUMith_Vbbp) = Ith_Vbbp;
|
||||
*(ckt->CKTstate0 + here->HICUMith_Veie) = Ith_Veie;
|
||||
|
||||
|
||||
|
||||
load:
|
||||
// #############################################################
|
||||
|
|
|
|||
|
|
@ -166,8 +166,8 @@ int hicum_thermal_update(HICUMmodel *inModel, HICUMinstance *inInstance, double
|
|||
HICUMTemp = TMAX + CONSTCtoK;
|
||||
}
|
||||
}
|
||||
temp = HICUMTemp+1_e; //dual number valued temperature
|
||||
vt = temp*CONSTKoverQ; // dual temperature
|
||||
temp = HICUMTemp+1_e; //dual number valued temperature
|
||||
vt = temp*CONSTKoverQ; // dual valued temperature voltage
|
||||
|
||||
here->HICUMvt0 = Tnom * CONSTKoverQ;
|
||||
here->HICUMvt.rpart = vt.rpart();
|
||||
|
|
|
|||
Loading…
Reference in New Issue