[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: gEDA-user: Periodic steady state in NGSpice
On Tuesday 19 September 2006 09:02, Dan McMahill wrote:
> I'll ask a naive question here. I thought that the way
> shooting methods worked were after the initial transient you
> took a snapshot of the state, and ran for what you believe to
> be exactly 1 period and then compared the state of the
> circuit again and if it didn't match, you do sort of newtons
> method calculation to pick a new starting state.
I said "approximately". The idea of changing initial conditions
is a way of avoiding the transient run to get past the start-up
transient. Hopefully, this would make it faster.
> Or maybe you're just describing a different way of deciding
> when you've run enough cycles in a transient sim to find the
> periodic steady state solution.
Yes ... but the advanced algorithms try to avoid that transient
sim to get past the start-up, into steady state. I was
describing a quick and dirty way to get there.
> I don't think I quite understand about the tweaking the
> frequency and running the fourier analysis again bit.
You need to run it for "exactly 1 period". The gnucap fourier
command first runs a transient analysis with the stepping
chosen to be optimum for the frequencies you
selected. "Tweaking the frequency" means that after running it
once, you adjust the frequency slightly with the goal of really
getting "exactly 1 period".
> I'll add a caution that if you're not comparing the state of
> the entire circuit you have to be very careful to observe a
> signal which should have the fundamental period of the
> circuit as a whole and also pick one with the longest time
> constants. The first is important or you might think you
> have a periodic solution but suppose there is some block
> which creates subharmonics (a toggle flip-flop somewhere for
> example), you may have found a half-period solution instead
> of the whole period. Also suppose you have some bypassed
> bias line or some slow control loop. That line may not even
> have much of the periodic signal on it but it may have a long
> initial transient that takes a while to die out.
>
> > In ngspice, you will need a real Fourier transform, and the
> > ability to do repeat runs, with changes between them in
> > such as way as to not start over every time.
>
> This is a very nice feature of gnucap.
>
> > You will also need to
> > find a way to synchronize the data points with the Fourier
> > points, otherwise you will see what appears to be a high
> > noise floor, even if your frequencies are perfectly
> > matched. Also, I question whether the step size control is
> > capable of getting acceptable accuracy. You may need to
> > completely replace the time step control code.
>
> without having looked, does ngspice have a "strobeperiod"
> parameter like spectre? That basically says "in addition to
> your usual time step algorithm, output data points every
> strobeperiod seconds being sure to actually solve the circuit
> here"
I don't think so. As I recall, it gets the Fourier points by
interpolating on a previous transient analysis. This is a big
source of error. In gnucap, the time step you specify is
interpreted the same as the spectre strobeperiod. Based on a
conversation I had recently with some of the spectre people, I
think gnucap does a better job at taking that into account when
it picks the internal time steps. Gnucap tries hard to keep
the time step constant, while still accomodating a need for
changing the time step.
As an example .. suppose you ask for stepping every
microsecond, and the error control says you need .4
microsecond. Gnucap will give you .3333333 consistently, so
every third step matches the requested ones. I believe, but
don't know for sure, that spectre gives
you .4, .4, .2, .4, .4, .2 etc. I believe that spice 3f5 (and
therefore ng-spice) would give you .4 repeated,missing the
strobe points. Actually, I believe ng-spice would miscalculate
the needed stepping and give you 1 us repeated, with none of
the points matching the strobe, so it would interpolate every
time.
On the other hand, suppose error control asks for 4 us. Gnucap
and spectre both give you the 1 us you asked for. Spice gives
you 1 us stepping, but makes no attempt to synchronize to the
strobe.
_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user