devices/res/resparam.c, whitespace and parenthesis
This commit is contained in:
parent
0a48e6f2a7
commit
0e1294b3b5
|
|
@ -58,52 +58,52 @@ RESupdate_conduct(RESinstance *here)
|
|||
double difference;
|
||||
double tc1, tc2, tce;
|
||||
|
||||
if (!here->RESresGiven) {
|
||||
if (here->RESlength * here->RESwidth * model->RESsheetRes > 0.0) {
|
||||
here->RESresist =
|
||||
(here->RESlength - 2 * model->RESshort) /
|
||||
(here->RESwidth - 2 * model->RESnarrow) *
|
||||
model->RESsheetRes;
|
||||
} else if (model->RESresGiven) {
|
||||
here->RESresist = model->RESres;
|
||||
} else {
|
||||
SPfrontEnd->IFerrorf (ERR_WARNING,
|
||||
"%s: resistance to low, set to 1 mOhm", here->RESname);
|
||||
here->RESresist = 1e-03;
|
||||
}
|
||||
}
|
||||
if (!here->RESresGiven) {
|
||||
if (here->RESlength * here->RESwidth * model->RESsheetRes > 0.0) {
|
||||
here->RESresist =
|
||||
(here->RESlength - 2 * model->RESshort) /
|
||||
(here->RESwidth - 2 * model->RESnarrow) *
|
||||
model->RESsheetRes;
|
||||
} else if (model->RESresGiven) {
|
||||
here->RESresist = model->RESres;
|
||||
} else {
|
||||
SPfrontEnd->IFerrorf (ERR_WARNING,
|
||||
"%s: resistance to low, set to 1 mOhm", here->RESname);
|
||||
here->RESresist = 1e-03;
|
||||
}
|
||||
}
|
||||
|
||||
difference = (here->REStemp + here->RESdtemp) - model->REStnom;
|
||||
difference = (here->REStemp + here->RESdtemp) - model->REStnom;
|
||||
|
||||
/* instance parameters tc1,tc2 and tce will override
|
||||
model parameters tc1,tc2 and tce */
|
||||
if (here->REStc1Given)
|
||||
tc1 = here->REStc1; /* instance */
|
||||
else
|
||||
tc1 = model->REStempCoeff1; /* model */
|
||||
/* instance parameters tc1,tc2 and tce will override
|
||||
model parameters tc1,tc2 and tce */
|
||||
if (here->REStc1Given)
|
||||
tc1 = here->REStc1; /* instance */
|
||||
else
|
||||
tc1 = model->REStempCoeff1; /* model */
|
||||
|
||||
if (here->REStc2Given)
|
||||
tc2 = here->REStc2;
|
||||
else
|
||||
tc2 = model->REStempCoeff2;
|
||||
if (here->REStc2Given)
|
||||
tc2 = here->REStc2;
|
||||
else
|
||||
tc2 = model->REStempCoeff2;
|
||||
|
||||
if (here->REStceGiven)
|
||||
tce = here->REStce;
|
||||
else
|
||||
tce = model->REStempCoeffe;
|
||||
if (here->REStceGiven)
|
||||
tce = here->REStce;
|
||||
else
|
||||
tce = model->REStempCoeffe;
|
||||
|
||||
if ((here->REStceGiven)||(model->REStceGiven))
|
||||
factor = pow(1.01, tce * difference);
|
||||
else
|
||||
factor = (((tc2 * difference) + tc1) * difference) + 1.0;
|
||||
if (here->REStceGiven || model->REStceGiven)
|
||||
factor = pow(1.01, tce * difference);
|
||||
else
|
||||
factor = (((tc2 * difference) + tc1) * difference) + 1.0;
|
||||
|
||||
here -> RESconduct = (1.0/(here->RESresist * factor * here->RESscale));
|
||||
here->RESconduct = (1.0/(here->RESresist * factor * here->RESscale));
|
||||
|
||||
/* Paolo Nenzi: AC value */
|
||||
if(here->RESacresGiven)
|
||||
here->RESacConduct = (1.0/(here->RESacResist * factor * here->RESscale));
|
||||
else {
|
||||
here -> RESacConduct = here -> RESconduct;
|
||||
here -> RESacResist = here -> RESresist;
|
||||
}
|
||||
/* Paolo Nenzi: AC value */
|
||||
if (here->RESacresGiven) {
|
||||
here->RESacConduct = (1.0/(here->RESacResist * factor * here->RESscale));
|
||||
} else {
|
||||
here->RESacConduct = here->RESconduct;
|
||||
here->RESacResist = here->RESresist;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue