fix HICUM setup
This commit is contained in:
parent
f6e4bba9e3
commit
8dfd2e5a4d
|
|
@ -345,149 +345,162 @@ typedef struct sHICUMinstance {
|
|||
#define HICUMiciei HICUMstate+16
|
||||
#define HICUMiciei_Vbiei HICUMstate+17
|
||||
#define HICUMiciei_Vbici HICUMstate+18
|
||||
#define HICUMiciei_Vrth HICUMstate+19
|
||||
#define HICUMiciei_Vxf2 HICUMstate+19
|
||||
#define HICUMiciei_Vrth HICUMstate+20
|
||||
|
||||
#define HICUMibici HICUMstate+20
|
||||
#define HICUMibici_Vbici HICUMstate+21
|
||||
#define HICUMibici_Vbiei HICUMstate+22
|
||||
#define HICUMibici_Vrth HICUMstate+23
|
||||
#define HICUMibici HICUMstate+21
|
||||
#define HICUMibici_Vbici HICUMstate+22
|
||||
#define HICUMibici_Vbiei HICUMstate+23
|
||||
#define HICUMibici_Vrth HICUMstate+24
|
||||
|
||||
#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 HICUMibpbi HICUMstate+25
|
||||
#define HICUMibpbi_Vbpbi HICUMstate+26
|
||||
#define HICUMibpbi_Vbiei HICUMstate+27
|
||||
#define HICUMibpbi_Vbici HICUMstate+28
|
||||
#define HICUMibpbi_Vrth HICUMstate+29
|
||||
|
||||
#define HICUMibpci HICUMstate+29
|
||||
#define HICUMibpci_Vbpci HICUMstate+30
|
||||
#define HICUMibpci_Vrth HICUMstate+31
|
||||
#define HICUMibpci HICUMstate+30
|
||||
#define HICUMibpci_Vbpci HICUMstate+31
|
||||
#define HICUMibpci_Vrth HICUMstate+32
|
||||
|
||||
#define HICUMisici HICUMstate+32
|
||||
#define HICUMisici_Vsici HICUMstate+33
|
||||
#define HICUMisici_Vrth HICUMstate+34
|
||||
#define HICUMisici HICUMstate+33
|
||||
#define HICUMisici_Vsici HICUMstate+34
|
||||
#define HICUMisici_Vrth HICUMstate+35
|
||||
|
||||
#define HICUMibpsi HICUMstate+35
|
||||
#define HICUMibpsi_Vbpci HICUMstate+36
|
||||
#define HICUMibpsi_Vsici HICUMstate+37
|
||||
#define HICUMibpsi_Vrth HICUMstate+38
|
||||
#define HICUMibpsi HICUMstate+36
|
||||
#define HICUMibpsi_Vbpci HICUMstate+37
|
||||
#define HICUMibpsi_Vsici HICUMstate+38
|
||||
#define HICUMibpsi_Vrth HICUMstate+39
|
||||
|
||||
#define HICUMisis_Vsis HICUMstate+39
|
||||
#define HICUMisis_Vsis HICUMstate+40
|
||||
|
||||
#define HICUMieie HICUMstate+40 // needed for re-flicker noise
|
||||
#define HICUMieie_Vrth HICUMstate+41
|
||||
#define HICUMieie HICUMstate+41 // needed for re-flicker noise
|
||||
#define HICUMieie_Vrth HICUMstate+42
|
||||
|
||||
#define HICUMqrbi HICUMstate+42
|
||||
#define HICUMcqrbi HICUMstate+43
|
||||
#define HICUMqrbi_Vbiei HICUMstate+44
|
||||
#define HICUMqrbi_Vbici HICUMstate+45
|
||||
#define HICUMqrbi_Vrth HICUMstate+46
|
||||
#define HICUMqrbi HICUMstate+43
|
||||
#define HICUMcqrbi HICUMstate+44
|
||||
#define HICUMqrbi_Vbiei HICUMstate+45
|
||||
#define HICUMqrbi_Vbici HICUMstate+46
|
||||
#define HICUMqrbi_Vrth HICUMstate+47
|
||||
|
||||
#define HICUMqjei HICUMstate+47
|
||||
#define HICUMcqjei HICUMstate+48
|
||||
#define HICUMqjei_Vrth HICUMstate+49
|
||||
#define HICUMqjei HICUMstate+48
|
||||
#define HICUMcqjei HICUMstate+49
|
||||
#define HICUMqjei_Vrth HICUMstate+50
|
||||
|
||||
#define HICUMqf HICUMstate+50
|
||||
#define HICUMcqf HICUMstate+51
|
||||
#define HICUMqf_Vbici HICUMstate+52
|
||||
#define HICUMqf_Vrth HICUMstate+53
|
||||
#define HICUMqf HICUMstate+51
|
||||
#define HICUMcqf HICUMstate+52
|
||||
#define HICUMqf_Vbici HICUMstate+53
|
||||
#define HICUMqf_Vxf HICUMstate+54
|
||||
#define HICUMqf_Vrth HICUMstate+55
|
||||
|
||||
#define HICUMqr HICUMstate+54
|
||||
#define HICUMcqr HICUMstate+55
|
||||
#define HICUMqr_Vbiei HICUMstate+56
|
||||
#define HICUMqr_Vrth HICUMstate+57
|
||||
#define HICUMqr HICUMstate+56
|
||||
#define HICUMcqr HICUMstate+57
|
||||
#define HICUMqr_Vbiei HICUMstate+58
|
||||
#define HICUMqr_Vrth HICUMstate+59
|
||||
|
||||
#define HICUMqjci HICUMstate+58
|
||||
#define HICUMcqjci HICUMstate+59
|
||||
#define HICUMqjci_Vrth HICUMstate+59
|
||||
#define HICUMqjci HICUMstate+60
|
||||
#define HICUMcqjci HICUMstate+61
|
||||
#define HICUMqjci_Vrth HICUMstate+62
|
||||
|
||||
#define HICUMqjep HICUMstate+60
|
||||
#define HICUMcqjep HICUMstate+61
|
||||
#define HICUMqjep_Vrth HICUMstate+62
|
||||
#define HICUMqjep HICUMstate+63
|
||||
#define HICUMcqjep HICUMstate+64
|
||||
#define HICUMqjep_Vrth HICUMstate+65
|
||||
|
||||
#define HICUMqjcx0_i HICUMstate+63
|
||||
#define HICUMcqcx0_t_i HICUMstate+64
|
||||
#define HICUMqjcx0_i_Vrth HICUMstate+65
|
||||
#define HICUMqjcx0_i HICUMstate+66
|
||||
#define HICUMcqcx0_t_i HICUMstate+67
|
||||
#define HICUMqjcx0_i_Vrth HICUMstate+68
|
||||
|
||||
#define HICUMqjcx0_ii HICUMstate+66
|
||||
#define HICUMcqcx0_t_ii HICUMstate+67
|
||||
#define HICUMqjcx0_ii_Vrth HICUMstate+68
|
||||
#define HICUMqjcx0_ii HICUMstate+69
|
||||
#define HICUMcqcx0_t_ii HICUMstate+70
|
||||
#define HICUMqjcx0_ii_Vrth HICUMstate+71
|
||||
|
||||
#define HICUMqdsu HICUMstate+70
|
||||
#define HICUMcqdsu HICUMstate+71
|
||||
#define HICUMqdsu_Vrth HICUMstate+72
|
||||
#define HICUMqdsu_Vsici HICUMstate+73
|
||||
#define HICUMqdsu HICUMstate+72
|
||||
#define HICUMcqdsu HICUMstate+73
|
||||
#define HICUMqdsu_Vrth HICUMstate+74
|
||||
#define HICUMqdsu_Vsici HICUMstate+75
|
||||
|
||||
#define HICUMqjs HICUMstate+74
|
||||
#define HICUMcqjs HICUMstate+75
|
||||
#define HICUMqjs_Vrth HICUMstate+76
|
||||
#define HICUMqjs HICUMstate+76
|
||||
#define HICUMcqjs HICUMstate+77
|
||||
#define HICUMqjs_Vrth HICUMstate+78
|
||||
|
||||
#define HICUMqscp HICUMstate+77
|
||||
#define HICUMcqscp HICUMstate+78
|
||||
#define HICUMqscp_Vrth HICUMstate+79
|
||||
#define HICUMqscp HICUMstate+79
|
||||
#define HICUMcqscp HICUMstate+80
|
||||
#define HICUMqscp_Vrth HICUMstate+81
|
||||
|
||||
#define HICUMqbepar1 HICUMstate+80
|
||||
#define HICUMcqbepar1 HICUMstate+81
|
||||
#define HICUMgqbepar1 HICUMstate+82
|
||||
#define HICUMqbepar1 HICUMstate+82
|
||||
#define HICUMcqbepar1 HICUMstate+83
|
||||
#define HICUMgqbepar1 HICUMstate+84
|
||||
|
||||
#define HICUMqbepar2 HICUMstate+83
|
||||
#define HICUMcqbepar2 HICUMstate+84
|
||||
#define HICUMgqbepar2 HICUMstate+85
|
||||
#define HICUMqbepar2 HICUMstate+85
|
||||
#define HICUMcqbepar2 HICUMstate+86
|
||||
#define HICUMgqbepar2 HICUMstate+87
|
||||
|
||||
#define HICUMqbcpar1 HICUMstate+86
|
||||
#define HICUMcqbcpar1 HICUMstate+87
|
||||
#define HICUMgqbcpar1 HICUMstate+88
|
||||
#define HICUMqbcpar1 HICUMstate+88
|
||||
#define HICUMcqbcpar1 HICUMstate+89
|
||||
#define HICUMgqbcpar1 HICUMstate+90
|
||||
|
||||
#define HICUMqbcpar2 HICUMstate+89
|
||||
#define HICUMcqbcpar2 HICUMstate+90
|
||||
#define HICUMgqbcpar2 HICUMstate+91
|
||||
#define HICUMqbcpar2 HICUMstate+91
|
||||
#define HICUMcqbcpar2 HICUMstate+92
|
||||
#define HICUMgqbcpar2 HICUMstate+93
|
||||
|
||||
#define HICUMqsu HICUMstate+92
|
||||
#define HICUMcqsu HICUMstate+93
|
||||
#define HICUMgqsu HICUMstate+94
|
||||
#define HICUMqsu HICUMstate+94
|
||||
#define HICUMcqsu HICUMstate+95
|
||||
#define HICUMgqsu HICUMstate+96
|
||||
|
||||
#define HICUMqcth HICUMstate+95
|
||||
#define HICUMcqcth HICUMstate+96
|
||||
#define HICUMqcth HICUMstate+97
|
||||
#define HICUMcqcth HICUMstate+98
|
||||
|
||||
#define HICUMvrth HICUMstate+97
|
||||
#define HICUMicth_dT HICUMstate+98
|
||||
#define HICUMvrth HICUMstate+99
|
||||
#define HICUMicth_dT HICUMstate+100
|
||||
|
||||
#define HICUMvxf HICUMstate+99
|
||||
#define HICUMqxf HICUMstate+100
|
||||
#define HICUMcqxf HICUMstate+101
|
||||
#define HICUMgqxf HICUMstate+102
|
||||
#define HICUMixf_Vbiei HICUMstate+103
|
||||
#define HICUMixf_Vbici HICUMstate+104
|
||||
#define HICUMvxf HICUMstate+101
|
||||
#define HICUMqxf HICUMstate+102
|
||||
#define HICUMqxf_Vxf HICUMstate+103
|
||||
#define HICUMcqxf HICUMstate+104
|
||||
#define HICUMgqxf HICUMstate+105
|
||||
#define HICUMixf HICUMstate+106
|
||||
#define HICUMixf_Vbiei HICUMstate+107
|
||||
#define HICUMixf_Vbici HICUMstate+108
|
||||
#define HICUMixf_Vxf HICUMstate+109
|
||||
#define HICUMixf_Vrth HICUMstate+110
|
||||
|
||||
#define HICUMvxf1 HICUMstate+105
|
||||
#define HICUMqxf1 HICUMstate+106
|
||||
#define HICUMcqxf1 HICUMstate+107
|
||||
#define HICUMgqxf1 HICUMstate+108
|
||||
#define HICUMixf1_Vbiei HICUMstate+109
|
||||
#define HICUMixf1_Vbici HICUMstate+110
|
||||
#define HICUMixf1_Vfx2 HICUMstate+111
|
||||
#define HICUMvxf1 HICUMstate+111
|
||||
#define HICUMqxf1 HICUMstate+112
|
||||
#define HICUMqxf1_Vxf1 HICUMstate+113
|
||||
#define HICUMcqxf1 HICUMstate+114
|
||||
#define HICUMgqxf1 HICUMstate+115
|
||||
#define HICUMixf1 HICUMstate+116
|
||||
#define HICUMixf1_Vbiei HICUMstate+117
|
||||
#define HICUMixf1_Vbici HICUMstate+118
|
||||
#define HICUMixf1_Vxf2 HICUMstate+119
|
||||
#define HICUMixf1_Vrth HICUMstate+120
|
||||
|
||||
#define HICUMvxf2 HICUMstate+112
|
||||
#define HICUMqxf2 HICUMstate+113
|
||||
#define HICUMcqxf2 HICUMstate+114
|
||||
#define HICUMgqxf2 HICUMstate+115
|
||||
#define HICUMixf2_Vbiei HICUMstate+116
|
||||
#define HICUMixf2_Vbici HICUMstate+117
|
||||
#define HICUMixf2_Vfx1 HICUMstate+118
|
||||
#define HICUMvxf2 HICUMstate+121
|
||||
#define HICUMqxf2 HICUMstate+122
|
||||
#define HICUMqxf2_Vxf2 HICUMstate+123
|
||||
#define HICUMcqxf2 HICUMstate+124
|
||||
#define HICUMgqxf2 HICUMstate+125
|
||||
#define HICUMixf2 HICUMstate+126
|
||||
#define HICUMixf2_Vbiei HICUMstate+127
|
||||
#define HICUMixf2_Vbici HICUMstate+128
|
||||
#define HICUMixf2_Vxf1 HICUMstate+129
|
||||
#define HICUMixf2_Vxf2 HICUMstate+130
|
||||
#define HICUMixf2_Vrth HICUMstate+131
|
||||
|
||||
#define HICUMith HICUMstate+119
|
||||
#define HICUMith_Vrth HICUMstate+120
|
||||
#define HICUMith_Vbiei HICUMstate+121
|
||||
#define HICUMith_Vbici HICUMstate+122
|
||||
#define HICUMith_Vbpbi HICUMstate+123
|
||||
#define HICUMith_Vbpci HICUMstate+124
|
||||
#define HICUMith_Vbpei HICUMstate+125
|
||||
#define HICUMith_Vciei HICUMstate+126
|
||||
#define HICUMith_Vsici HICUMstate+127
|
||||
#define HICUMith_Vcic HICUMstate+128
|
||||
#define HICUMith_Vbbp HICUMstate+129
|
||||
#define HICUMith_Veie HICUMstate+130
|
||||
#define HICUMith HICUMstate+132
|
||||
#define HICUMith_Vrth HICUMstate+133
|
||||
#define HICUMith_Vbiei HICUMstate+134
|
||||
#define HICUMith_Vbici HICUMstate+135
|
||||
#define HICUMith_Vbpbi HICUMstate+136
|
||||
#define HICUMith_Vbpci HICUMstate+137
|
||||
#define HICUMith_Vbpei HICUMstate+138
|
||||
#define HICUMith_Vciei HICUMstate+139
|
||||
#define HICUMith_Vsici HICUMstate+140
|
||||
#define HICUMith_Vcic HICUMstate+141
|
||||
#define HICUMith_Vbbp HICUMstate+142
|
||||
#define HICUMith_Veie HICUMstate+143
|
||||
|
||||
#define HICUMnumStates 132
|
||||
#define HICUMnumStates 144
|
||||
|
||||
/* per model data */
|
||||
typedef struct sHICUMmodel { /* model structure for a hicum */
|
||||
|
|
|
|||
|
|
@ -747,9 +747,10 @@ HICUMunsetup(
|
|||
here->HICUMcollCINode = 0;
|
||||
|
||||
if (selfheat) {
|
||||
// if (here->HICUMtempNode > 5) // it is an internal node
|
||||
// CKTdltNNum(ckt, here->HICUMtempNode);
|
||||
// here->HICUMtempNode = 0;
|
||||
if (here->HICUMtempNode > 5) { // it is an internal node
|
||||
CKTdltNNum(ckt, here->HICUMtempNode);
|
||||
here->HICUMtempNode = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if(here->HICUMxfNode > 0)
|
||||
|
|
|
|||
|
|
@ -471,7 +471,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, delvbbp=0.0, delveie=0.0, delvciei=0.0, delvcic=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, delvxf2=0.0;
|
||||
double ibieihat;
|
||||
double ibpeihat;
|
||||
double icieihat;
|
||||
|
|
@ -543,7 +543,6 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
|
||||
//NQS
|
||||
double Qxf_Vxf, Qxf1_Vxf1, Qxf2_Vxf2;
|
||||
double Iqxf=0, Iqxf_Vxf=0, Iqxf1=0, Iqxf1_Vxf1=0, Iqxf2=0, Iqxf2_Vxf2=0; //not needed withouth NQS, initialized with 0 here
|
||||
|
||||
double volatile Ith=0, Vrth=0, Icth, Icth_Vrth, delvrth;
|
||||
|
||||
|
|
@ -1454,6 +1453,7 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
*(ckt->CKTstate0+here->HICUMiciei)=*(ckt->CKTstate1+here->HICUMiciei);
|
||||
*(ckt->CKTstate0+here->HICUMiciei_Vbiei)=*(ckt->CKTstate1+here->HICUMiciei_Vbiei);
|
||||
*(ckt->CKTstate0+here->HICUMiciei_Vbici)=*(ckt->CKTstate1+here->HICUMiciei_Vbici);
|
||||
*(ckt->CKTstate0+here->HICUMiciei_Vxf2)=*(ckt->CKTstate1+here->HICUMiciei_Vxf2);
|
||||
*(ckt->CKTstate0+here->HICUMiciei_Vrth)=*(ckt->CKTstate1+here->HICUMiciei_Vrth);
|
||||
*(ckt->CKTstate0+here->HICUMibici)=*(ckt->CKTstate1+here->HICUMibici);
|
||||
*(ckt->CKTstate0+here->HICUMibici_Vbici)=*(ckt->CKTstate1+here->HICUMibici_Vbici);
|
||||
|
|
@ -1488,6 +1488,7 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
*(ckt->CKTstate0+here->HICUMqf)=*(ckt->CKTstate1+here->HICUMqf);
|
||||
*(ckt->CKTstate0+here->HICUMcqf)=*(ckt->CKTstate1+here->HICUMcqf);
|
||||
*(ckt->CKTstate0+here->HICUMqf_Vbici)=*(ckt->CKTstate1+here->HICUMqf_Vbici);
|
||||
*(ckt->CKTstate0+here->HICUMqf_Vxf)=*(ckt->CKTstate1+here->HICUMqf_Vxf);
|
||||
*(ckt->CKTstate0+here->HICUMqf_Vrth)=*(ckt->CKTstate1+here->HICUMqf_Vrth);
|
||||
*(ckt->CKTstate0+here->HICUMqr)=*(ckt->CKTstate1+here->HICUMqr);
|
||||
*(ckt->CKTstate0+here->HICUMcqr)=*(ckt->CKTstate1+here->HICUMcqr);
|
||||
|
|
@ -1536,24 +1537,32 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
*(ckt->CKTstate0+here->HICUMicth_dT)=*(ckt->CKTstate1+here->HICUMicth_dT);
|
||||
*(ckt->CKTstate0+here->HICUMvxf)=*(ckt->CKTstate1+here->HICUMvxf);
|
||||
*(ckt->CKTstate0+here->HICUMqxf)=*(ckt->CKTstate1+here->HICUMqxf);
|
||||
*(ckt->CKTstate0+here->HICUMqxf_Vxf)=*(ckt->CKTstate1+here->HICUMqxf_Vxf);
|
||||
*(ckt->CKTstate0+here->HICUMcqxf)=*(ckt->CKTstate1+here->HICUMcqxf);
|
||||
*(ckt->CKTstate0+here->HICUMgqxf)=*(ckt->CKTstate1+here->HICUMgqxf);
|
||||
*(ckt->CKTstate0+here->HICUMixf_Vbiei)=*(ckt->CKTstate1+here->HICUMixf_Vbiei);
|
||||
*(ckt->CKTstate0+here->HICUMixf_Vbici)=*(ckt->CKTstate1+here->HICUMixf_Vbici);
|
||||
*(ckt->CKTstate0+here->HICUMixf_Vxf)=*(ckt->CKTstate1+here->HICUMixf_Vxf);
|
||||
*(ckt->CKTstate0+here->HICUMixf_Vrth)=*(ckt->CKTstate1+here->HICUMixf_Vrth);
|
||||
*(ckt->CKTstate0+here->HICUMvxf1)=*(ckt->CKTstate1+here->HICUMvxf1);
|
||||
*(ckt->CKTstate0+here->HICUMqxf1)=*(ckt->CKTstate1+here->HICUMqxf1);
|
||||
*(ckt->CKTstate0+here->HICUMqxf1_Vxf1)=*(ckt->CKTstate1+here->HICUMqxf1_Vxf1);
|
||||
*(ckt->CKTstate0+here->HICUMcqxf1)=*(ckt->CKTstate1+here->HICUMcqxf1);
|
||||
*(ckt->CKTstate0+here->HICUMgqxf1)=*(ckt->CKTstate1+here->HICUMgqxf1);
|
||||
*(ckt->CKTstate0+here->HICUMixf1_Vbiei)=*(ckt->CKTstate1+here->HICUMixf1_Vbiei);
|
||||
*(ckt->CKTstate0+here->HICUMixf1_Vbici)=*(ckt->CKTstate1+here->HICUMixf1_Vbici);
|
||||
*(ckt->CKTstate0+here->HICUMixf1_Vfx2)=*(ckt->CKTstate1+here->HICUMixf1_Vfx2);
|
||||
*(ckt->CKTstate0+here->HICUMixf1_Vxf2)=*(ckt->CKTstate1+here->HICUMixf1_Vxf2);
|
||||
*(ckt->CKTstate0+here->HICUMixf1_Vrth)=*(ckt->CKTstate1+here->HICUMixf1_Vrth);
|
||||
*(ckt->CKTstate0+here->HICUMvxf2)=*(ckt->CKTstate1+here->HICUMvxf2);
|
||||
*(ckt->CKTstate0+here->HICUMqxf2)=*(ckt->CKTstate1+here->HICUMqxf2);
|
||||
*(ckt->CKTstate0+here->HICUMqxf2_Vxf2)=*(ckt->CKTstate1+here->HICUMqxf2_Vxf2);
|
||||
*(ckt->CKTstate0+here->HICUMcqxf2)=*(ckt->CKTstate1+here->HICUMcqxf2);
|
||||
*(ckt->CKTstate0+here->HICUMgqxf2)=*(ckt->CKTstate1+here->HICUMgqxf2);
|
||||
*(ckt->CKTstate0+here->HICUMixf2_Vbiei)=*(ckt->CKTstate1+here->HICUMixf2_Vbiei);
|
||||
*(ckt->CKTstate0+here->HICUMixf2_Vbici)=*(ckt->CKTstate1+here->HICUMixf2_Vbici);
|
||||
*(ckt->CKTstate0+here->HICUMixf2_Vfx1)=*(ckt->CKTstate1+here->HICUMixf2_Vfx1);
|
||||
*(ckt->CKTstate0+here->HICUMixf2_Vxf1)=*(ckt->CKTstate1+here->HICUMixf2_Vxf1);
|
||||
*(ckt->CKTstate0+here->HICUMixf2_Vxf2)=*(ckt->CKTstate1+here->HICUMixf2_Vxf2);
|
||||
*(ckt->CKTstate0+here->HICUMixf2_Vrth)=*(ckt->CKTstate1+here->HICUMixf2_Vrth);
|
||||
*(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);
|
||||
|
|
@ -1566,7 +1575,6 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
*(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
|
||||
/////////////////////////
|
||||
|
|
@ -1629,6 +1637,7 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
delvcic = Vcic - *(ckt->CKTstate0 + here->HICUMvcic);
|
||||
delvbbp = Vbbp - *(ckt->CKTstate0 + here->HICUMvbbp);
|
||||
delveie = Veie - *(ckt->CKTstate0 + here->HICUMveie);
|
||||
delvxf2 = Vxf2 - *(ckt->CKTstate0 + here->HICUMvxf2);
|
||||
delvciei = delvbiei-delvbici;
|
||||
if (selfheat) {
|
||||
delvrth = Vrth - *(ckt->CKTstate0 + here->HICUMvrth);
|
||||
|
|
@ -1689,6 +1698,7 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
icieihat = *(ckt->CKTstate0 + here->HICUMiciei) +
|
||||
*(ckt->CKTstate0 + here->HICUMiciei_Vbiei)*delvbiei +
|
||||
*(ckt->CKTstate0 + here->HICUMiciei_Vrth)*delvrth +
|
||||
*(ckt->CKTstate0 + here->HICUMiciei_Vxf2)*delvxf2 +
|
||||
*(ckt->CKTstate0 + here->HICUMiciei_Vbici)*delvbici;
|
||||
ibpbihat = *(ckt->CKTstate0 + here->HICUMibpbi) +
|
||||
*(ckt->CKTstate0 + here->HICUMibpbi_Vbpbi)*delvbpbi +
|
||||
|
|
@ -1813,6 +1823,7 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
Iciei_Vbiei = *(ckt->CKTstate0 + here->HICUMiciei_Vbiei);
|
||||
Iciei_Vbici = *(ckt->CKTstate0 + here->HICUMiciei_Vbici);
|
||||
Iciei_Vrth = *(ckt->CKTstate0 + here->HICUMiciei_Vrth);
|
||||
Iciei_Vxf2 = *(ckt->CKTstate0 + here->HICUMiciei_Vxf2);
|
||||
|
||||
Ibici = *(ckt->CKTstate0 + here->HICUMibici);
|
||||
Ibici_Vbici = *(ckt->CKTstate0 + here->HICUMibici_Vbici);
|
||||
|
|
@ -1847,6 +1858,24 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
gqbepar2 = *(ckt->CKTstate0 + here->HICUMgqbepar2);
|
||||
gqbcpar1 = *(ckt->CKTstate0 + here->HICUMgqbcpar1);
|
||||
gqbcpar2 = *(ckt->CKTstate0 + here->HICUMgqbcpar2);
|
||||
|
||||
Ixf = *(ckt->CKTstate0 + here->HICUMixf) ;
|
||||
Ixf_Vbiei = *(ckt->CKTstate0 + here->HICUMixf_Vbiei) ;
|
||||
Ixf_Vbici = *(ckt->CKTstate0 + here->HICUMixf_Vbici) ;
|
||||
Ixf_Vxf = *(ckt->CKTstate0 + here->HICUMixf_Vxf) ;
|
||||
Ixf_dT = *(ckt->CKTstate0 + here->HICUMixf_Vrth) ;
|
||||
Ixf1 = *(ckt->CKTstate0 + here->HICUMixf1) ;
|
||||
Ixf1_Vbiei = *(ckt->CKTstate0 + here->HICUMixf1_Vbiei) ;
|
||||
Ixf1_Vbici = *(ckt->CKTstate0 + here->HICUMixf1_Vbici) ;
|
||||
Ixf1_Vxf2 = *(ckt->CKTstate0 + here->HICUMixf1_Vxf2) ;
|
||||
Ixf1_dT = *(ckt->CKTstate0 + here->HICUMixf1_Vrth) ;
|
||||
Ixf2 = *(ckt->CKTstate0 + here->HICUMixf2) ;
|
||||
Ixf2_Vbiei = *(ckt->CKTstate0 + here->HICUMixf2_Vbiei) ;
|
||||
Ixf2_Vbici = *(ckt->CKTstate0 + here->HICUMixf2_Vbici) ;
|
||||
Ixf2_Vxf1 = *(ckt->CKTstate0 + here->HICUMixf2_Vxf1) ;
|
||||
Ixf2_Vxf2 = *(ckt->CKTstate0 + here->HICUMixf2_Vxf2) ;
|
||||
Ixf2_dT = *(ckt->CKTstate0 + here->HICUMixf2_Vrth) ;
|
||||
|
||||
goto load;
|
||||
}
|
||||
/*
|
||||
|
|
@ -2783,7 +2812,7 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
}
|
||||
// ********************************************
|
||||
|
||||
// all nodes (B BP BI C CI E EI S SI) connected to gmin
|
||||
// all nodes (B BP BI C CI E EI S SI,XF1,XF2,XF3) connected to gmin
|
||||
// T node not neede since if rth to small, non existent
|
||||
Ibiei += ckt->CKTgmin*Vbiei; //BI EI -> BI EI
|
||||
Ibici += ckt->CKTgmin*Vbici; //BI CI -> CI
|
||||
|
|
@ -2792,6 +2821,9 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
// Ibpbi += ckt->CKTgmin*Vbpbi; //BP BI -> not needed
|
||||
// Ibpci += ckt->CKTgmin*Vbpci; //BP CI -> not needed
|
||||
Isici += ckt->CKTgmin*Vsici; //SI CI -> SI
|
||||
Ixf1 += ckt->CKTgmin*Vxf1; //SI CI -> SI
|
||||
Ixf2 += ckt->CKTgmin*Vxf2; //SI CI -> SI
|
||||
Ixf += ckt->CKTgmin*Vxf; //SI CI -> SI
|
||||
//C from Icic
|
||||
//E from Ieie
|
||||
//S from Isis
|
||||
|
|
@ -2832,6 +2864,20 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
Ibpsi_Vbpci += ckt->CKTgmin;
|
||||
Ibpsi_Vsici += ckt->CKTgmin;
|
||||
|
||||
//Ixf
|
||||
Ixf_Vbiei += ckt->CKTgmin;
|
||||
Ixf_Vbici += ckt->CKTgmin;
|
||||
Ixf_Vxf += ckt->CKTgmin;
|
||||
//Ixf1
|
||||
Ixf1_Vbiei += ckt->CKTgmin;
|
||||
Ixf1_Vbici += ckt->CKTgmin;
|
||||
Ixf1_Vxf2 += ckt->CKTgmin;
|
||||
//Ixf2
|
||||
Ixf2_Vbiei += ckt->CKTgmin;
|
||||
Ixf2_Vbici += ckt->CKTgmin;
|
||||
Ixf2_Vxf2 += ckt->CKTgmin;
|
||||
Ixf2_Vxf1 += ckt->CKTgmin;
|
||||
|
||||
//SHE derivatives
|
||||
if (selfheat) {
|
||||
// T node
|
||||
|
|
@ -2868,13 +2914,12 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
Ith_Vbbp += ckt->CKTgmin;
|
||||
Ith_Veie += ckt->CKTgmin;
|
||||
Ith_Vrth += ckt->CKTgmin;
|
||||
}
|
||||
|
||||
// NQS effect
|
||||
// Ibxf1 = Ixf1;
|
||||
// Icxf1 += ddt(Qxf1);
|
||||
// Ibxf2 = Ixf2;
|
||||
// Icxf2 += ddt(Qxf2);
|
||||
//NQS
|
||||
Ixf_dT += ckt->CKTgmin;
|
||||
Ixf1_dT += ckt->CKTgmin;
|
||||
Ixf2_dT += ckt->CKTgmin;
|
||||
}
|
||||
|
||||
// end of Load_sources
|
||||
|
||||
|
|
@ -2917,6 +2962,7 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
*(ckt->CKTstate0 + here->HICUMcqf) = Qdeix_Vbiei;
|
||||
*(ckt->CKTstate0 + here->HICUMqf_Vbici) = Qdeix_Vbici;
|
||||
*(ckt->CKTstate0 + here->HICUMqf_Vrth) = Qdeix_dT;
|
||||
*(ckt->CKTstate0 + here->HICUMqf_Vxf) = Qdeix_Vxf;
|
||||
//Qr
|
||||
*(ckt->CKTstate0 + here->HICUMqr) = Qr;
|
||||
*(ckt->CKTstate0 + here->HICUMcqr) = Qr_Vbici;
|
||||
|
|
@ -2969,8 +3015,11 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
|
||||
//NQS
|
||||
*(ckt->CKTstate0 + here->HICUMqxf1) = Qxf1;
|
||||
*(ckt->CKTstate0 + here->HICUMcqxf1) = Qxf1_Vxf1;
|
||||
*(ckt->CKTstate0 + here->HICUMqxf2) = Qxf2;
|
||||
*(ckt->CKTstate0 + here->HICUMcqxf2) = Qxf2_Vxf2;
|
||||
*(ckt->CKTstate0 + here->HICUMqxf) = Qxf;
|
||||
*(ckt->CKTstate0 + here->HICUMcqxf) = Qxf_Vxf;
|
||||
if (selfheat) {
|
||||
//Qth
|
||||
*(ckt->CKTstate0 + here->HICUMqcth) = Qcth;
|
||||
|
|
@ -2998,10 +3047,10 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
(!(ckt->CKTmode & MODEUIC)) ) {
|
||||
if(ckt->CKTmode & MODEINITSMSIG) {
|
||||
|
||||
//TODO (transient not yet implented)
|
||||
*(ckt->CKTstate0 + here->HICUMcqf) = Qdeix_Vbiei;
|
||||
*(ckt->CKTstate0 + here->HICUMqf_Vbici) = Qdeix_Vbici;
|
||||
*(ckt->CKTstate0 + here->HICUMqf_Vrth) = Qdeix_dT;
|
||||
*(ckt->CKTstate0 + here->HICUMqf_Vxf) = Qdeix_Vxf;
|
||||
|
||||
*(ckt->CKTstate0 + here->HICUMcqjei) = Cjei;
|
||||
*(ckt->CKTstate0 + here->HICUMcqjci) = Cjci;
|
||||
|
|
@ -3067,6 +3116,7 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
*(ckt->CKTstate0 + here->HICUMqxf2) ;
|
||||
*(ckt->CKTstate1 + here->HICUMqxf) =
|
||||
*(ckt->CKTstate0 + here->HICUMqxf) ;
|
||||
|
||||
if (selfheat)
|
||||
*(ckt->CKTstate1 + here->HICUMqcth) =
|
||||
*(ckt->CKTstate0 + here->HICUMqcth) ;
|
||||
|
|
@ -3130,21 +3180,21 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
if(error) return(error);
|
||||
Isc_Vsc = geq;
|
||||
Isc = *(ckt->CKTstate0 + here->HICUMcqscp);
|
||||
//NQS
|
||||
//Qxf
|
||||
error = NIintegrate(ckt,&geq,&ceq,Qxf1_Vxf1,here->HICUMqxf);
|
||||
if(error) return(error);
|
||||
Iqxf1_Vxf1 = geq;
|
||||
Iqxf1 = *(ckt->CKTstate0 + here->HICUMcqxf1);
|
||||
Ixf1_Vxf1 += geq;
|
||||
Ixf1 += *(ckt->CKTstate0 + here->HICUMcqxf);
|
||||
//Qxf2
|
||||
error = NIintegrate(ckt,&geq,&ceq,Qxf2_Vxf2,here->HICUMqxf);
|
||||
error = NIintegrate(ckt,&geq,&ceq,Qxf2_Vxf2,here->HICUMqxf2);
|
||||
if(error) return(error);
|
||||
Iqxf2_Vxf2 = geq;
|
||||
Iqxf2 = *(ckt->CKTstate0 + here->HICUMcqxf2);
|
||||
Ixf2_Vxf2 += geq;
|
||||
Ixf2 += *(ckt->CKTstate0 + here->HICUMcqxf2);
|
||||
//Qxf
|
||||
error = NIintegrate(ckt,&geq,&ceq,Qxf_Vxf,here->HICUMqxf);
|
||||
error = NIintegrate(ckt,&geq,&ceq,Qxf_Vxf,here->HICUMqxf1);
|
||||
if(error) return(error);
|
||||
Iqxf_Vxf = geq;
|
||||
Iqxf = *(ckt->CKTstate0 + here->HICUMcqxf);
|
||||
Ixf_Vxf += geq;
|
||||
Ixf += *(ckt->CKTstate0 + here->HICUMcqxf1);
|
||||
|
||||
if (selfheat)
|
||||
{
|
||||
|
|
@ -3237,7 +3287,7 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
}
|
||||
}
|
||||
|
||||
// Write to state vector
|
||||
// Write branch currents and voltages to state vector
|
||||
*(ckt->CKTstate0 + here->HICUMvbiei) = Vbiei;
|
||||
*(ckt->CKTstate0 + here->HICUMvbici) = Vbici;
|
||||
*(ckt->CKTstate0 + here->HICUMvbpei) = Vbpei;
|
||||
|
|
@ -3247,6 +3297,9 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
*(ckt->CKTstate0 + here->HICUMvcic) = Vcic;
|
||||
*(ckt->CKTstate0 + here->HICUMvbbp) = Vbbp;
|
||||
*(ckt->CKTstate0 + here->HICUMveie) = Veie;
|
||||
*(ckt->CKTstate0 + here->HICUMvxf1) = Vxf1;
|
||||
*(ckt->CKTstate0 + here->HICUMvxf2) = Vxf2;
|
||||
*(ckt->CKTstate0 + here->HICUMvxf) = Vxf;
|
||||
|
||||
*(ckt->CKTstate0 + here->HICUMibiei) = Ibiei;
|
||||
*(ckt->CKTstate0 + here->HICUMibiei_Vbiei) = Ibiei_Vbiei;
|
||||
|
|
@ -3261,7 +3314,7 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
*(ckt->CKTstate0 + here->HICUMiciei_Vbiei) = Iciei_Vbiei;
|
||||
*(ckt->CKTstate0 + here->HICUMiciei_Vbici) = Iciei_Vbici;
|
||||
*(ckt->CKTstate0 + here->HICUMiciei_Vrth) = Iciei_Vrth;
|
||||
//*(ckt->CKTstate0 + here->HICUMiciei_Vxf2) = Iciei_Vxf2;
|
||||
*(ckt->CKTstate0 + here->HICUMiciei_Vxf2) = Iciei_Vxf2;
|
||||
|
||||
*(ckt->CKTstate0 + here->HICUMibici) = Ibici;
|
||||
*(ckt->CKTstate0 + here->HICUMibici_Vbici) = Ibici_Vbici;
|
||||
|
|
@ -3317,7 +3370,24 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
*(ckt->CKTstate0 + here->HICUMith_Vbbp) = Ith_Vbbp;
|
||||
*(ckt->CKTstate0 + here->HICUMith_Veie) = Ith_Veie;
|
||||
|
||||
*(ckt->CKTstate0 + here->HICUMixf) = Ixf;
|
||||
*(ckt->CKTstate0 + here->HICUMixf_Vbiei) = Ixf_Vbiei;
|
||||
*(ckt->CKTstate0 + here->HICUMixf_Vbici) = Ixf_Vbici;
|
||||
*(ckt->CKTstate0 + here->HICUMixf_Vxf) = Ixf_Vxf;
|
||||
*(ckt->CKTstate0 + here->HICUMixf_Vrth) = Ixf_dT;
|
||||
|
||||
*(ckt->CKTstate0 + here->HICUMixf1) = Ixf1;
|
||||
*(ckt->CKTstate0 + here->HICUMixf1_Vbiei) = Ixf1_Vbiei;
|
||||
*(ckt->CKTstate0 + here->HICUMixf1_Vbici) = Ixf1_Vbici;
|
||||
*(ckt->CKTstate0 + here->HICUMixf1_Vxf2) = Ixf1_Vxf2;
|
||||
*(ckt->CKTstate0 + here->HICUMixf1_Vrth) = Ixf1_dT;
|
||||
|
||||
*(ckt->CKTstate0 + here->HICUMixf2) = Ixf2;
|
||||
*(ckt->CKTstate0 + here->HICUMixf2_Vbiei) = Ixf2_Vbiei;
|
||||
*(ckt->CKTstate0 + here->HICUMixf2_Vbici) = Ixf2_Vbici;
|
||||
*(ckt->CKTstate0 + here->HICUMixf2_Vxf1) = Ixf2_Vxf1;
|
||||
*(ckt->CKTstate0 + here->HICUMixf2_Vxf2) = Ixf2_Vxf2;
|
||||
*(ckt->CKTstate0 + here->HICUMixf2_Vrth) = Ixf2_dT;
|
||||
|
||||
load:
|
||||
// #############################################################
|
||||
|
|
@ -3597,18 +3667,7 @@ load:
|
|||
*(here->HICUMxfBaseBIPtr) += +Ixf_Vbici;
|
||||
*(here->HICUMxfCollCIPtr) += -Ixf_Vbici;
|
||||
*(here->HICUMxfXfPtr) += +Ixf_Vxf;
|
||||
// Branch: xf1-ground, Stamp element: Qxf1 // TODO Test in AC simulation!
|
||||
rhs_current = Iqxf1 - Iqxf1_Vxf1*Vxf1;
|
||||
*(ckt->CKTrhs + here->HICUMxf1Node) += -rhs_current;
|
||||
*(here->HICUMxf1Xf1Ptr) += +Iqxf1_Vxf1;
|
||||
// Branch: xf2-ground, Stamp element: Qxf2 // TODO Test in AC simulation!
|
||||
rhs_current = Iqxf2 - Iqxf2_Vxf2*Vxf2;
|
||||
*(ckt->CKTrhs + here->HICUMxf2Node) += -rhs_current;
|
||||
*(here->HICUMxf2Xf2Ptr) += +Iqxf2_Vxf2;
|
||||
// Branch: xf-ground, Stamp element: Qxf // TODO Test in AC simulation!
|
||||
rhs_current = model->HICUMtype * (Iqxf - Iqxf_Vxf*Vxf);
|
||||
*(ckt->CKTrhs + here->HICUMxfNode) += -rhs_current; // into ground
|
||||
*(here->HICUMxfXfPtr) += +Iqxf_Vxf;
|
||||
|
||||
/*
|
||||
c Branch: xf1-ground, Stamp element: Rxf1 TODO: This is wrong, but needed at the moment for convergence
|
||||
*/
|
||||
|
|
@ -3739,6 +3798,27 @@ c Branch: xf-ground, Stamp element: Rxf
|
|||
*(here->HICUMsubsSItempPtr) += -Ibpsi_Vrth;
|
||||
// finish
|
||||
|
||||
// Stamp element: Ixf f_xf = +
|
||||
rhs_current = -Ixf_dT*Vrth;
|
||||
*(ckt->CKTrhs + here->HICUMxfNode) += -rhs_current;
|
||||
// with respect to Potential Vxf
|
||||
*(here->HICUMxfTempPtr) += Ixf_dT;
|
||||
// finish
|
||||
|
||||
// Stamp element: Ixf1 f_xf1 = +
|
||||
rhs_current = -Ixf1_dT*Vrth;
|
||||
*(ckt->CKTrhs + here->HICUMxf1Node) += -rhs_current;
|
||||
// with respect to Potential Vxf1
|
||||
*(here->HICUMxf1TempPtr) += Ixf1_dT;
|
||||
// finish
|
||||
|
||||
// Stamp element: Ixf2 f_xf2 = +
|
||||
rhs_current = -Ixf2_dT*Vrth;
|
||||
*(ckt->CKTrhs + here->HICUMxf2Node) += -rhs_current;
|
||||
// with respect to Potential Vxf2
|
||||
*(here->HICUMxf2TempPtr) += Ixf2_dT;
|
||||
// finish
|
||||
|
||||
// Stamp element: Ith f_T = - Ith
|
||||
rhs_current = Ith + Icth - Icth_Vrth*Vrth
|
||||
- Ith_Vbiei*Vbiei - Ith_Vbici*Vbici - Ith_Vciei*Vciei
|
||||
|
|
|
|||
Loading…
Reference in New Issue