Fix a bug in the inductance formula.
This commit is contained in:
parent
55d96ad2c2
commit
2c8c5b11b1
|
|
@ -47,22 +47,15 @@ INDsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
|
||||||
model->INDmodNt = 0.0;
|
model->INDmodNt = 0.0;
|
||||||
}
|
}
|
||||||
if (!model->INDmuGiven) {
|
if (!model->INDmuGiven) {
|
||||||
model->INDmu = 0.0;
|
model->INDmu = 1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* precompute specific inductance (one turn) */
|
/* precompute specific inductance (one turn) */
|
||||||
if((model->INDlengthGiven)
|
if((model->INDlengthGiven) && (model->INDlength > 0.0)) {
|
||||||
&& (model->INDlength > 0.0)) {
|
model->INDspecInd = (model->INDmu * CONSTmuZero
|
||||||
|
* model->INDcsect) / model->INDlength;
|
||||||
if (model->INDmuGiven)
|
|
||||||
model->INDspecInd = (model->INDmu * CONSTmuZero
|
|
||||||
* model->INDcsect * model->INDcsect) / model->INDlength;
|
|
||||||
else
|
|
||||||
model->INDspecInd = (CONSTmuZero * model->INDcsect
|
|
||||||
* model->INDcsect ) / model->INDlength;
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
model->INDspecInd = 0.0;
|
model->INDspecInd = 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!model->INDmIndGiven)
|
if (!model->INDmIndGiven)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue