something like that -.-
This commit is contained in:
parent
929e668836
commit
404e165e4a
|
|
@ -67,6 +67,8 @@ typedef struct sHICUMinstance {
|
||||||
int HICUMxfNode; /* number of internal excess phase node qdei */
|
int HICUMxfNode; /* number of internal excess phase node qdei */
|
||||||
int HICUMxf1Node; /* number of internal excess phase 1 node itf */
|
int HICUMxf1Node; /* number of internal excess phase 1 node itf */
|
||||||
int HICUMxf2Node; /* number of internal excess phase 2 node itf */
|
int HICUMxf2Node; /* number of internal excess phase 2 node itf */
|
||||||
|
int HICUMNoise1Node; /* number of internal noise 1 node for BiEi correlated noise */
|
||||||
|
int HICUMNoise2Node; /* number of internal noise 2 node for CiEi correlated noise */
|
||||||
|
|
||||||
double HICUMarea; /* area factor for the hicum */
|
double HICUMarea; /* area factor for the hicum */
|
||||||
//initial conditions
|
//initial conditions
|
||||||
|
|
@ -191,8 +193,8 @@ typedef struct sHICUMinstance {
|
||||||
* (emitter prime,xf) */
|
* (emitter prime,xf) */
|
||||||
double *HICUMbaseBIXfPtr; /* pointer to sparse matrix at
|
double *HICUMbaseBIXfPtr; /* pointer to sparse matrix at
|
||||||
* (base prime,xf) */
|
* (base prime,xf) */
|
||||||
|
|
||||||
|
|
||||||
double *HICUMsubsSISubsSIPtr; /* pointer to sparse matrix at
|
double *HICUMsubsSISubsSIPtr; /* pointer to sparse matrix at
|
||||||
* (substrate prime, substrate prime) */
|
* (substrate prime, substrate prime) */
|
||||||
|
|
||||||
|
|
@ -254,7 +256,7 @@ typedef struct sHICUMinstance {
|
||||||
* (emitter prime,base prime) */
|
* (emitter prime,base prime) */
|
||||||
double *HICUMsubsTempPtr; /* pointer to sparse matrix at
|
double *HICUMsubsTempPtr; /* pointer to sparse matrix at
|
||||||
* (subs ,T) */
|
* (subs ,T) */
|
||||||
|
|
||||||
|
|
||||||
double *HICUMcollCIBasePtr;
|
double *HICUMcollCIBasePtr;
|
||||||
double *HICUMbaseCollCIPtr;
|
double *HICUMbaseCollCIPtr;
|
||||||
|
|
@ -311,6 +313,10 @@ typedef struct sHICUMinstance {
|
||||||
double *HICUMtempSubsSIPtr;
|
double *HICUMtempSubsSIPtr;
|
||||||
double *HICUMtempTempPtr;
|
double *HICUMtempTempPtr;
|
||||||
|
|
||||||
|
/* correlated noise */
|
||||||
|
double *HICUMn1N1Ptr;
|
||||||
|
double *HICUMn2N2Ptr;
|
||||||
|
|
||||||
unsigned HICUMareaGiven :1; /* flag to indicate area was specified */
|
unsigned HICUMareaGiven :1; /* flag to indicate area was specified */
|
||||||
unsigned HICUMoff :1; /* 'off' flag for hicum */
|
unsigned HICUMoff :1; /* 'off' flag for hicum */
|
||||||
unsigned HICUMicVBEGiven :1; /* flag to indicate VBE init. cond. given */
|
unsigned HICUMicVBEGiven :1; /* flag to indicate VBE init. cond. given */
|
||||||
|
|
@ -383,150 +389,160 @@ typedef struct sHICUMinstance {
|
||||||
#define HICUMvxf HICUMstate+10
|
#define HICUMvxf HICUMstate+10
|
||||||
#define HICUMvxf1 HICUMstate+11
|
#define HICUMvxf1 HICUMstate+11
|
||||||
#define HICUMvxf2 HICUMstate+12
|
#define HICUMvxf2 HICUMstate+12
|
||||||
|
#define HICUMvn1 HICUMstate+13
|
||||||
|
#define HICUMvn2 HICUMstate+14
|
||||||
|
|
||||||
#define HICUMibiei HICUMstate+13
|
#define HICUMibiei HICUMstate+15
|
||||||
#define HICUMibiei_Vbiei HICUMstate+14
|
#define HICUMibiei_Vbiei HICUMstate+16
|
||||||
#define HICUMibiei_Vbici HICUMstate+15
|
#define HICUMibiei_Vbici HICUMstate+17
|
||||||
#define HICUMibiei_Vrth HICUMstate+16
|
#define HICUMibiei_Vrth HICUMstate+18
|
||||||
|
|
||||||
#define HICUMibpei HICUMstate+17
|
#define HICUMibpei HICUMstate+19
|
||||||
#define HICUMibpei_Vbpei HICUMstate+18
|
#define HICUMibpei_Vbpei HICUMstate+20
|
||||||
#define HICUMibpei_Vrth HICUMstate+19
|
#define HICUMibpei_Vrth HICUMstate+21
|
||||||
|
|
||||||
#define HICUMiciei HICUMstate+20
|
#define HICUMiciei HICUMstate+22
|
||||||
#define HICUMiciei_Vbiei HICUMstate+21
|
#define HICUMiciei_Vbiei HICUMstate+23
|
||||||
#define HICUMiciei_Vbici HICUMstate+22
|
#define HICUMiciei_Vbici HICUMstate+24
|
||||||
#define HICUMiciei_Vxf2 HICUMstate+23
|
#define HICUMiciei_Vxf2 HICUMstate+25
|
||||||
#define HICUMiciei_Vrth HICUMstate+24
|
#define HICUMiciei_Vrth HICUMstate+26
|
||||||
|
|
||||||
#define HICUMibici HICUMstate+25
|
#define HICUMibici HICUMstate+27
|
||||||
#define HICUMibici_Vbici HICUMstate+26
|
#define HICUMibici_Vbici HICUMstate+28
|
||||||
#define HICUMibici_Vbiei HICUMstate+27
|
#define HICUMibici_Vbiei HICUMstate+29
|
||||||
#define HICUMibici_Vrth HICUMstate+28
|
#define HICUMibici_Vrth HICUMstate+30
|
||||||
|
|
||||||
#define HICUMibpbi HICUMstate+29
|
#define HICUMibpbi HICUMstate+31
|
||||||
#define HICUMibpbi_Vbpbi HICUMstate+30
|
#define HICUMibpbi_Vbpbi HICUMstate+32
|
||||||
#define HICUMibpbi_Vbiei HICUMstate+31
|
#define HICUMibpbi_Vbiei HICUMstate+33
|
||||||
#define HICUMibpbi_Vbici HICUMstate+32
|
#define HICUMibpbi_Vbici HICUMstate+34
|
||||||
#define HICUMibpbi_Vrth HICUMstate+33
|
#define HICUMibpbi_Vrth HICUMstate+35
|
||||||
|
|
||||||
#define HICUMibpci HICUMstate+34
|
#define HICUMibpci HICUMstate+36
|
||||||
#define HICUMibpci_Vbpci HICUMstate+35
|
#define HICUMibpci_Vbpci HICUMstate+37
|
||||||
#define HICUMibpci_Vrth HICUMstate+36
|
#define HICUMibpci_Vrth HICUMstate+38
|
||||||
|
|
||||||
#define HICUMisici HICUMstate+37
|
#define HICUMisici HICUMstate+39
|
||||||
#define HICUMisici_Vsici HICUMstate+38
|
#define HICUMisici_Vsici HICUMstate+40
|
||||||
#define HICUMisici_Vrth HICUMstate+39
|
#define HICUMisici_Vrth HICUMstate+41
|
||||||
|
|
||||||
#define HICUMibpsi HICUMstate+40
|
#define HICUMibpsi HICUMstate+42
|
||||||
#define HICUMibpsi_Vbpci HICUMstate+41
|
#define HICUMibpsi_Vbpci HICUMstate+43
|
||||||
#define HICUMibpsi_Vsici HICUMstate+42
|
#define HICUMibpsi_Vsici HICUMstate+44
|
||||||
#define HICUMibpsi_Vrth HICUMstate+43
|
#define HICUMibpsi_Vrth HICUMstate+45
|
||||||
|
|
||||||
#define HICUMisis_Vsis HICUMstate+44
|
#define HICUMisis_Vsis HICUMstate+46
|
||||||
|
|
||||||
#define HICUMieie HICUMstate+45 // needed for re-flicker noise
|
#define HICUMieie HICUMstate+47 // needed for re-flicker noise
|
||||||
#define HICUMieie_Vrth HICUMstate+46
|
#define HICUMieie_Vrth HICUMstate+48
|
||||||
|
|
||||||
#define HICUMqrbi HICUMstate+47
|
#define HICUMqrbi HICUMstate+49
|
||||||
#define HICUMcqrbi HICUMstate+48
|
#define HICUMcqrbi HICUMstate+50
|
||||||
|
|
||||||
#define HICUMqjei HICUMstate+49
|
#define HICUMqjei HICUMstate+51
|
||||||
#define HICUMcqjei HICUMstate+50
|
#define HICUMcqjei HICUMstate+52
|
||||||
|
|
||||||
#define HICUMqf HICUMstate+51
|
#define HICUMqf HICUMstate+53
|
||||||
#define HICUMcqf HICUMstate+52
|
#define HICUMcqf HICUMstate+54
|
||||||
|
|
||||||
#define HICUMqr HICUMstate+53
|
#define HICUMqr HICUMstate+55
|
||||||
#define HICUMcqr HICUMstate+54
|
#define HICUMcqr HICUMstate+56
|
||||||
|
|
||||||
#define HICUMqjci HICUMstate+55
|
#define HICUMqjci HICUMstate+57
|
||||||
#define HICUMcqjci HICUMstate+56
|
#define HICUMcqjci HICUMstate+58
|
||||||
|
|
||||||
#define HICUMqjep HICUMstate+57
|
#define HICUMqjep HICUMstate+59
|
||||||
#define HICUMcqjep HICUMstate+58
|
#define HICUMcqjep HICUMstate+60
|
||||||
|
|
||||||
#define HICUMqjcx0_i HICUMstate+59
|
#define HICUMqjcx0_i HICUMstate+61
|
||||||
#define HICUMcqcx0_t_i HICUMstate+60
|
#define HICUMcqcx0_t_i HICUMstate+62
|
||||||
|
|
||||||
#define HICUMqjcx0_ii HICUMstate+61
|
#define HICUMqjcx0_ii HICUMstate+63
|
||||||
#define HICUMcqcx0_t_ii HICUMstate+62
|
#define HICUMcqcx0_t_ii HICUMstate+64
|
||||||
|
|
||||||
#define HICUMqdsu HICUMstate+63
|
#define HICUMqdsu HICUMstate+65
|
||||||
#define HICUMcqdsu HICUMstate+64
|
#define HICUMcqdsu HICUMstate+66
|
||||||
|
|
||||||
#define HICUMqjs HICUMstate+65
|
#define HICUMqjs HICUMstate+67
|
||||||
#define HICUMcqjs HICUMstate+66
|
#define HICUMcqjs HICUMstate+68
|
||||||
|
|
||||||
#define HICUMqscp HICUMstate+67
|
#define HICUMqscp HICUMstate+69
|
||||||
#define HICUMcqscp HICUMstate+68
|
#define HICUMcqscp HICUMstate+70
|
||||||
|
|
||||||
#define HICUMqbepar1 HICUMstate+69
|
#define HICUMqbepar1 HICUMstate+71
|
||||||
#define HICUMcqbepar1 HICUMstate+70
|
#define HICUMcqbepar1 HICUMstate+72
|
||||||
#define HICUMgqbepar1 HICUMstate+71
|
#define HICUMgqbepar1 HICUMstate+73
|
||||||
|
|
||||||
#define HICUMqbepar2 HICUMstate+72
|
#define HICUMqbepar2 HICUMstate+74
|
||||||
#define HICUMcqbepar2 HICUMstate+73
|
#define HICUMcqbepar2 HICUMstate+75
|
||||||
#define HICUMgqbepar2 HICUMstate+74
|
#define HICUMgqbepar2 HICUMstate+76
|
||||||
|
|
||||||
#define HICUMqbcpar1 HICUMstate+75
|
#define HICUMqbcpar1 HICUMstate+77
|
||||||
#define HICUMcqbcpar1 HICUMstate+76
|
#define HICUMcqbcpar1 HICUMstate+78
|
||||||
#define HICUMgqbcpar1 HICUMstate+77
|
#define HICUMgqbcpar1 HICUMstate+79
|
||||||
|
|
||||||
#define HICUMqbcpar2 HICUMstate+78
|
#define HICUMqbcpar2 HICUMstate+80
|
||||||
#define HICUMcqbcpar2 HICUMstate+79
|
#define HICUMcqbcpar2 HICUMstate+81
|
||||||
#define HICUMgqbcpar2 HICUMstate+80
|
#define HICUMgqbcpar2 HICUMstate+82
|
||||||
|
|
||||||
#define HICUMqsu HICUMstate+81
|
#define HICUMqsu HICUMstate+83
|
||||||
#define HICUMcqsu HICUMstate+82
|
#define HICUMcqsu HICUMstate+84
|
||||||
#define HICUMgqsu HICUMstate+83
|
#define HICUMgqsu HICUMstate+85
|
||||||
|
|
||||||
#define HICUMqcth HICUMstate+84
|
#define HICUMqcth HICUMstate+86
|
||||||
#define HICUMcqcth HICUMstate+85
|
#define HICUMcqcth HICUMstate+87
|
||||||
|
|
||||||
#define HICUMqxf HICUMstate+86
|
#define HICUMqxf HICUMstate+88
|
||||||
#define HICUMcqxf HICUMstate+87
|
#define HICUMcqxf HICUMstate+89
|
||||||
#define HICUMgqxf HICUMstate+88
|
#define HICUMgqxf HICUMstate+90
|
||||||
#define HICUMixf HICUMstate+89
|
#define HICUMixf HICUMstate+91
|
||||||
#define HICUMixf_Vbiei HICUMstate+90
|
#define HICUMixf_Vbiei HICUMstate+92
|
||||||
#define HICUMixf_Vbici HICUMstate+91
|
#define HICUMixf_Vbici HICUMstate+93
|
||||||
#define HICUMixf_Vxf HICUMstate+92
|
#define HICUMixf_Vxf HICUMstate+94
|
||||||
#define HICUMixf_Vrth HICUMstate+93
|
#define HICUMixf_Vrth HICUMstate+95
|
||||||
|
|
||||||
#define HICUMqxf1 HICUMstate+94
|
#define HICUMqxf1 HICUMstate+96
|
||||||
#define HICUMcqxf1 HICUMstate+95
|
#define HICUMcqxf1 HICUMstate+97
|
||||||
#define HICUMgqxf1 HICUMstate+96
|
#define HICUMgqxf1 HICUMstate+98
|
||||||
#define HICUMixf1 HICUMstate+97
|
#define HICUMixf1 HICUMstate+99
|
||||||
#define HICUMixf1_Vbiei HICUMstate+98
|
#define HICUMixf1_Vbiei HICUMstate+100
|
||||||
#define HICUMixf1_Vbici HICUMstate+99
|
#define HICUMixf1_Vbici HICUMstate+101
|
||||||
#define HICUMixf1_Vxf2 HICUMstate+100
|
#define HICUMixf1_Vxf2 HICUMstate+102
|
||||||
#define HICUMixf1_Vxf1 HICUMstate+101
|
#define HICUMixf1_Vxf1 HICUMstate+103
|
||||||
#define HICUMixf1_Vrth HICUMstate+102
|
#define HICUMixf1_Vrth HICUMstate+104
|
||||||
|
|
||||||
#define HICUMqxf2 HICUMstate+103
|
#define HICUMqxf2 HICUMstate+105
|
||||||
#define HICUMcqxf2 HICUMstate+104
|
#define HICUMcqxf2 HICUMstate+106
|
||||||
#define HICUMgqxf2 HICUMstate+105
|
#define HICUMgqxf2 HICUMstate+107
|
||||||
#define HICUMixf2 HICUMstate+106
|
#define HICUMixf2 HICUMstate+108
|
||||||
#define HICUMixf2_Vbiei HICUMstate+108
|
#define HICUMixf2_Vbiei HICUMstate+109
|
||||||
#define HICUMixf2_Vbici HICUMstate+109
|
#define HICUMixf2_Vbici HICUMstate+110
|
||||||
#define HICUMixf2_Vxf1 HICUMstate+110
|
#define HICUMixf2_Vxf1 HICUMstate+111
|
||||||
#define HICUMixf2_Vxf2 HICUMstate+111
|
#define HICUMixf2_Vxf2 HICUMstate+112
|
||||||
#define HICUMixf2_Vrth HICUMstate+112
|
#define HICUMixf2_Vrth HICUMstate+113
|
||||||
|
|
||||||
#define HICUMith HICUMstate+113
|
#define HICUMith HICUMstate+114
|
||||||
#define HICUMith_Vrth HICUMstate+114
|
#define HICUMith_Vrth HICUMstate+115
|
||||||
#define HICUMith_Vbiei HICUMstate+115
|
#define HICUMith_Vbiei HICUMstate+116
|
||||||
#define HICUMith_Vbici HICUMstate+116
|
#define HICUMith_Vbici HICUMstate+117
|
||||||
#define HICUMith_Vbpbi HICUMstate+117
|
#define HICUMith_Vbpbi HICUMstate+118
|
||||||
#define HICUMith_Vbpci HICUMstate+118
|
#define HICUMith_Vbpci HICUMstate+119
|
||||||
#define HICUMith_Vbpei HICUMstate+119
|
#define HICUMith_Vbpei HICUMstate+120
|
||||||
#define HICUMith_Vciei HICUMstate+120
|
#define HICUMith_Vciei HICUMstate+121
|
||||||
#define HICUMith_Vsici HICUMstate+121
|
#define HICUMith_Vsici HICUMstate+122
|
||||||
#define HICUMith_Vcic HICUMstate+122
|
#define HICUMith_Vcic HICUMstate+123
|
||||||
#define HICUMith_Vbbp HICUMstate+123
|
#define HICUMith_Vbbp HICUMstate+124
|
||||||
#define HICUMith_Veie HICUMstate+124
|
#define HICUMith_Veie HICUMstate+125
|
||||||
|
|
||||||
#define HICUMnumStates 125
|
#define HICUMqn1 HICUMstate+126
|
||||||
|
#define HICUMcqn1 HICUMstate+127
|
||||||
|
#define HICUMgqn1 HICUMstate+128
|
||||||
|
|
||||||
|
#define HICUMqn2 HICUMstate+129
|
||||||
|
#define HICUMcqn2 HICUMstate+130
|
||||||
|
#define HICUMgqn2 HICUMstate+131
|
||||||
|
|
||||||
|
#define HICUMnumStates 132
|
||||||
|
|
||||||
/* per model data */
|
/* per model data */
|
||||||
typedef struct sHICUMmodel { /* model structure for a hicum */
|
typedef struct sHICUMmodel { /* model structure for a hicum */
|
||||||
|
|
|
||||||
|
|
@ -169,33 +169,16 @@ HICUMnoise (int mode, int operation, GENmodel *genmodel, CKTcircuit *ckt, Ndata
|
||||||
*(ckt->CKTstate0 + here->HICUMisici));
|
*(ckt->CKTstate0 + here->HICUMisici));
|
||||||
|
|
||||||
//todo: iciei contains it, has to be separated for non-correlated noise
|
//todo: iciei contains it, has to be separated for non-correlated noise
|
||||||
if ( model->HICUMflcono == 1 && (model->HICUMalit > 0 && model->HICUMalqf > 0)) {
|
if (model->HICUMflcono == 1 && (model->HICUMalit > 0 && model->HICUMalqf > 0)) {
|
||||||
// parameter definition
|
// in case of correlated noise, the noise is added to two new branches and then added to biei and ciei in the DC/AC load
|
||||||
int n_w = 1;
|
NevalSrc(&noizDens[HICUMIBEINOIZ],&lnNdens[HICUMIBEINOIZ],
|
||||||
float n_1 = here->HICUMtf*model->HICUMalit;
|
ckt,SHOTNOISE,here->HICUMNoise1Node, 0,
|
||||||
IFvalue betadc;
|
*(ckt->CKTstate0 + here->HICUMibiei));
|
||||||
HICUMask(ckt, here, HICUM_QUEST_BETADC, &betadc, select);
|
NevalSrc(&noizDens[HICUMITNOIZ],&lnNdens[HICUMITNOIZ],
|
||||||
float sqrt_n2 = betadc.rValue * (2*model->HICUMalqf-model->HICUMalit*model->HICUMalit);
|
ckt,SHOTNOISE,here->HICUMNoise2Node, 0,
|
||||||
float n_2 = 0;
|
*(ckt->CKTstate0 + here->HICUMiciei));
|
||||||
|
|
||||||
if (sqrt_n2 > 0.0) {
|
|
||||||
n_2 = here->HICUMtf*sqrt(sqrt_n2);
|
|
||||||
}
|
|
||||||
|
|
||||||
// realization of modified base shot noise source I1(bi,ei)
|
|
||||||
I(b_n1) <+ white_noise(2*`P_Q*abs(ibei),"ibei");
|
|
||||||
I(b_n1) <+ -V(b_n1);
|
|
||||||
I(bi,ei) <+ V(b_n1)+n_2/n_w*ddt(n_w*V(b_n1));
|
|
||||||
|
|
||||||
// realization of controlled base noise source I2(bi,ei)
|
|
||||||
I(bi,ei) <+ n_1/n_w*ddt(n_w*V(b_n2));
|
|
||||||
|
|
||||||
// realization of modified collector shot noise source I(ci,ei) (uncontrolled)
|
|
||||||
I(b_n2) <+ white_noise(2*`P_Q*abs(it),"it");
|
|
||||||
I(b_n2) <+ -V(b_n2);
|
|
||||||
I(ci,ei) <+ V(b_n2);
|
|
||||||
|
|
||||||
// end "Correlated noise in BJT"
|
|
||||||
} else {
|
} else {
|
||||||
NevalSrc(&noizDens[HICUMITNOIZ],&lnNdens[HICUMITNOIZ],
|
NevalSrc(&noizDens[HICUMITNOIZ],&lnNdens[HICUMITNOIZ],
|
||||||
ckt,SHOTNOISE,here->HICUMcollCINode,here->HICUMemitEINode,
|
ckt,SHOTNOISE,here->HICUMcollCINode,here->HICUMemitEINode,
|
||||||
|
|
|
||||||
|
|
@ -450,7 +450,7 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
double Ibpbi, Ibpbi_Vbpbi, Ibpbi_Vbici, Ibpbi_Vbiei;
|
double Ibpbi, Ibpbi_Vbpbi, Ibpbi_Vbici, Ibpbi_Vbiei;
|
||||||
double Ibpsi, Ibpsi_Vbpci, Ibpsi_Vsici, Ibpsi_Vrth;
|
double Ibpsi, Ibpsi_Vbpci, Ibpsi_Vsici, Ibpsi_Vrth;
|
||||||
double Icic_Vcic=0.0;
|
double Icic_Vcic=0.0;
|
||||||
double Ibci=0.0, Ibci_Vbci=0.0;
|
double Ibci=0.0, Ibci_Vbci=0.0;
|
||||||
double hjei_vbe_Vbiei, hjei_vbe_dT, ibet_Vbpei, ibet_dT, ibet_Vbiei, ibh_rec_Vbiei, ibh_rec_dT, ibh_rec_Vbici;
|
double hjei_vbe_Vbiei, hjei_vbe_dT, ibet_Vbpei, ibet_dT, ibet_Vbiei, ibh_rec_Vbiei, ibh_rec_dT, ibh_rec_Vbici;
|
||||||
double irei_Vbiei, irei_dT;
|
double irei_Vbiei, irei_dT;
|
||||||
double ibep_Vbpei, ibep_dT;
|
double ibep_Vbpei, ibep_dT;
|
||||||
|
|
@ -464,7 +464,7 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
//below variable has a real part equal to the device temperature and a dual part equal to dTdev/dVrth
|
//below variable has a real part equal to the device temperature and a dual part equal to dTdev/dVrth
|
||||||
//this is necessary, since for some Vrth, HICUM sets Tdev constant (eg very high self heating beyond 300K)
|
//this is necessary, since for some Vrth, HICUM sets Tdev constant (eg very high self heating beyond 300K)
|
||||||
//then, dTdev/dVrth. Else it is equal to 1.
|
//then, dTdev/dVrth. Else it is equal to 1.
|
||||||
duals::duald Temp_dual;
|
duals::duald Temp_dual;
|
||||||
|
|
||||||
double Cjei_Vbiei,Cjci_Vbici,Cjep_Vbpei,Cjep_dT,Cjs_Vsici;
|
double Cjei_Vbiei,Cjci_Vbici,Cjep_Vbpei,Cjep_dT,Cjs_Vsici;
|
||||||
double Cjei_dT, Cjci_dT;
|
double Cjei_dT, Cjci_dT;
|
||||||
|
|
@ -1119,6 +1119,7 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
// Model_initialization
|
// Model_initialization
|
||||||
int selfheat = ((model->HICUMflsh > 0) && (model->HICUMrthGiven) && (model->HICUMrth > 0.0));
|
int selfheat = ((model->HICUMflsh > 0) && (model->HICUMrthGiven) && (model->HICUMrth > 0.0));
|
||||||
int nqs = ((model->HICUMflnqs != 0 || model->HICUMflcomp < 2.3) && (model->HICUMalit > 0 || model->HICUMalqf > 0));
|
int nqs = ((model->HICUMflnqs != 0 || model->HICUMflcomp < 2.3) && (model->HICUMalit > 0 || model->HICUMalqf > 0));
|
||||||
|
int correlated_noise = (model->HICUMflcono == 1 && (model->HICUMalit > 0 && model->HICUMalqf > 0));
|
||||||
|
|
||||||
// Avoid divide-by-zero and define infinity other way
|
// Avoid divide-by-zero and define infinity other way
|
||||||
// High current correction for 2D and 3D effects
|
// High current correction for 2D and 3D effects
|
||||||
|
|
@ -1589,17 +1590,17 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
*(ckt->CKTstate0 + here->HICUMibpsi_Vrth)*delvrth +
|
*(ckt->CKTstate0 + here->HICUMibpsi_Vrth)*delvrth +
|
||||||
*(ckt->CKTstate0 + here->HICUMibpsi_Vsici)*delvsici;
|
*(ckt->CKTstate0 + here->HICUMibpsi_Vsici)*delvsici;
|
||||||
ithhat = *(ckt->CKTstate0 + here->HICUMith) +
|
ithhat = *(ckt->CKTstate0 + here->HICUMith) +
|
||||||
*(ckt->CKTstate0 + here->HICUMith_Vbiei)*delvbiei+
|
*(ckt->CKTstate0 + here->HICUMith_Vbiei)*delvbiei+
|
||||||
*(ckt->CKTstate0 + here->HICUMith_Vbici)*delvbici+
|
*(ckt->CKTstate0 + here->HICUMith_Vbici)*delvbici+
|
||||||
*(ckt->CKTstate0 + here->HICUMith_Vbpbi)*delvbpbi+
|
*(ckt->CKTstate0 + here->HICUMith_Vbpbi)*delvbpbi+
|
||||||
*(ckt->CKTstate0 + here->HICUMith_Vbpci)*delvbpci+
|
*(ckt->CKTstate0 + here->HICUMith_Vbpci)*delvbpci+
|
||||||
*(ckt->CKTstate0 + here->HICUMith_Vbpei)*delvbpei+
|
*(ckt->CKTstate0 + here->HICUMith_Vbpei)*delvbpei+
|
||||||
*(ckt->CKTstate0 + here->HICUMith_Vciei)*delvciei+
|
*(ckt->CKTstate0 + here->HICUMith_Vciei)*delvciei+
|
||||||
*(ckt->CKTstate0 + here->HICUMith_Vsici)*delvsici+
|
*(ckt->CKTstate0 + here->HICUMith_Vsici)*delvsici+
|
||||||
*(ckt->CKTstate0 + here->HICUMith_Vcic)*delvcic+
|
*(ckt->CKTstate0 + here->HICUMith_Vcic)*delvcic+
|
||||||
*(ckt->CKTstate0 + here->HICUMith_Vbbp)*delvbbp+
|
*(ckt->CKTstate0 + here->HICUMith_Vbbp)*delvbbp+
|
||||||
*(ckt->CKTstate0 + here->HICUMith_Veie)*delveie+
|
*(ckt->CKTstate0 + here->HICUMith_Veie)*delveie+
|
||||||
*(ckt->CKTstate0 + here->HICUMith_Vrth)*delvrth;
|
*(ckt->CKTstate0 + here->HICUMith_Vrth)*delvrth;
|
||||||
/*
|
/*
|
||||||
* bypass if solution has not changed
|
* bypass if solution has not changed
|
||||||
*/
|
*/
|
||||||
|
|
@ -2019,7 +2020,7 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
iavl_Vbiei = result.dpart();
|
iavl_Vbiei = result.dpart();
|
||||||
|
|
||||||
result = calc_iavl(Vbici , Cjci+1_e*Cjci_dT , itf+1_e*itf_dT , Temp_dual);
|
result = calc_iavl(Vbici , Cjci+1_e*Cjci_dT , itf+1_e*itf_dT , Temp_dual);
|
||||||
iavl_dT = result.dpart();
|
iavl_dT = result.dpart();
|
||||||
|
|
||||||
here->HICUMiavl = iavl;
|
here->HICUMiavl = iavl;
|
||||||
|
|
||||||
|
|
@ -2315,8 +2316,8 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
Ibpci_Vrth = model->HICUMtype*ijbcx_dT;
|
Ibpci_Vrth = model->HICUMtype*ijbcx_dT;
|
||||||
|
|
||||||
Ibici = model->HICUMtype*(ibci - iavl);
|
Ibici = model->HICUMtype*(ibci - iavl);
|
||||||
Ibici_Vbici = model->HICUMtype*(ibci_Vbici - iavl_Vbici);
|
Ibici_Vbici = model->HICUMtype*(ibci_Vbici - iavl_Vbici);
|
||||||
Ibici_Vbiei = model->HICUMtype*( - iavl_Vbiei);
|
Ibici_Vbiei = model->HICUMtype*( - iavl_Vbiei);
|
||||||
Ibici_Vrth = model->HICUMtype*(ibci_dT - iavl_dT);
|
Ibici_Vrth = model->HICUMtype*(ibci_dT - iavl_dT);
|
||||||
|
|
||||||
Isici = model->HICUMtype*ijsc;
|
Isici = model->HICUMtype*ijsc;
|
||||||
|
|
@ -2332,7 +2333,7 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
if (rbi > 0.0) {
|
if (rbi > 0.0) {
|
||||||
Ibpbi = Vbpbi / rbi;
|
Ibpbi = Vbpbi / rbi;
|
||||||
Ibpbi_Vbpbi = 1 / rbi;
|
Ibpbi_Vbpbi = 1 / rbi;
|
||||||
Ibpbi_Vbiei = -Vbpbi * rbi_Vbiei / (rbi*rbi);
|
Ibpbi_Vbiei = -Vbpbi * rbi_Vbiei / (rbi*rbi);
|
||||||
Ibpbi_Vbici = -Vbpbi * rbi_Vbici / (rbi*rbi);
|
Ibpbi_Vbici = -Vbpbi * rbi_Vbici / (rbi*rbi);
|
||||||
Ibpbi_Vrth = -Vbpbi * rbi_dT / (rbi*rbi);
|
Ibpbi_Vrth = -Vbpbi * rbi_dT / (rbi*rbi);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -2368,19 +2369,19 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
|
|
||||||
Ith_Vrth = pterm_dT;
|
Ith_Vrth = pterm_dT;
|
||||||
Ith_Vrth += -1/here->HICUMrth_t.rpart;
|
Ith_Vrth += -1/here->HICUMrth_t.rpart;
|
||||||
Ith_Vrth += +Vrth/(here->HICUMrth_t.rpart*here->HICUMrth_t.rpart) * here->HICUMrth_t.dpart;
|
Ith_Vrth += +Vrth/(here->HICUMrth_t.rpart*here->HICUMrth_t.rpart) * here->HICUMrth_t.dpart;
|
||||||
if (model->HICUMflsh == 1) {
|
if (model->HICUMflsh == 1) {
|
||||||
//it(Vbiei,Vbici)*(Vbiei-Vbici)
|
//it(Vbiei,Vbici)*(Vbiei-Vbici)
|
||||||
Ith_Vbiei += it_Vbiei*(Vbiei-Vbici) + it;
|
Ith_Vbiei += it_Vbiei*(Vbiei-Vbici) + it;
|
||||||
Ith_Vbici += it_Vbici*(Vbiei-Vbici) - it;
|
Ith_Vbici += it_Vbici*(Vbiei-Vbici) - it;
|
||||||
//avalanche current
|
//avalanche current
|
||||||
//(here->HICUMvdci_t.rpart-Vbici)*iavl = vdci_t*iavl - Vbici*iavl
|
//(here->HICUMvdci_t.rpart-Vbici)*iavl = vdci_t*iavl - Vbici*iavl
|
||||||
Ith_Vbici += (here->HICUMvdci_t.rpart-Vbici)*iavl_Vbici - iavl;
|
Ith_Vbici += (here->HICUMvdci_t.rpart-Vbici)*iavl_Vbici - iavl;
|
||||||
Ith_Vbiei += (here->HICUMvdci_t.rpart-Vbici)*iavl_Vbiei;
|
Ith_Vbiei += (here->HICUMvdci_t.rpart-Vbici)*iavl_Vbiei;
|
||||||
} else if (model->HICUMflsh == 2) {
|
} else if (model->HICUMflsh == 2) {
|
||||||
//remember:
|
//remember:
|
||||||
//pterm = (Vbiei-Vbici)*it + (here->HICUMvdci_t.rpart-Vbici)*iavl + ibei*Vbiei + ibci*Vbici + ibep*Vbpei + ijbcx*Vbpci + ijsc*Vsici;
|
//pterm = (Vbiei-Vbici)*it + (here->HICUMvdci_t.rpart-Vbici)*iavl + ibei*Vbiei + ibci*Vbici + ibep*Vbpei + ijbcx*Vbpci + ijsc*Vsici;
|
||||||
//it(Vbiei,Vbici)*(Vbiei-Vbici)
|
//it(Vbiei,Vbici)*(Vbiei-Vbici)
|
||||||
Ith_Vbiei += it_Vbiei*(Vbiei-Vbici) + it;
|
Ith_Vbiei += it_Vbiei*(Vbiei-Vbici) + it;
|
||||||
Ith_Vbici += it_Vbici*(Vbiei-Vbici) - it;
|
Ith_Vbici += it_Vbici*(Vbiei-Vbici) - it;
|
||||||
//Vbiei*Ibiei(Vbiei)
|
//Vbiei*Ibiei(Vbiei)
|
||||||
|
|
@ -2583,10 +2584,10 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
//transient analysis
|
//transient analysis
|
||||||
if(ckt->CKTmode & MODEINITTRAN) {
|
if(ckt->CKTmode & MODEINITTRAN) {
|
||||||
//copy charges to CKTstate1
|
//copy charges to CKTstate1
|
||||||
*(ckt->CKTstate1 + here->HICUMqrbi) =
|
*(ckt->CKTstate1 + here->HICUMqrbi) =
|
||||||
*(ckt->CKTstate0 + here->HICUMqrbi) ;
|
*(ckt->CKTstate0 + here->HICUMqrbi) ;
|
||||||
*(ckt->CKTstate1 + here->HICUMqjei) =
|
*(ckt->CKTstate1 + here->HICUMqjei) =
|
||||||
*(ckt->CKTstate0 + here->HICUMqjei) ;
|
*(ckt->CKTstate0 + here->HICUMqjei) ;
|
||||||
*(ckt->CKTstate1 + here->HICUMqf) =
|
*(ckt->CKTstate1 + here->HICUMqf) =
|
||||||
*(ckt->CKTstate0 + here->HICUMqf) ;
|
*(ckt->CKTstate0 + here->HICUMqf) ;
|
||||||
*(ckt->CKTstate1 + here->HICUMqr) =
|
*(ckt->CKTstate1 + here->HICUMqr) =
|
||||||
|
|
@ -2714,10 +2715,10 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
|
|
||||||
if(ckt->CKTmode & MODEINITTRAN) {
|
if(ckt->CKTmode & MODEINITTRAN) {
|
||||||
//copy from state1 to state0
|
//copy from state1 to state0
|
||||||
*(ckt->CKTstate1 + here->HICUMcqrbi) =
|
*(ckt->CKTstate1 + here->HICUMcqrbi) =
|
||||||
*(ckt->CKTstate0 + here->HICUMcqrbi) ;
|
*(ckt->CKTstate0 + here->HICUMcqrbi) ;
|
||||||
*(ckt->CKTstate1 + here->HICUMcqjei) =
|
*(ckt->CKTstate1 + here->HICUMcqjei) =
|
||||||
*(ckt->CKTstate0 + here->HICUMcqjei) ;
|
*(ckt->CKTstate0 + here->HICUMcqjei) ;
|
||||||
*(ckt->CKTstate1 + here->HICUMcqf) =
|
*(ckt->CKTstate1 + here->HICUMcqf) =
|
||||||
*(ckt->CKTstate0 + here->HICUMcqf) ;
|
*(ckt->CKTstate0 + here->HICUMcqf) ;
|
||||||
*(ckt->CKTstate1 + here->HICUMcqr) =
|
*(ckt->CKTstate1 + here->HICUMcqr) =
|
||||||
|
|
@ -2760,7 +2761,7 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* charge storage for electrostatic caps
|
* charge storage for electrostatic caps
|
||||||
*/
|
*/
|
||||||
if(ckt->CKTmode & (MODETRAN | MODEAC)) {
|
if(ckt->CKTmode & (MODETRAN | MODEAC)) {
|
||||||
// Ibe += ddt(cbepar1*Vbe);
|
// Ibe += ddt(cbepar1*Vbe);
|
||||||
|
|
@ -2897,11 +2898,11 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
load:
|
load:
|
||||||
// #############################################################
|
// #############################################################
|
||||||
// ############### STAMPS NO SH ##############################
|
// ############### STAMPS NO SH ##############################
|
||||||
// #############################################################
|
// #############################################################
|
||||||
|
|
||||||
// first branches that are not relevant in DC HICUM, e.g. only in the transient case
|
// first branches that are not relevant in DC HICUM, e.g. only in the transient case
|
||||||
|
|
||||||
// Branch: sc, Stamp element: Cscp
|
// Branch: sc, Stamp element: Cscp
|
||||||
rhs_current = model->HICUMtype * (Isc - Isc_Vsc*Vsc);
|
rhs_current = model->HICUMtype * (Isc - Isc_Vsc*Vsc);
|
||||||
*(ckt->CKTrhs + here->HICUMsubsNode) += -rhs_current;
|
*(ckt->CKTrhs + here->HICUMsubsNode) += -rhs_current;
|
||||||
*(ckt->CKTrhs + here->HICUMcollNode) += rhs_current;
|
*(ckt->CKTrhs + here->HICUMcollNode) += rhs_current;
|
||||||
|
|
@ -2923,7 +2924,7 @@ load:
|
||||||
*(here->HICUMcollCIBasePtr) += -Ibci_Vbci;
|
*(here->HICUMcollCIBasePtr) += -Ibci_Vbci;
|
||||||
// finish
|
// finish
|
||||||
|
|
||||||
// Branch: be, Stamp element: Cbepar1
|
// Branch: be, Stamp element: Cbepar1
|
||||||
rhs_current = model->HICUMtype * (*(ckt->CKTstate0 + here->HICUMcqbepar1) - Vbe * gqbepar1);
|
rhs_current = model->HICUMtype * (*(ckt->CKTstate0 + here->HICUMcqbepar1) - Vbe * gqbepar1);
|
||||||
*(ckt->CKTrhs + here->HICUMbaseNode) += -rhs_current;
|
*(ckt->CKTrhs + here->HICUMbaseNode) += -rhs_current;
|
||||||
*(ckt->CKTrhs + here->HICUMemitNode) += rhs_current;
|
*(ckt->CKTrhs + here->HICUMemitNode) += rhs_current;
|
||||||
|
|
@ -2934,7 +2935,7 @@ load:
|
||||||
*(here->HICUMemitBasePtr) += -gqbepar1;
|
*(here->HICUMemitBasePtr) += -gqbepar1;
|
||||||
// finish
|
// finish
|
||||||
|
|
||||||
// Branch: bpe, Stamp element: Cbepar2
|
// Branch: bpe, Stamp element: Cbepar2
|
||||||
rhs_current = model->HICUMtype * (*(ckt->CKTstate0 + here->HICUMcqbepar2) - Vbpe * gqbepar2);
|
rhs_current = model->HICUMtype * (*(ckt->CKTstate0 + here->HICUMcqbepar2) - Vbpe * gqbepar2);
|
||||||
*(ckt->CKTrhs + here->HICUMbaseBPNode) += -rhs_current;
|
*(ckt->CKTrhs + here->HICUMbaseBPNode) += -rhs_current;
|
||||||
*(ckt->CKTrhs + here->HICUMemitNode) += rhs_current;
|
*(ckt->CKTrhs + here->HICUMemitNode) += rhs_current;
|
||||||
|
|
@ -3032,7 +3033,7 @@ load:
|
||||||
*(here->HICUMcollCIEmitEIPtr) += -Iciei_Vbiei;
|
*(here->HICUMcollCIEmitEIPtr) += -Iciei_Vbiei;
|
||||||
*(here->HICUMemitEIBaseBIPtr) += -Iciei_Vbiei;
|
*(here->HICUMemitEIBaseBIPtr) += -Iciei_Vbiei;
|
||||||
// with respect to Vbici
|
// with respect to Vbici
|
||||||
*(here->HICUMcollCIBaseBIPtr) += Iciei_Vbici;
|
*(here->HICUMcollCIBaseBIPtr) += Iciei_Vbici;
|
||||||
*(here->HICUMemitEICollCIPtr) += Iciei_Vbici;
|
*(here->HICUMemitEICollCIPtr) += Iciei_Vbici;
|
||||||
*(here->HICUMcollCICollCIPtr) += -Iciei_Vbici;
|
*(here->HICUMcollCICollCIPtr) += -Iciei_Vbici;
|
||||||
*(here->HICUMemitEIBaseBIPtr) += -Iciei_Vbici;
|
*(here->HICUMemitEIBaseBIPtr) += -Iciei_Vbici;
|
||||||
|
|
@ -3083,19 +3084,19 @@ load:
|
||||||
rhs_current = model->HICUMtype * (Ibpbi - Ibpbi_Vbpbi*Vbpbi - Ibpbi_Vbiei*Vbiei - Ibpbi_Vbici*Vbici);
|
rhs_current = model->HICUMtype * (Ibpbi - Ibpbi_Vbpbi*Vbpbi - Ibpbi_Vbiei*Vbiei - Ibpbi_Vbici*Vbici);
|
||||||
*(ckt->CKTrhs + here->HICUMbaseBPNode) += -rhs_current;
|
*(ckt->CKTrhs + here->HICUMbaseBPNode) += -rhs_current;
|
||||||
*(ckt->CKTrhs + here->HICUMbaseBINode) += rhs_current;
|
*(ckt->CKTrhs + here->HICUMbaseBINode) += rhs_current;
|
||||||
//f_Bp = + f_Bi = -
|
//f_Bp = + f_Bi = -
|
||||||
// with respect to Vbpbi
|
// with respect to Vbpbi
|
||||||
*(here->HICUMbaseBPBaseBPPtr) += Ibpbi_Vbpbi;
|
*(here->HICUMbaseBPBaseBPPtr) += Ibpbi_Vbpbi;
|
||||||
*(here->HICUMbaseBIBaseBIPtr) += Ibpbi_Vbpbi;
|
*(here->HICUMbaseBIBaseBIPtr) += Ibpbi_Vbpbi;
|
||||||
*(here->HICUMbaseBPBaseBIPtr) += -Ibpbi_Vbpbi;
|
*(here->HICUMbaseBPBaseBIPtr) += -Ibpbi_Vbpbi;
|
||||||
*(here->HICUMbaseBIBaseBPPtr) += -Ibpbi_Vbpbi;
|
*(here->HICUMbaseBIBaseBPPtr) += -Ibpbi_Vbpbi;
|
||||||
// with respect to Vbiei
|
// with respect to Vbiei
|
||||||
*(here->HICUMbaseBPBaseBIPtr) += Ibpbi_Vbiei;
|
*(here->HICUMbaseBPBaseBIPtr) += Ibpbi_Vbiei;
|
||||||
*(here->HICUMbaseBIEmitEIPtr) += Ibpbi_Vbiei;
|
*(here->HICUMbaseBIEmitEIPtr) += Ibpbi_Vbiei;
|
||||||
*(here->HICUMbaseBPEmitEIPtr) += -Ibpbi_Vbiei;
|
*(here->HICUMbaseBPEmitEIPtr) += -Ibpbi_Vbiei;
|
||||||
*(here->HICUMbaseBIBaseBIPtr) += -Ibpbi_Vbiei;
|
*(here->HICUMbaseBIBaseBIPtr) += -Ibpbi_Vbiei;
|
||||||
// with respect to Vbici
|
// with respect to Vbici
|
||||||
*(here->HICUMbaseBPBaseBIPtr) += Ibpbi_Vbici;
|
*(here->HICUMbaseBPBaseBIPtr) += Ibpbi_Vbici;
|
||||||
*(here->HICUMbaseBICollCIPtr) += Ibpbi_Vbici;
|
*(here->HICUMbaseBICollCIPtr) += Ibpbi_Vbici;
|
||||||
*(here->HICUMbaseBPCollCIPtr) += -Ibpbi_Vbici;
|
*(here->HICUMbaseBPCollCIPtr) += -Ibpbi_Vbici;
|
||||||
*(here->HICUMbaseBIBaseBIPtr) += -Ibpbi_Vbici;
|
*(here->HICUMbaseBIBaseBIPtr) += -Ibpbi_Vbici;
|
||||||
|
|
@ -3139,7 +3140,7 @@ load:
|
||||||
// finish
|
// finish
|
||||||
|
|
||||||
if (nqs) {
|
if (nqs) {
|
||||||
// Branch: xf1-ground, Stamp element: Ixf1 f_xf1=+
|
// Branch: xf1-ground, Stamp element: Ixf1 f_xf1=+
|
||||||
rhs_current = Ixf1 - Ixf1_Vbici*Vbici - Ixf1_Vbiei*Vbiei -Ixf1_Vxf1*Vxf1 - Ixf1_Vxf2*Vxf2;
|
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
|
*(ckt->CKTrhs + here->HICUMxf1Node) += -rhs_current; // rhs_current; // into xf1 node
|
||||||
*(here->HICUMxf1BaseBIPtr) += +Ixf1_Vbiei;
|
*(here->HICUMxf1BaseBIPtr) += +Ixf1_Vbiei;
|
||||||
|
|
@ -3149,7 +3150,7 @@ load:
|
||||||
*(here->HICUMxf1Xf2Ptr) += +Ixf1_Vxf2;
|
*(here->HICUMxf1Xf2Ptr) += +Ixf1_Vxf2;
|
||||||
*(here->HICUMxf1Xf1Ptr) += +Ixf1_Vxf1;
|
*(here->HICUMxf1Xf1Ptr) += +Ixf1_Vxf1;
|
||||||
|
|
||||||
// Branch: xf2-ground, Stamp element: Ixf2 f_xf2=+
|
// Branch: xf2-ground, Stamp element: Ixf2 f_xf2=+
|
||||||
rhs_current = Ixf2 - Ixf2_Vbici*Vbici - Ixf2_Vbiei*Vbiei - Ixf2_Vxf1*Vxf1 - Ixf2_Vxf2*Vxf2;
|
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
|
*(ckt->CKTrhs + here->HICUMxf2Node) += -rhs_current; // rhs_current; // into xf2 node
|
||||||
*(here->HICUMxf2BaseBIPtr) += +Ixf2_Vbiei;
|
*(here->HICUMxf2BaseBIPtr) += +Ixf2_Vbiei;
|
||||||
|
|
@ -3159,7 +3160,7 @@ load:
|
||||||
*(here->HICUMxf2Xf2Ptr) += +Ixf2_Vxf2;
|
*(here->HICUMxf2Xf2Ptr) += +Ixf2_Vxf2;
|
||||||
*(here->HICUMxf2Xf1Ptr) += +Ixf2_Vxf1;
|
*(here->HICUMxf2Xf1Ptr) += +Ixf2_Vxf1;
|
||||||
|
|
||||||
// Branch: xf-ground, Stamp element: Ixf f_xf=+
|
// Branch: xf-ground, Stamp element: Ixf f_xf=+
|
||||||
rhs_current = Ixf - Ixf_Vbici*Vbici - Ixf_Vbiei*Vbiei - Ixf_Vxf*Vxf;
|
rhs_current = Ixf - Ixf_Vbici*Vbici - Ixf_Vbiei*Vbiei - Ixf_Vxf*Vxf;
|
||||||
*(ckt->CKTrhs + here->HICUMxfNode) += -rhs_current; // rhs_current; // into xf2 node
|
*(ckt->CKTrhs + here->HICUMxfNode) += -rhs_current; // rhs_current; // into xf2 node
|
||||||
*(here->HICUMxfBaseBIPtr) += +Ixf_Vbiei;
|
*(here->HICUMxfBaseBIPtr) += +Ixf_Vbiei;
|
||||||
|
|
@ -3172,14 +3173,14 @@ load:
|
||||||
|
|
||||||
// #############################################################
|
// #############################################################
|
||||||
// ############### FINISH STAMPS NO SH #########################
|
// ############### FINISH STAMPS NO SH #########################
|
||||||
// #############################################################
|
// #############################################################
|
||||||
|
|
||||||
if (selfheat) {
|
if (selfheat) {
|
||||||
|
|
||||||
// #############################################################
|
// #############################################################
|
||||||
// ############### STAMP WITH SH ADDITIONS #####################
|
// ############### STAMP WITH SH ADDITIONS #####################
|
||||||
// #############################################################
|
// #############################################################
|
||||||
|
|
||||||
// Stamp element: Ibiei f_Bi = + f_Ei = -
|
// Stamp element: Ibiei f_Bi = + f_Ei = -
|
||||||
rhs_current = -Ibiei_Vrth*Vrth;
|
rhs_current = -Ibiei_Vrth*Vrth;
|
||||||
*(ckt->CKTrhs + here->HICUMbaseBINode) += -rhs_current;
|
*(ckt->CKTrhs + here->HICUMbaseBINode) += -rhs_current;
|
||||||
|
|
@ -3283,21 +3284,21 @@ load:
|
||||||
// finish
|
// finish
|
||||||
|
|
||||||
if (nqs) {
|
if (nqs) {
|
||||||
// Stamp element: Ixf f_xf = +
|
// Stamp element: Ixf f_xf = +
|
||||||
rhs_current = -Ixf_dT*Vrth;
|
rhs_current = -Ixf_dT*Vrth;
|
||||||
*(ckt->CKTrhs + here->HICUMxfNode) += -rhs_current;
|
*(ckt->CKTrhs + here->HICUMxfNode) += -rhs_current;
|
||||||
// with respect to Potential Vxf
|
// with respect to Potential Vxf
|
||||||
*(here->HICUMxfTempPtr) += Ixf_dT;
|
*(here->HICUMxfTempPtr) += Ixf_dT;
|
||||||
// finish
|
// finish
|
||||||
|
|
||||||
// Stamp element: Ixf1 f_xf1 = +
|
// Stamp element: Ixf1 f_xf1 = +
|
||||||
rhs_current = -Ixf1_dT*Vrth;
|
rhs_current = -Ixf1_dT*Vrth;
|
||||||
*(ckt->CKTrhs + here->HICUMxf1Node) += -rhs_current;
|
*(ckt->CKTrhs + here->HICUMxf1Node) += -rhs_current;
|
||||||
// with respect to Potential Vxf1
|
// with respect to Potential Vxf1
|
||||||
*(here->HICUMxf1TempPtr) += Ixf1_dT;
|
*(here->HICUMxf1TempPtr) += Ixf1_dT;
|
||||||
// finish
|
// finish
|
||||||
|
|
||||||
// Stamp element: Ixf2 f_xf2 = +
|
// Stamp element: Ixf2 f_xf2 = +
|
||||||
rhs_current = -Ixf2_dT*Vrth;
|
rhs_current = -Ixf2_dT*Vrth;
|
||||||
*(ckt->CKTrhs + here->HICUMxf2Node) += -rhs_current;
|
*(ckt->CKTrhs + here->HICUMxf2Node) += -rhs_current;
|
||||||
// with respect to Potential Vxf2
|
// with respect to Potential Vxf2
|
||||||
|
|
@ -3305,8 +3306,8 @@ load:
|
||||||
// finish
|
// finish
|
||||||
}
|
}
|
||||||
|
|
||||||
// Stamp element: Ith f_T = - Ith
|
// Stamp element: Ith f_T = - Ith
|
||||||
rhs_current = Ith
|
rhs_current = Ith
|
||||||
- Ith_Vbiei*Vbiei - Ith_Vbici*Vbici - Ith_Vciei*Vciei
|
- Ith_Vbiei*Vbiei - Ith_Vbici*Vbici - Ith_Vciei*Vciei
|
||||||
- Ith_Vbpei*Vbpei - Ith_Vbpci*Vbpci - Ith_Vsici*Vsici
|
- Ith_Vbpei*Vbpei - Ith_Vbpci*Vbpci - Ith_Vsici*Vsici
|
||||||
- Ith_Vbpbi*Vbpbi
|
- Ith_Vbpbi*Vbpbi
|
||||||
|
|
@ -3355,6 +3356,63 @@ load:
|
||||||
*(here->HICUMtempTempPtr) += +Icth_Vrth;
|
*(here->HICUMtempTempPtr) += +Icth_Vrth;
|
||||||
// finish
|
// finish
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (correlated_noise) {
|
||||||
|
// #############################################################
|
||||||
|
// ############# STAMP WITH CORRELATED NOISE ###################
|
||||||
|
// #############################################################
|
||||||
|
// parameter definition
|
||||||
|
int n_w = 1;
|
||||||
|
double n_1 = Tf*model->HICUMalit;
|
||||||
|
double betadc = it/ibei;
|
||||||
|
double sqrt_n2 = betadc * (2*model->HICUMalqf-model->HICUMalit*model->HICUMalit);
|
||||||
|
double n_2 = 0;
|
||||||
|
|
||||||
|
if (sqrt_n2 > 0.0) {
|
||||||
|
n_2 = Tf*sqrt(sqrt_n2);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Branch: n1 0, Stamp element: Rn1 = 1 Ohm
|
||||||
|
// with respect to Vn1
|
||||||
|
*(ckt->CKTrhs + here->HICUMNoise1Node) -= *(ckt->CKTstate0 + here->HICUMvn1);
|
||||||
|
// finish
|
||||||
|
|
||||||
|
// Branch: n2 0, Stamp element: Rn2 = 1 Ohm
|
||||||
|
// with respect to Vn2
|
||||||
|
*(ckt->CKTrhs + here->HICUMNoise2Node) -= *(ckt->CKTstate0 + here->HICUMvn2);
|
||||||
|
// finish
|
||||||
|
|
||||||
|
// Stamp element: Ibiei f_Bi = + f_Ei = -
|
||||||
|
// realization of modified base shot noise source I1(bi,ei)
|
||||||
|
rhs_current = -*(ckt->CKTstate0 + here->HICUMvn1);
|
||||||
|
double q_n1 = n_w* *(ckt->CKTstate0 + here->HICUMvn1);
|
||||||
|
double In1_Vn1 = 0;
|
||||||
|
// I(bi,ei) <+ n_2/n_w*ddt(n_w* *(ckt->CKTstate0 + here->HICUMvn1));
|
||||||
|
error = NIintegrate(ckt, &geq, &ceq, n_w, here->HICUMqn1);
|
||||||
|
if(error) return(error);
|
||||||
|
In1_Vn1 += n_2/n_w*geq;
|
||||||
|
rhs_current += n_2/n_w * *(ckt->CKTstate0 + here->HICUMcqn1);
|
||||||
|
|
||||||
|
*(ckt->CKTrhs + here->HICUMcollCINode) += -rhs_current;
|
||||||
|
*(ckt->CKTrhs + here->HICUMemitEINode) += rhs_current;
|
||||||
|
*(here->HICUMn1N1Ptr) += +In1_Vn1;
|
||||||
|
|
||||||
|
// realization of controlled base noise source I2(bi,ei)
|
||||||
|
// I(bi,ei) <+ n_1/n_w*ddt(n_w* *(ckt->CKTstate0 + here->HICUMvn2));
|
||||||
|
error = NIintegrate(ckt, &geq, &ceq, n_w, here->HICUMqn1);
|
||||||
|
if(error) return(error);
|
||||||
|
In1_Vn1 += n_2/n_w*geq;
|
||||||
|
rhs_current += n_2/n_w * *(ckt->CKTstate0 + here->HICUMcqn1);
|
||||||
|
// finish
|
||||||
|
|
||||||
|
// Stamp element: Iciei f_Ci = + f_Ei = -
|
||||||
|
// realization of modified collector shot noise source I(ci,ei) (uncontrolled)
|
||||||
|
rhs_current = -*(ckt->CKTstate0 + here->HICUMvn2);
|
||||||
|
*(ckt->CKTrhs + here->HICUMcollCINode) += -rhs_current;
|
||||||
|
*(ckt->CKTrhs + here->HICUMemitEINode) += rhs_current;
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,5 +2,5 @@
|
||||||
|
|
||||||
/icm/GNUmakefile
|
/icm/GNUmakefile
|
||||||
/icm/makedefs
|
/icm/makedefs
|
||||||
|
|
||||||
!/examples/*/Makefile
|
!/examples/*/Makefile
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue