correct pnp type bipolar transistor current convention
This commit is contained in:
parent
3073d8c7d3
commit
eaf67ac940
|
|
@ -94,7 +94,7 @@ BJTask(CKTcircuit *ckt, GENinstance *instPtr, int which, IFvalue *value, IFvalue
|
|||
return(OK);
|
||||
case BJT_QUEST_CC:
|
||||
value->rValue = *(ckt->CKTstate0 + here->BJTcc);
|
||||
value->rValue *= here->BJTm;
|
||||
value->rValue *= here->BJTm * BJTmodPtr(here)->BJTtype;
|
||||
return(OK);
|
||||
case BJT_QUEST_CB:
|
||||
value->rValue = *(ckt->CKTstate0 + here->BJTcb);
|
||||
|
|
@ -105,7 +105,7 @@ BJTask(CKTcircuit *ckt, GENinstance *instPtr, int which, IFvalue *value, IFvalue
|
|||
value->rValue -= *(ckt->CKTstate0 + here->BJTcqsub);
|
||||
}
|
||||
}
|
||||
value->rValue *= here->BJTm;
|
||||
value->rValue *= here->BJTm * BJTmodPtr(here)->BJTtype;
|
||||
return(OK);
|
||||
case BJT_QUEST_GPI:
|
||||
value->rValue = *(ckt->CKTstate0 + here->BJTgpi);
|
||||
|
|
@ -255,7 +255,7 @@ BJTask(CKTcircuit *ckt, GENinstance *instPtr, int which, IFvalue *value, IFvalue
|
|||
(*(ckt->CKTstate0 + here->BJTcqsub) +
|
||||
*(ckt->CKTstate0 + here->BJTcdsub)));
|
||||
}
|
||||
value->rValue *= here->BJTm;
|
||||
value->rValue *= here->BJTm * BJTmodPtr(here)->BJTtype;
|
||||
return(OK);
|
||||
case BJT_QUEST_CE :
|
||||
if (ckt->CKTcurrentAnalysis & DOING_AC) {
|
||||
|
|
@ -274,7 +274,7 @@ BJTask(CKTcircuit *ckt, GENinstance *instPtr, int which, IFvalue *value, IFvalue
|
|||
}
|
||||
}
|
||||
}
|
||||
value->rValue *= here->BJTm;
|
||||
value->rValue *= here->BJTm * BJTmodPtr(here)->BJTtype;
|
||||
return(OK);
|
||||
case BJT_QUEST_POWER :
|
||||
if (ckt->CKTcurrentAnalysis & DOING_AC) {
|
||||
|
|
|
|||
|
|
@ -99,26 +99,29 @@ 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) -
|
||||
*(ckt->CKTstate0 + here->HICUMibici) -
|
||||
*(ckt->CKTstate0 + here->HICUMibpci) -
|
||||
*(ckt->CKTstate0 + here->HICUMisici);
|
||||
value->rValue *= HICUMmodPtr(here)->HICUMtype;
|
||||
return(OK);
|
||||
case HICUM_QUEST_CB:
|
||||
value->rValue = *(ckt->CKTstate0 + here->HICUMibiei) +
|
||||
*(ckt->CKTstate0 + here->HICUMibici) +
|
||||
*(ckt->CKTstate0 + here->HICUMibpci) +
|
||||
*(ckt->CKTstate0 + here->HICUMibpsi);
|
||||
value->rValue *= HICUMmodPtr(here)->HICUMtype;
|
||||
return(OK);
|
||||
case HICUM_QUEST_CE:
|
||||
value->rValue = - *(ckt->CKTstate0 + here->HICUMibiei) -
|
||||
*(ckt->CKTstate0 + here->HICUMibpei) -
|
||||
*(ckt->CKTstate0 + here->HICUMiciei);
|
||||
value->rValue *= HICUMmodPtr(here)->HICUMtype;
|
||||
return(OK);
|
||||
case HICUM_QUEST_CS:
|
||||
value->rValue = *(ckt->CKTstate0 + here->HICUMisici) -
|
||||
*(ckt->CKTstate0 + here->HICUMibpsi);
|
||||
value->rValue *= HICUMmodPtr(here)->HICUMtype;
|
||||
return(OK);
|
||||
case HICUM_QUEST_CAVL:
|
||||
value->rValue = here->HICUMiavl;
|
||||
|
|
@ -129,7 +132,6 @@ HICUMask(CKTcircuit *ckt, GENinstance *instPtr, int which, IFvalue *value, IFval
|
|||
case HICUM_QUEST_CBCI:
|
||||
value->rValue = *(ckt->CKTstate0 + here->HICUMibici);
|
||||
return(OK);
|
||||
|
||||
/* resistances */
|
||||
case HICUM_QUEST_RCX_T:
|
||||
value->rValue = here->HICUMrcx_t.rpart;
|
||||
|
|
|
|||
|
|
@ -78,6 +78,7 @@ VBICask(CKTcircuit *ckt, GENinstance *instPtr, int which, IFvalue *value, IFvalu
|
|||
value->rValue = *(ckt->CKTstate0 + here->VBICitzf) -
|
||||
*(ckt->CKTstate0 + here->VBICitzr) -
|
||||
*(ckt->CKTstate0 + here->VBICibc);
|
||||
value->rValue *= VBICmodPtr(here)->VBICtype;
|
||||
return(OK);
|
||||
case VBIC_QUEST_CB:
|
||||
value->rValue = *(ckt->CKTstate0 + here->VBICibe) +
|
||||
|
|
@ -85,16 +86,19 @@ VBICask(CKTcircuit *ckt, GENinstance *instPtr, int which, IFvalue *value, IFvalu
|
|||
*(ckt->CKTstate0 + here->VBICibex) +
|
||||
*(ckt->CKTstate0 + here->VBICibep) +
|
||||
*(ckt->CKTstate0 + here->VBICiccp);
|
||||
value->rValue *= VBICmodPtr(here)->VBICtype;
|
||||
return(OK);
|
||||
case VBIC_QUEST_CE:
|
||||
value->rValue = - *(ckt->CKTstate0 + here->VBICibe) -
|
||||
*(ckt->CKTstate0 + here->VBICibex) -
|
||||
*(ckt->CKTstate0 + here->VBICitzf) +
|
||||
*(ckt->CKTstate0 + here->VBICitzr);
|
||||
value->rValue *= VBICmodPtr(here)->VBICtype;
|
||||
return(OK);
|
||||
case VBIC_QUEST_CS:
|
||||
value->rValue = *(ckt->CKTstate0 + here->VBICiccp) -
|
||||
*(ckt->CKTstate0 + here->VBICibcp);
|
||||
value->rValue *= VBICmodPtr(here)->VBICtype;
|
||||
return(OK);
|
||||
case VBIC_QUEST_POWER:
|
||||
VBICask(ckt, instPtr, VBIC_QUEST_CC, &IC, select);
|
||||
|
|
|
|||
Loading…
Reference in New Issue