HICUM acload initial review
This commit is contained in:
parent
6eefe34d56
commit
9737dc7a5b
|
|
@ -59,24 +59,39 @@ HICUMacLoad(GENmodel *inModel, CKTcircuit *ckt)
|
|||
double Ibpsi_Vrth;
|
||||
|
||||
double XQrbi_Vbpbi;
|
||||
// double XQrbi_Vbiei;
|
||||
// double XQrbi_Vbici;
|
||||
double XQrbi_Vbiei;
|
||||
double XQrbi_Vbici;
|
||||
double XQrbi_Vrth;
|
||||
double XQdeix_Vbiei;
|
||||
double XQjei_Vbiei;
|
||||
double XQjei_Vrth;
|
||||
double XQdci_Vbici;
|
||||
double XQjci_Vbici;
|
||||
double XQjci_Vrth;
|
||||
double XQjep_Vbpei;
|
||||
double XQjep_Vrth;
|
||||
double Xqjcx0_t_i_Vbci;
|
||||
double Xqjcx0_t_i_Vrth;
|
||||
double Xqjcx0_t_ii_Vbpci;
|
||||
double Xqjcx0_t_ii_Vrth;
|
||||
double XQdsu_Vbpci;
|
||||
// double XQdsu_Vsici;
|
||||
double XQdsu_Vsici;
|
||||
double XQdsu_Vrth;
|
||||
double XQjs_Vsici;
|
||||
double XQjs_Vrth;
|
||||
double XQscp_Vsc;
|
||||
double XQscp_Vrth;
|
||||
double XQbepar1_Vbe;
|
||||
double XQbepar2_Vbpe;
|
||||
double XQbcpar1_Vbci;
|
||||
double XQbcpar2_Vbpci;
|
||||
double XQsu_Vsis;
|
||||
double XQf_Vbiei;
|
||||
double XQf_Vbici;
|
||||
double XQf_Vrth;
|
||||
double XQr_Vrth;
|
||||
double XQr_Vbiei;
|
||||
double XQr_Vbici;
|
||||
|
||||
/* loop through all the models */
|
||||
for( ; model != NULL; model = HICUMnextModel(model)) {
|
||||
|
|
@ -196,7 +211,7 @@ HICUMacLoad(GENmodel *inModel, CKTcircuit *ckt)
|
|||
*(here->HICUMbaseBPBaseBIPtr) += Ibpbi_Vbici;
|
||||
*(here->HICUMbaseBICollCIPtr) += Ibpbi_Vbici;
|
||||
*(here->HICUMbaseBPCollCIPtr) += -Ibpbi_Vbici;
|
||||
*(here->HICUMbaseBIBaseBIPtr) += -Ibpbi_Vbici
|
||||
*(here->HICUMbaseBIBaseBIPtr) += -Ibpbi_Vbici;
|
||||
|
||||
// Stamp element: Re
|
||||
*(here->HICUMemitEmitPtr) += Ieie_Veie;
|
||||
|
|
@ -229,131 +244,148 @@ HICUMacLoad(GENmodel *inModel, CKTcircuit *ckt)
|
|||
////////////////////////////////////
|
||||
////////// The complex part //////
|
||||
////////////////////////////////////
|
||||
//todo: Complete with partial dervatives e.g. Qjs_Vsici, Qrbi_Vbici
|
||||
|
||||
//Qrbi
|
||||
XQrbi_Vbpbi = *(ckt->CKTstate0 + here->HICUMcqrbi) * ckt->CKTomega;
|
||||
XQdeix_Vbiei = *(ckt->CKTstate0 + here->HICUMcqdeix) * ckt->CKTomega;
|
||||
XQrbi_Vbiei = *(ckt->CKTstate0 + here->HICUMqrbi_Vbiei) * ckt->CKTomega;
|
||||
XQrbi_Vbici = *(ckt->CKTstate0 + here->HICUMqrbi_Vbici) * ckt->CKTomega;
|
||||
XQrbi_Vrth = *(ckt->CKTstate0 + here->HICUMqrbi_Vrth) * ckt->CKTomega;
|
||||
//Qjei
|
||||
XQjei_Vbiei = *(ckt->CKTstate0 + here->HICUMcqjei) * ckt->CKTomega;
|
||||
XQdci_Vbici = *(ckt->CKTstate0 + here->HICUMcqdci) * ckt->CKTomega;
|
||||
XQjei_Vrth = *(ckt->CKTstate0 + here->HICUMqjei_Vrth) * ckt->CKTomega;
|
||||
//Qf
|
||||
XQf_Vbiei = *(ckt->CKTstate0 + here->HICUMcqf) * ckt->CKTomega;
|
||||
XQf_Vbici = *(ckt->CKTstate0 + here->HICUMqf_Vbici) * ckt->CKTomega;
|
||||
XQf_Vrth = *(ckt->CKTstate0 + here->HICUMqf_Vrth) * ckt->CKTomega;
|
||||
//Qr
|
||||
XQr_Vbici = *(ckt->CKTstate0 + here->HICUMcqr) * ckt->CKTomega;
|
||||
XQr_Vbiei = *(ckt->CKTstate0 + here->HICUMqr_Vbiei) * ckt->CKTomega;
|
||||
XQr_Vrth = *(ckt->CKTstate0 + here->HICUMqr_Vrth) * ckt->CKTomega;
|
||||
//Qjci
|
||||
XQjci_Vbici = *(ckt->CKTstate0 + here->HICUMcqjci) * ckt->CKTomega;
|
||||
XQjci_Vrth = *(ckt->CKTstate0 + here->HICUMqjci_Vrth) * ckt->CKTomega;
|
||||
//Qjep
|
||||
XQjep_Vbpei = *(ckt->CKTstate0 + here->HICUMcqjep) * ckt->CKTomega;
|
||||
XQjep_Vrth = *(ckt->CKTstate0 + here->HICUMqjep_Vrth) * ckt->CKTomega;
|
||||
//Qjcx_i
|
||||
Xqjcx0_t_i_Vbci = *(ckt->CKTstate0 + here->HICUMcqcx0_t_i) * ckt->CKTomega;
|
||||
Xqjcx0_t_i_Vrth = *(ckt->CKTstate0 + here->HICUMqjcx0_i_Vrth) * ckt->CKTomega;
|
||||
//Qjcx_ii
|
||||
Xqjcx0_t_ii_Vbpci = *(ckt->CKTstate0 + here->HICUMcqcx0_t_ii) * ckt->CKTomega;
|
||||
Xqjcx0_t_ii_Vrth = *(ckt->CKTstate0 + here->HICUMqjcx0_ii_Vrth) * ckt->CKTomega;
|
||||
//Qdsu
|
||||
XQdsu_Vbpci = *(ckt->CKTstate0 + here->HICUMcqdsu) * ckt->CKTomega;
|
||||
XQdsu_Vsici = *(ckt->CKTstate0 + here->HICUMqdsu_Vsici) * ckt->CKTomega;
|
||||
XQdsu_Vrth = *(ckt->CKTstate0 + here->HICUMqdsu_Vrth) * ckt->CKTomega;
|
||||
//Qjs
|
||||
XQjs_Vsici = *(ckt->CKTstate0 + here->HICUMcqjs) * ckt->CKTomega;
|
||||
XQjs_Vrth = *(ckt->CKTstate0 + here->HICUMqjs_Vrth) * ckt->CKTomega;
|
||||
//Qscp
|
||||
XQscp_Vsc = *(ckt->CKTstate0 + here->HICUMcqscp) * ckt->CKTomega;
|
||||
XQscp_Vrth = *(ckt->CKTstate0 + here->HICUMqscp_Vrth) * ckt->CKTomega;
|
||||
//Qbepar1
|
||||
XQbepar1_Vbe = *(ckt->CKTstate0 + here->HICUMcqbepar1) * ckt->CKTomega;
|
||||
//Qbepar2
|
||||
XQbepar2_Vbpe = *(ckt->CKTstate0 + here->HICUMcqbepar2) * ckt->CKTomega;
|
||||
//Qbcpar1
|
||||
XQbcpar1_Vbci = *(ckt->CKTstate0 + here->HICUMcqbcpar1) * ckt->CKTomega;
|
||||
//Qbcpar2
|
||||
XQbcpar2_Vbpci = *(ckt->CKTstate0 + here->HICUMcqbcpar2) * ckt->CKTomega;
|
||||
//Qsu
|
||||
XQsu_Vsis = *(ckt->CKTstate0 + here->HICUMcqsu) * ckt->CKTomega;
|
||||
/*
|
||||
c Stamp element: Qbepar1
|
||||
*/
|
||||
*(here->HICUMbaseBasePtr + 1) += XQbepar1_Vbe;
|
||||
*(here->HICUMbaseEmitPtr + 1) += -XQbepar1_Vbe;
|
||||
*(here->HICUMemitBasePtr + 1) += -XQbepar1_Vbe;
|
||||
*(here->HICUMemitEmitPtr + 1) += XQbepar1_Vbe;
|
||||
/*
|
||||
c Stamp element: Qbepar2
|
||||
*/
|
||||
*(here->HICUMbaseBPBaseBPPtr + 1) += XQbepar2_Vbpe;
|
||||
*(here->HICUMemitBaseBPPtr + 1) += -XQbepar2_Vbpe;
|
||||
*(here->HICUMemitEmitPtr + 1) += -XQbepar2_Vbpe;
|
||||
*(here->HICUMbaseBPEmitPtr + 1) += XQbepar2_Vbpe;
|
||||
/*
|
||||
c Stamp element: Qdeix, Qjei
|
||||
*/
|
||||
*(here->HICUMbaseBIBaseBIPtr + 1) += XQdeix_Vbiei;
|
||||
*(here->HICUMbaseBIEmitEIPtr + 1) += -XQdeix_Vbiei;
|
||||
*(here->HICUMemitEIBaseBIPtr + 1) += -XQdeix_Vbiei;
|
||||
*(here->HICUMemitEIEmitEIPtr + 1) += XQdeix_Vbiei;
|
||||
*(here->HICUMbaseBIBaseBIPtr + 1) += XQjei_Vbiei;
|
||||
*(here->HICUMbaseBIEmitEIPtr + 1) += -XQjei_Vbiei;
|
||||
*(here->HICUMemitEIBaseBIPtr + 1) += -XQjei_Vbiei;
|
||||
*(here->HICUMemitEIEmitEIPtr + 1) += XQjei_Vbiei;
|
||||
/*
|
||||
c Stamp element: Qjep
|
||||
*/
|
||||
*(here->HICUMbaseBPBaseBPPtr + 1) += XQjep_Vbpei;
|
||||
*(here->HICUMbaseBPEmitEIPtr + 1) += -XQjep_Vbpei;
|
||||
*(here->HICUMemitEIBaseBPPtr + 1) += -XQjep_Vbpei;
|
||||
*(here->HICUMemitEIEmitEIPtr + 1) += XQjep_Vbpei;
|
||||
|
||||
/*
|
||||
c Stamp element: Qdci, Qjci
|
||||
*/
|
||||
*(here->HICUMbaseBIBaseBIPtr + 1) += XQdci_Vbici;
|
||||
*(here->HICUMbaseBICollCIPtr + 1) += -XQdci_Vbici;
|
||||
*(here->HICUMcollCIBaseBIPtr + 1) += -XQdci_Vbici;
|
||||
*(here->HICUMcollCICollCIPtr + 1) += XQdci_Vbici;
|
||||
*(here->HICUMbaseBIBaseBIPtr + 1) += XQjci_Vbici;
|
||||
*(here->HICUMbaseBICollCIPtr + 1) += -XQjci_Vbici;
|
||||
*(here->HICUMcollCIBaseBIPtr + 1) += -XQjci_Vbici;
|
||||
*(here->HICUMcollCICollCIPtr + 1) += XQjci_Vbici;
|
||||
/*
|
||||
c Stamp element: Qbcpar1, qjcx0_i
|
||||
*/
|
||||
*(here->HICUMbaseBasePtr + 1) += XQbcpar1_Vbci;
|
||||
*(here->HICUMbaseCollCIPtr + 1) += -XQbcpar1_Vbci;
|
||||
*(here->HICUMcollCIBasePtr + 1) += -XQbcpar1_Vbci;
|
||||
*(here->HICUMcollCICollCIPtr + 1) += XQbcpar1_Vbci;
|
||||
*(here->HICUMbaseBasePtr + 1) += Xqjcx0_t_i_Vbci;
|
||||
*(here->HICUMbaseCollCIPtr + 1) += -Xqjcx0_t_i_Vbci;
|
||||
*(here->HICUMcollCIBasePtr + 1) += -Xqjcx0_t_i_Vbci;
|
||||
*(here->HICUMcollCICollCIPtr + 1) += Xqjcx0_t_i_Vbci;
|
||||
/*
|
||||
c Stamp element: Qbcpar2, qjcx0_ii, Qdsu
|
||||
*/
|
||||
*(here->HICUMbaseBPBaseBPPtr + 1) += XQbcpar2_Vbpci;
|
||||
*(here->HICUMcollCICollCIPtr + 1) += XQbcpar2_Vbpci;
|
||||
*(here->HICUMbaseBPCollCIPtr + 1) += -XQbcpar2_Vbpci;
|
||||
*(here->HICUMcollCIBaseBPPtr + 1) += -XQbcpar2_Vbpci;
|
||||
*(here->HICUMbaseBPCollCIPtr + 1) += Xqjcx0_t_ii_Vbpci;
|
||||
*(here->HICUMbaseBPBaseBPPtr + 1) += -Xqjcx0_t_ii_Vbpci;
|
||||
*(here->HICUMcollCIBaseBPPtr + 1) += -Xqjcx0_t_ii_Vbpci;
|
||||
*(here->HICUMcollCICollCIPtr + 1) += Xqjcx0_t_ii_Vbpci;
|
||||
*(here->HICUMbaseBPCollCIPtr + 1) += XQdsu_Vbpci;
|
||||
*(here->HICUMbaseBPBaseBPPtr + 1) += -XQdsu_Vbpci;
|
||||
*(here->HICUMcollCIBaseBPPtr + 1) += -XQdsu_Vbpci;
|
||||
*(here->HICUMcollCICollCIPtr + 1) += XQdsu_Vbpci;
|
||||
/*
|
||||
c Stamp element: Qrbi
|
||||
*/
|
||||
*(here->HICUMbaseBPBaseBPPtr + 1) += XQrbi_Vbpbi;
|
||||
*(here->HICUMbaseBPBaseBIPtr + 1) += -XQrbi_Vbpbi;
|
||||
*(here->HICUMbaseBIBaseBPPtr + 1) += -XQrbi_Vbpbi;
|
||||
*(here->HICUMbaseBIBaseBIPtr + 1) += XQrbi_Vbpbi;
|
||||
//todo:
|
||||
// *(here->HICUMbaseBPBaseBIPtr + 1) += XQrbi_Vbiei;
|
||||
// *(here->HICUMbaseBPEmitEIPtr + 1) += -XQrbi_Vbiei;
|
||||
// *(here->HICUMbaseBIBaseBIPtr + 1) += -XQrbi_Vbiei;
|
||||
// *(here->HICUMbaseBIEmitEIPtr + 1) += XQrbi_Vbiei;
|
||||
// *(here->HICUMbaseBPCollCIPtr + 1) += XQrbi_Vbici;
|
||||
// *(here->HICUMbaseBPEmitEIPtr + 1) += -XQrbi_Vbici;
|
||||
// *(here->HICUMbaseBICollCIPtr + 1) += -XQrbi_Vbici;
|
||||
// *(here->HICUMbaseBIEmitEIPtr + 1) += XQrbi_Vbici;
|
||||
/*
|
||||
c Stamp element: Cscp
|
||||
*/
|
||||
*(here->HICUMsubsSubsPtr + 1) += XQscp_Vsc;
|
||||
*(here->HICUMcollSubsPtr + 1) += -XQscp_Vsc;
|
||||
*(here->HICUMcollCollPtr + 1) += -XQscp_Vsc;
|
||||
*(here->HICUMsubsCollPtr + 1) += XQscp_Vsc;
|
||||
/*
|
||||
c Stamp element: Cjs
|
||||
*/
|
||||
*(here->HICUMsubsSISubsSIPtr + 1) += XQjs_Vsici;
|
||||
*(here->HICUMsubsSICollCIPtr + 1) += -XQjs_Vsici;
|
||||
*(here->HICUMcollCISubsSIPtr + 1) += -XQjs_Vsici;
|
||||
*(here->HICUMcollCICollCIPtr + 1) += XQjs_Vsici;
|
||||
/*
|
||||
c Stamp element: Csu
|
||||
*/
|
||||
*(here->HICUMsubsSubsPtr + 1) += XQsu_Vsis;
|
||||
*(here->HICUMsubsSISubsPtr + 1) += -XQsu_Vsis;
|
||||
*(here->HICUMsubsSubsSIPtr + 1) += -XQsu_Vsis;
|
||||
*(here->HICUMsubsSISubsSIPtr + 1) += XQsu_Vsis;
|
||||
//Qrbi
|
||||
*(here->HICUMbaseBPBaseBPPtr + 1) += XQrbi_Vbpbi;
|
||||
*(here->HICUMbaseBIBaseBIPtr + 1) += XQrbi_Vbpbi;
|
||||
*(here->HICUMbaseBPBaseBIPtr + 1) += -XQrbi_Vbpbi;
|
||||
*(here->HICUMbaseBIBaseBPPtr + 1) += -XQrbi_Vbpbi;
|
||||
*(here->HICUMbaseBPBaseBIPtr + 1) += XQrbi_Vbiei;
|
||||
*(here->HICUMbaseBIEmitEIPtr + 1) += XQrbi_Vbiei;
|
||||
*(here->HICUMbaseBPEmitEIPtr + 1) += -XQrbi_Vbiei;
|
||||
*(here->HICUMbaseBIBaseBIPtr + 1) += -XQrbi_Vbiei;
|
||||
*(here->HICUMbaseBPBaseBIPtr + 1) += XQrbi_Vbici;
|
||||
*(here->HICUMbaseBICollCIPtr + 1) += XQrbi_Vbici;
|
||||
*(here->HICUMbaseBPCollCIPtr + 1) += -XQrbi_Vbici;
|
||||
*(here->HICUMbaseBIBaseBIPtr + 1) += -XQrbi_Vbici;
|
||||
//Qjei
|
||||
*(here->HICUMbaseBIBaseBIPtr + 1) += XQjei_Vbiei;
|
||||
*(here->HICUMemitEIEmitEIPtr + 1) += XQjei_Vbiei;
|
||||
*(here->HICUMbaseBIEmitEIPtr + 1) += -XQjei_Vbiei;
|
||||
*(here->HICUMemitEIBaseBIPtr + 1) += -XQjei_Vbiei;
|
||||
//Qf
|
||||
*(here->HICUMbaseBIBaseBIPtr +1) += XQf_Vbiei;
|
||||
*(here->HICUMemitEIEmitEIPtr +1) += XQf_Vbiei;
|
||||
*(here->HICUMbaseBIEmitEIPtr +1) += -XQf_Vbiei;
|
||||
*(here->HICUMemitEIBaseBIPtr +1) += -XQf_Vbiei;
|
||||
*(here->HICUMbaseBIBaseBIPtr +1) += XQf_Vbici;
|
||||
*(here->HICUMemitEICollCIPtr +1) += XQf_Vbici;
|
||||
*(here->HICUMbaseBICollCIPtr +1) += -XQf_Vbici;
|
||||
*(here->HICUMemitEIBaseBIPtr +1) += -XQf_Vbici;
|
||||
//Qjci
|
||||
*(here->HICUMbaseBIBaseBIPtr +1) += XQjci_Vbici;
|
||||
*(here->HICUMcollCICollCIPtr +1) += XQjci_Vbici;
|
||||
*(here->HICUMcollCIBaseBIPtr +1) += -XQjci_Vbici;
|
||||
*(here->HICUMbaseBICollCIPtr +1) += -XQjci_Vbici;
|
||||
//Qjep
|
||||
*(here->HICUMbaseBPBaseBPPtr +1) += XQjep_Vbpei;
|
||||
*(here->HICUMemitEIEmitEIPtr +1) += XQjep_Vbpei;
|
||||
*(here->HICUMbaseBPEmitEIPtr +1) += -XQjep_Vbpei;
|
||||
*(here->HICUMemitEIBaseBPPtr +1) += -XQjep_Vbpei;
|
||||
//Qjcx_i
|
||||
*(here->HICUMbaseBasePtr +1) += Xqjcx0_t_i_Vbci;
|
||||
*(here->HICUMcollCICollCIPtr +1) += Xqjcx0_t_i_Vbci;
|
||||
*(here->HICUMbaseCollCIPtr +1) += -Xqjcx0_t_i_Vbci;
|
||||
*(here->HICUMcollCIBasePtr +1) += -Xqjcx0_t_i_Vbci;
|
||||
//Qjcx_ii
|
||||
*(here->HICUMbaseBPBaseBPPtr +1) += Xqjcx0_t_ii_Vbpci;
|
||||
*(here->HICUMcollCICollCIPtr +1) += Xqjcx0_t_ii_Vbpci;
|
||||
*(here->HICUMbaseBPCollCIPtr +1) += -Xqjcx0_t_ii_Vbpci;
|
||||
*(here->HICUMcollCIBaseBPPtr +1) += -Xqjcx0_t_ii_Vbpci;
|
||||
//Qdsu
|
||||
*(here->HICUMbaseBPBaseBPPtr +1) += XQdsu_Vbpci;
|
||||
*(here->HICUMcollCICollCIPtr +1) += XQdsu_Vbpci;
|
||||
*(here->HICUMbaseBPCollCIPtr +1) += -XQdsu_Vbpci;
|
||||
*(here->HICUMcollCIBaseBPPtr +1) += -XQdsu_Vbpci;
|
||||
// these matrix entries are not implemented
|
||||
// *(here->HICUMbaseBPsubsSIPtr +1) += XQdsu_Vsici;
|
||||
// *(here->HICUMcollCIcollCIPtr +1) += XQdsu_Vsici;
|
||||
// *(here->HICUMcollCIsubsSIPtr +1) += -XQdsu_Vsici;
|
||||
// *(here->HICUMsubsSIbaseBPPtr +1) += -XQdsu_Vsici;
|
||||
//Qjs
|
||||
*(here->HICUMsubsSISubsSIPtr +1) += XQjs_Vsici;
|
||||
*(here->HICUMcollCICollCIPtr +1) += XQjs_Vsici;
|
||||
*(here->HICUMsubsSICollCIPtr +1) += -XQjs_Vsici;
|
||||
*(here->HICUMcollCISubsSIPtr +1) += -XQjs_Vsici;
|
||||
//Qscp
|
||||
*(here->HICUMsubsSubsPtr + 1) += XQscp_Vsc;
|
||||
*(here->HICUMsubsCollPtr + 1) += XQscp_Vsc;
|
||||
*(here->HICUMcollSubsPtr + 1) += -XQscp_Vsc;
|
||||
*(here->HICUMcollCollPtr + 1) += -XQscp_Vsc;
|
||||
//Qbepar1
|
||||
*(here->HICUMbaseBasePtr + 1) += XQbepar1_Vbe;
|
||||
*(here->HICUMbaseEmitPtr + 1) += -XQbepar1_Vbe;
|
||||
*(here->HICUMemitBasePtr + 1) += -XQbepar1_Vbe;
|
||||
*(here->HICUMemitEmitPtr + 1) += XQbepar1_Vbe;
|
||||
//Qbepar2
|
||||
*(here->HICUMbaseBPBaseBPPtr + 1) += XQbepar2_Vbpe;
|
||||
*(here->HICUMemitBaseBPPtr + 1) += -XQbepar2_Vbpe;
|
||||
*(here->HICUMemitEmitPtr + 1) += -XQbepar2_Vbpe;
|
||||
*(here->HICUMbaseBPEmitPtr + 1) += XQbepar2_Vbpe;
|
||||
//Qbcpar1
|
||||
*(here->HICUMbaseBasePtr + 1) += XQbcpar1_Vbci;
|
||||
*(here->HICUMbaseCollCIPtr + 1) += -XQbcpar1_Vbci;
|
||||
*(here->HICUMcollCIBasePtr + 1) += -XQbcpar1_Vbci;
|
||||
*(here->HICUMcollCICollCIPtr + 1) += XQbcpar1_Vbci;
|
||||
//Qbcpar2
|
||||
*(here->HICUMbaseBPBaseBPPtr +1) += XQbepar2_Vbpe;
|
||||
*(here->HICUMcollCICollCIPtr +1) += XQbepar2_Vbpe;
|
||||
*(here->HICUMbaseBPCollCIPtr +1) += -XQbepar2_Vbpe;
|
||||
*(here->HICUMcollCIBaseBPPtr +1) += -XQbepar2_Vbpe;
|
||||
//Qsu
|
||||
*(here->HICUMsubsSubsPtr + 1) += XQsu_Vsis;
|
||||
*(here->HICUMsubsSISubsPtr + 1) += -XQsu_Vsis;
|
||||
*(here->HICUMsubsSubsSIPtr + 1) += -XQsu_Vsis;
|
||||
*(here->HICUMsubsSISubsSIPtr + 1) += XQsu_Vsis;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -359,100 +359,116 @@ typedef struct sHICUMinstance {
|
|||
|
||||
#define HICUMqrbi HICUMstate+42
|
||||
#define HICUMcqrbi HICUMstate+43
|
||||
#define HICUMqrbi_Vbiei HICUMstate+44
|
||||
#define HICUMqrbi_Vbici HICUMstate+45
|
||||
#define HICUMqrbi_Vrth HICUMstate+46
|
||||
|
||||
#define HICUMqjei HICUMstate+44
|
||||
#define HICUMcqjei HICUMstate+45
|
||||
#define HICUMqjei HICUMstate+47
|
||||
#define HICUMcqjei HICUMstate+48
|
||||
#define HICUMqjei_Vrth HICUMstate+49
|
||||
|
||||
#define HICUMqdeix HICUMstate+46
|
||||
#define HICUMcqdeix HICUMstate+47
|
||||
#define HICUMqf HICUMstate+50
|
||||
#define HICUMcqf HICUMstate+51
|
||||
#define HICUMqf_Vbici HICUMstate+52
|
||||
#define HICUMqf_Vrth HICUMstate+53
|
||||
|
||||
#define HICUMqjci HICUMstate+48
|
||||
#define HICUMcqjci HICUMstate+49
|
||||
#define HICUMqr HICUMstate+54
|
||||
#define HICUMcqr HICUMstate+55
|
||||
#define HICUMqr_Vbiei HICUMstate+56
|
||||
#define HICUMqr_Vrth HICUMstate+57
|
||||
|
||||
#define HICUMqdci HICUMstate+50
|
||||
#define HICUMcqdci HICUMstate+51
|
||||
#define HICUMqjci HICUMstate+58
|
||||
#define HICUMcqjci HICUMstate+59
|
||||
#define HICUMqjci_Vrth HICUMstate+59
|
||||
|
||||
#define HICUMqjep HICUMstate+52
|
||||
#define HICUMcqjep HICUMstate+53
|
||||
#define HICUMqjep HICUMstate+60
|
||||
#define HICUMcqjep HICUMstate+61
|
||||
#define HICUMqjep_Vrth HICUMstate+62
|
||||
|
||||
#define HICUMqjcx0_i HICUMstate+54
|
||||
#define HICUMcqcx0_t_i HICUMstate+55
|
||||
#define HICUMqjcx0_i HICUMstate+63
|
||||
#define HICUMcqcx0_t_i HICUMstate+64
|
||||
#define HICUMqjcx0_i_Vrth HICUMstate+65
|
||||
|
||||
#define HICUMqjcx0_ii HICUMstate+56
|
||||
#define HICUMcqcx0_t_ii HICUMstate+57
|
||||
#define HICUMqjcx0_ii HICUMstate+66
|
||||
#define HICUMcqcx0_t_ii HICUMstate+67
|
||||
#define HICUMqjcx0_ii_Vrth HICUMstate+68
|
||||
|
||||
#define HICUMqdsu HICUMstate+58
|
||||
#define HICUMcqdsu HICUMstate+59
|
||||
#define HICUMqdsu HICUMstate+70
|
||||
#define HICUMcqdsu HICUMstate+71
|
||||
#define HICUMqdsu_Vrth HICUMstate+72
|
||||
#define HICUMqdsu_Vsici HICUMstate+73
|
||||
|
||||
#define HICUMqjs HICUMstate+60
|
||||
#define HICUMcqjs HICUMstate+61
|
||||
#define HICUMqjs HICUMstate+74
|
||||
#define HICUMcqjs HICUMstate+75
|
||||
#define HICUMqjs_Vrth HICUMstate+76
|
||||
|
||||
#define HICUMqscp HICUMstate+62
|
||||
#define HICUMcqscp HICUMstate+63
|
||||
#define HICUMqscp HICUMstate+77
|
||||
#define HICUMcqscp HICUMstate+78
|
||||
#define HICUMqscp_Vrth HICUMstate+79
|
||||
|
||||
#define HICUMqbepar1 HICUMstate+64
|
||||
#define HICUMcqbepar1 HICUMstate+65
|
||||
#define HICUMgqbepar1 HICUMstate+66
|
||||
#define HICUMqbepar1 HICUMstate+80
|
||||
#define HICUMcqbepar1 HICUMstate+81
|
||||
#define HICUMgqbepar1 HICUMstate+82
|
||||
|
||||
#define HICUMqbepar2 HICUMstate+67
|
||||
#define HICUMcqbepar2 HICUMstate+68
|
||||
#define HICUMgqbepar2 HICUMstate+69
|
||||
#define HICUMqbepar2 HICUMstate+83
|
||||
#define HICUMcqbepar2 HICUMstate+84
|
||||
#define HICUMgqbepar2 HICUMstate+85
|
||||
|
||||
#define HICUMqbcpar1 HICUMstate+70
|
||||
#define HICUMcqbcpar1 HICUMstate+71
|
||||
#define HICUMgqbcpar1 HICUMstate+72
|
||||
#define HICUMqbcpar1 HICUMstate+86
|
||||
#define HICUMcqbcpar1 HICUMstate+87
|
||||
#define HICUMgqbcpar1 HICUMstate+88
|
||||
|
||||
#define HICUMqbcpar2 HICUMstate+73
|
||||
#define HICUMcqbcpar2 HICUMstate+74
|
||||
#define HICUMgqbcpar2 HICUMstate+75
|
||||
#define HICUMqbcpar2 HICUMstate+89
|
||||
#define HICUMcqbcpar2 HICUMstate+90
|
||||
#define HICUMgqbcpar2 HICUMstate+91
|
||||
|
||||
#define HICUMqsu HICUMstate+76
|
||||
#define HICUMcqsu HICUMstate+77
|
||||
#define HICUMgqsu HICUMstate+78
|
||||
#define HICUMqsu HICUMstate+92
|
||||
#define HICUMcqsu HICUMstate+93
|
||||
#define HICUMgqsu HICUMstate+94
|
||||
|
||||
#define HICUMqcth HICUMstate+79 /* thermal capacitor charge */
|
||||
#define HICUMcqcth HICUMstate+80 /* thermal capacitor current */
|
||||
#define HICUMqcth HICUMstate+95
|
||||
#define HICUMcqcth HICUMstate+96
|
||||
|
||||
#define HICUMvrth HICUMstate+81
|
||||
#define HICUMicth_dT HICUMstate+82
|
||||
#define HICUMvrth HICUMstate+97
|
||||
#define HICUMicth_dT HICUMstate+98
|
||||
|
||||
#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 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 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 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 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 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 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 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 HICUMnumStates 115
|
||||
#define HICUMnumStates 132
|
||||
|
||||
/* per model data */
|
||||
typedef struct sHICUMmodel { /* model structure for a hicum */
|
||||
|
|
|
|||
|
|
@ -1390,8 +1390,6 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
Qrbi_Vbiei = Vbpbi*model->HICUMfcrbi*(T_f0*itf_Vbiei+Cjei_Vbiei);
|
||||
Qrbi_Vbici = Vbpbi*model->HICUMfcrbi*(model->HICUMtr*itr_Vbici+Cjci_Vbici);
|
||||
|
||||
// Qrbi = model->HICUMfcrbi*(Qjei+Qjci+Qdei+Qdci);
|
||||
|
||||
//HICCR: }
|
||||
|
||||
//Internal base current across b-c junction
|
||||
|
|
@ -1813,7 +1811,7 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
Qcth=model->HICUMcth*Vrth;
|
||||
|
||||
*(ckt->CKTstate0 + here->HICUMqrbi) = Qrbi;
|
||||
*(ckt->CKTstate0 + here->HICUMqdeix) = Qdeix;
|
||||
*(ckt->CKTstate0 + here->HICUMqf) = Qdeix;
|
||||
*(ckt->CKTstate0 + here->HICUMqjei) = Qjei;
|
||||
*(ckt->CKTstate0 + here->HICUMqdci) = Qdci;
|
||||
*(ckt->CKTstate0 + here->HICUMqjci) = Qjci;
|
||||
|
|
@ -1857,7 +1855,7 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
(!(ckt->CKTmode & MODEUIC)) ) {
|
||||
if(ckt->CKTmode & MODEINITSMSIG) {
|
||||
*(ckt->CKTstate0 + here->HICUMcqrbi) = Qrbi_Vbpbi;
|
||||
*(ckt->CKTstate0 + here->HICUMcqdeix) = Qdeix_Vbiei;
|
||||
*(ckt->CKTstate0 + here->HICUMcqf) = Qdeix_Vbiei;
|
||||
*(ckt->CKTstate0 + here->HICUMcqjei) = Cjei;
|
||||
*(ckt->CKTstate0 + here->HICUMcqdci) = Qdci_Vbici;
|
||||
*(ckt->CKTstate0 + here->HICUMcqjci) = Cjci;
|
||||
|
|
@ -1888,8 +1886,8 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
*(ckt->CKTstate0 + here->HICUMqrbi) ;
|
||||
*(ckt->CKTstate1 + here->HICUMqjei) =
|
||||
*(ckt->CKTstate0 + here->HICUMqjei) ;
|
||||
*(ckt->CKTstate1 + here->HICUMqdeix) =
|
||||
*(ckt->CKTstate0 + here->HICUMqdeix) ;
|
||||
*(ckt->CKTstate1 + here->HICUMqf) =
|
||||
*(ckt->CKTstate0 + here->HICUMqf) ;
|
||||
*(ckt->CKTstate1 + here->HICUMqjci) =
|
||||
*(ckt->CKTstate0 + here->HICUMqjci) ;
|
||||
*(ckt->CKTstate1 + here->HICUMqdci) =
|
||||
|
|
@ -1931,10 +1929,10 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
Ibpbi += *(ckt->CKTstate0 + here->HICUMcqrbi);
|
||||
|
||||
// Ibiei += ddt(model->HICUMtype*(Qdeix+Qjei));
|
||||
error = NIintegrate(ckt,&geq,&ceq,Cdei,here->HICUMqdeix);
|
||||
error = NIintegrate(ckt,&geq,&ceq,Cdei,here->HICUMqf);
|
||||
if(error) return(error);
|
||||
Ibiei_Vbiei += geq;
|
||||
Ibiei += *(ckt->CKTstate0 + here->HICUMcqdeix);
|
||||
Ibiei += *(ckt->CKTstate0 + here->HICUMcqf);
|
||||
|
||||
error = NIintegrate(ckt,&geq,&ceq,Cjei,here->HICUMqjei);
|
||||
if(error) return(error);
|
||||
|
|
@ -2017,8 +2015,8 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
*(ckt->CKTstate0 + here->HICUMcqrbi);
|
||||
*(ckt->CKTstate1 + here->HICUMcqjei) =
|
||||
*(ckt->CKTstate0 + here->HICUMcqjei);
|
||||
*(ckt->CKTstate1 + here->HICUMcqdeix) =
|
||||
*(ckt->CKTstate0 + here->HICUMcqdeix);
|
||||
*(ckt->CKTstate1 + here->HICUMcqf) =
|
||||
*(ckt->CKTstate0 + here->HICUMcqf);
|
||||
*(ckt->CKTstate1 + here->HICUMcqjci) =
|
||||
*(ckt->CKTstate0 + here->HICUMcqjci);
|
||||
*(ckt->CKTstate1 + here->HICUMcqdci) =
|
||||
|
|
|
|||
|
|
@ -196,9 +196,9 @@ c The complex part
|
|||
//todo: Complete with partial dervatives e.g. Qjs_Vsici, Qrbi_Vbici
|
||||
|
||||
XQrbi_Vbpbi = *(ckt->CKTstate0 + here->HICUMcqrbi) * ckt->CKTomega;
|
||||
XQdeix_Vbiei = *(ckt->CKTstate0 + here->HICUMcqdeix) * ckt->CKTomega;
|
||||
XQdeix_Vbiei = *(ckt->CKTstate0 + here->HICUMcqf) * ckt->CKTomega;
|
||||
XQjei_Vbiei = *(ckt->CKTstate0 + here->HICUMcqjei) * ckt->CKTomega;
|
||||
XQdci_Vbici = *(ckt->CKTstate0 + here->HICUMcqdci) * ckt->CKTomega;
|
||||
XQdci_Vbici = *(ckt->CKTstate0 + here->HICUMcqr) * ckt->CKTomega;
|
||||
XQjci_Vbici = *(ckt->CKTstate0 + here->HICUMcqjci) * ckt->CKTomega;
|
||||
XQjep_Vbpei = *(ckt->CKTstate0 + here->HICUMcqjep) * ckt->CKTomega;
|
||||
Xqjcx0_t_i_Vbci = *(ckt->CKTstate0 + here->HICUMcqcx0_t_i) * ckt->CKTomega;
|
||||
|
|
|
|||
|
|
@ -29,9 +29,9 @@ HICUMtrunc(GENmodel *inModel, CKTcircuit *ckt, double *timeStep)
|
|||
|
||||
CKTterr(here->HICUMqrbi, ckt, timeStep);
|
||||
CKTterr(here->HICUMqjei, ckt, timeStep);
|
||||
CKTterr(here->HICUMqdeix, ckt, timeStep);
|
||||
CKTterr(here->HICUMqf, ckt, timeStep);
|
||||
CKTterr(here->HICUMqjci, ckt, timeStep);
|
||||
CKTterr(here->HICUMqdci, ckt, timeStep);
|
||||
CKTterr(here->HICUMqr, ckt, timeStep);
|
||||
CKTterr(here->HICUMqjep, ckt, timeStep);
|
||||
CKTterr(here->HICUMqjcx0_i, ckt, timeStep);
|
||||
CKTterr(here->HICUMqjcx0_ii, ckt, timeStep);
|
||||
|
|
|
|||
|
|
@ -436,6 +436,9 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
double volatile Q_bf, Q_bf_Vbiei=0, Q_bf_Vbici=0, Q_bf_Vciei=0, Q_bf_dT=0, Q_bf_dick=0, Q_bf_dT_f0=0, Q_bf_dQ_pT=0;
|
||||
double volatile Q_pT=0, Q_pT_dVbiei=0, Q_pT_dVbici=0, Q_pT_dT=0, Q_pT_dick=0, Q_pT_dT_f0=0, Q_pT_dQ_0=0, Q_pT_dVciei=0;
|
||||
double Qf, Cdei, Qr, Cdci;
|
||||
double Cdei_Vbiei, Cdei_Vbici, Cdei_Vrth;
|
||||
double Cdci_Vbiei, Cdci_Vbici, Cdci_Vrth;
|
||||
double Crbi_Vbiei, Crbi_Vbici, Crbi_Vrth;
|
||||
double ick, ick_Vciei, ick_dT,cjcx01,cjcx02;
|
||||
|
||||
//NQS
|
||||
|
|
@ -512,8 +515,10 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
double Qbcpar2;
|
||||
double Qsu;
|
||||
double Qcth;
|
||||
double Qcth_Vrth;
|
||||
|
||||
double Qrbi_Vbpbi;
|
||||
double Qrbi_Vrth;
|
||||
double Qrbi_Vbiei;
|
||||
double Qrbi_Vbici;
|
||||
double Qdeix_Vbiei;
|
||||
|
|
@ -1425,95 +1430,6 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
/////////////////////////
|
||||
// begin copy state vector
|
||||
/////////////////////////
|
||||
//below is obsolete, I leave it here to remember old code since I am no ngspice expert
|
||||
// *(ckt->CKTstate0 + here->HICUMvbiei) =
|
||||
// *(ckt->CKTstate1 + here->HICUMvbiei);
|
||||
// *(ckt->CKTstate0 + here->HICUMvbpei) =
|
||||
// *(ckt->CKTstate1 + here->HICUMvbpei);
|
||||
// *(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->HICUMvsici) =
|
||||
// *(ckt->CKTstate1 + here->HICUMvsici);
|
||||
// *(ckt->CKTstate0 + here->HICUMvxf) =
|
||||
// *(ckt->CKTstate1 + here->HICUMvxf);
|
||||
// *(ckt->CKTstate0 + here->HICUMvxf1) =
|
||||
// *(ckt->CKTstate1 + here->HICUMvxf1);
|
||||
// *(ckt->CKTstate0 + here->HICUMvxf2) =
|
||||
// *(ckt->CKTstate1 + here->HICUMvxf2);
|
||||
// *(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);
|
||||
// *(ckt->CKTstate0 + here->HICUMibpei) =
|
||||
// *(ckt->CKTstate1 + here->HICUMibpei);
|
||||
// *(ckt->CKTstate0 + here->HICUMibpei_Vbpei) =
|
||||
// *(ckt->CKTstate1 + here->HICUMibpei_Vbpei);
|
||||
// *(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->HICUMibici) =
|
||||
// *(ckt->CKTstate1 + here->HICUMibici);
|
||||
// *(ckt->CKTstate0 + here->HICUMibici_Vbici) =
|
||||
// *(ckt->CKTstate1 + here->HICUMibici_Vbici);
|
||||
// *(ckt->CKTstate0 + here->HICUMibici_Vbiei) =
|
||||
// *(ckt->CKTstate1 + here->HICUMibici_Vbiei);
|
||||
// *(ckt->CKTstate0 + here->HICUMibpei) =
|
||||
// *(ckt->CKTstate1 + here->HICUMibpei);
|
||||
// *(ckt->CKTstate0 + here->HICUMibpbi) =
|
||||
// *(ckt->CKTstate1 + here->HICUMibpbi);
|
||||
// *(ckt->CKTstate0 + here->HICUMibpbi_Vbpbi) =
|
||||
// *(ckt->CKTstate1 + here->HICUMibpbi_Vbpbi);
|
||||
// *(ckt->CKTstate0 + here->HICUMibpbi_Vbiei) =
|
||||
// *(ckt->CKTstate1 + here->HICUMibpbi_Vbiei);
|
||||
// *(ckt->CKTstate0 + here->HICUMibpbi_Vbici) =
|
||||
// *(ckt->CKTstate1 + here->HICUMibpbi_Vbici);
|
||||
// *(ckt->CKTstate0 + here->HICUMisici) =
|
||||
// *(ckt->CKTstate1 + here->HICUMisici);
|
||||
// *(ckt->CKTstate0 + here->HICUMisici_Vsici) =
|
||||
// *(ckt->CKTstate1 + here->HICUMisici_Vsici);
|
||||
// *(ckt->CKTstate0 + here->HICUMibpsi) =
|
||||
// *(ckt->CKTstate1 + here->HICUMibpsi);
|
||||
// *(ckt->CKTstate0 + here->HICUMibpsi_Vbpci) =
|
||||
// *(ckt->CKTstate1 + here->HICUMibpsi_Vbpci);
|
||||
// *(ckt->CKTstate0 + here->HICUMibpsi_Vsici) =
|
||||
// *(ckt->CKTstate1 + here->HICUMibpsi_Vsici);
|
||||
// *(ckt->CKTstate0 + here->HICUMgqbepar1) =
|
||||
// *(ckt->CKTstate1 + here->HICUMgqbepar1);
|
||||
// *(ckt->CKTstate0 + here->HICUMgqbepar2) =
|
||||
// *(ckt->CKTstate1 + here->HICUMgqbepar2);
|
||||
// *(ckt->CKTstate0 + here->HICUMieie) =
|
||||
// *(ckt->CKTstate1 + here->HICUMieie);
|
||||
// *(ckt->CKTstate0 + here->HICUMisis_Vsis) =
|
||||
// *(ckt->CKTstate1 + here->HICUMisis_Vsis);
|
||||
// //NQS
|
||||
// *(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);
|
||||
|
||||
// if (model->HICUMflsh) {
|
||||
// Vrth = (1.0 + xfact)* (*(ckt->CKTstate1 + here->HICUMvrth))
|
||||
// - ( xfact * (*(ckt->CKTstate2 + here->HICUMvrth)));
|
||||
// *(ckt->CKTstate0 + here->HICUMvrth) =
|
||||
// *(ckt->CKTstate1 + here->HICUMvrth);
|
||||
// *(ckt->CKTstate0 + here->HICUMith) =
|
||||
// *(ckt->CKTstate1 + here->HICUMith);
|
||||
// *(ckt->CKTstate0 + here->HICUMith_Vrth) =
|
||||
// *(ckt->CKTstate1 + here->HICUMith_Vrth);
|
||||
// *(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);
|
||||
|
|
@ -1559,26 +1475,42 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
*(ckt->CKTstate0+here->HICUMieie_Vrth)=*(ckt->CKTstate1+here->HICUMieie_Vrth);
|
||||
*(ckt->CKTstate0+here->HICUMqrbi)=*(ckt->CKTstate1+here->HICUMqrbi);
|
||||
*(ckt->CKTstate0+here->HICUMcqrbi)=*(ckt->CKTstate1+here->HICUMcqrbi);
|
||||
*(ckt->CKTstate0+here->HICUMqrbi_Vbiei)=*(ckt->CKTstate1+here->HICUMqrbi_Vbiei);
|
||||
*(ckt->CKTstate0+here->HICUMqrbi_Vbici)=*(ckt->CKTstate1+here->HICUMqrbi_Vbici);
|
||||
*(ckt->CKTstate0+here->HICUMqrbi_Vrth)=*(ckt->CKTstate1+here->HICUMqrbi_Vrth);
|
||||
*(ckt->CKTstate0+here->HICUMqjei)=*(ckt->CKTstate1+here->HICUMqjei);
|
||||
*(ckt->CKTstate0+here->HICUMcqjei)=*(ckt->CKTstate1+here->HICUMcqjei);
|
||||
*(ckt->CKTstate0+here->HICUMqdeix)=*(ckt->CKTstate1+here->HICUMqdeix);
|
||||
*(ckt->CKTstate0+here->HICUMcqdeix)=*(ckt->CKTstate1+here->HICUMcqdeix);
|
||||
*(ckt->CKTstate0+here->HICUMqjei_Vrth)=*(ckt->CKTstate1+here->HICUMqjei_Vrth);
|
||||
*(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_Vrth)=*(ckt->CKTstate1+here->HICUMqf_Vrth);
|
||||
*(ckt->CKTstate0+here->HICUMqr)=*(ckt->CKTstate1+here->HICUMqr);
|
||||
*(ckt->CKTstate0+here->HICUMcqr)=*(ckt->CKTstate1+here->HICUMcqr);
|
||||
*(ckt->CKTstate0+here->HICUMqr_Vbiei)=*(ckt->CKTstate1+here->HICUMqr_Vbiei);
|
||||
*(ckt->CKTstate0+here->HICUMqr_Vrth)=*(ckt->CKTstate1+here->HICUMqr_Vrth);
|
||||
*(ckt->CKTstate0+here->HICUMqjci)=*(ckt->CKTstate1+here->HICUMqjci);
|
||||
*(ckt->CKTstate0+here->HICUMcqjci)=*(ckt->CKTstate1+here->HICUMcqjci);
|
||||
*(ckt->CKTstate0+here->HICUMqdci)=*(ckt->CKTstate1+here->HICUMqdci);
|
||||
*(ckt->CKTstate0+here->HICUMcqdci)=*(ckt->CKTstate1+here->HICUMcqdci);
|
||||
*(ckt->CKTstate0+here->HICUMqjci_Vrth)=*(ckt->CKTstate1+here->HICUMqjci_Vrth);
|
||||
*(ckt->CKTstate0+here->HICUMqjep)=*(ckt->CKTstate1+here->HICUMqjep);
|
||||
*(ckt->CKTstate0+here->HICUMcqjep)=*(ckt->CKTstate1+here->HICUMcqjep);
|
||||
*(ckt->CKTstate0+here->HICUMqjep_Vrth)=*(ckt->CKTstate1+here->HICUMqjep_Vrth);
|
||||
*(ckt->CKTstate0+here->HICUMqjcx0_i)=*(ckt->CKTstate1+here->HICUMqjcx0_i);
|
||||
*(ckt->CKTstate0+here->HICUMcqcx0_t_i)=*(ckt->CKTstate1+here->HICUMcqcx0_t_i);
|
||||
*(ckt->CKTstate0+here->HICUMqjcx0_i_Vrth)=*(ckt->CKTstate1+here->HICUMqjcx0_i_Vrth);
|
||||
*(ckt->CKTstate0+here->HICUMqjcx0_ii)=*(ckt->CKTstate1+here->HICUMqjcx0_ii);
|
||||
*(ckt->CKTstate0+here->HICUMcqcx0_t_ii)=*(ckt->CKTstate1+here->HICUMcqcx0_t_ii);
|
||||
*(ckt->CKTstate0+here->HICUMqjcx0_ii_Vrth)=*(ckt->CKTstate1+here->HICUMqjcx0_ii_Vrth);
|
||||
*(ckt->CKTstate0+here->HICUMqdsu)=*(ckt->CKTstate1+here->HICUMqdsu);
|
||||
*(ckt->CKTstate0+here->HICUMcqdsu)=*(ckt->CKTstate1+here->HICUMcqdsu);
|
||||
*(ckt->CKTstate0+here->HICUMqdsu_Vrth)=*(ckt->CKTstate1+here->HICUMqdsu_Vrth);
|
||||
*(ckt->CKTstate0+here->HICUMqdsu_Vsici)=*(ckt->CKTstate1+here->HICUMqdsu_Vsici);
|
||||
*(ckt->CKTstate0+here->HICUMqjs)=*(ckt->CKTstate1+here->HICUMqjs);
|
||||
*(ckt->CKTstate0+here->HICUMcqjs)=*(ckt->CKTstate1+here->HICUMcqjs);
|
||||
*(ckt->CKTstate0+here->HICUMqjs_Vrth)=*(ckt->CKTstate1+here->HICUMqjs_Vrth);
|
||||
*(ckt->CKTstate0+here->HICUMqscp)=*(ckt->CKTstate1+here->HICUMqscp);
|
||||
*(ckt->CKTstate0+here->HICUMcqscp)=*(ckt->CKTstate1+here->HICUMcqscp);
|
||||
*(ckt->CKTstate0+here->HICUMqscp_Vrth)=*(ckt->CKTstate1+here->HICUMqscp_Vrth);
|
||||
*(ckt->CKTstate0+here->HICUMqbepar1)=*(ckt->CKTstate1+here->HICUMqbepar1);
|
||||
*(ckt->CKTstate0+here->HICUMcqbepar1)=*(ckt->CKTstate1+here->HICUMcqbepar1);
|
||||
*(ckt->CKTstate0+here->HICUMgqbepar1)=*(ckt->CKTstate1+here->HICUMgqbepar1);
|
||||
|
|
@ -1622,6 +1554,7 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
*(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_Vbpbi)=*(ckt->CKTstate1+here->HICUMith_Vbpbi);
|
||||
*(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);
|
||||
|
|
@ -1630,8 +1563,6 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
*(ckt->CKTstate0+here->HICUMith_Vbbp)=*(ckt->CKTstate1+here->HICUMith_Vbbp);
|
||||
*(ckt->CKTstate0+here->HICUMith_Veie)=*(ckt->CKTstate1+here->HICUMith_Veie);
|
||||
|
||||
|
||||
|
||||
/////////////////////////
|
||||
// end copy state vector
|
||||
/////////////////////////
|
||||
|
|
@ -2337,14 +2268,27 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
Qdci = Qr;
|
||||
|
||||
//High-frequency emitter current crowding (lateral NQS)
|
||||
//TODO : derivatives missing here???
|
||||
Cdei = T_f0*itf/here->HICUMvt.rpart;
|
||||
Cdei_Vbiei = T_f0*itf_Vbiei/here->HICUMvt.rpart;
|
||||
Cdei_Vbici = T_f0_Vbici*itf/here->HICUMvt.rpart;
|
||||
Cdei_Vbici+= T_f0*itf_Vbici/here->HICUMvt.rpart;
|
||||
Cdei_Vrth = T_f0_dT*itf/here->HICUMvt.rpart + T_f0*itf_dT/here->HICUMvt.rpart - T_f0*itf/here->HICUMvt.rpart/here->HICUMvt.rpart*here->HICUMvt.dpart;
|
||||
|
||||
Cdci = model->HICUMtr*itr/here->HICUMvt.rpart;
|
||||
Cdci_Vbiei = model->HICUMtr*itr_Vbiei/here->HICUMvt.rpart;
|
||||
Cdci_Vbici = model->HICUMtr*itr_Vbici/here->HICUMvt.rpart;
|
||||
Cdci_Vrth = model->HICUMtr*itr_dT/here->HICUMvt.rpart - model->HICUMtr*itr/here->HICUMvt.rpart/here->HICUMvt.rpart*here->HICUMvt.dpart;
|
||||
|
||||
Crbi = model->HICUMfcrbi*(Cjei+Cjci+Cdei+Cdci);
|
||||
Crbi_Vrth = model->HICUMfcrbi*(Cjei_dT+Cjci_dT+Cdei_Vrth+Cdci_Vrth);
|
||||
Crbi_Vbiei = model->HICUMfcrbi*(Cjei_Vbiei+Cdei_Vbiei+Cdci_Vbiei);
|
||||
Crbi_Vbici = model->HICUMfcrbi*(Cjci_Vbici+Cdei_Vbici+Cdci_Vbici);
|
||||
|
||||
Qrbi = Crbi*Vbpbi;
|
||||
Qrbi_Vbpbi = Crbi;
|
||||
Qrbi_Vbiei = Vbpbi*model->HICUMfcrbi*(T_f0*itf_Vbiei+Cjei_Vbiei);
|
||||
Qrbi_Vbici = Vbpbi*model->HICUMfcrbi*(model->HICUMtr*itr_Vbici+Cjci_Vbici);
|
||||
Qrbi_Vbiei = Vbpbi*Crbi_Vbiei;
|
||||
Qrbi_Vbici = Vbpbi*Crbi_Vbici;
|
||||
Qrbi_Vrth = Vbpbi*Crbi_Vrth;
|
||||
|
||||
// Qrbi = model->HICUMfcrbi*(Qjei+Qjci+Qdei+Qdci);
|
||||
|
||||
|
|
@ -2788,51 +2732,98 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
|
||||
// end of Load_sources
|
||||
|
||||
|
||||
Qjcx_i_Vbci = Cjcx_i;//
|
||||
Qjcx_ii_Vbpci = Cjcx_ii;
|
||||
Qjep_Vbpei = Cjep;
|
||||
Qdeix_Vbiei = Cdei;
|
||||
Qdci_Vbici = Cdci;
|
||||
// calculate charge derivatives over electrostatic caps
|
||||
Qbepar1_Vbe = cbepar1;
|
||||
Qbepar2_Vbpe = cbepar2;
|
||||
Qbcpar1_Vbci = cbcpar1;
|
||||
Qbcpar2_Vbpci = cbcpar2;
|
||||
Qsu_Vsis = model->HICUMcsu;
|
||||
Qjs_Vsici = Cjs;
|
||||
|
||||
//TODO: @Dietmar: what about dQ/dT ?
|
||||
|
||||
Qcth_Vrth = model->HICUMcth;
|
||||
|
||||
if( (ckt->CKTmode & (MODEDCTRANCURVE | MODETRAN | MODEAC)) ||
|
||||
((ckt->CKTmode & MODETRANOP) && (ckt->CKTmode & MODEUIC)) ||
|
||||
(ckt->CKTmode & MODEINITSMSIG)) {
|
||||
/*
|
||||
* charge storage elements
|
||||
*/
|
||||
Qbepar1=cbepar1*Vbe;
|
||||
Qbepar2=cbepar2*Vbpe;
|
||||
Qbcpar1=cbcpar1*Vbci;
|
||||
Qbcpar2=cbcpar2*Vbpci;
|
||||
Qsu=model->HICUMcsu*Vsis;
|
||||
Qcth=model->HICUMcth*Vrth;
|
||||
|
||||
*(ckt->CKTstate0 + here->HICUMqrbi) = Qrbi;
|
||||
*(ckt->CKTstate0 + here->HICUMqdeix) = Qdeix;
|
||||
*(ckt->CKTstate0 + here->HICUMqjei) = Qjei;
|
||||
*(ckt->CKTstate0 + here->HICUMqdci) = Qdci;
|
||||
*(ckt->CKTstate0 + here->HICUMqjci) = Qjci;
|
||||
*(ckt->CKTstate0 + here->HICUMqjep) = Qjep;
|
||||
*(ckt->CKTstate0 + here->HICUMqjcx0_i) = Qjcx_i;
|
||||
*(ckt->CKTstate0 + here->HICUMqjcx0_ii) = Qjcx_ii;
|
||||
*(ckt->CKTstate0 + here->HICUMqdsu) = Qdsu;
|
||||
*(ckt->CKTstate0 + here->HICUMqjs) = Qjs;
|
||||
*(ckt->CKTstate0 + here->HICUMqscp) = Qscp;
|
||||
*(ckt->CKTstate0 + here->HICUMqbepar1) = Qbepar1;
|
||||
*(ckt->CKTstate0 + here->HICUMqbepar2) = Qbepar2;
|
||||
*(ckt->CKTstate0 + here->HICUMqbcpar1) = Qbcpar1;
|
||||
*(ckt->CKTstate0 + here->HICUMqbcpar2) = Qbcpar2;
|
||||
*(ckt->CKTstate0 + here->HICUMqsu) = Qsu;
|
||||
// calculate charges over electrostatic caps
|
||||
Qbepar1 = cbepar1*Vbe;
|
||||
Qbepar2 = cbepar2*Vbpe;
|
||||
Qbcpar1 = cbcpar1*Vbci;
|
||||
Qbcpar2 = cbcpar2*Vbpci;
|
||||
Qsu = model->HICUMcsu*Vsis;
|
||||
if (model->HICUMflsh) {
|
||||
Qcth = model->HICUMcth*Vrth;
|
||||
} else {
|
||||
Qcth = 0;
|
||||
}
|
||||
|
||||
// store charges and their derivatives in state vector
|
||||
//Qrbi
|
||||
*(ckt->CKTstate0 + here->HICUMqrbi) = Qrbi;
|
||||
*(ckt->CKTstate0 + here->HICUMcqrbi) = Qrbi_Vbpbi;
|
||||
*(ckt->CKTstate0 + here->HICUMqrbi_Vbiei) = Qrbi_Vbiei;
|
||||
*(ckt->CKTstate0 + here->HICUMqrbi_Vbici) = Qrbi_Vbici;
|
||||
*(ckt->CKTstate0 + here->HICUMqrbi_Vrth) = Qrbi_Vrth;
|
||||
//Qjei
|
||||
*(ckt->CKTstate0 + here->HICUMqjei) = Qjei;
|
||||
*(ckt->CKTstate0 + here->HICUMcqjei) = Qjei_Vbiei;
|
||||
*(ckt->CKTstate0 + here->HICUMqjei_Vrth) = Qjei_dT;
|
||||
//Qf
|
||||
*(ckt->CKTstate0 + here->HICUMqf) = Qf;
|
||||
*(ckt->CKTstate0 + here->HICUMcqf) = Qf_Vbiei;
|
||||
*(ckt->CKTstate0 + here->HICUMqf_Vbici) = Qf_Vbici;
|
||||
*(ckt->CKTstate0 + here->HICUMqf_Vrth) = Qf_dT;
|
||||
//Qr
|
||||
*(ckt->CKTstate0 + here->HICUMqr) = Qr;
|
||||
*(ckt->CKTstate0 + here->HICUMcqr) = Qr_Vbici;
|
||||
*(ckt->CKTstate0 + here->HICUMqr_Vbiei) = Qr_Vbiei;
|
||||
*(ckt->CKTstate0 + here->HICUMqr_Vrth) = Qr_dT;
|
||||
//Qjci
|
||||
*(ckt->CKTstate0 + here->HICUMqjci) = Qjci;
|
||||
*(ckt->CKTstate0 + here->HICUMcqjci) = Qjci_Vbici;
|
||||
*(ckt->CKTstate0 + here->HICUMqjci_Vrth) = Qjci_dT;
|
||||
//Qjep
|
||||
*(ckt->CKTstate0 + here->HICUMqjep) = Qjep;
|
||||
*(ckt->CKTstate0 + here->HICUMcqjep) = Qjep_Vbpei;
|
||||
*(ckt->CKTstate0 + here->HICUMqjep_Vrth) = Qjep_dT;
|
||||
//Qjcx_i
|
||||
*(ckt->CKTstate0 + here->HICUMqjcx0_i) = Qjcx_i;
|
||||
*(ckt->CKTstate0 + here->HICUMcqcx0_t_i) = Qjcx_i_Vbci;
|
||||
*(ckt->CKTstate0 + here->HICUMqjcx0_i_Vrth) = Qjcx_i_dT;
|
||||
//Qjcx_ii
|
||||
*(ckt->CKTstate0 + here->HICUMqjcx0_i) = Qjcx_ii;
|
||||
*(ckt->CKTstate0 + here->HICUMcqcx0_t_i) = Qjcx_ii_Vbpci;
|
||||
*(ckt->CKTstate0 + here->HICUMqjcx0_i_Vrth) = Qjcx_ii_dT;
|
||||
//Qdsu
|
||||
*(ckt->CKTstate0 + here->HICUMqdsu) = Qdsu;
|
||||
*(ckt->CKTstate0 + here->HICUMcqdsu) = Qdsu_Vbpci;
|
||||
*(ckt->CKTstate0 + here->HICUMqdsu_Vrth) = Qdsu_dT;
|
||||
*(ckt->CKTstate0 + here->HICUMqdsu_Vsici) = Qdsu_Vsici;//
|
||||
//Qs
|
||||
*(ckt->CKTstate0 + here->HICUMqjs) = Qjs;
|
||||
*(ckt->CKTstate0 + here->HICUMcqjs) = Qjs_Vsici;
|
||||
*(ckt->CKTstate0 + here->HICUMqjs_Vrth) = Qjs_dT;
|
||||
//Qscp
|
||||
*(ckt->CKTstate0 + here->HICUMqscp) = Qscp;
|
||||
*(ckt->CKTstate0 + here->HICUMcqscp) = Qscp_Vsc;
|
||||
*(ckt->CKTstate0 + here->HICUMqscp_Vrth) = Qscp_dT;
|
||||
//Qbepar1
|
||||
*(ckt->CKTstate0 + here->HICUMqbepar1) = Qbepar1;
|
||||
*(ckt->CKTstate0 + here->HICUMcqbepar1) = Qbepar1_Vbe;
|
||||
//Qbepar2
|
||||
*(ckt->CKTstate0 + here->HICUMqbepar2) = Qbepar2;
|
||||
*(ckt->CKTstate0 + here->HICUMcqbepar2) = Qbepar2_Vbpe;
|
||||
//Qbcpar1
|
||||
*(ckt->CKTstate0 + here->HICUMqbcpar1) = Qbcpar1;
|
||||
*(ckt->CKTstate0 + here->HICUMcqbcpar1) = Qbcpar1_Vbci;
|
||||
//Qbcpar2
|
||||
*(ckt->CKTstate0 + here->HICUMqbcpar2) = Qbcpar2;
|
||||
*(ckt->CKTstate0 + here->HICUMcqbcpar2) = Qbcpar1_Vbci;
|
||||
//Qsu
|
||||
*(ckt->CKTstate0 + here->HICUMqsu) = Qsu;
|
||||
*(ckt->CKTstate0 + here->HICUMcqsu) = Qsu_Vsis;
|
||||
//Qth
|
||||
*(ckt->CKTstate0 + here->HICUMqcth) = Qcth;
|
||||
*(ckt->CKTstate0 + here->HICUMcqcth) = Qcth_Vrth;
|
||||
//NQS
|
||||
*(ckt->CKTstate0 + here->HICUMqxf1) = Qxf1;
|
||||
*(ckt->CKTstate0 + here->HICUMqxf2) = Qxf2;
|
||||
|
|
@ -2840,6 +2831,7 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
if (model->HICUMflsh)
|
||||
*(ckt->CKTstate0 + here->HICUMqcth) = Qcth;
|
||||
|
||||
//below is not important for load
|
||||
here->HICUMcaprbi = Qrbi_Vbpbi;
|
||||
here->HICUMcapdeix = Cdei;
|
||||
here->HICUMcapjei = Cjei;
|
||||
|
|
@ -2855,16 +2847,18 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
here->HICUMcapcth = model->HICUMcth;
|
||||
here->HICUMcapscp = Cscp;
|
||||
|
||||
/*
|
||||
* store small-signal parameters
|
||||
*/
|
||||
// store all derivatives of charges
|
||||
if ( (!(ckt->CKTmode & MODETRANOP))||
|
||||
(!(ckt->CKTmode & MODEUIC)) ) {
|
||||
if(ckt->CKTmode & MODEINITSMSIG) {
|
||||
*(ckt->CKTstate0 + here->HICUMcqrbi) = Qrbi_Vbpbi;
|
||||
*(ckt->CKTstate0 + here->HICUMcqdeix) = Qdeix_Vbiei;
|
||||
|
||||
//TODO
|
||||
*(ckt->CKTstate0 + here->HICUMcqf) = Qf_Vbiei;
|
||||
*(ckt->CKTstate0 + here->HICUMqf_Vbici) = Qf_Vbici;
|
||||
*(ckt->CKTstate0 + here->HICUMqf_Vrth) = Qf_dT;
|
||||
|
||||
*(ckt->CKTstate0 + here->HICUMcqjei) = Cjei;
|
||||
*(ckt->CKTstate0 + here->HICUMcqdci) = Qdci_Vbici;
|
||||
*(ckt->CKTstate0 + here->HICUMcqr) = Qdci_Vbici;
|
||||
*(ckt->CKTstate0 + here->HICUMcqjci) = Cjci;
|
||||
*(ckt->CKTstate0 + here->HICUMcqjep) = Qjep_Vbpei;
|
||||
*(ckt->CKTstate0 + here->HICUMcqcx0_t_i) = Qjcx_i_Vbci;
|
||||
|
|
@ -2885,20 +2879,18 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
*(ckt->CKTstate0 + here->HICUMcqcth) = model->HICUMcth;
|
||||
continue; /* go to 1000 */
|
||||
}
|
||||
/*
|
||||
* transient analysis
|
||||
*/
|
||||
//transient analysis TODO
|
||||
if(ckt->CKTmode & MODEINITTRAN) {
|
||||
*(ckt->CKTstate1 + here->HICUMqrbi) =
|
||||
*(ckt->CKTstate0 + here->HICUMqrbi) ;
|
||||
*(ckt->CKTstate1 + here->HICUMqjei) =
|
||||
*(ckt->CKTstate0 + here->HICUMqjei) ;
|
||||
*(ckt->CKTstate1 + here->HICUMqdeix) =
|
||||
*(ckt->CKTstate0 + here->HICUMqdeix) ;
|
||||
*(ckt->CKTstate1 + here->HICUMqf) =
|
||||
*(ckt->CKTstate0 + here->HICUMqf) ;
|
||||
*(ckt->CKTstate1 + here->HICUMqjci) =
|
||||
*(ckt->CKTstate0 + here->HICUMqjci) ;
|
||||
*(ckt->CKTstate1 + here->HICUMqdci) =
|
||||
*(ckt->CKTstate0 + here->HICUMqdci) ;
|
||||
*(ckt->CKTstate1 + here->HICUMqr) =
|
||||
*(ckt->CKTstate0 + here->HICUMqr) ;
|
||||
*(ckt->CKTstate1 + here->HICUMqjep) =
|
||||
*(ckt->CKTstate0 + here->HICUMqjep) ;
|
||||
*(ckt->CKTstate1 + here->HICUMqjcx0_i) =
|
||||
|
|
@ -2936,10 +2928,10 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
Ibpbi += *(ckt->CKTstate0 + here->HICUMcqrbi);
|
||||
|
||||
// Ibiei += ddt(model->HICUMtype*(Qdeix+Qjei));
|
||||
error = NIintegrate(ckt,&geq,&ceq,Cdei,here->HICUMqdeix);
|
||||
error = NIintegrate(ckt,&geq,&ceq,Cdei,here->HICUMqf);
|
||||
if(error) return(error);
|
||||
Ibiei_Vbiei += geq;
|
||||
Ibiei += *(ckt->CKTstate0 + here->HICUMcqdeix);
|
||||
Ibiei += *(ckt->CKTstate0 + here->HICUMcqf);
|
||||
|
||||
error = NIintegrate(ckt,&geq,&ceq,Cjei,here->HICUMqjei);
|
||||
if(error) return(error);
|
||||
|
|
@ -2947,10 +2939,10 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
Ibiei += *(ckt->CKTstate0 + here->HICUMcqjep);
|
||||
|
||||
// ibici += ddt(model->HICUMtype*(Qdci+Qjci));
|
||||
error = NIintegrate(ckt,&geq,&ceq,Cdci,here->HICUMqdci);
|
||||
error = NIintegrate(ckt,&geq,&ceq,Cdci,here->HICUMqr);
|
||||
if(error) return(error);
|
||||
Ibici_Vbici += geq;
|
||||
Ibici += *(ckt->CKTstate0 + here->HICUMcqdci);
|
||||
Ibici += *(ckt->CKTstate0 + here->HICUMcqr);
|
||||
|
||||
error = NIintegrate(ckt,&geq,&ceq,Cjci,here->HICUMqjci);
|
||||
if(error) return(error);
|
||||
|
|
@ -3022,12 +3014,12 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
*(ckt->CKTstate0 + here->HICUMcqrbi);
|
||||
*(ckt->CKTstate1 + here->HICUMcqjei) =
|
||||
*(ckt->CKTstate0 + here->HICUMcqjei);
|
||||
*(ckt->CKTstate1 + here->HICUMcqdeix) =
|
||||
*(ckt->CKTstate0 + here->HICUMcqdeix);
|
||||
*(ckt->CKTstate1 + here->HICUMcqf) =
|
||||
*(ckt->CKTstate0 + here->HICUMcqf);
|
||||
*(ckt->CKTstate1 + here->HICUMcqjci) =
|
||||
*(ckt->CKTstate0 + here->HICUMcqjci);
|
||||
*(ckt->CKTstate1 + here->HICUMcqdci) =
|
||||
*(ckt->CKTstate0 + here->HICUMcqdci);
|
||||
*(ckt->CKTstate1 + here->HICUMcqr) =
|
||||
*(ckt->CKTstate0 + here->HICUMcqr);
|
||||
*(ckt->CKTstate1 + here->HICUMcqjep) =
|
||||
*(ckt->CKTstate0 + here->HICUMcqjep);
|
||||
*(ckt->CKTstate1 + here->HICUMcqcx0_t_i) =
|
||||
|
|
@ -3586,12 +3578,6 @@ c Branch: xf-ground, Stamp element: Rxf
|
|||
*(here->HICUMsubsSItempPtr) += -Ibpsi_Vrth;
|
||||
// finish
|
||||
|
||||
// Rsu
|
||||
|
||||
// Stamp element: Cth
|
||||
*(here->HICUMtempTempPtr) += Icth_Vrth;
|
||||
// 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