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

gEDA-user: Verifying ngspice with an RLC sample in given link



Hi, I found the time to go back to my past
and revisit spice (used older Berkeley spice then)
so I tried a simple RLC circuit from the following
link and using ngspice:

http://www.allaboutcircuits.com/vol_2/chpt_6/3.html

Unfortunately, I was not able to duplicate the
plots as shown in the above link.  I am assuming
that the author is using something other than ngspice
or I am doing something wrong?

Attached is the rlc.sch file with the same circuit sans
the circuit netlist but it can be easily generated:

> gnetlist -o rlc.cir -g spice-sdb rlc.sch

The contents of rlc.cir is:

*********************************************************
* Spice file generated by gnetlist                      *
* spice-sdb version 4.28.2007 by SDB --                 *
* provides advanced spice netlisting capability.        *
* Documentation at http://www.brorson.com/gEDA/SPICE/   *
*********************************************************
*==============  Begin SPICE netlist of main design ============
L1 0 3 10mH
C1 3 2 10uF 
R1 1 2 1 
V1 1 0 dc 0 ac 1 sin
.end


Since the following was probably added manually:

.ac lin 20 100 200
.plot ac i(v1)
so, I added this in manually and ngspice seems to have
ignored it when started, so at this point I left it out.

I restarted ngspice:

> ngspice rlc.cir
******
** ngspice-21plus : 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-bugs@xxxxxxxxxxxxxxxxxxxxx
** Creation Date: Thu Jul 22 17:58:52 UTC 2010
******

Circuit: * gnetlist -o rlc.cir -g spice-sdb rlc.sch

ngspice 1 -> ac lin 20 100 200 <-- manually typed in
Doing analysis at TEMP = 27.000000 and TNOM = 27.000000



No. of Data Rows : 20
ngspice 2 -> plot i(v1) v(2,3) v(3) <-- manually typed in

I noted that I had to leave out 'ac' in plot command line
as ngspice did not recognize this vector...

Anyway, the plot results did not match what was given in the link.

What I was looking for was a peak as shown in the link but it
looked more like a lowpass filter.... what am I doing wrong?

Thanks-

Attachment: rlc.sch
Description: application/kicad-schematic


_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user