help-gnucap
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-gnucap] complex numbers and parametric sweeps


From: Al Davis
Subject: Re: [Help-gnucap] complex numbers and parametric sweeps
Date: Thu, 24 Jul 2003 15:13:48 -0600

On Wednesday 09 July 2003 17:41, Berk Ozer wrote:
> Does Gnucap support complex numbers?
> When running the following netlist in SPICE
> I get complex-valued frequency and V(2) values.
> When I run it in Gnucap I get real frequency
> values and nothing for V(2).

Of course it does.  It is a lot more flexible than Spice.

If you don't specify, you get the magnitude, so V(2) gives the 
magnitude.

Appending a letter gives a variant ...

VP(2) is phase (in degrees by default)
VR(2) is the real part
VI(2) is the imaginary part
VM(2) is the magnitude
VDB(2) is magnitude in DB. (relative to 1).

If you want phase in radians (like Spice), do ".option phase=radians".


> I am close to finish the integration of Gnucap
> into my circuit simulation GUI but I still have
> no clue how complex numbers and parametric
> sweeps are displayed, if at all.
> Here is an example for the analysis option which
> I call "parametric sweep":
>
>
> PARAMETRIC SWEEP
> * circuit description
> m1  2 1 4 3 p1 L=0.35u W=10.0u
> vgs 1 0 -3.5
> vds 2 0 -0.1
> vbs 3 0 0.0
> r1  4 0 10k
> * mosfet model
> .model p1 PMOS
> * analysis
> .dc vgs 0 -3.5 -0.05 vbs 0 3. 0.5  <------ A set of lines with vbs
> as the parameter
> .print dc v(4)
> .end

You need to select the print points first, before analyzing, 
otherwise it will print nothing.  It's like a real circuit.  You need 
to attach the probes first.

For now, the DC sweep only does one parameter.   I have been meaning 
to change that for years.  Unlike Spice, you can sweep any simple 
component, not just sources.

The "sweep" command gives you another level of nesting, and is more 
general.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]