Questions tagged [ngspice]

Anything related to NGSPICE, an open-source SPICE simulation program.

Anything related to NGSPICE, an open-source SPICE simulation program.

Excerpt from NGSPICE website:

Ngspice is a mixed-level/mixed-signal circuit simulator. Its code is based on three open source software packages: Spice3f5, Cider1b1 and Xspice. It is the open source successor of these venerable packages. Many, many modifications, bug fixes and improvements have been added to the code, yielding a stable and reliable simulator. Therefore, besides being used as a standalone simulator, Ngspice has been incorporated into many projects, see our simulation environments page.

See also Ngspice on Wikipedia

125 questions
3
votes
1 answer

ngspice - print numbers in engineering notation

Can .print in ngspice be told to print numbers in engineering notation (e.g. vout = 450e-3, not vout = 4.5e-1)? I've searched online and in the manual but could not find anything.
pschulz
  • 225
  • 1
  • 8
3
votes
1 answer

Export vector data from ngspice

Is it possible to export vector values or other data from ngspice to a file? It would be nice to use the data in other programs such as octave or gnplot for prettier plots. Thanks
EarthIsHome
  • 265
  • 1
  • 10
2
votes
2 answers

How to set forward voltage for a diode model in NGSpice?

I am trying to understand the documentation for the diode model, but I could not find how to set the forward voltage value. Can someone help me simulate silicon diode that has a forward voltage of approximately 0.7 volts?
simo
  • 273
  • 1
  • 13
2
votes
1 answer

NgSpice error: unknown subckt

I am have defined a subcircuit header as: .SUBCKT RELAY_SPDT_BHV coila coilb no nc com T_make=20mSec T_break=10mSec I_pull=35ma I_drop=25ma R_coil=100 L_coil=5mH R_open=100MEG R_close=.05 and I am calling it as: X1 6 1 4 7 8…
simo
  • 273
  • 1
  • 13
2
votes
2 answers

Is it possible to pass netlist via command line to ngspice instead of using input file?

Is there a way to use ngspice command line without providing a circuit file? ex: passing the circuit as a string within the command line ? EDIT Currently the only way I could use ngspice in command line is by providing an input file.. I could not…
simo
  • 273
  • 1
  • 13
2
votes
1 answer

How do I get an output file out of ngspice

I have this simple netlist First Circuit R1 1 2 3k R2 2 0 6k R3 2 3 4k R4 3 0 2k Vs 1 0 DC 9 Is 3 0 DC 5M .dc .End In the past when running a text based SPICE program I get and output file where it tells me all of the node voltages and other simple…
Jay
  • 63
  • 1
  • 7
1
vote
0 answers

Xschem and ngspice Error: unknown subckt

I'm trying to get started with xschem and ngspice to simulate some circuits but have problems getting the programs installed. I tried a very small circuit with 1 transistor, but get an error. After looking around on the web I still don't now how to…
Faith
  • 11
  • 1
1
vote
0 answers

Ngspice -Scale set

I am trying to simulate an SRAM in Ngspice. I am writing data into a particular address from an input port and reading the same from an output port while performing transient analysis. The simulation takes a couple of hours and then asks for "Scale…
rachana
  • 11
  • 1
1
vote
1 answer

Unknown model type bjt - ignored

I am trying to use Transistor model as in the NGSpice manual 8.2 BJT Models (NPN/PNP): .model QMOD1 BJT level=2 however, I got this error: q1 n15 n16 n17 qmod1 could not find a valid modelname Warning: Model issue on line 61 : .model qmod1 bjt…
simo
  • 273
  • 1
  • 13
1
vote
2 answers

How to simulate simple on/off, Single-Pole-Single-Throw switch?

I am trying to simulate ON, OFF switch in this simple circuit: V1 0 1 1.5v Rfan1 3 4 1 S1 1 4 SW ON Rwire1 6 5 0.00001 VV1 0 2 dc 0 VRfan1 3 5 dc 0 VRwire1 2 6 dc 0 .dc V1 1.5 1.5 1 .print dc i(VV1) i(VRfan1) i(VRwire1) .end but I got this…
simo
  • 273
  • 1
  • 13
1
vote
1 answer

ngspice ltvspice netlist compatibility problems

This is my netlist .title KiCad schematic V1 Net-_R1-Pad1_ 0 5V R1 Net-_R1-Pad1_ Net-_R1-Pad2_ 100k X1 0 Net-_R1-Pad2_ LM385BZ-1.2 .SUBCKT LM385BZ-1.2 A K * * TWO-TERMINAL VOLTAGE REFERENCE * DFWD A K DF GREV A K…
1
vote
1 answer

How to generate triangle shape?

I tried to follow docs, and here is my implementation for triangle pulse: V1 0 1 PULSE(-0.75 0.75 0m 8.335m 8.335m 0 16.67m 0) but the result is: although the Rise time is 8.335m at appears as 0, can someone explain what’s the issue?
simo
  • 273
  • 1
  • 13
1
vote
2 answers

ngspice pulse remains at 0 volts

I'm trying to simulate a simple pulse generator that gets activated by a voltage source vs. vs starts at 0V and switches to 5V at 10us where it remains at 5V for the duration of the simulation. When I run the simulation and plot v(in), the voltage…
EarthIsHome
  • 265
  • 1
  • 10
0
votes
2 answers

How to deal with dangling nets in SPICE simulations?

I am running an operating point simulation in ngspice and I get DC currents through capacitors. The netlist I am using is programmatically generated. Some components from a circuit were deleted which results in dangling components/nets that do not…
ARF
  • 5,199
  • 9
  • 43
  • 71
0
votes
1 answer

How does ngSPICE pick the variables to solve in a network?

I've been thinking about how ngspice and other circuit simulators select the 'state variables' for a network. I know that this will involve some graph theory but was unable to find any references that describe just what it is that the solvers do.…
1
2