From 7483f6224da0527a7d6c6116cbf30248a92c5999 Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Tue, 20 Sep 2022 22:47:24 +0200 Subject: [PATCH] Note: vs: dc value used for op instead of transient time=0 value Former warning message or note only issued when dc value and value at transient time=0 differ. --- src/spicelib/devices/vsrc/vsrctemp.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/spicelib/devices/vsrc/vsrctemp.c b/src/spicelib/devices/vsrc/vsrctemp.c index d05ccaaf7..413a7392e 100644 --- a/src/spicelib/devices/vsrc/vsrctemp.c +++ b/src/spicelib/devices/vsrc/vsrctemp.c @@ -47,11 +47,21 @@ VSRCtemp(GENmodel *inModel, CKTcircuit *ckt) "%s: has no value, DC 0 assumed", here->VSRCname); } - else if (here->VSRCdcGiven && here->VSRCfuncTGiven) { - /* no DC value, no transient value */ - SPfrontEnd->IFerrorf(ERR_INFO, - "%s: dc value used for op instead of transient time 0 value.", - here->VSRCname); + else if (here->VSRCdcGiven && here->VSRCfuncTGiven + && here->VSRCfunctionType != TRNOISE && here->VSRCfunctionType != TRRANDOM) { + /* DC value and transient time 0 values given */ + double time0value; + /* determine transient time 0 value */ + if (here->VSRCfunctionType == AM || here->VSRCfunctionType == PWL) + time0value = here->VSRCcoeffs[1]; + else + time0value = here->VSRCcoeffs[0]; + /* No warning issued if DC value and transient time 0 value are the same */ + if (!AlmostEqualUlps(time0value, here->VSRCdcValue, 3)) { + SPfrontEnd->IFerrorf(ERR_INFO, + "%s: dc value used for op instead of transient time=0 value.", + here->VSRCname); + } } radians = here->VSRCacPhase * M_PI / 180.0; here->VSRCacReal = here->VSRCacMag * cos(radians);