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;
|
INDmodel *model = (INDmodel*)inModel;
|
||||||
double val;
|
double val;
|
||||||
|
double m;
|
||||||
INDinstance *here;
|
INDinstance *here;
|
||||||
|
|
||||||
for( ; model != NULL; model = model->INDnextModel) {
|
for( ; model != NULL; model = model->INDnextModel) {
|
||||||
for( here = model->INDinstances;here != NULL;
|
for( here = model->INDinstances;here != NULL;
|
||||||
here = here->INDnextInstance) {
|
here = here->INDnextInstance) {
|
||||||
|
|
||||||
val = ckt->CKTomega * here->INDinduct;
|
m = (here->INDm);
|
||||||
|
|
||||||
|
val = ckt->CKTomega * here->INDinduct / m;
|
||||||
|
|
||||||
*(here->INDposIbrptr) += 1;
|
*(here->INDposIbrptr) += 1;
|
||||||
*(here->INDnegIbrptr) -= 1;
|
*(here->INDnegIbrptr) -= 1;
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ INDload(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
INDinstance *here;
|
INDinstance *here;
|
||||||
double veq;
|
double veq;
|
||||||
double req;
|
double req;
|
||||||
|
double m;
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
#ifdef MUTUAL
|
#ifdef MUTUAL
|
||||||
|
|
@ -37,12 +38,14 @@ INDload(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
for (here = model->INDinstances; here != NULL ;
|
for (here = model->INDinstances; here != NULL ;
|
||||||
here=here->INDnextInstance) {
|
here=here->INDnextInstance) {
|
||||||
|
|
||||||
|
m = (here->INDm);
|
||||||
|
|
||||||
if(!(ckt->CKTmode & (MODEDC|MODEINITPRED))) {
|
if(!(ckt->CKTmode & (MODEDC|MODEINITPRED))) {
|
||||||
if(ckt->CKTmode & MODEUIC && ckt->CKTmode & MODEINITTRAN) {
|
if(ckt->CKTmode & MODEUIC && ckt->CKTmode & MODEINITTRAN) {
|
||||||
*(ckt->CKTstate0 + here->INDflux) = here->INDinduct *
|
*(ckt->CKTstate0 + here->INDflux) = here->INDinduct / m *
|
||||||
here->INDinitCond;
|
here->INDinitCond;
|
||||||
} else {
|
} else {
|
||||||
*(ckt->CKTstate0 + here->INDflux) = here->INDinduct *
|
*(ckt->CKTstate0 + here->INDflux) = here->INDinduct / m *
|
||||||
*(ckt->CKTrhsOld + here->INDbrEq);
|
*(ckt->CKTrhsOld + here->INDbrEq);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -86,6 +89,7 @@ INDload(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
req = 0.0;
|
req = 0.0;
|
||||||
veq = 0.0;
|
veq = 0.0;
|
||||||
} else {
|
} else {
|
||||||
|
double newmind;
|
||||||
#ifndef PREDICTOR
|
#ifndef PREDICTOR
|
||||||
if(ckt->CKTmode & MODEINITPRED) {
|
if(ckt->CKTmode & MODEINITPRED) {
|
||||||
*(ckt->CKTstate0 + here->INDflux) =
|
*(ckt->CKTstate0 + here->INDflux) =
|
||||||
|
|
@ -99,7 +103,9 @@ INDload(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
#ifndef PREDICTOR
|
#ifndef PREDICTOR
|
||||||
}
|
}
|
||||||
#endif /*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);
|
if(error) return(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue