consistent derivative with Vrth/Tdev=> will rework this, I do not like

this
This commit is contained in:
Markus Mueller 2020-07-23 16:50:31 +02:00
parent 03c3efd762
commit 154036c09f
7 changed files with 160 additions and 457 deletions

View File

@ -116,6 +116,7 @@ HICUMacLoad(GENmodel *inModel, CKTcircuit *ckt)
double Ixf_Vrth ;
double Ith_Vrth, Ith_Vbiei, Ith_Vbici, Ith_Vbpbi, Ith_Vbpci, Ith_Vbpei, Ith_Vciei, Ith_Vsici, Ith_Vcic, Ith_Vbbp, Ith_Veie;
double Tdev_Vrth;
/* loop through all the models */
for( ; model != NULL; model = HICUMnextModel(model)) {
@ -127,6 +128,8 @@ HICUMacLoad(GENmodel *inModel, CKTcircuit *ckt)
for( here = HICUMinstances(model); here!= NULL;
here = HICUMnextInstance(here)) {
Tdev_Vrth = here->HICUMtemp_Vrth ;
// get all derivatives of branch DC currents
if(model->HICUMrcxGiven && model->HICUMrcx != 0) {
Icic_Vcic = 1/here->HICUMrcx_t.rpart;
@ -519,46 +522,46 @@ HICUMacLoad(GENmodel *inModel, CKTcircuit *ckt)
// Stamps with SH
if (selfheat) {
// Stamp element: Ibiei f_Bi = + f_Ei = -
*(here->HICUMbaseBItempPtr) += Ibiei_Vrth;
*(here->HICUMemitEItempPtr) += -Ibiei_Vrth;
*(here->HICUMbaseBItempPtr) += Ibiei_Vrth*Tdev_Vrth;
*(here->HICUMemitEItempPtr) += -Ibiei_Vrth*Tdev_Vrth;
// Stamp element: Ibpei f_Bp = + f_Ei = -
// with respect to Potential Vrth
*(here->HICUMbaseBPtempPtr) += Ibpei_Vrth;
*(here->HICUMemitEItempPtr) += -Ibpei_Vrth;
*(here->HICUMbaseBPtempPtr) += Ibpei_Vrth*Tdev_Vrth;
*(here->HICUMemitEItempPtr) += -Ibpei_Vrth*Tdev_Vrth;
// Stamp element: Ibici f_Bi = + f_Ci = -
*(here->HICUMbaseBItempPtr) += Ibici_Vrth;
*(here->HICUMcollCItempPtr) += -Ibici_Vrth;
*(here->HICUMbaseBItempPtr) += Ibici_Vrth*Tdev_Vrth;
*(here->HICUMcollCItempPtr) += -Ibici_Vrth*Tdev_Vrth;
// Stamp element: Iciei f_Ci = + f_Ei = -
*(here->HICUMcollCItempPtr) += Iciei_Vrth;
*(here->HICUMemitEItempPtr) += -Iciei_Vrth;
*(here->HICUMcollCItempPtr) += Iciei_Vrth*Tdev_Vrth;
*(here->HICUMemitEItempPtr) += -Iciei_Vrth*Tdev_Vrth;
// Stamp element: Ibpci f_Bp = + f_Ci = -
*(here->HICUMbaseBPtempPtr) += Ibpci_Vrth;
*(here->HICUMcollCItempPtr) += -Ibpci_Vrth;
*(here->HICUMbaseBPtempPtr) += Ibpci_Vrth*Tdev_Vrth;
*(here->HICUMcollCItempPtr) += -Ibpci_Vrth*Tdev_Vrth;
// Stamp element: Rcx f_Ci = + f_C = -
*(here->HICUMcollCItempPtr) += Icic_Vrth;
*(here->HICUMcollTempPtr) += -Icic_Vrth;
*(here->HICUMcollCItempPtr) += Icic_Vrth*Tdev_Vrth;
*(here->HICUMcollTempPtr) += -Icic_Vrth*Tdev_Vrth;
// Stamp element: Rbx f_B = + f_Bp = -
*(here->HICUMbaseTempPtr) += Ibbp_Vrth;
*(here->HICUMbaseBPtempPtr) += -Ibbp_Vrth;
*(here->HICUMbaseTempPtr) += Ibbp_Vrth*Tdev_Vrth;
*(here->HICUMbaseBPtempPtr) += -Ibbp_Vrth*Tdev_Vrth;
// Stamp element: Re f_Ei = + f_E = -
*(here->HICUMemitEItempPtr) += Ieie_Vrth;
*(here->HICUMemitTempPtr) += -Ieie_Vrth;
*(here->HICUMemitEItempPtr) += Ieie_Vrth*Tdev_Vrth;
*(here->HICUMemitTempPtr) += -Ieie_Vrth*Tdev_Vrth;
// Stamp element: Rbi f_Bp = + f_Bi = -
*(here->HICUMbaseBPtempPtr) += Ibpbi_Vrth;
*(here->HICUMbaseBItempPtr) += -Ibpbi_Vrth;
*(here->HICUMbaseBPtempPtr) += Ibpbi_Vrth*Tdev_Vrth;
*(here->HICUMbaseBItempPtr) += -Ibpbi_Vrth*Tdev_Vrth;
// Stamp element: Isici f_Si = + f_Ci = -
*(here->HICUMsubsSItempPtr) += Isici_Vrth;
*(here->HICUMcollCItempPtr) += -Isici_Vrth;
*(here->HICUMsubsSItempPtr) += Isici_Vrth*Tdev_Vrth;
*(here->HICUMcollCItempPtr) += -Isici_Vrth*Tdev_Vrth;
// Branch: bpsi, Stamp element: Its
*(here->HICUMbaseBPtempPtr) += Ibpsi_Vrth;
*(here->HICUMsubsSItempPtr) += -Ibpsi_Vrth;
*(here->HICUMbaseBPtempPtr) += Ibpsi_Vrth*Tdev_Vrth;
*(here->HICUMsubsSItempPtr) += -Ibpsi_Vrth*Tdev_Vrth;
if (nqs) {
// Stamp element: Ixf f_xf = +
*(here->HICUMxfTempPtr) += Ixf_Vrth;
*(here->HICUMxfTempPtr) += Ixf_Vrth*Tdev_Vrth;
// Stamp element: Ixf1 f_xf1 = +
*(here->HICUMxf1TempPtr) += Ixf1_Vrth;
*(here->HICUMxf1TempPtr) += Ixf1_Vrth*Tdev_Vrth;
// Stamp element: Ixf2 f_xf2 = +
*(here->HICUMxf2TempPtr) += Ixf2_Vrth;
*(here->HICUMxf2TempPtr) += Ixf2_Vrth*Tdev_Vrth;
}
// Stamp element: Ith f_T = - Ith
@ -597,29 +600,29 @@ HICUMacLoad(GENmodel *inModel, CKTcircuit *ckt)
// finish
//the charges
*(here->HICUMbaseBItempPtr + 1) += +XQrbi_Vrth;
*(here->HICUMbaseBPtempPtr + 1) += -XQrbi_Vrth;
*(here->HICUMbaseBItempPtr + 1) += +XQjei_Vrth;
*(here->HICUMemitEItempPtr + 1) += -XQjei_Vrth;
*(here->HICUMbaseBItempPtr + 1) += +XQf_Vrth;
*(here->HICUMemitEItempPtr + 1) += -XQf_Vrth;
*(here->HICUMbaseBItempPtr + 1) += +XQr_Vrth;
*(here->HICUMcollCItempPtr + 1) += -XQr_Vrth;
*(here->HICUMbaseBItempPtr + 1) += +XQjci_Vrth;
*(here->HICUMcollCItempPtr + 1) += -XQjci_Vrth;
*(here->HICUMbaseBPtempPtr + 1) += +XQjep_Vrth;
*(here->HICUMemitEItempPtr + 1) += -XQjep_Vrth;
*(here->HICUMbaseTempPtr + 1) += +Xqjcx0_t_i_Vrth;
*(here->HICUMcollCItempPtr + 1) += -Xqjcx0_t_i_Vrth;
*(here->HICUMbaseBPtempPtr + 1) += +Xqjcx0_t_ii_Vrth;
*(here->HICUMcollCItempPtr + 1) += -Xqjcx0_t_ii_Vrth;
*(here->HICUMbaseBPtempPtr + 1) += +XQdsu_Vrth;
*(here->HICUMcollCItempPtr + 1) += -XQdsu_Vrth;
*(here->HICUMsubsSItempPtr + 1) += +XQjs_Vrth;
*(here->HICUMcollCItempPtr + 1) += -XQjs_Vrth;
*(here->HICUMsubsTempPtr + 1) += +XQscp_Vrth;
*(here->HICUMcollTempPtr + 1) += -XQscp_Vrth;
*(here->HICUMtempTempPtr + 1) += +XQcth_Vrth;
*(here->HICUMbaseBItempPtr + 1) += +XQrbi_Vrth*Tdev_Vrth;
*(here->HICUMbaseBPtempPtr + 1) += -XQrbi_Vrth*Tdev_Vrth;
*(here->HICUMbaseBItempPtr + 1) += +XQjei_Vrth*Tdev_Vrth;
*(here->HICUMemitEItempPtr + 1) += -XQjei_Vrth*Tdev_Vrth;
*(here->HICUMbaseBItempPtr + 1) += +XQf_Vrth*Tdev_Vrth;
*(here->HICUMemitEItempPtr + 1) += -XQf_Vrth*Tdev_Vrth;
*(here->HICUMbaseBItempPtr + 1) += +XQr_Vrth*Tdev_Vrth;
*(here->HICUMcollCItempPtr + 1) += -XQr_Vrth*Tdev_Vrth;
*(here->HICUMbaseBItempPtr + 1) += +XQjci_Vrth*Tdev_Vrth;
*(here->HICUMcollCItempPtr + 1) += -XQjci_Vrth*Tdev_Vrth;
*(here->HICUMbaseBPtempPtr + 1) += +XQjep_Vrth*Tdev_Vrth;
*(here->HICUMemitEItempPtr + 1) += -XQjep_Vrth*Tdev_Vrth;
*(here->HICUMbaseTempPtr + 1) += +Xqjcx0_t_i_Vrth*Tdev_Vrth;
*(here->HICUMcollCItempPtr + 1) += -Xqjcx0_t_i_Vrth*Tdev_Vrth;
*(here->HICUMbaseBPtempPtr + 1) += +Xqjcx0_t_ii_Vrth*Tdev_Vrth;
*(here->HICUMcollCItempPtr + 1) += -Xqjcx0_t_ii_Vrth*Tdev_Vrth;
*(here->HICUMbaseBPtempPtr + 1) += +XQdsu_Vrth*Tdev_Vrth;
*(here->HICUMcollCItempPtr + 1) += -XQdsu_Vrth*Tdev_Vrth;
*(here->HICUMsubsSItempPtr + 1) += +XQjs_Vrth*Tdev_Vrth;
*(here->HICUMcollCItempPtr + 1) += -XQjs_Vrth*Tdev_Vrth;
*(here->HICUMsubsTempPtr + 1) += +XQscp_Vrth*Tdev_Vrth;
*(here->HICUMcollTempPtr + 1) += -XQscp_Vrth*Tdev_Vrth;
*(here->HICUMtempTempPtr + 1) += +XQcth_Vrth*Tdev_Vrth;
}

View File

@ -44,6 +44,8 @@ HICUMconvTest(GENmodel *inModel, CKTcircuit *ckt)
double isicihat;
double volatile ithhat;
double Tdev_Vrth;
double Vbiei, Vbici, Vciei, Vbpei, Vbpbi, Vbpci, Vbci, Vsici, Vrth, Vcic, Vbbp, Veie;
double Ibiei, Ibici, Iciei, Ibpei, Ibpbi, Ibpci, Ibpsi, Isici, Ith;
@ -102,34 +104,36 @@ HICUMconvTest(GENmodel *inModel, CKTcircuit *ckt)
delvbbp = Vbbp - *(ckt->CKTstate0 + here->HICUMvbbp);
delveie = Veie - *(ckt->CKTstate0 + here->HICUMveie);
Tdev_Vrth = here->HICUMtemp_Vrth ;
ibieihat = *(ckt->CKTstate0 + here->HICUMibiei) +
*(ckt->CKTstate0 + here->HICUMibiei_Vbiei)*delvbiei +
*(ckt->CKTstate0 + here->HICUMibiei_Vrth)*delvrth +
*(ckt->CKTstate0 + here->HICUMibiei_Vrth)*Tdev_Vrth*delvrth +
*(ckt->CKTstate0 + here->HICUMibiei_Vbici)*delvbici;
ibicihat = *(ckt->CKTstate0 + here->HICUMibici) +
*(ckt->CKTstate0 + here->HICUMibici_Vbici)*delvbici+
*(ckt->CKTstate0 + here->HICUMibici_Vrth)*delvrth+
*(ckt->CKTstate0 + here->HICUMibici_Vrth)*Tdev_Vrth*delvrth+
*(ckt->CKTstate0 + here->HICUMibici_Vbiei)*delvbiei;
icieihat = *(ckt->CKTstate0 + here->HICUMiciei) +
*(ckt->CKTstate0 + here->HICUMiciei_Vbiei)*delvbiei +
*(ckt->CKTstate0 + here->HICUMiciei_Vrth)*delvrth +
*(ckt->CKTstate0 + here->HICUMiciei_Vrth)*Tdev_Vrth*delvrth +
*(ckt->CKTstate0 + here->HICUMiciei_Vbici)*delvbici;
ibpeihat = *(ckt->CKTstate0 + here->HICUMibpei) +
*(ckt->CKTstate0 + here->HICUMibpei_Vrth)*delvrth+
*(ckt->CKTstate0 + here->HICUMibpei_Vbpei)*delvbpei;
ibpbihat = *(ckt->CKTstate0 + here->HICUMibpbi) +
*(ckt->CKTstate0 + here->HICUMibpbi_Vbiei)*delvbiei +
*(ckt->CKTstate0 + here->HICUMibpbi_Vrth)*delvrth +
*(ckt->CKTstate0 + here->HICUMibpbi_Vrth)*Tdev_Vrth*delvrth +
*(ckt->CKTstate0 + here->HICUMibpbi_Vbici)*delvbici;
ibpcihat = *(ckt->CKTstate0 + here->HICUMibpci) +
*(ckt->CKTstate0 + here->HICUMibpci_Vrth)*delvrth+
*(ckt->CKTstate0 + here->HICUMibpci_Vrth)*Tdev_Vrth*delvrth+
*(ckt->CKTstate0 + here->HICUMibpci_Vbpci)*delvbici;
ibpsihat = *(ckt->CKTstate0 + here->HICUMibpsi) +
*(ckt->CKTstate0 + here->HICUMibpsi_Vbpci)*delvbpci +
*(ckt->CKTstate0 + here->HICUMibpsi_Vrth)*delvrth +
*(ckt->CKTstate0 + here->HICUMibpsi_Vrth)*Tdev_Vrth*delvrth +
*(ckt->CKTstate0 + here->HICUMibpsi_Vsici)*delvsici;
isicihat = *(ckt->CKTstate0 + here->HICUMisici) +
*(ckt->CKTstate0 + here->HICUMisici_Vrth)*delvrth+
*(ckt->CKTstate0 + here->HICUMisici_Vrth)*Tdev_Vrth*delvrth+
*(ckt->CKTstate0 + here->HICUMisici_Vsici)*delvsici;
ithhat = *(ckt->CKTstate0 + here->HICUMith) +
*(ckt->CKTstate0 + here->HICUMith_Vrth)*delvrth+

View File

@ -65,8 +65,8 @@ typedef struct sHICUMinstance {
int HICUMbaseBPNode; /* number of internal base node of hicum */
int HICUMsubsSINode; /* number of internal substrate node */
int HICUMxfNode; /* number of internal excess phase node qdei */
int HICUMxf1Node; /* number of internal excess phase node itf */
int HICUMxf2Node; /* number of internal excess phase node itf */
int HICUMxf1Node; /* number of internal excess phase 1 node itf */
int HICUMxf2Node; /* number of internal excess phase 2 node itf */
double HICUMarea; /* area factor for the hicum */
//initial conditions

View File

@ -115,6 +115,8 @@ HICUMpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s)
double Ixf_Vxf ;
double Ixf_Vrth ;
double Tdev_Vrth;
double Ith_Vrth, Ith_Vbiei, Ith_Vbici, Ith_Vbpbi, Ith_Vbpci, Ith_Vbpei, Ith_Vciei, Ith_Vsici, Ith_Vcic, Ith_Vbbp, Ith_Veie;
/* loop through all the models */
@ -127,6 +129,8 @@ HICUMpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s)
for( here = HICUMinstances(model); here!= NULL;
here = HICUMnextInstance(here)) {
Tdev_Vrth = here->HICUMtemp_Vrth ;
// get all derivatives of branch DC currents
if(model->HICUMrcxGiven && model->HICUMrcx != 0) {
Icic_Vcic = 1/here->HICUMrcx_t.rpart;
@ -608,46 +612,46 @@ HICUMpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s)
// Stamps with SH
if (selfheat) {
// Stamp element: Ibiei f_Bi = + f_Ei = -
*(here->HICUMbaseBItempPtr) += Ibiei_Vrth;
*(here->HICUMemitEItempPtr) += -Ibiei_Vrth;
*(here->HICUMbaseBItempPtr) += Ibiei_Vrth*Tdev_Vrth;
*(here->HICUMemitEItempPtr) += -Ibiei_Vrth*Tdev_Vrth;
// Stamp element: Ibpei f_Bp = + f_Ei = -
// with respect to Potential Vrth
*(here->HICUMbaseBPtempPtr) += Ibpei_Vrth;
*(here->HICUMemitEItempPtr) += -Ibpei_Vrth;
*(here->HICUMbaseBPtempPtr) += Ibpei_Vrth*Tdev_Vrth;
*(here->HICUMemitEItempPtr) += -Ibpei_Vrth*Tdev_Vrth;
// Stamp element: Ibici f_Bi = + f_Ci = -
*(here->HICUMbaseBItempPtr) += Ibici_Vrth;
*(here->HICUMcollCItempPtr) += -Ibici_Vrth;
*(here->HICUMbaseBItempPtr) += Ibici_Vrth*Tdev_Vrth;
*(here->HICUMcollCItempPtr) += -Ibici_Vrth*Tdev_Vrth;
// Stamp element: Iciei f_Ci = + f_Ei = -
*(here->HICUMcollCItempPtr) += Iciei_Vrth;
*(here->HICUMemitEItempPtr) += -Iciei_Vrth;
*(here->HICUMcollCItempPtr) += Iciei_Vrth*Tdev_Vrth;
*(here->HICUMemitEItempPtr) += -Iciei_Vrth*Tdev_Vrth;
// Stamp element: Ibpci f_Bp = + f_Ci = -
*(here->HICUMbaseBPtempPtr) += Ibpci_Vrth;
*(here->HICUMcollCItempPtr) += -Ibpci_Vrth;
*(here->HICUMbaseBPtempPtr) += Ibpci_Vrth*Tdev_Vrth;
*(here->HICUMcollCItempPtr) += -Ibpci_Vrth*Tdev_Vrth;
// Stamp element: Rcx f_Ci = + f_C = -
*(here->HICUMcollCItempPtr) += Icic_Vrth;
*(here->HICUMcollTempPtr) += -Icic_Vrth;
*(here->HICUMcollCItempPtr) += Icic_Vrth*Tdev_Vrth;
*(here->HICUMcollTempPtr) += -Icic_Vrth*Tdev_Vrth;
// Stamp element: Rbx f_B = + f_Bp = -
*(here->HICUMbaseTempPtr) += Ibbp_Vrth;
*(here->HICUMbaseBPtempPtr) += -Ibbp_Vrth;
*(here->HICUMbaseTempPtr) += Ibbp_Vrth*Tdev_Vrth;
*(here->HICUMbaseBPtempPtr) += -Ibbp_Vrth*Tdev_Vrth;
// Stamp element: Re f_Ei = + f_E = -
*(here->HICUMemitEItempPtr) += Ieie_Vrth;
*(here->HICUMemitTempPtr) += -Ieie_Vrth;
*(here->HICUMemitEItempPtr) += Ieie_Vrth*Tdev_Vrth;
*(here->HICUMemitTempPtr) += -Ieie_Vrth*Tdev_Vrth;
// Stamp element: Rbi f_Bp = + f_Bi = -
*(here->HICUMbaseBPtempPtr) += Ibpbi_Vrth;
*(here->HICUMbaseBItempPtr) += -Ibpbi_Vrth;
*(here->HICUMbaseBPtempPtr) += Ibpbi_Vrth*Tdev_Vrth;
*(here->HICUMbaseBItempPtr) += -Ibpbi_Vrth*Tdev_Vrth;
// Stamp element: Isici f_Si = + f_Ci = -
*(here->HICUMsubsSItempPtr) += Isici_Vrth;
*(here->HICUMcollCItempPtr) += -Isici_Vrth;
*(here->HICUMsubsSItempPtr) += Isici_Vrth*Tdev_Vrth;
*(here->HICUMcollCItempPtr) += -Isici_Vrth*Tdev_Vrth;
// Branch: bpsi, Stamp element: Its
*(here->HICUMbaseBPtempPtr) += Ibpsi_Vrth;
*(here->HICUMsubsSItempPtr) += -Ibpsi_Vrth;
*(here->HICUMbaseBPtempPtr) += Ibpsi_Vrth*Tdev_Vrth;
*(here->HICUMsubsSItempPtr) += -Ibpsi_Vrth*Tdev_Vrth;
if (nqs) {
// Stamp element: Ixf f_xf = +
*(here->HICUMxfTempPtr) += Ixf_Vrth;
*(here->HICUMxfTempPtr) += Ixf_Vrth*Tdev_Vrth;
// Stamp element: Ixf1 f_xf1 = +
*(here->HICUMxf1TempPtr) += Ixf1_Vrth;
*(here->HICUMxf1TempPtr) += Ixf1_Vrth*Tdev_Vrth;
// Stamp element: Ixf2 f_xf2 = +
*(here->HICUMxf2TempPtr) += Ixf2_Vrth;
*(here->HICUMxf2TempPtr) += Ixf2_Vrth*Tdev_Vrth;
}
// Stamp element: Ith f_T = - Ith
@ -686,50 +690,50 @@ HICUMpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s)
// finish
//the charges
*(here->HICUMbaseBItempPtr + 1) += +XQrbi_Vrth*(s->imag);
*(here->HICUMbaseBItempPtr ) += +XQrbi_Vrth*(s->real);
*(here->HICUMbaseBPtempPtr + 1) += -XQrbi_Vrth*(s->imag);
*(here->HICUMbaseBPtempPtr ) += -XQrbi_Vrth*(s->real);
*(here->HICUMbaseBItempPtr + 1) += +XQjei_Vrth*(s->imag);
*(here->HICUMbaseBItempPtr ) += +XQjei_Vrth*(s->real);
*(here->HICUMemitEItempPtr + 1) += -XQjei_Vrth*(s->imag);
*(here->HICUMemitEItempPtr ) += -XQjei_Vrth*(s->real);
*(here->HICUMbaseBItempPtr + 1) += +XQf_Vrth*(s->imag);
*(here->HICUMbaseBItempPtr ) += +XQf_Vrth*(s->real);
*(here->HICUMemitEItempPtr + 1) += -XQf_Vrth*(s->imag);
*(here->HICUMemitEItempPtr ) += -XQf_Vrth*(s->real);
*(here->HICUMbaseBItempPtr + 1) += +XQr_Vrth*(s->imag);
*(here->HICUMbaseBItempPtr ) += +XQr_Vrth*(s->real);
*(here->HICUMcollCItempPtr + 1) += -XQr_Vrth*(s->imag);
*(here->HICUMcollCItempPtr ) += -XQr_Vrth*(s->real);
*(here->HICUMbaseBItempPtr + 1) += +XQjci_Vrth*(s->imag);
*(here->HICUMbaseBItempPtr ) += +XQjci_Vrth*(s->real);
*(here->HICUMcollCItempPtr + 1) += -XQjci_Vrth*(s->imag);
*(here->HICUMcollCItempPtr ) += -XQjci_Vrth*(s->real);
*(here->HICUMbaseBPtempPtr + 1) += +XQjep_Vrth*(s->imag);
*(here->HICUMbaseBPtempPtr ) += +XQjep_Vrth*(s->real);
*(here->HICUMemitEItempPtr + 1) += -XQjep_Vrth*(s->imag);
*(here->HICUMemitEItempPtr ) += -XQjep_Vrth*(s->real);
*(here->HICUMbaseTempPtr + 1) += +Xqjcx0_t_i_Vrth*(s->imag);
*(here->HICUMbaseTempPtr ) += +Xqjcx0_t_i_Vrth*(s->real);
*(here->HICUMcollCItempPtr + 1) += -Xqjcx0_t_i_Vrth*(s->imag);
*(here->HICUMcollCItempPtr ) += -Xqjcx0_t_i_Vrth*(s->real);
*(here->HICUMbaseBPtempPtr + 1) += +Xqjcx0_t_ii_Vrth*(s->imag);
*(here->HICUMbaseBPtempPtr ) += +Xqjcx0_t_ii_Vrth*(s->real);
*(here->HICUMcollCItempPtr + 1) += -Xqjcx0_t_ii_Vrth*(s->imag);
*(here->HICUMcollCItempPtr ) += -Xqjcx0_t_ii_Vrth*(s->real);
*(here->HICUMbaseBPtempPtr + 1) += +XQdsu_Vrth*(s->imag);
*(here->HICUMbaseBPtempPtr ) += +XQdsu_Vrth*(s->real);
*(here->HICUMcollCItempPtr + 1) += -XQdsu_Vrth*(s->imag);
*(here->HICUMcollCItempPtr ) += -XQdsu_Vrth*(s->real);
*(here->HICUMsubsSItempPtr + 1) += +XQjs_Vrth*(s->imag);
*(here->HICUMsubsSItempPtr ) += +XQjs_Vrth*(s->real);
*(here->HICUMcollCItempPtr + 1) += -XQjs_Vrth*(s->imag);
*(here->HICUMcollCItempPtr ) += -XQjs_Vrth*(s->real);
*(here->HICUMsubsTempPtr + 1) += +XQscp_Vrth*(s->imag);
*(here->HICUMsubsTempPtr ) += +XQscp_Vrth*(s->real);
*(here->HICUMcollTempPtr + 1) += -XQscp_Vrth*(s->imag);
*(here->HICUMcollTempPtr ) += -XQscp_Vrth*(s->real);
*(here->HICUMbaseBItempPtr + 1) += +XQrbi_Vrth*Tdev_Vrth*(s->imag);
*(here->HICUMbaseBItempPtr ) += +XQrbi_Vrth*Tdev_Vrth*(s->real);
*(here->HICUMbaseBPtempPtr + 1) += -XQrbi_Vrth*Tdev_Vrth*(s->imag);
*(here->HICUMbaseBPtempPtr ) += -XQrbi_Vrth*Tdev_Vrth*(s->real);
*(here->HICUMbaseBItempPtr + 1) += +XQjei_Vrth*Tdev_Vrth*(s->imag);
*(here->HICUMbaseBItempPtr ) += +XQjei_Vrth*Tdev_Vrth*(s->real);
*(here->HICUMemitEItempPtr + 1) += -XQjei_Vrth*Tdev_Vrth*(s->imag);
*(here->HICUMemitEItempPtr ) += -XQjei_Vrth*Tdev_Vrth*(s->real);
*(here->HICUMbaseBItempPtr + 1) += +XQf_Vrth*Tdev_Vrth*(s->imag);
*(here->HICUMbaseBItempPtr ) += +XQf_Vrth*Tdev_Vrth*(s->real);
*(here->HICUMemitEItempPtr + 1) += -XQf_Vrth*Tdev_Vrth*(s->imag);
*(here->HICUMemitEItempPtr ) += -XQf_Vrth*Tdev_Vrth*(s->real);
*(here->HICUMbaseBItempPtr + 1) += +XQr_Vrth*Tdev_Vrth*(s->imag);
*(here->HICUMbaseBItempPtr ) += +XQr_Vrth*Tdev_Vrth*(s->real);
*(here->HICUMcollCItempPtr + 1) += -XQr_Vrth*Tdev_Vrth*(s->imag);
*(here->HICUMcollCItempPtr ) += -XQr_Vrth*Tdev_Vrth*(s->real);
*(here->HICUMbaseBItempPtr + 1) += +XQjci_Vrth*Tdev_Vrth*(s->imag);
*(here->HICUMbaseBItempPtr ) += +XQjci_Vrth*Tdev_Vrth*(s->real);
*(here->HICUMcollCItempPtr + 1) += -XQjci_Vrth*Tdev_Vrth*(s->imag);
*(here->HICUMcollCItempPtr ) += -XQjci_Vrth*Tdev_Vrth*(s->real);
*(here->HICUMbaseBPtempPtr + 1) += +XQjep_Vrth*Tdev_Vrth*(s->imag);
*(here->HICUMbaseBPtempPtr ) += +XQjep_Vrth*Tdev_Vrth*(s->real);
*(here->HICUMemitEItempPtr + 1) += -XQjep_Vrth*Tdev_Vrth*(s->imag);
*(here->HICUMemitEItempPtr ) += -XQjep_Vrth*Tdev_Vrth*(s->real);
*(here->HICUMbaseTempPtr + 1) += +Xqjcx0_t_i_Vrth*Tdev_Vrth*(s->imag);
*(here->HICUMbaseTempPtr ) += +Xqjcx0_t_i_Vrth*Tdev_Vrth*(s->real);
*(here->HICUMcollCItempPtr + 1) += -Xqjcx0_t_i_Vrth*Tdev_Vrth*(s->imag);
*(here->HICUMcollCItempPtr ) += -Xqjcx0_t_i_Vrth*Tdev_Vrth*(s->real);
*(here->HICUMbaseBPtempPtr + 1) += +Xqjcx0_t_ii_Vrth*Tdev_Vrth*(s->imag);
*(here->HICUMbaseBPtempPtr ) += +Xqjcx0_t_ii_Vrth*Tdev_Vrth*(s->real);
*(here->HICUMcollCItempPtr + 1) += -Xqjcx0_t_ii_Vrth*Tdev_Vrth*(s->imag);
*(here->HICUMcollCItempPtr ) += -Xqjcx0_t_ii_Vrth*Tdev_Vrth*(s->real);
*(here->HICUMbaseBPtempPtr + 1) += +XQdsu_Vrth*Tdev_Vrth*(s->imag);
*(here->HICUMbaseBPtempPtr ) += +XQdsu_Vrth*Tdev_Vrth*(s->real);
*(here->HICUMcollCItempPtr + 1) += -XQdsu_Vrth*Tdev_Vrth*(s->imag);
*(here->HICUMcollCItempPtr ) += -XQdsu_Vrth*Tdev_Vrth*(s->real);
*(here->HICUMsubsSItempPtr + 1) += +XQjs_Vrth*Tdev_Vrth*(s->imag);
*(here->HICUMsubsSItempPtr ) += +XQjs_Vrth*Tdev_Vrth*(s->real);
*(here->HICUMcollCItempPtr + 1) += -XQjs_Vrth*Tdev_Vrth*(s->imag);
*(here->HICUMcollCItempPtr ) += -XQjs_Vrth*Tdev_Vrth*(s->real);
*(here->HICUMsubsTempPtr + 1) += +XQscp_Vrth*Tdev_Vrth*(s->imag);
*(here->HICUMsubsTempPtr ) += +XQscp_Vrth*Tdev_Vrth*(s->real);
*(here->HICUMcollTempPtr + 1) += -XQscp_Vrth*Tdev_Vrth*(s->imag);
*(here->HICUMcollTempPtr ) += -XQscp_Vrth*Tdev_Vrth*(s->real);
*(here->HICUMtempTempPtr + 1) += +XQcth_Vrth*(s->imag);
*(here->HICUMtempTempPtr ) += +XQcth_Vrth*(s->real);

View File

@ -2,38 +2,15 @@
Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1985 Thomas L. Quarles
Model Author: 1990 Michael Schröter TU Dresden
Spice3 Implementation: 2019 Dietmar Warning, Markus Müller, Mario Krattenmacher
Spice3 Implementation: 2020 Dietmar Warning, Markus Müller, Mario Krattenmacher
**********/
/*
* This file defines the HICUM L2.4.0 model load function
* Comments on the Code:
* - We use dual numbers to calculate derivatives, this is readble and error proof.
* - The code is targeted to be readbale and maintainable, speed is sacrificied for this purpose.
* - The verilog a code is available at the website of TU Dresden, Michael Schroeter#s chair.
*
* Checklist of what needs to be done: (@Mario: also look at this, did I get everything?)
* - ijBEp
* - ijBCx
* - QjEp
* - QBCx'
* - QBCx''
* - QdS
* - QjS
* - iTS
* - ijSC
* - rbi
* - crbi,qrbi
* - Qjci
* - Qjei
* - ijBCi
* - ijBEi
* - Qf
* - Qr
* - iavl
* - iBEti
* - itf, itr
* - NQS derivatives, sources and elements
* - We use dual numbers to calculate derivatives, this is readble and error proof. => you need to understand that to understand this code
* - The code is targeted to be readbale and maintainable, speed is sacrificed for this purpose.
* - The verilog a code is available at the website of TU Dresden, Michael Schroeter's chair.
*/
#include "cmath"
@ -374,7 +351,7 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
double Qdei,Qrbi;
double Qdei_Vbiei, Qdei_Vbici, Qdei_dT;
double it,ibei,irei,ibci,ibep,irep,ibh_rec;
double volatile ibet,iavl,iavl_dT,iavl_Vbiei,iavl_Vbici;
double ibet,iavl,iavl_dT,iavl_Vbiei,iavl_Vbici;
double ijbcx,ijbcx_dT,ijbcx_Vbpci,ijsc,ijsc_Vsici,ijsc_Vrth,Qjs,Qscp,HSI_Tsu,Qdsu;
double HSI_Tsu_Vbpci, HSI_Tsu_Vsici, HSI_Tsu_dT;
double Qdsu_Vbpci, Qdsu_Vsici, Qdsu_dT;
@ -383,7 +360,7 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
double Cscp_Vsc, Cscp_dT;
//Base resistance and self-heating power
double volatile rbi,pterm,pterm_dT;
double rbi,pterm,pterm_dT;
//Model initialization
double C_1;
@ -455,7 +432,7 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
double ibpsihat;
double ithhat;
double ceq, geq=0.0;
double volatile rhs_current;
double rhs_current;
int icheck=1;
int ichk1, ichk2, ichk3, ichk4, ichk5, ichk6;
int error;
@ -467,7 +444,7 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
double Ibpci=0, Ibpci_Vbpci;
double Isici, Isici_Vsici;//
double Isc=0, Isc_Vsc=0;
double volatile Iciei, Iciei_Vbiei, Iciei_Vbici, Iciei_Vrth, Iciei_Vxf2;
double Iciei, Iciei_Vbiei, Iciei_Vbici, Iciei_Vrth, Iciei_Vxf2;
double Ibbp_Vbbp=0;
double Isis_Vsis;
double Ieie, Ieie_Veie=0;
@ -518,7 +495,7 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
//NQS
double Qxf_Vxf, Qxf1_Vxf1, Qxf2_Vxf2;
double volatile Ith=0, Vrth=0, Icth, Icth_Vrth, delvrth;
double Ith=0, Vrth=0, Icth, Icth_Vrth, delvrth;
double Ibiei_Vrth=0;
double Ibici_Vrth=0;
@ -868,14 +845,6 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
//Avalanche current
duals::duald iavl;
duals::duald v_bord,v_q,U0,av,avl,cjci0_t, vdci_t, qavl_t,favl_t, kavl_t;
// double v_bord_r;
// double volatile v_bord_r1;
// int use_aval;
// if ((model->HICUMfavl > 0.0) && (model->HICUMcjci0_scaled > 0.0)) {
// use_aval = 1;
// } else {
// use_aval = 0;
// }
if (use_aval == 1) {//begin : HICAVL
double T_dpart = T.dpart();
cjci0_t = here->HICUMcjci0_t.rpart;
@ -915,19 +884,11 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
} else {
iavl = itf*avl;
}
// if (avl > 0 && iavl==0){
// printf("error");
// fflush(stdout);
// }
} else {
iavl = 0.0;
// printf("error");
// fflush(stdout);
}
} else{
iavl = 0;
// printf("error");
// fflush(stdout);
}
// Note that iavl = 0.0 is already set in the initialization block for use_aval == 0 (Markus: not for this lambda!)
return iavl;
@ -1115,24 +1076,10 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
l_it = l_it+1;
if (!(abs(d_Q) >= RTOLC*abs(Q_pT))) { //extra_rounds to get rid of derivative noise
extra_round = extra_round + 1;
// printf("extra round\n");
// condition_ = (extra_round < 5);
// std::cout << std::noboolalpha << condition_ << " == " << std::boolalpha << condition_ << std::endl;
// condition_ = (abs(d_Q) >= RTOLC*abs(Q_pT)) && (l_it <= l_itmax) && (extra_round < 5);
// std::cout << std::noboolalpha << condition_ << " == " << std::boolalpha << condition_ << std::endl;
}
}
// I_Tf1 = i_0f/Q_pT;
// a_h = Oich*I_Tf1;
// itf = I_Tf1*(1.0+a_h);
// itr = i_0r/Q_pT;
// //Final transit times, charges and transport current components
// Tf = T_f0;
// Qf = T_f0*itf;
// // `HICQFF(itf,ick,Tf,Qf,T_fT,Q_fT,Q_bf)
// Qr = Tr*itr;
//final calculations afterwards, see later in load where this is called
} //if
return Q_pT;
@ -1399,7 +1346,6 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
/////////////////////////
// begin copy state vector
/////////////////////////
//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);
@ -1532,7 +1478,7 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
Vbiei = model->HICUMtype*(
*(ckt->CKTrhsOld+here->HICUMbaseBINode)-
*(ckt->CKTrhsOld+here->HICUMemitEINode));
Vbe = model->HICUMtype*( //@Dietmar: correct?
Vbe = model->HICUMtype*(
*(ckt->CKTrhsOld+here->HICUMbaseNode)-
*(ckt->CKTrhsOld+here->HICUMemitNode));
Vbici = model->HICUMtype*(
@ -1863,7 +1809,6 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
/*
* determine dc current and derivatives
*/
//todo: check for double multiplication on pnp's
Vbiei = model->HICUMtype*Vbiei;
Vbici = model->HICUMtype*Vbici;
Vciei = (Vbiei-Vbici);
@ -1872,6 +1817,7 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
Vbci = model->HICUMtype*Vbci;
Vsici = model->HICUMtype*Vsici;
Vsc = model->HICUMtype*Vsc;
//Dietmar, what about this
// Vxf = model->HICUMtype*Vxf;
// Vxf1 = model->HICUMtype*Vxf1;
// Vxf2 = model->HICUMtype*Vxf2;
@ -1880,10 +1826,12 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
Temp = here->HICUMtemp+Vrth;
_iret = hicum_thermal_update(model, here, &Temp, &Tdev_Vrth);
here->HICUMdtemp_sh = Temp - here->HICUMtemp;
here->HICUMdtemp_sh = Temp - here->HICUMtemp;
here->HICUMtemp_Vrth = Tdev_Vrth;
} else {
Temp = here->HICUMtemp;
here->HICUMdtemp_sh = 0;
here->HICUMdtemp_sh = 0;
here->HICUMtemp_Vrth = 0;
}
// Model_evaluation
@ -1999,7 +1947,6 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
//begin final transfer current calculations -> itf, itr, Qf, Qr------------
calc_it_final(Temp+1_e, Vbiei , Vbici , Q_pT+1_e*Q_pT_dT , T_f0+1_e*T_f0_dT , ick+1_e*ick_dT , &result_itf, &result_itr, &result_Qf, &result_Qr, &result_Q_bf, &result_Tf);
// calc_it_final(Temp+1_e, Vbiei , Vbici , Q_pT , T_f0 , ick , &result_itf, &result_itr, &result_Qf, &result_Qr);
itf = result_itf.rpart();
itr = result_itr.rpart();
Qf = result_Qf.rpart();
@ -2074,7 +2021,7 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
Qrbi = Crbi*Vbpbi; //Vbpbi=(Vbpei-Vbiei)=(Vbpci-Vbici)
Qrbi_Vbpbi = Crbi;
Qrbi_Vbiei = Vbpbi*Crbi_Vbiei;// - Crbi; //What do you think Dietmar?
Qrbi_Vbiei = Vbpbi*Crbi_Vbiei;// - Crbi; //not sure about this derivative
Qrbi_Vbici = Vbpbi*Crbi_Vbici;//- Crbi;
Qrbi_Vrth = Vbpbi*Crbi_Vrth;
@ -2098,61 +2045,6 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
here->HICUMiavl = iavl;
// double v_bord, v_bord_Vbici, v_bord_dT;
// double v_q, v_q_dT, v_q_Vbici;
// double U0,U0_dT;
// double av,av_dT, av_Vbici;
// double avl,avl_av, avl_U0, avl_v_q, avl_v_bord, avl_Vbici, avl_dT;
//Avalanche current hand implementation
// iavl = 0;
// iavl_Vbici = 0;
// iavl_Vbiei = 0;
// iavl_dT = 0;
// if (use_aval == 1) {//begin : HICAVL
// v_bord = here->HICUMvdci_t.rpart-Vbici;
// v_bord_Vbici = -1;
// v_bord_dT = here->HICUMvdci_t.dpart;
// if (v_bord > 0) {
// v_q = here->HICUMqavl_t.rpart/Cjci;
// v_q_dT = here->HICUMqavl_t.dpart/Cjci - v_q/Cjci*Cjci_dT ;
// v_q_Vbici = -v_q*Cjci_Vbici/Cjci;
// U0 = here->HICUMqavl_t.rpart/here->HICUMcjci0_t.rpart;
// U0_dT = here->HICUMqavl_t.dpart/here->HICUMcjci0_t.rpart - U0/here->HICUMcjci0_t.rpart*here->HICUMcjci0_t.dpart;
// if(v_bord > U0){
// av = here->HICUMfavl_t.rpart*exp(-v_q/U0);
// av_dT = here->HICUMfavl_t.dpart*exp(-v_q/U0) - av*(v_q_dT/U0-v_q/U0*U0_dT);
// av_Vbici = -av*v_q_Vbici/U0;
// avl = av*(U0+(1.0+v_q/U0)*(v_bord-U0));
// avl_av = (U0+(1.0+v_q/U0)*(v_bord-U0));
// avl_U0 = av*(1.0 - v_q/U0/U0*(v_bord-U0) - (1.0+v_q/U0) );
// avl_v_bord = av*(1.0+v_q/U0);
// avl_v_q = av*(v_bord-U0)/U0;
// avl_Vbici = avl_av*av_Vbici + avl_v_q*v_q_Vbici + avl_v_bord*v_bord_Vbici;
// avl_dT = avl_av*av_dT + avl_U0*U0_dT + avl_v_bord*v_bord_dT + avl_v_q*v_q_dT;
// } else {
// avl = here->HICUMfavl_t.rpart*v_bord*exp(-v_q/v_bord);
// avl_v_q = -avl/v_bord;
// avl_v_bord = avl*v_q/v_bord/v_bord;
// avl_dT = here->HICUMfavl_t.dpart*v_bord*exp(-v_q/v_bord) + avl_v_bord*v_bord_dT + avl_v_q*v_q_dT;
// avl_Vbici = avl_v_q*v_q_Vbici + avl_v_bord*v_bord_Vbici;
// }
// if (model->HICUMkavl > 0) { //: HICAVLHIGH
// // duals::duald denom,sq_smooth,hl;
// // denom = 1-kavl_t*avl;
// // // Avoid denom < 0 using a smoothing function
// // sq_smooth = sqrt(denom*denom+0.01);
// // hl = 0.5*(denom+sq_smooth);
// // iavl = itf*avl/hl;
// } else {
// iavl = itf*avl;
// iavl_Vbici = avl*itf_Vbici + avl_Vbici*itf;
// iavl_Vbiei = avl*itf_Vbiei;
// iavl_dT = avl*itf_dT + itf*avl_dT;
// }
// }
// }
//Excess base current from recombination at the b-c barrier
ibh_rec = Q_bf*Otbhrec;
ibh_rec_Vbiei = Otbhrec*Q_bf_Vbiei ;
@ -3279,7 +3171,7 @@ load:
// finish
if (nqs) {
// Branch: xf1-ground, Stamp element: Ixf1 f_xf1=+ //Markus has opposite sign than Dietmar. This current flows from xf1 to ground?
// Branch: xf1-ground, Stamp element: Ixf1 f_xf1=+
rhs_current = Ixf1 - Ixf1_Vbici*Vbici - Ixf1_Vbiei*Vbiei -Ixf1_Vxf1*Vxf1 - Ixf1_Vxf2*Vxf2;
*(ckt->CKTrhs + here->HICUMxf1Node) += -rhs_current; // rhs_current; // into xf1 node
*(here->HICUMxf1BaseBIPtr) += +Ixf1_Vbiei;
@ -3289,7 +3181,7 @@ load:
*(here->HICUMxf1Xf2Ptr) += +Ixf1_Vxf2;
*(here->HICUMxf1Xf1Ptr) += +Ixf1_Vxf1;
// Branch: xf2-ground, Stamp element: Ixf2 f_xf2=+ //Markus has opposite sign than Dietmar. This current flows from xf1 to ground?
// Branch: xf2-ground, Stamp element: Ixf2 f_xf2=+
rhs_current = Ixf2 - Ixf2_Vbici*Vbici - Ixf2_Vbiei*Vbiei - Ixf2_Vxf1*Vxf1 - Ixf2_Vxf2*Vxf2;
*(ckt->CKTrhs + here->HICUMxf2Node) += -rhs_current; // rhs_current; // into xf2 node
*(here->HICUMxf2BaseBIPtr) += +Ixf2_Vbiei;
@ -3299,7 +3191,7 @@ load:
*(here->HICUMxf2Xf2Ptr) += +Ixf2_Vxf2;
*(here->HICUMxf2Xf1Ptr) += +Ixf2_Vxf1;
// Branch: xf-ground, Stamp element: Ixf f_xf=+ //Markus has opposite sign than Dietmar. This current flows from xf1 to ground?
// Branch: xf-ground, Stamp element: Ixf f_xf=+
rhs_current = Ixf - Ixf_Vbici*Vbici - Ixf_Vbiei*Vbiei - Ixf_Vxf*Vxf;
*(ckt->CKTrhs + here->HICUMxfNode) += -rhs_current; // rhs_current; // into xf2 node
*(here->HICUMxfBaseBIPtr) += +Ixf_Vbiei;

View File

@ -168,8 +168,10 @@ int hicum_thermal_update(HICUMmodel *inModel, HICUMinstance *inInstance, double
*(Tdev_Vrth) = 0;
}
}
//This routine calculate the derivative with respect to Vrth. Since at some point
// Tdev becomes constant (see above), we need to account for this like below.
temp = *(HICUMTemp)+1_e* *(Tdev_Vrth); // dual number device temperature
vt = temp*CONSTKoverQ; // dual valued temperature voltage
vt = temp*CONSTKoverQ; // dual valued temperature voltage
here->HICUMvt0 = Tnom * CONSTKoverQ;
here->HICUMvt.rpart = vt.rpart();

View File

@ -1,202 +0,0 @@
notes of Mario and Markus with thanks to Dietmar
# Overview of Spice Files for HiCUM
This file gives an overview of the files needed for the ngspice HiCUM version, e.g. their:
- intent
- status
- assignee (Mario or Markus)
- hicum2.c
- Definition of the external instance and model structure.
- Including the variables which can be accessed from the outside.
- hicum2acld.c
- hicum2ask.c
- Define how the instance output data is saved.
- hicum2conv.c
- hicum2defs.h
- Define the internal data structure
- hicum2ext.h
- hicum2getic.h
- hicum2init.h
- hicum2itf.h
- hicum2load.c
- hicum2mask.c
- Define how the model output data is saved.
- hicum2mpar.c
- Check which parameters for the model were given in the netlist. If a parameter is given, save it and set the XXXGiven flag.
- hicum2noise.c
- hicum2param.c
- hicum2pzld.c
- hicum2setup.c
- hicum2soachk.c
- hicum2temp.c
- Temperature scaling of all parameters
- Models are implemented and all derivatives are implemented using dual numbers
- Assignee: Mario
- hicum2trunc.c
- hicumL2.cpp
Implemented equivalent circuit elements:
- Ijbei
- Ijbci
- Cjei
- Cjci
- It
- Crbi (Mario check this)
- Iavl
- Ibhrec
- rbi
- Ijbep
- Ijbep
- Ijbcx
- Cjcx
- Cjs
- Cjep
- Ibet
- Ijsc
Missing:
- Ibpsi
## Working in the DC case without self heating:
See test case in DMT where this is compared against ADS.
- re
- Ibiei
- Ibici
## useful stuff
non-ancient explanation how equation system of spice looks:
<https://spicesharp.github.io/SpiceSharp/articles/custom_components/modified_nodal_analysis.html#nonlinear-components>
# run tests and get netlists
Ja, gibt es: run_cmc_check script im tests/bin Verzeichnis hat oben einen debug Schalter.
Dann musst Du in qaSpec Dir die entsprechenden tests ein- bzw. auskommentieren.
Nicht über die hohen % Zahlen wundern. Wir bewegen uns oft im exp Bereich. Deshalb der tkdiff Vergleich ob es grob stimmt.
# run cmc tests
P.S. Bedienungsanleitung cmc qa check:
- das zu prüfende ngspice muß im Pfad liegen!
- ins tests/hicum2/npn Verzeichnis setzen und "./run" aufrufen
- die results mit den reference per tkdiff oder ähnlich vergleichen
# AC Anleitung
Die Regeln für die AC load Aufstellung sind:
1. Inspizieren ob XXXload.c Matrix und RHS vollständig ist!
2. Cut the entire block.
3. Paste into XXXacload.c
4. Löschen der RHS Einträge.
5. Verdoppeln aller Matrixeinträge + shift mit +1 für die imag Anteile von reaktive Zweigen.
6. dafür sorgen daß diese mit 2*Pi*f CKTomega) malgenommen werden.
Es ist reine cut&paste Arbeit mit einem guten Editor.
# Kommentar von DWarn, mal ansehen
Im Init part, line 1142:
if (ibets > 0) begin : HICTUN_T
Im Update part, line 1361:
if (ibets > 0 && (Vbpei < 0.0 || Vbiei < 0.0)) begin : HICTUN_T
# gmin
Die Knoten eines nichlinearen Zweiges müssen einmal (!) mit gmin verbunden werden.
Daraus folgt, wie schon gemacht, für den Strom gmin*Vxy als Zusatz und für alle (!)
Ableitungen des Stromes gmin als Zusatz.
Praktisch heißt das, daß die Beaufschlagung von Iciei überflüssig ist,
da schon mit den Zweigen biei und bici erfolgt ist.
Es fehlen aber noch Beaufschlagungen,
z.B. Ibiei_Vbici, weil die Ableitung später hinzugekommen ist.
# CMC Failing Tests
****** Checking test (ngspice): fgum_ac_npn_1D_ac
variant: standard (compared to: reference) FAIL (probably from some simulation failure)
****** Checking test (ngspice): fgum_ac_npn_internal_ac
variant: standard (compared to: reference) FAIL (probably from some simulation failure)
****** Checking test (ngspice): fgum_ac_npn_full_ac
variant: standard (compared to: reference) FAIL (probably from some simulation failure)
****** Checking test (ngspice): fgum_ac_npn_full_subcoupl_peri_bias_ac
variant: standard (compared to: reference) DIFFER (max rel error is 100%)
variant: standard (compared to: reference) DIFFER (max rel error is 100%)
****** Checking test (ngspice): fgum_ac_npn_full_subcoupl_peri_con_ac
variant: standard (compared to: reference) DIFFER (max rel error is 100%)
****** Checking test (ngspice): fgum_ac_npn_full_subcoupl_peri_bias_ac
variant: standard (compared to: reference) DIFFER (max rel error is 100%)
variant: standard (compared to: reference) DIFFER (max rel error is 100%)
****** Checking test (ngspice): fgum_ac_npn_full_subcoupl_peri_cond_ac
variant: standard (compared to: reference) DIFFER (max rel error is 100%)
****** Checking test (ngspice): fgum_ac_npn_vert_nqs_ac
variant: standard (compared to: reference) FAIL (probably from some simulation failure)
***** Checking test (ngspice): fgum_ac_npn_lat_nqs_ac
variant: standard (compared to: reference) FAIL (probably from some simulation failure)
****** Checking test (ngspice): fgum_ac_npn_cornoise_ac
variant: standard (compared to: reference) DIFFER (max rel error is 100%)
***** Checking test (ngspice): CBE_npn_1D_dc
variant: standard (compared to: reference) FAIL (probably from some simulation failure)
****** Checking test (ngspice): CBE_npn_1D_ac
variant: standard (compared to: reference) FAIL (probably from some simulation failure)
****** Checking test (ngspice): CBE_npn_internal_ac
variant: standard (compared to: reference) FAIL (probably from some simulation failure)
***** Checking test (ngspice): CBE_npn_full_ac
variant: standard (compared to: reference) FAIL (probably from some simulation failure)
***** Checking test (ngspice): ypara_npn_1D_ac
variant: standard (compared to: reference) FAIL (probably from some simulation failure)
***** Checking test (ngspice): ypara_npn_internal_ac
variant: standard (compared to: reference) FAIL (probably from some simulation failure)
***** Checking test (ngspice): ypara_npn_full_ac
variant: standard (compared to: reference) FAIL (probably from some simulation failure)
***** Checking test (ngspice): ypara_npn_full_sh_ac
variant: standard (compared to: reference) DIFFER (max rel error is 100%)
****** Checking test (ngspice): ypara_npn_full_subtran_ac
variant: standard (compared to: reference) DIFFER (max rel error is 100%)
****** Checking test (ngspice): ypara_npn_full_subcoupl_ac
variant: standard (compared to: reference) DIFFER (max rel error is 100%)
****** Checking test (ngspice): ypara_npn_full_subcoupl_peri_bias_ac
variant: standard (compared to: reference) DIFFER (max rel error is 100%)
variant: standard (compared to: reference) DIFFER (max rel error is 100%)
****** Checking test (ngspice): ypara_npn_full_subcoupl_peri_con_ac
variant: standard (compared to: reference) DIFFER (max rel error is 100%)
variant: standard (compared to: reference) DIFFER (max rel error is 100%)
***** Checking test (ngspice): ypara_npn_full_subcoupl_peri_bias_ac
variant: standard (compared to: reference) DIFFER (max rel error is 100%)
variant: standard (compared to: reference) DIFFER (max rel error is 100%)
****** Checking test (ngspice): ypara_npn_full_subcoupl_peri_con_ac
variant: standard (compared to: reference) DIFFER (max rel error is 100%)
variant: standard (compared to: reference) DIFFER (max rel error is 100%)
***** Checking test (ngspice): ypara_npn_vert_nqs_ac
variant: standard (compared to: reference) FAIL (probably from some simulation failure)
****** Checking test (ngspice): ypara_npn_lat_nqs_ac
variant: standard (compared to: reference) FAIL (probably from some simulation failure)
****** Checking test (ngspice): ypara_npn_cornoise_ac
variant: standard (compared to: reference) DIFFER (max rel error is 100%)