test of supply ramping

This commit is contained in:
Holger Vogt 2020-06-01 16:04:11 +02:00
parent 89f78bfc6c
commit b07a54b8e1
1 changed files with 17 additions and 1 deletions

View File

@ -236,6 +236,19 @@ OPtran(CKTcircuit *ckt)
// int type = ckt->CKTcurJob->JOBtype;
SPfrontEnd->IFerrorf(ERR_INFO, "Transient op started");
if (opramptime > 0) {
CKTnode* n;
ckt->CKTsrcFact = 0.;
SPfrontEnd->IFerrorf(ERR_INFO, "Ramptime enabled");
for (n = ckt->CKTnodes; n; n = n->next)
ckt->CKTrhsOld[n->number] = 0;
for (i = 0; i < ckt->CKTnumStates; i++)
ckt->CKTstate0[i] = 0;
/* First, try a straight solution with all sources at zero */
converged = NIiter(ckt, ckt->CKTdcTrcvMaxIter);
}
#if 0
/* Set the final time */
/* If we are in transient simulation */
@ -554,7 +567,6 @@ resume:
}
ckt->CKTstates[0] = temp;
/* 600 */
for (;;) {
#if defined SHARED_MODULE
redostep = 1;
@ -564,6 +576,10 @@ resume:
/* time abort? */
optime += ckt->CKTdelta;
/* supply ramping, when opramptime > 0 */
if (opramptime > 0)
ckt->CKTsrcFact = MIN(1., optime / opramptime);
ckt->CKTdeltaOld[0]=ckt->CKTdelta;
NIcomCof(ckt);
save_mode = ckt->CKTmode;