[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gEDA-user: Simulation with Potentimeter



I tried doing an analysis in tclspice/ngspice using a simple resistor
dividor.  Here's the output:

---------------------  Tclspice log  -----------------------
******
** tclspice-0.2.15 : Circuit level simulation program
** The U. C. Berkeley CAD Group
** Copyright 1985-1994, Regents of the University of California.
** Please submit bug-reports to: ngspice-devel@lists.sourceforge.net
** Creation Date: Sun Dec 21 22:06:36 EST 2003
******

Circuit: * Resistor sweep test circuit

tclspice 362 -> listing
	* Resistor sweep test circuit

     2 : r1 0 1 1k
     3 : r2 1 2 1k
     4 : v1 0 2 1v
     5 : .dc r1 100 0 1k
     6 : .end
tclspice 363 -> run
Doing analysis at TEMP = 300.150000 and TNOM = 300.150000
** Resistor sweep is highly alpha code
**Results may not be accurate.

No. of Data Rows : 1
tclspice 364 -> plot V(1)
tclspice 365 -> print V(1)
v(1) = -5.00000e-01

tclspice 364 -> exit
Warning: the following plots haven't been saved:
dc1	* Resistor sweep test circuit, DC transfer characteristic

Are you sure you want to quit (yes)? yes
--------------------  End of tclspice log  ---------------------

Unfortunately, the result is not a vector, so the sweep didn't work as
one would want, at least in tclspice.  I'll add this to my (ever-growing)
list of things needing fixin' in that prog.  Or maybe my head is wedged 
& I have not entered the right command sequence?  

Nonetheless, if you have a simulator which works, I'd recommend that you
use the "spice-directive" symbol in the spice directory to input 
the ".dc r1 100 0 1K" string directly into your netlist.  "Spice-directive"
 simply outputs the string you place into the "value" attribute.  Just 
delete the "file" attribute -- you don't need it.  That way you can do 
simulations with a swept resistor.  

Alternatively, if you have a simulator
which admits swept parameters, you can just type the sweeping command
directly into the "spice-directive" symbol.

Stuart

Quoting "mailinglists@my-mail.ch" <mailinglists@my-mail.ch>:
> I just had a look at the source code and it seems as if it's just a DC
> analysis like:
> 
> R2 3 1 100 
> R1 2 3 100 
> V1 2 1 5
> .DC R1 100 1k 100
> .END
> 
> Tobias
> 
> 
> Am Sam, den 03.01.2004 schrieb Stuart Brorson um 23:32:
> > 
> > I looked through the docs I have, but found no reference to resistor
> > sweeps in ngspice.  Do you know what the syntax is for this analysis?
> > (Yes, I could grep through the tclspice code for it, but that is a
> > real PITA . . . . )
> > 
> > Stuart