RE: [ng-spice-devel] Use Initial Conditions problem in Spice 3f5.


To <ng-spice-devel@ieee.ing.uniroma1.it>
From "Jon Engelbert" <jon@beigebag.com>
Date Tue, 1 May 2001 20:34:10 -0400
Delivered-To mailing list ng-spice-devel@ieee.ing.uniroma1.it
Importance Normal
In-Reply-To <NDBBJKNCILBBMJOEMBICIEAHEDAA.jon@beigebag.com >
Mailing-List contact ng-spice-devel-help@ieee.ing.uniroma1.it; run by ezmlm
Reply-To ng-spice-devel@ieee.ing.uniroma1.it

OK,
I finally ran that test on Spice.  Here's what I found.

Here's the test circuit

tut2
IVIN N1  0 0
IVOUT N2  0 0
VP0 N1  0 DC 5 PULSE( 0 1 1n 1n 1n .5 1) AC 1 0
C3 N2  0  1n  ic = 5
VAm1 3  N2 0
R1 3  N1  50
* the following will change from test to test.
.IC  V(N1)= 3 V(N2) = 4
.TRAN  .05u 1u 0 .05u uic
.end


As you can see, the pulse starts at transient 0.
The capacitor has ic=5V.
And the nodes N1 and N2, at the voltage source and capacitor, start at 3 and
4 respectively.

With uic present, the .IC line overrides the capacitor initial voltage at
time 0.  But then the capacitor's ic=5 takes over at time 10p, the first
calculated time point, as V(N2) goes immediately to 5.  For this case, at
time 0, the voltage source's node N1 is at 3V, then it immediately changes
to 0 at time 10p.

Case 2: .TRAN  .05u 1u 0 .05u
Without uic present, things work more smoothly.  The capacitor's initial
voltage starts at 4V as specificied in the .IC line, and it stays around
there at 10p.  The voltage source's node N1 starts at 0V, and it stays there
as described by its transient at 10p.

So, as you can see using uic can lead to very screwy results.  The state at
time 0 seems consistent, but it jumps arbitrarily to the next time point.
I'm not sure at this point what the best solution is.  Perhaps, when uic is
present, the transient algorithm should prioritize its initial conditions so
that this jump doesn't happen.  For example, first the transient will set
the internal device initial conditions (e.g., capacitor's initial voltage),
then the .IC line, then the voltage and current sources' initial states,
with each successive setting overriding the previous settings if there is a
conflict.

Jon Engelbert
President, Beige Bag Software
279 E. Liberty, Ann Arbor, MI 48105
jon@beigebag.com

-----Original Message-----
From: Jon Engelbert [mailto:jon@beigebag.com]
Sent: Thursday, April 26, 2001 7:17 PM
To: ng-spice-devel@ieee.ing.uniroma1.it
Subject: RE: [ng-spice-devel] Use Initial Conditions problem in Spice 3f5.

Alan,
You're right.
This is from the SPICE manual.
"UIC is an optional keyword which indicates that the user does not want
SPICE to solve for the quiescent operating point before beginning the
transient analysis.  If this keyword is specified, SPICE uses the values
specified using  IC = ... on the various elements as the initial transient
condition and proceeds with the analysis.  ..."

I'd recommend changing it so that voltage sources are set at their initial
transient value in addition to using .IC settings.

I haven't looked at the code, but does anyone know if the state reported at
time zero is even consistent when UIC is used?  I'll try to set up a test
case tomorrow.


Jon Engelbert
President, Beige Bag Software
279 E. Liberty, Ann Arbor, MI 48105
jon@beigebag.com

-----Original Message-----
From: Gillespie, Alan [mailto:Alan.Gillespie@analog.com]
Sent: Thursday, April 26, 2001 5:43 AM
To: 'ng-spice-devel@ieee.ing.uniroma1.it'
Subject: RE: [ng-spice-devel] Use Initial Conditions problem in Spice 3f5.


> With UIC specified...
> sources start at zero, regardless of their dc value or their initial
> transient value.
> Also, I think that capacitors with no initial condition
> specified start with
> 0 volts across them.

As far as I understand it, that's what UIC is supposed to
do. There's no initial attempt at a DC solution, and everything
starts either at 0, or at the IC defined on the device line.

With the .IC card, spice will actually try to find initial
convergance with all the nodes held as they're defined on the
.IC line. I can't remember if Berkeley Spice uses the IC=
parameter on the devices in this mode. Some Spices do, others
don't.

The whole area of .IC, IC= and UIC has been interpreted
different ways by different Spices. Maybe we should state
a definition.

Cheers,

Alan


Partial thread listing: