indload.c, indacld.c: multiplier m added
This commit is contained in:
parent
e4cfe0ffff
commit
cb6fe6389c
|
|
@ -17,13 +17,16 @@ INDacLoad(GENmodel *inModel, CKTcircuit *ckt)
|
|||
{
|
||||
INDmodel *model = (INDmodel*)inModel;
|
||||
double val;
|
||||
double m;
|
||||
INDinstance *here;
|
||||
|
||||
for( ; model != NULL; model = model->INDnextModel) {
|
||||
for( here = model->INDinstances;here != NULL;
|
||||
here = here->INDnextInstance) {
|
||||
|
||||
val = ckt->CKTomega * here->INDinduct;
|
||||
m = (here->INDm);
|
||||
|
||||
val = ckt->CKTomega * here->INDinduct / m;
|
||||
|
||||
*(here->INDposIbrptr) += 1;
|
||||
*(here->INDnegIbrptr) -= 1;
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ INDload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
INDinstance *here;
|
||||
double veq;
|
||||
double req;
|
||||
double m;
|
||||
int error;
|
||||
|
||||
#ifdef MUTUAL
|
||||
|
|
@ -37,12 +38,14 @@ INDload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
for (here = model->INDinstances; here != NULL ;
|
||||
here=here->INDnextInstance) {
|
||||
|
||||
m = (here->INDm);
|
||||
|
||||
if(!(ckt->CKTmode & (MODEDC|MODEINITPRED))) {
|
||||
if(ckt->CKTmode & MODEUIC && ckt->CKTmode & MODEINITTRAN) {
|
||||
*(ckt->CKTstate0 + here->INDflux) = here->INDinduct *
|
||||
*(ckt->CKTstate0 + here->INDflux) = here->INDinduct / m *
|
||||
here->INDinitCond;
|
||||
} else {
|
||||
*(ckt->CKTstate0 + here->INDflux) = here->INDinduct *
|
||||
*(ckt->CKTstate0 + here->INDflux) = here->INDinduct / m *
|
||||
*(ckt->CKTrhsOld + here->INDbrEq);
|
||||
}
|
||||
}
|
||||
|
|
@ -86,6 +89,7 @@ INDload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
req = 0.0;
|
||||
veq = 0.0;
|
||||
} else {
|
||||
double newmind;
|
||||
#ifndef PREDICTOR
|
||||
if(ckt->CKTmode & MODEINITPRED) {
|
||||
*(ckt->CKTstate0 + here->INDflux) =
|
||||
|
|
@ -99,7 +103,9 @@ INDload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
#ifndef PREDICTOR
|
||||
}
|
||||
#endif /*PREDICTOR*/
|
||||
error=NIintegrate(ckt,&req,&veq,here->INDinduct,here->INDflux);
|
||||
m = (here->INDm);
|
||||
newmind = here->INDinduct/m;
|
||||
error=NIintegrate(ckt,&req,&veq,newmind,here->INDflux);
|
||||
if(error) return(error);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue