From a54c52221c7d30b6ccc613e4018fd199c2ac29d7 Mon Sep 17 00:00:00 2001 From: Markus Mueller Date: Sat, 27 Jun 2020 20:05:58 +0200 Subject: [PATCH] small fixes HICUM --- output_ngspice_dc.ngspice | 2 ++ src/spicelib/devices/hicum2/hicum2acld.c | 31 +++++++++++++++--------- src/spicelib/devices/hicum2/hicumL2.cpp | 14 +++++------ 3 files changed, 29 insertions(+), 18 deletions(-) diff --git a/output_ngspice_dc.ngspice b/output_ngspice_dc.ngspice index 551d70f2b..e355761ed 100644 --- a/output_ngspice_dc.ngspice +++ b/output_ngspice_dc.ngspice @@ -2,3 +2,5 @@ 2.00000000e+00 1.00000000e+00 2.01746671e+05 -8.04244503e+01 0.00000000e+00 3.50311244e-15 2.70336374e-15 6.72516281e-15 4.93507402e-15 0.00000000e+00 3.95610869e-08 2.13703336e+12 2.76080200e-10 1.00000000e-18 1.29187266e-13 -9.07852493e-14 -1.29257913e-13 3.84900492e-14 7.30135377e-12 3.19625139e-02 3.00000000e-01 2.00000000e+00 -7.21060090e-12 -2.00000000e-18 7.17207647e-12 1.00000000e+00 1.46522842e-11 1.81743808e+01 3.17438082e+00 1.00000000e+01 1.99941623e+00 3.45139302e+12 1.00000000e+18 3.62213587e+09 7.55020036e+11 7.29998838e+14 2.68500000e+01 4.79428371e-13 3.00000000e+02 -1.44169925e-11 0.00000000e+00 0.00000000e+00 -1.70000000e+00 3.00000000e-01 -2.88158386e-13 0.00000000e+00 2.00000000e+00 0.00000000e+00 3.00000000e-01 3.00000000e-01 3.00000000e-01 2.00000000e+00 2.00000000e+00 2.00000000e+00 1.44212018e-14 7.21060090e-15 0.00000000e+00 2.00000000e-21 0.00000000e+00 3.95610606e-08 2.00000000e+00 1.44314137e-11 4.00000000e-21 5.68434189e-14 -7.27595761e-12 7.21060090e-12 2.00000000e-18 n_c @q_q_h[area] @q_q_h[betaac] @q_q_h[betadc] @q_q_h[ccs] @q_q_h[cmui] @q_q_h[cmux] @q_q_h[cpii] @q_q_h[cpix] @q_q_h[crbi] @q_q_h[dtsh] @q_q_h[ft] @q_q_h[gmi] @q_q_h[gms] @q_q_h[iavl] @q_q_h[ib] @q_q_h[ibci] @q_q_h[ibei] @q_q_h[ic] @q_q_h[ick] @q_q_h[icvb] @q_q_h[icvc] @q_q_h[ie] @q_q_h[is] @q_q_h[it] @q_q_h[m] @q_q_h[p] @q_q_h[rb] @q_q_h[rbi] @q_q_h[rcx_t] @q_q_h[re_t] @q_q_h[rmui] @q_q_h[rmux] @q_q_h[roi] @q_q_h[rpii] @q_q_h[rpix] @q_q_h[temp] @q_q_h[tf] @q_q_h[tk] @q_q_h[vbbp] @q_q_h[vbc] @q_q_h[vbe] @q_q_h[vbici] @q_q_h[vbiei] @q_q_h[vbpbi] @q_q_h[vce] @q_q_h[vciei] @q_q_h[vsc] n_b n_b_forced n_bx n_c n_c_forced n_cx n_e n_e_forced n_ex n_s n_sx n_t q_q_h#collCI q_q_h#emitEI q_q_h#subsSI v_v_b#branch v_v_c#branch v_v_e#branch v_v_s#branch 2.00000000e+00 1.00000000e+00 2.01746671e+05 -8.04244503e+01 0.00000000e+00 3.50311244e-15 2.70336374e-15 6.72516281e-15 4.93507402e-15 0.00000000e+00 3.95610869e-08 2.13703336e+12 2.76080200e-10 1.00000000e-18 1.29187266e-13 -9.07852493e-14 -1.29257913e-13 3.84900492e-14 7.30135377e-12 3.19625139e-02 3.00000000e-01 2.00000000e+00 -7.21060090e-12 -2.00000000e-18 7.17207647e-12 1.00000000e+00 1.46522842e-11 1.81743808e+01 3.17438082e+00 1.00000000e+01 1.99941623e+00 3.45139302e+12 1.00000000e+18 3.62213587e+09 7.55020036e+11 7.29998838e+14 2.68500000e+01 4.79428371e-13 3.00000000e+02 -1.44169925e-11 0.00000000e+00 0.00000000e+00 -1.70000000e+00 3.00000000e-01 -2.88158386e-13 0.00000000e+00 2.00000000e+00 0.00000000e+00 3.00000000e-01 3.00000000e-01 3.00000000e-01 2.00000000e+00 2.00000000e+00 2.00000000e+00 1.44212018e-14 7.21060090e-15 0.00000000e+00 2.00000000e-21 0.00000000e+00 3.95610606e-08 2.00000000e+00 1.44314137e-11 4.00000000e-21 5.68434189e-14 -7.27595761e-12 7.21060090e-12 2.00000000e-18 + n_c @q_q_h[betaac] @q_q_h[betadc] @q_q_h[ccs] @q_q_h[cmui] @q_q_h[cmux] @q_q_h[cpii] @q_q_h[cpix] @q_q_h[crbi] @q_q_h[dtsh] @q_q_h[ft] @q_q_h[gmi] @q_q_h[gms] @q_q_h[iavl] @q_q_h[ib] @q_q_h[ibci] @q_q_h[ibei] @q_q_h[ic] @q_q_h[ick] @q_q_h[icvb] @q_q_h[icvc] @q_q_h[ie] @q_q_h[is] @q_q_h[it] @q_q_h[m] @q_q_h[p] @q_q_h[rb] @q_q_h[rbi] @q_q_h[rcx_t] @q_q_h[re_t] @q_q_h[rmui] @q_q_h[rmux] @q_q_h[roi] @q_q_h[rpii] @q_q_h[rpix] @q_q_h[temp] @q_q_h[tf] @q_q_h[tk] @q_q_h[vbbp] @q_q_h[vbc] @q_q_h[vbe] @q_q_h[vbici] @q_q_h[vbiei] @q_q_h[vbpbi] @q_q_h[vce] @q_q_h[vciei] @q_q_h[vsc] n_b n_b_forced n_bx n_c n_c_forced n_cx n_e n_e_forced n_ex n_s n_sx n_t q_q_h#collCI q_q_h#emitEI q_q_h#subsSI q_q_h#xf q_q_h#xf1 q_q_h#xf2 v_v_b#branch v_v_c#branch v_v_e#branch v_v_s#branch v_v_v_b#branch v_v_v_c#branch v_v_v_e#branch v_v_v_s#branch + 2.00000000e+00 1.96947731e+02 4.44892593e+01 9.60943028e-16 0.00000000e+00 3.01224208e-16 5.47382747e-24 0.00000000e+00 0.00000000e+00 1.37501388e-08 8.18004028e+12 2.38209995e-11 1.00000000e-18 0.00000000e+00 1.38680642e-14 -1.76237000e-18 1.38727036e-14 6.16979903e-13 7.12907004e-03 3.00000000e-01 2.00000000e+00 -6.40135090e-13 -1.15500000e-15 6.15820264e-13 1.00000000e+00 1.23431480e-12 1.11993183e+02 7.09031830e+01 3.97200000e+01 2.41800000e+01 5.00000000e+17 1.00000000e+18 4.19797649e+10 3.55408009e+12 4.71373970e+12 2.68500000e+01 2.29790000e-13 3.00000000e+02 -1.54784665e-11 0.00000000e+00 0.00000000e+00 -1.70000000e+00 3.00000000e-01 9.83491066e-13 0.00000000e+00 2.00000000e+00 0.00000000e+00 3.00000000e-01 3.00000000e-01 3.00000000e-01 2.00000000e+00 2.00000000e+00 2.00000000e+00 6.40135090e-16 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 1.37501137e-08 2.00000000e+00 1.54791066e-11 9.24000002e-12 -1.11398791e-32 -1.11398791e-32 -1.11398791e-32 -1.13686838e-13 -9.09494702e-13 6.40135090e-13 1.15500000e-15 -1.13686838e-13 -9.09494702e-13 6.40135090e-13 1.15500000e-15 diff --git a/src/spicelib/devices/hicum2/hicum2acld.c b/src/spicelib/devices/hicum2/hicum2acld.c index 20be3999a..935af60d0 100644 --- a/src/spicelib/devices/hicum2/hicum2acld.c +++ b/src/spicelib/devices/hicum2/hicum2acld.c @@ -296,7 +296,7 @@ HICUMacLoad(GENmodel *inModel, CKTcircuit *ckt) *(here->HICUMbaseBPCollCIPtr) += -Ibpsi_Vbpci; *(here->HICUMsubsSIBaseBPPtr) += -Ibpsi_Vbpci;; -// Stamp element: Rs +// Stamp element: Rsu *(here->HICUMsubsSubsPtr) += Isis_Vsis; *(here->HICUMsubsSISubsSIPtr) += Isis_Vsis; *(here->HICUMsubsSISubsPtr) += -Isis_Vsis; @@ -385,7 +385,7 @@ HICUMacLoad(GENmodel *inModel, CKTcircuit *ckt) XQxf1_Vxf1 = *(ckt->CKTstate0 + here->HICUMcqxf1) * ckt->CKTomega; XQxf2_Vxf2 = *(ckt->CKTstate0 + here->HICUMcqxf2) * ckt->CKTomega; - //Qrbi + //Qrbi f_bp=+ f_bi=- *(here->HICUMbaseBPBaseBPPtr + 1) += XQrbi_Vbpbi; *(here->HICUMbaseBIBaseBIPtr + 1) += XQrbi_Vbpbi; *(here->HICUMbaseBPBaseBIPtr + 1) += -XQrbi_Vbpbi; @@ -421,6 +421,15 @@ HICUMacLoad(GENmodel *inModel, CKTcircuit *ckt) *(here->HICUMcollCICollCIPtr +1) += XQjci_Vbici; *(here->HICUMcollCIBaseBIPtr +1) += -XQjci_Vbici; *(here->HICUMbaseBICollCIPtr +1) += -XQjci_Vbici; + //Qr f_bi = + f_ci=- + *(here->HICUMbaseBIBaseBIPtr +1) += XQr_Vbici; + *(here->HICUMcollCICollCIPtr +1) += XQr_Vbici; + *(here->HICUMcollCIBaseBIPtr +1) += -XQr_Vbici; + *(here->HICUMbaseBICollCIPtr +1) += -XQr_Vbici; + *(here->HICUMbaseBIBaseBIPtr +1) += XQr_Vbiei; + *(here->HICUMcollCIEmitEIPtr +1) += XQr_Vbiei; + *(here->HICUMcollCIBaseBIPtr +1) += -XQr_Vbiei; + *(here->HICUMbaseBIEmitEIPtr +1) += -XQr_Vbiei; //Qjep *(here->HICUMbaseBPBaseBPPtr +1) += XQjep_Vbpei; *(here->HICUMemitEIEmitEIPtr +1) += XQjep_Vbpei; @@ -436,15 +445,15 @@ HICUMacLoad(GENmodel *inModel, CKTcircuit *ckt) *(here->HICUMcollCICollCIPtr +1) += Xqjcx0_t_ii_Vbpci; *(here->HICUMbaseBPCollCIPtr +1) += -Xqjcx0_t_ii_Vbpci; *(here->HICUMcollCIBaseBPPtr +1) += -Xqjcx0_t_ii_Vbpci; - //Qdsu + //Qdsu f_bp=+ f_ci=- *(here->HICUMbaseBPBaseBPPtr +1) += XQdsu_Vbpci; *(here->HICUMcollCICollCIPtr +1) += XQdsu_Vbpci; *(here->HICUMbaseBPCollCIPtr +1) += -XQdsu_Vbpci; *(here->HICUMcollCIBaseBPPtr +1) += -XQdsu_Vbpci; - *(here->HICUMbaseBPBaseBPPtr +1) += XQdsu_Vsici; - *(here->HICUMsubsSISubsSIPtr +1) += XQdsu_Vsici; - *(here->HICUMbaseBPSubsSIPtr +1) += -XQdsu_Vsici; - *(here->HICUMsubsSIBaseBPPtr +1) += -XQdsu_Vsici; + *(here->HICUMbaseBPSubsSIPtr +1) += XQdsu_Vsici; + *(here->HICUMcollCICollCIPtr +1) += XQdsu_Vsici; + *(here->HICUMbaseBPCollCIPtr +1) += -XQdsu_Vsici; + *(here->HICUMcollCISubsSIPtr +1) += -XQdsu_Vsici; //Qjs *(here->HICUMsubsSISubsSIPtr +1) += XQjs_Vsici; *(here->HICUMcollCICollCIPtr +1) += XQjs_Vsici; @@ -452,9 +461,9 @@ HICUMacLoad(GENmodel *inModel, CKTcircuit *ckt) *(here->HICUMcollCISubsSIPtr +1) += -XQjs_Vsici; //Qscp *(here->HICUMsubsSubsPtr + 1) += XQscp_Vsc; - *(here->HICUMsubsCollPtr + 1) += XQscp_Vsc; + *(here->HICUMcollCollPtr + 1) += XQscp_Vsc; *(here->HICUMcollSubsPtr + 1) += -XQscp_Vsc; - *(here->HICUMcollCollPtr + 1) += -XQscp_Vsc; + *(here->HICUMsubsCollPtr + 1) += -XQscp_Vsc; //Qbepar1 *(here->HICUMbaseBasePtr + 1) += XQbepar1_Vbe; *(here->HICUMemitEmitPtr + 1) += XQbepar1_Vbe; @@ -601,8 +610,8 @@ HICUMacLoad(GENmodel *inModel, CKTcircuit *ckt) *(here->HICUMsubsSItempPtr + 1) += -XQjs_Vrth; *(here->HICUMcollCItempPtr + 1) += +XQjs_Vrth; //Qscp from S to C f_S =- f_C =+ - // *(here->HICUMsubsTempPtr + 1) += -XQscp_Vrth; - // *(here->HICUMcollTempPtr + 1) += +XQscp_Vrth; + *(here->HICUMsubsTempPtr + 1) += -XQscp_Vrth; + *(here->HICUMcollTempPtr + 1) += +XQscp_Vrth; //Qcth from 0 to T f_0=- f_T=+ *(here->HICUMtempTempPtr + 1) += -XQcth_Vrth; diff --git a/src/spicelib/devices/hicum2/hicumL2.cpp b/src/spicelib/devices/hicum2/hicumL2.cpp index 3009fd4ed..5cd72796d 100644 --- a/src/spicelib/devices/hicum2/hicumL2.cpp +++ b/src/spicelib/devices/hicum2/hicumL2.cpp @@ -2318,10 +2318,10 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt) Crbi_Vbiei = model->HICUMfcrbi*(Cjei_Vbiei+Cdei_Vbiei+Cdci_Vbiei); Crbi_Vbici = model->HICUMfcrbi*(Cjci_Vbici+Cdei_Vbici+Cdci_Vbici); - Qrbi = Crbi*Vbpbi; + Qrbi = Crbi*Vbpbi; //Vbpbi=(Vbpei-Vbiei)=(Vbpci-Vbici) Qrbi_Vbpbi = Crbi; - Qrbi_Vbiei = Vbpbi*Crbi_Vbiei; - Qrbi_Vbici = Vbpbi*Crbi_Vbici; + Qrbi_Vbiei = Vbpbi*Crbi_Vbiei - Crbi; //What do you think Dietmar? + Qrbi_Vbici = Vbpbi*Crbi_Vbici - Crbi; Qrbi_Vrth = Vbpbi*Crbi_Vrth; // Qrbi = model->HICUMfcrbi*(Qjei+Qjci+Qdei+Qdci); @@ -2475,8 +2475,8 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt) Cscp = model->HICUMcscp0; Cscp_Vsc = 0; Cscp_dT = 0; - Qscp = model->HICUMcscp0*Vsc; - Qscp_Vsc = 0; + Qscp = model->HICUMcscp0*Vsc; + Qscp_Vsc = model->HICUMcscp0; Qscp_dT = 0; } @@ -2550,7 +2550,7 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt) // Excess Phase calculation - if ( nqs && (ckt->CKTmode & (MODETRAN | MODEAC) ) ) { //evaluate nqs network only in TRANSIENT and AC modes. + if ( nqs){ // && (ckt->CKTmode & (MODETRAN | MODEAC) ) ) { //evaluate nqs network only in TRANSIENT and AC modes. Ixf1 = (Vxf2-itf)/Tf*model->HICUMt0; Ixf1_Vxf2 = 1.0/Tf*model->HICUMt0; Ixf1_ditf = -Ixf1_Vxf2; @@ -3051,7 +3051,7 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt) *(ckt->CKTstate0 + here->HICUMcqcx0_t_ii) = Qjcx_ii_Vbpci; *(ckt->CKTstate0 + here->HICUMcqdsu) = Qdsu_Vbpci; *(ckt->CKTstate0 + here->HICUMcqjs) = Qjs_Vsici; - *(ckt->CKTstate0 + here->HICUMcqscp) = Cscp; + *(ckt->CKTstate0 + here->HICUMcqscp) = Qscp_Vsc; *(ckt->CKTstate0 + here->HICUMcqbepar1) = Qbepar1_Vbe; *(ckt->CKTstate0 + here->HICUMcqbepar2) = Qbepar2_Vbpe; *(ckt->CKTstate0 + here->HICUMcqbcpar1) = Qbcpar1_Vbci;