V Pulse delivers erratic outputs, when not parameterized properly.
Update the pulse generation: negative TR, TF, PW, PER not possible, get default values instead. 0 PW is allowed. Defaults are: TR negative or 0 --> TR = ckt->CKTstep TF negative or 0 --> TF = ckt->CKTstep PW < 0 --> PW = 0 PER <= 0 --> PER = TR + TF + PW */
This commit is contained in:
parent
527cc86969
commit
7159d6aa4b
|
|
@ -56,20 +56,24 @@ VSRCaccept(CKTcircuit *ckt, GENmodel *inModel)
|
||||||
double phase;
|
double phase;
|
||||||
double deltat;
|
double deltat;
|
||||||
|
|
||||||
|
/* TR negative or 0 --> TR = ckt->CKTstep
|
||||||
|
TF negative or 0 --> TF = ckt->CKTstep
|
||||||
|
PW < 0 --> PW = 0
|
||||||
|
PER <= 0 --> PER = TR + TF + PW */
|
||||||
TD = here->VSRCfunctionOrder > 2
|
TD = here->VSRCfunctionOrder > 2
|
||||||
? here->VSRCcoeffs[2] : 0.0;
|
? here->VSRCcoeffs[2] : 0.0;
|
||||||
TR = here->VSRCfunctionOrder > 3
|
TR = here->VSRCfunctionOrder > 3
|
||||||
&& here->VSRCcoeffs[3] != 0.0
|
&& here->VSRCcoeffs[3] > 0.0
|
||||||
? here->VSRCcoeffs[3] : ckt->CKTstep;
|
? here->VSRCcoeffs[3] : ckt->CKTstep;
|
||||||
TF = here->VSRCfunctionOrder > 4
|
TF = here->VSRCfunctionOrder > 4
|
||||||
&& here->VSRCcoeffs[4] != 0.0
|
&& here->VSRCcoeffs[4] > 0.0
|
||||||
? here->VSRCcoeffs[4] : ckt->CKTstep;
|
? here->VSRCcoeffs[4] : ckt->CKTstep;
|
||||||
PW = here->VSRCfunctionOrder > 5
|
PW = here->VSRCfunctionOrder > 5
|
||||||
&& here->VSRCcoeffs[5] != 0.0
|
&& here->VSRCcoeffs[5] >= 0.0
|
||||||
? here->VSRCcoeffs[5] : ckt->CKTfinalTime;
|
? here->VSRCcoeffs[5] : 0.0;
|
||||||
PER = here->VSRCfunctionOrder > 6
|
PER = here->VSRCfunctionOrder > 6
|
||||||
&& here->VSRCcoeffs[6] != 0.0
|
&& here->VSRCcoeffs[6] > 0.0
|
||||||
? here->VSRCcoeffs[6] : ckt->CKTfinalTime;
|
? here->VSRCcoeffs[6] : TR + TF + PW;
|
||||||
PHASE = here->VSRCfunctionOrder > 7
|
PHASE = here->VSRCfunctionOrder > 7
|
||||||
? here->VSRCcoeffs[7] : 0.0;
|
? here->VSRCcoeffs[7] : 0.0;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,12 @@ VSRCload(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
} else {
|
} else {
|
||||||
time = ckt->CKTtime;
|
time = ckt->CKTtime;
|
||||||
}
|
}
|
||||||
/* use the transient functions */
|
/* use the transient functions. Parameter limits:
|
||||||
|
TR negative or 0 --> TR = ckt->CKTstep
|
||||||
|
TF negative or 0 --> TF = ckt->CKTstep
|
||||||
|
PW < 0 --> PW = 0
|
||||||
|
PER <= 0 --> PER = TR + TF + PW
|
||||||
|
*/
|
||||||
switch(here->VSRCfunctionType) {
|
switch(here->VSRCfunctionType) {
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
@ -106,17 +111,17 @@ VSRCload(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
TD = here->VSRCfunctionOrder > 2
|
TD = here->VSRCfunctionOrder > 2
|
||||||
? here->VSRCcoeffs[2] : 0.0;
|
? here->VSRCcoeffs[2] : 0.0;
|
||||||
TR = here->VSRCfunctionOrder > 3
|
TR = here->VSRCfunctionOrder > 3
|
||||||
&& here->VSRCcoeffs[3] != 0.0
|
&& here->VSRCcoeffs[3] > 0.0
|
||||||
? here->VSRCcoeffs[3] : ckt->CKTstep;
|
? here->VSRCcoeffs[3] : ckt->CKTstep;
|
||||||
TF = here->VSRCfunctionOrder > 4
|
TF = here->VSRCfunctionOrder > 4
|
||||||
&& here->VSRCcoeffs[4] != 0.0
|
&& here->VSRCcoeffs[4] > 0.0
|
||||||
? here->VSRCcoeffs[4] : ckt->CKTstep;
|
? here->VSRCcoeffs[4] : ckt->CKTstep;
|
||||||
PW = here->VSRCfunctionOrder > 5
|
PW = here->VSRCfunctionOrder > 5
|
||||||
&& here->VSRCcoeffs[5] != 0.0
|
&& here->VSRCcoeffs[5] >= 0.0
|
||||||
? here->VSRCcoeffs[5] : ckt->CKTfinalTime;
|
? here->VSRCcoeffs[5] : 0.0;
|
||||||
PER = here->VSRCfunctionOrder > 6
|
PER = here->VSRCfunctionOrder > 6
|
||||||
&& here->VSRCcoeffs[6] != 0.0
|
&& here->VSRCcoeffs[6] > 0.0
|
||||||
? here->VSRCcoeffs[6] : ckt->CKTfinalTime;
|
? here->VSRCcoeffs[6] : TR + TF + PW;
|
||||||
|
|
||||||
/* shift time by delay time TD */
|
/* shift time by delay time TD */
|
||||||
time -= TD;
|
time -= TD;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue