Circuit with Passive Elements, Operating Point
We need a dc voltage source and two resistors that build a simple resistive voltage divider.
What is the netlist of this circuit? The voltage source is connected between 0 (ground) and node in, with value 1 (volt). R1 is connected between in and out with value 1k (ohms), R2 is connected between out and ground and has value 2k (ohms).
Note that the dimensions (volts, ohms, amps etc.) are omitted in the netlist file.
voltage divider netlist V1 in 0 1 R1 in out 1k R2 out 0 2k .end
Line 1 is a title line. >.end
in line 5 denotes the end of the netlist. Put these lines into a text file named vdiv.cir and save it. Now start ngspice and looad the netlist into ngspice by entering the command source vdiv.cir
or, in linux, just ngspice vdiv.cir
. ngspice is now ready for simulation, the netlist is loaded.
What kind of simulation do we now want to have? Of interest is the DC voltage at node out. This is the operating point of the circuit. We will get this by entering the print out
command. This is the output you will get with ngspice for the complete sequence, and you see the voltage at node out:
****** ** ngspice-31 : Circuit level simulation program ** The U. C. Berkeley CAD Group ** Copyright 1985-1994, Regents of the University of California. ** Please get your ngspice manual from https://ngspice.sourceforge.io/docs.html ** Please file your bug-reports at https://ngspice.sourceforge.io/bugrep.html ** Creation Date: Mar 30 2019 09:37:02 ****** ngspice 1 -> source vdiv.cir Circuit: voltage divider netlist ngspice 2 -> op Doing analysis at TEMP = 27.000000 and TNOM = 27.000000 No. of Data Rows : 1 ngspice 3 -> print out out = 6.666667e-01 ngspice 4 ->