How to display results using ngspice

simulationspice

Using this tutorial, I am using ngspice (on Cygwin) to run the following file:

My first circuit
v 1 0 dc 10
r 1 0 5
.end

However, after running it using ngspice < first.cir, I receive the following output:

Circuit: My first circuit

Note: No ".plot", ".print", or ".fourier" lines; no simulations run

How do I print the basic diagnostics of the circuit?

Best Answer

Since your deck doesn't specify any simulations to be run, or any output to be produced, Spice is letting you know it hasn't done anything.

There are three ways to fix this:

  1. Add a simulation card (like .OP or .DC) and an output card (like .PRINT) to your circuit.

  2. Use ngspice's interactive mode. Start the program with ngspice first.cir (no '<' character) and it will give you an interactive shell where you can request specific simulations be run and outputs to be plotted.

  3. Use .CONTROL ... .ENDC (an ngspice extension) in your deck to add batch commands that execute simulations and plot outputs, using the syntax of the interactive shell.