more thermal stuff implemented

This commit is contained in:
mariok 2020-05-20 11:22:01 +02:00
parent 194331867e
commit 460e7ec04b
4 changed files with 134 additions and 131 deletions

View File

@ -118,29 +118,26 @@ HICUMask(CKTcircuit *ckt, GENinstance *instPtr, int which, IFvalue *value, IFval
return(OK);
/* currents */
case HICUM_QUEST_CC:
value->rValue = 0.0;
// value->rValue = *(ckt->CKTstate0 + here->HICUMiciei) - // TODO: why does this not work ???
// *(ckt->CKTstate0 + here->HICUMibici) - // these counter shoud be defined and expand to a integer
// *(ckt->CKTstate0 + here->HICUMibpci) -
// *(ckt->CKTstate0 + here->HICUMisici);
// value->rValue = 0.0;
value->rValue = *(ckt->CKTstate0 + here->HICUMiciei) -
*(ckt->CKTstate0 + here->HICUMibici) -
*(ckt->CKTstate0 + here->HICUMibpci) -
*(ckt->CKTstate0 + here->HICUMisici);
return(OK);
case HICUM_QUEST_CB:
value->rValue = 0.0;
// value->rValue = *(ckt->CKTstate0 + here->HICUMibiei) +
// *(ckt->CKTstate0 + here->HICUMibici) +
// *(ckt->CKTstate0 + here->HICUMibpci) +
// *(ckt->CKTstate0 + here->HICUMibpsi);
value->rValue = *(ckt->CKTstate0 + here->HICUMibiei) +
*(ckt->CKTstate0 + here->HICUMibici) +
*(ckt->CKTstate0 + here->HICUMibpci) +
*(ckt->CKTstate0 + here->HICUMibpsi);
return(OK);
case HICUM_QUEST_CE:
value->rValue = 0.0;
// value->rValue = - *(ckt->CKTstate0 + here->HICUMibiei) -
// *(ckt->CKTstate0 + here->HICUMibpei) -
// *(ckt->CKTstate0 + here->HICUMiciei);
value->rValue = - *(ckt->CKTstate0 + here->HICUMibiei) -
*(ckt->CKTstate0 + here->HICUMibpei) -
*(ckt->CKTstate0 + here->HICUMiciei);
return(OK);
case HICUM_QUEST_CS:
value->rValue = 0.0;
// value->rValue = *(ckt->CKTstate0 + here->HICUMisici) -
// *(ckt->CKTstate0 + here->HICUMibpsi);
value->rValue = *(ckt->CKTstate0 + here->HICUMisici) -
*(ckt->CKTstate0 + here->HICUMibpsi);
return(OK);
case HICUM_QUEST_CAVL:
value->rValue = here->HICUMiavl;
@ -179,32 +176,32 @@ HICUMask(CKTcircuit *ckt, GENinstance *instPtr, int which, IFvalue *value, IFval
}
return(OK);
case HICUM_QUEST_GMI:
value->rValue = 0.0;
// value->rValue = *(ckt->CKTstate0 + here->HICUMiciei_Vbiei); // TODO: Check sign vs VA-Code in ADS
// value->rValue = 0.0;
value->rValue = *(ckt->CKTstate0 + here->HICUMiciei_Vbiei); // TODO: Check sign vs VA-Code in ADS
return(OK);
case HICUM_QUEST_GMS:
value->rValue = 0.0;
// value->rValue = *(ckt->CKTstate0 + here->HICUMibpsi_Vbpci); // TODO: Check sign vs VA-Code in ADS
// value->rValue = 0.0;
value->rValue = *(ckt->CKTstate0 + here->HICUMibpsi_Vbpci); // TODO: Check sign vs VA-Code in ADS
return(OK);
case HICUM_QUEST_RPII:
value->rValue = 0.0;
// value->rValue = 1/( *(ckt->CKTstate0 + here->HICUMibiei_Vbiei) + ckt->CKTgmin); // TODO: Check sign vs VA-Code in ADS
// value->rValue = 0.0;
value->rValue = 1/( *(ckt->CKTstate0 + here->HICUMibiei_Vbiei) + ckt->CKTgmin); // TODO: Check sign vs VA-Code in ADS
return(OK);
case HICUM_QUEST_RPIX:
value->rValue = 0.0;
// value->rValue = 1/( *(ckt->CKTstate0 + here->HICUMibpei_Vbpei) + ckt->CKTgmin); // TODO: Check sign vs VA-Code in ADS
// value->rValue = 0.0;
value->rValue = 1/( *(ckt->CKTstate0 + here->HICUMibpei_Vbpei) + ckt->CKTgmin); // TODO: Check sign vs VA-Code in ADS
return(OK);
case HICUM_QUEST_RMUI:
value->rValue = 0.0;
// value->rValue = 1/( *(ckt->CKTstate0 + here->HICUMibici_Vbici) + ckt->CKTgmin); // TODO: Check sign vs VA-Code in ADS
// value->rValue = 0.0;
value->rValue = 1/( *(ckt->CKTstate0 + here->HICUMibici_Vbici) + ckt->CKTgmin); // TODO: Check sign vs VA-Code in ADS
return(OK);
case HICUM_QUEST_RMUX:
value->rValue = 0.0;
// value->rValue = 1/( *(ckt->CKTstate0 + here->HICUMibpci_Vbpci) + ckt->CKTgmin); // TODO: Check sign vs VA-Code in ADS
// value->rValue = 0.0;
value->rValue = 1/( *(ckt->CKTstate0 + here->HICUMibpci_Vbpci) + ckt->CKTgmin); // TODO: Check sign vs VA-Code in ADS
return(OK);
case HICUM_QUEST_ROI:
value->rValue = 0.0;
// value->rValue = 1/( *(ckt->CKTstate0 + here->HICUMiciei_Vbiei) + ckt->CKTgmin); // TODO: Check sign vs VA-Code in ADS
// value->rValue = 0.0;
value->rValue = 1/( *(ckt->CKTstate0 + here->HICUMiciei_Vbiei) + ckt->CKTgmin); // TODO: Check sign vs VA-Code in ADS
return(OK);
case HICUM_QUEST_CPII:
value->rValue = here->HICUMcapjei + here->HICUMcapdeix;

View File

@ -1690,7 +1690,6 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
//Intrinsic transistor
//Internal base currents across b-e junction
//TODO:derivative of ibeis_t and ireis_t missing here
hicum_diode(here->HICUMtemp,here->HICUMibeis_t,model->HICUMmbei, Vbiei, &ibei, &ibei_Vbiei, &ibei_dT);
hicum_diode(here->HICUMtemp,here->HICUMireis_t,model->HICUMmrei, Vbiei, &irei, &irei_Vbiei, &irei_dT);
@ -2073,7 +2072,6 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
//HICCR: }
//Internal base current across b-c junction
//TODO ibcis_t
hicum_diode(here->HICUMtemp,here->HICUMibcis_t,model->HICUMmbci, Vbici, &ibci, &ibci_Vbici, &ibci_dT);
//Avalanche current
@ -2082,14 +2080,14 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
iavl_Vbici = result.dpart();
result = calc_iavl(Vbici , Cjci+1_e, itf , here->HICUMtemp);
iavl_dCjci = result.dpart();
iavl_Vbici += iavl_dCjci*Cjci_Vbici;
result = calc_iavl(Vbici , Cjci , itf+1_e, here->HICUMtemp);
iavl_ditf = result.dpart();
iavl_Vbici += iavl_ditf*itf_Vbici;
iavl_Vbiei = iavl_ditf*itf_Vbiei;
iavl_dT = iavl_ditf*itf_dT + iavl_dCjci*Cjci_dT; //TODO: derivatives kavl_t favl_t qavl_t cjci0_t vdci_t
// or like this (TEST):
// result = calc_iavl(Vbici , Cjci+1_e*Cjci_dT, itf+1_e*itf_dT, here->HICUMtemp+1_e);
// iavl_ditf = result.dpart();
result = calc_iavl(Vbici , Cjci , itf , here->HICUMtemp+1_e);
iavl_dT = result.dpart(); //TODO done: derivatives kavl_t favl_t qavl_t cjci0_t vdci_t
iavl_dT += iavl_ditf*itf_dT + iavl_dCjci*Cjci_dT;
here->HICUMiavl = iavl;
@ -2120,12 +2118,10 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
rbi_dT += rbi_dQjei*Qjei_dT + rbi_dQf*Qf_dT;
//Base currents across peripheral b-e junction
//TODO: temperature derivative with ibeps_t ireps_t
hicum_diode(here->HICUMtemp,here->HICUMibeps_t,model->HICUMmbep, Vbpei, &ibep, &ibep_Vbpei, &ibep_dT);
hicum_diode(here->HICUMtemp,here->HICUMireps_t,model->HICUMmrep, Vbpei, &irep, &irep_Vbpei, &irep_dT);
//Peripheral b-e junction capacitance and charge
//TODO: derivatives with cjep0_t vdep_t
hicum_qjmodf(here->HICUMtemp,here->HICUMcjep0_t,here->HICUMvdep_t,model->HICUMzep,here->HICUMajep_t,Vbpei,&Cjep,&Cjep_Vbpei, &Cjep_dT,&Qjep, &Qjep_Vbpei, &Qjep_dT);
//Tunneling current
@ -2191,7 +2187,6 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
here->HICUMbetadc=0.0;
}
Ieie = Veie/here->HICUMre_t.rpart; // only needed for re flicker noise
// TODO Ieie_dT ???
//Diode current for s-c junction (si,ci)
//HICDIO(here->HICUMvt,model->HICUMiscs,here->HICUMiscs_t,model->HICUMmsc,Vsici,&ijsc,&Isici_Vsici);
@ -2312,6 +2307,7 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
Ibpci = model->HICUMtype*ijbcx;
Ibpci_Vbpci = model->HICUMtype*ijbcx_Vbpci;
Ibpci_dT = model->HICUMtype*ijbcx_dT;
Ibici = model->HICUMtype*(ibci - iavl);
Ibici_Vbici = model->HICUMtype*(ibci_Vbici - iavl_Vbici); //@Dietmar: What about Ibici_Vbiei from Iavl?
@ -2356,8 +2352,10 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
Ith_Veie = 0.0;
Ith_dT = 0.0;
if(model->HICUMflsh == 0 || model->HICUMrth < MIN_R) {
Ith = 0.0;
Ith = 0.0;
} else {
Irth_dT = -Vrth*here->HICUMrth_t.dpart/(here->HICUMrth_t.rpart*here->HICUMrth_t.rpart);
Ith = Vrth/here->HICUMrth_t.rpart-pterm;
Ith_dT = (here->HICUMrth_t.rpart - Vrth*here->HICUMrth_t.dpart)/(here->HICUMrth_t.rpart*here->HICUMrth_t.rpart)-pterm_dT; // TODO Ith derivative for temp
if (model->HICUMflsh == 1 && model->HICUMrth >= MIN_R) {
@ -2404,6 +2402,7 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
}
Ibpbi_Vbiei = -Vbpbi * rbi_Vbiei / (rbi*rbi);
Ibpbi_Vbici = -Vbpbi * rbi_Vbici / (rbi*rbi);
Ibpbi_dT = -Vbpbi * rbi_dT / (rbi*rbi);
Qjcx_i_Vbci = Cjcx_i;
Qjcx_ii_Vbpci = Cjcx_ii;
@ -2419,11 +2418,6 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
//TODO: all the derivatives have to be known dI/dT
//TODO: @Dietmar: what about dQ/dT ?
Irth_dT = 0.0;
Ibici_dT = 0.0;
Ibpei_dT = 0.0;
Ibiei_dT = 0.0;
Ibpci_dT = 0.0;
Ibpbi_dT = 0.0;
Iciei_dT = 0.0;
Isici_dT = 0.0;
@ -2901,8 +2895,8 @@ c Branch: bpci, Stamp element: Ibpci ( was Ijbcx )
*/
rhs_current = model->HICUMtype * (Ibpci - Ibpci_Vbpci*Vbpci);
*(ckt->CKTrhs + here->HICUMbaseBPNode) += -rhs_current;
*(here->HICUMbaseBPCollCIPtr) += Ibpci_Vbpci;
*(here->HICUMbaseBPBaseBPPtr) += -Ibpci_Vbpci;
*(here->HICUMbaseBPBaseBPPtr) += Ibpci_Vbpci;
*(here->HICUMbaseBPCollCIPtr) += -Ibpci_Vbpci;
*(ckt->CKTrhs + here->HICUMcollCINode) += rhs_current;
*(here->HICUMcollCIBaseBPPtr) += -Ibpci_Vbpci;
*(here->HICUMcollCICollCIPtr) += Ibpci_Vbpci;
@ -3123,21 +3117,32 @@ c Stamp element: Isici
/*
c Stamp element: Rcx
*/
*(here->HICUMcollTempPtr) += Icic_dT;
*(here->HICUMcollCItempPtr) += -Icic_dT;
rhs_current = -Icic_dT*Vrth;
*(ckt->CKTrhs + here->HICUMcollCINode) += -rhs_current;
*(here->HICUMcollCItempPtr) += Icic_dT;
*(ckt->CKTrhs + here->HICUMcollNode) += rhs_current;
*(here->HICUMcollTempPtr) += -Icic_dT;
/*
c Stamp element: Rbx
*/
rhs_current = -Ibbp_dT*Vrth;
*(ckt->CKTrhs + here->HICUMbaseNode) += -rhs_current;
*(here->HICUMbaseTempPtr) += Ibbp_dT;
*(ckt->CKTrhs + here->HICUMbaseBPNode) += rhs_current;
*(here->HICUMbaseBPtempPtr) += -Ibbp_dT;
/*
c Stamp element: Re
*/
*(here->HICUMemitTempPtr) += Ieie_dT;
*(here->HICUMemitEItempPtr) += -Ieie_dT;
rhs_current = -Ieie_dT*Vrth;
*(ckt->CKTrhs + here->HICUMemitEINode) += -rhs_current;
*(here->HICUMemitEItempPtr) += Ieie_dT;
*(ckt->CKTrhs + here->HICUMemitNode) += rhs_current;
*(here->HICUMemitTempPtr) += -Ieie_dT;
/*
c Stamp element: Rth
c Stamp element: Rth -> Non-linear component here as Rth=f(T)
*/
rhs_current = -Irth_dT*Vrth;
*(ckt->CKTrhs + here->HICUMtempNode) += -rhs_current;
*(here->HICUMtempTempPtr) += Irth_dT;
/*
c Stamp element: Cth

View File

@ -1,72 +1,76 @@
# 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
- 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
# 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:
# 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
## 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>
## Checking Stamps of Elements without Self-Heating
# Checking Stamps of Elements without Self-Heating
- General quesiton: rhs has opposite sign than expected?
- ijbei -> ok
- ijbep -> ok

View File

@ -4,9 +4,8 @@ VC Q1_C 0 0.0
VB Q1_B 0 0.0
RT Q1_T 0 1M
Q1 Q1_C Q1_B Q1_E Q1_E Q1_T P1 icVB=0.2 icVC=0.2 dt=0.0
* .DC VE -0.2 -1.2 -10m
.DC VE -0.2 -0.21 -10m
.OPTIONS GMIN=1e-13 NOACCT TEMP=20 TNOM=30
.DC VE -0.2 -1.2 -10m
* .DC VE -0.2 -0.21 -10m
.print dc abs(i(vc)) abs(i(vb))
@ -14,27 +13,25 @@ Q1 Q1_C Q1_B Q1_E Q1_E Q1_T P1 icVB=0.2 icVC=0.2 dt=0.0
.MODEL P1 NPN LEVEL=8
+ c10=1.0000000000e-15 flcomp=2.4 flsh=0.0 re=1
* + c10=9.074e-030 qp0=1.008e-013 hfe=10.01 hfc=20.04 hjei=3.382 hjci=0.2
* + ibeis=1.328e-019 mbei=1.027 ireis=1.5e-014 mrei=2 ibeps=1.26e-019 mbep=1.042
* + ireps=1.8e-014 mrep=1.8 mcf=1 tbhrec=1e-010 ibcis=4.603e-017 mbci=1.15
* + ibcxs=0 mbcx=1 ibets=0.02035 abet=24 tunode=1 favl=18.96 qavl=5.092e-014
* + alfav=-0.0024 alqav=-0.0006284 rbi0=4.444 rbx=2.568 fgeo=0.7409 fdqr0=0
* + fcrbi=0 fqi=1 re=1.511 rcx=2.483 itss=0 msf=1 iscs=0 msc=1
* + tsf=0 rsu=0 csu=0 cjei0=8.869e-015 vdei=0.714 zei=0.2489 ajei=1.65
* + cjep0=2.178e-015 vdep=0.8501 zep=0.2632 ajep=1.6 cjci0=3.58e-015 vdci=0.8201
* + zci=0.2857 vptci=1.79 cjcx0=6.299e-015 vdcx=0.8201 zcx=0.2863 vptcx=1.977
* + fbcpar=0.3 fbepar=1 cjs0=2.6e-014 vds=0.9997 zs=0.4295 vpts=100
* + t0=2.089e-013 dt0h=8e-014 tbvl=8.25e-014 tef0=3.271e-013 gtfe=3.548 thcs=5.001e-012
* + ahc=0.05 fthc=0.7 rci0=9.523 vlim=0.6999 vces=0.01 vpt=2 tr=0
* + cbepar=2.609e-014 cbcpar=1.64512e-014 alqf=0.166667 alit=0.333333 flnqs=0 kf=0
* + af=2 cfbe=-1 latb=0 latl=0 vgb=0.91 alt0=0.004 kt0=6.588e-005
* + zetaci=0.58 alvs=0.001 alces=-0.2286 zetarbi=0.3002 zetarbx=0.06011 zetarcx=-0.02768
* + zetare=-0.9605 zetacx=0 vge=1.17 vgc=1.17 vgs=1.17 f1vg=-0.000102377 f2vg=0.00043215
* + zetact=5 zetabet=4.892 flsh=0 rth=1113.4 cth=6.841e-012 zetarth=0
* + alrth=0.002 flcomp=2.4 tnom=26.85 acbar=1.5 flcono=0 icbar=0.01
* + vcbar=0.04 zetavgbe=0.7 hf0=40 ahjei=3 rhjei=2 delck=2 zetahjei=-0.5
+ c10=9.074e-030 qp0=1.008e-013 hfe=10.01 hfc=20.04 hjei=3.382 hjci=0.2
+ ibeis=1.328e-019 mbei=1.027 ireis=1.5e-014 mrei=2 ibeps=1.26e-019 mbep=1.042
+ ireps=1.8e-014 mrep=1.8 mcf=1 tbhrec=1e-010 ibcis=4.603e-017 mbci=1.15
+ ibcxs=0 mbcx=1 ibets=0.02035 abet=24 tunode=1 favl=18.96 qavl=5.092e-014
+ alfav=-0.0024 alqav=-0.0006284 rbi0=4.444 rbx=2.568 fgeo=0.7409 fdqr0=0
+ fcrbi=0 fqi=1 re=1.511 rcx=2.483 itss=0 msf=1 iscs=0 msc=1
+ tsf=0 rsu=0 csu=0 cjei0=8.869e-015 vdei=0.714 zei=0.2489 ajei=1.65
+ cjep0=2.178e-015 vdep=0.8501 zep=0.2632 ajep=1.6 cjci0=3.58e-015 vdci=0.8201
+ zci=0.2857 vptci=1.79 cjcx0=6.299e-015 vdcx=0.8201 zcx=0.2863 vptcx=1.977
+ fbcpar=0.3 fbepar=1 cjs0=2.6e-014 vds=0.9997 zs=0.4295 vpts=100
+ t0=2.089e-013 dt0h=8e-014 tbvl=8.25e-014 tef0=3.271e-013 gtfe=3.548 thcs=5.001e-012
+ ahc=0.05 fthc=0.7 rci0=9.523 vlim=0.6999 vces=0.01 vpt=2 tr=0
+ cbepar=2.609e-014 cbcpar=1.64512e-014 alqf=0.166667 alit=0.333333 flnqs=0 kf=0
+ af=2 cfbe=-1 latb=0 latl=0 vgb=0.91 alt0=0.004 kt0=6.588e-005
+ zetaci=0.58 alvs=0.001 alces=-0.2286 zetarbi=0.3002 zetarbx=0.06011 zetarcx=-0.02768
+ zetare=-0.9605 zetacx=0 vge=1.17 vgc=1.17 vgs=1.17 f1vg=-0.000102377 f2vg=0.00043215
+ zetact=5 zetabet=4.892 flsh=0 rth=1113.4 cth=6.841e-012 zetarth=0
+ alrth=0.002 flcomp=2.4 tnom=26.85 acbar=1.5 flcono=0 icbar=0.01
+ vcbar=0.04 zetavgbe=0.7 hf0=40 ahjei=3 rhjei=2 delck=2 zetahjei=-0.5
.END