diff --git a/src/spicelib/analysis/acan.c b/src/spicelib/analysis/acan.c index 5aa942b77..89aeaf747 100644 --- a/src/spicelib/analysis/acan.c +++ b/src/spicelib/analysis/acan.c @@ -251,7 +251,7 @@ ACan(CKTcircuit *ckt, int restart) ckt->CKTomega = 2.0 * M_PI *freq; /* Update opertating point, if variable 'hertz' is given */ - if (ckt->CKTvarHertz) { + if (0 && ckt->CKTvarHertz) { #ifdef XSPICE /* Call EVTop if event-driven instances exist */ diff --git a/src/spicelib/devices/asrc/asrcacld.c b/src/spicelib/devices/asrc/asrcacld.c index 910f10064..017d65f81 100644 --- a/src/spicelib/devices/asrc/asrcacld.c +++ b/src/spicelib/devices/asrc/asrcacld.c @@ -24,7 +24,7 @@ ASRCacLoad(GENmodel *inModel, CKTcircuit *ckt) int i, j; double *derivs; double difference; - double factor; + double factor, rhs; NG_IGNORE(ckt); @@ -47,7 +47,13 @@ ASRCacLoad(GENmodel *inModel, CKTcircuit *ckt) */ j = 0; - derivs = here->ASRCacValues; + + if (here->ASRCtree->IFeval(here->ASRCtree, ckt->CKTgmin, &rhs, here->ASRCopValues, asrc_derivs) != OK) + return(E_BADPARM); + + derivs = asrc_derivs; + + // mit factor multiplien !! if (here->ASRCtype == ASRC_VOLTAGE) { diff --git a/src/spicelib/devices/asrc/asrcdefs.h b/src/spicelib/devices/asrc/asrcdefs.h index 93bdef553..ef0bcf7de 100644 --- a/src/spicelib/devices/asrc/asrcdefs.h +++ b/src/spicelib/devices/asrc/asrcdefs.h @@ -40,6 +40,7 @@ typedef struct sASRCinstance { * in the sparce matrix */ double ASRCprev_value; /* Previous value for the convergence test */ double *ASRCacValues; /* Store rhs and derivatives for ac anal */ + double *ASRCopValues; /* Store op for ac anal */ unsigned ASRCtempGiven : 1; /* indicates temperature specified */ unsigned ASRCdtempGiven : 1; /* indicates delta-temp specified */ diff --git a/src/spicelib/devices/asrc/asrcdest.c b/src/spicelib/devices/asrc/asrcdest.c index da4f371b5..4a1746c59 100644 --- a/src/spicelib/devices/asrc/asrcdest.c +++ b/src/spicelib/devices/asrc/asrcdest.c @@ -22,6 +22,7 @@ ASRCdestroy(GENmodel **model) for (here = mod->ASRCinstances; here; here = next) { next = here->ASRCnextInstance; FREE(here->ASRCacValues); + FREE(here->ASRCopValues); INPfreeTree(here->ASRCtree); if (here->ASRCposptr) free(here->ASRCposptr); diff --git a/src/spicelib/devices/asrc/asrcload.c b/src/spicelib/devices/asrc/asrcload.c index 5d2f3f561..8ff3bb6f4 100644 --- a/src/spicelib/devices/asrc/asrcload.c +++ b/src/spicelib/devices/asrc/asrcload.c @@ -69,8 +69,10 @@ ASRCload(GENmodel *inModel, CKTcircuit *ckt) /* The ac load precomputation and storage */ if (ckt->CKTmode & MODEINITSMSIG) - for (i = 0; i < here->ASRCtree->numVars; i++) + for (i = 0; i < here->ASRCtree->numVars; i++) { + here->ASRCopValues[i] = asrc_vals[i]; here->ASRCacValues[i] = asrc_derivs[i]; + } if (here->ASRCtype == ASRC_VOLTAGE) { diff --git a/src/spicelib/devices/asrc/asrcmdel.c b/src/spicelib/devices/asrc/asrcmdel.c index e23443f0a..cf1ce28d1 100644 --- a/src/spicelib/devices/asrc/asrcmdel.c +++ b/src/spicelib/devices/asrc/asrcmdel.c @@ -33,6 +33,7 @@ ASRCmDelete(GENmodel **modList, IFuid modname, GENmodel *killModel) for (here = (*model)->ASRCinstances; here; here = here->ASRCnextInstance) { FREE(here->ASRCacValues); + FREE(here->ASRCopValues); if (prev) FREE(prev); prev = here; diff --git a/src/spicelib/devices/asrc/asrcset.c b/src/spicelib/devices/asrc/asrcset.c index cf551b59b..bd4d1aede 100644 --- a/src/spicelib/devices/asrc/asrcset.c +++ b/src/spicelib/devices/asrc/asrcset.c @@ -64,6 +64,7 @@ ASRCsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) here->ASRCposptr = TMALLOC(double *, j); here->ASRCvars = TMALLOC(int, here->ASRCtree->numVars); here->ASRCacValues = TMALLOC(double, here->ASRCtree->numVars); + here->ASRCopValues = TMALLOC(double, here->ASRCtree->numVars); /* For each controlling variable set the entries in the vector of the positions of the SMP */