FM and FC exchange place in the parameter sequence of SFFM voltage

and current source, to become compatible with standard SPICE.
Fixes bug 832.
This commit is contained in:
Holger Vogt 2026-03-03 16:16:58 +01:00
parent f86018afe9
commit b5112b18e5
2 changed files with 6 additions and 6 deletions

View File

@ -205,18 +205,18 @@ ISRCload(GENmodel *inModel, CKTcircuit *ckt)
case SFFM: {
double VO, VA, FM, MDI, FC, TD, PHASEM, PHASEC;
double VO, VA, FC, MDI, FM, TD, PHASEM, PHASEC;
double phasec;
double phasem;
static bool warn1 = FALSE, warn2 = FALSE;
VO = here->ISRCcoeffs[0];
VA = here->ISRCcoeffs[1];
FM = here->ISRCfunctionOrder > 2
FC = here->ISRCfunctionOrder > 2
? here->ISRCcoeffs[2] : (5./ckt->CKTfinalTime);
MDI = here->ISRCfunctionOrder > 3
? here->ISRCcoeffs[3] : 90.0;
FC = here->ISRCfunctionOrder > 4
FM = here->ISRCfunctionOrder > 4
&& here->ISRCcoeffs[4]
? here->ISRCcoeffs[4] : (500./ckt->CKTfinalTime);
TD = here->ISRCfunctionOrder > 5

View File

@ -233,18 +233,18 @@ VSRCload(GENmodel *inModel, CKTcircuit *ckt)
case SFFM: {
double VO, VA, FM, MDI, FC, TD, PHASEM, PHASEC;
double VO, VA, FC, MDI, FM, TD, PHASEM, PHASEC;
double phasec;
double phasem;
static bool warn1 = FALSE, warn2 = FALSE;
VO = here->VSRCcoeffs[0];
VA = here->VSRCcoeffs[1];
FM = here->VSRCfunctionOrder > 2
FC = here->VSRCfunctionOrder > 2
? here->VSRCcoeffs[2] : (5./ckt->CKTfinalTime);
MDI = here->VSRCfunctionOrder > 3
? here->VSRCcoeffs[3] : 90.0; /* 0.9 * FC / FM */
FC = here->VSRCfunctionOrder > 4
FM = here->VSRCfunctionOrder > 4
&& here->VSRCcoeffs[4] /* test if not 0 */
? here->VSRCcoeffs[4] : (500./ckt->CKTfinalTime);
TD = here->VSRCfunctionOrder > 5