X-Authentication-Warning: delorie.com: mail set sender to geda-help-bounces using -f X-Recipient: geda-help AT delorie DOT com X-TCPREMOTEIP: 173.48.170.224 X-Authenticated-UID: jpd AT noqsi DOT com From: John Doty Content-Type: multipart/alternative; boundary="Apple-Mail=_32A5DFB1-1EA5-485F-8347-624FD2D6364E" Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: [geda-help] ngspice - to simulate the simplest circuit Date: Mon, 10 Jun 2019 15:10:41 -0400 References: To: "richard lucassen (mailinglists AT lucassen DOT org) [via geda-help AT delorie DOT com]" In-Reply-To: Message-Id: <0C25F9A4-F468-4A51-A4E2-F925CCA1EF44@noqsi.com> X-Mailer: Apple Mail (2.3273) Reply-To: geda-help AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: geda-help AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk --Apple-Mail=_32A5DFB1-1EA5-485F-8347-624FD2D6364E Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Change=20 .print v(Vin,0)=20 to=20 .print dc v(Vin) You need to tell .print which analysis, =E2=80=9Cdc=E2=80=9D in this = case. to take the output vector from. There is no output vector for node 0, so just use the absolute form = v(Vin) rather than the relative form. > On Jun 10, 2019, at 1:59 PM, Cs=C3=A1nyi P=C3=A1l = (csanyipal AT gmail DOT com) [via geda-help AT delorie DOT com] = wrote: >=20 > Hi, >=20 > I am trying to learn how to use ngspice. >=20 > I have the simplest circuit in the DC_R.sch schematic file: > v 20130925 2 > C 40000 40000 0 0 0 title-B.sym > C 43300 47300 1 0 0 resistor-2.sym > { > T 43700 47650 5 10 0 0 0 0 1 > device=3DRESISTOR > T 43500 47600 5 10 1 1 0 0 1 > refdes=3DR1 > T 43600 47100 5 10 1 1 0 0 1 > value=3D220 > } > C 43700 45900 1 0 0 gnd-1.sym > N 43000 46200 44200 46200 4 > N 44200 46200 44200 47400 4 > C 42700 46200 1 0 0 vdc-1.sym > { > T 43400 46850 5 10 1 1 0 0 1 > refdes=3DV1 > T 43400 47050 5 10 0 0 0 0 1 > device=3DVOLTAGE_SOURCE > T 43400 47250 5 10 0 0 0 0 1 > footprint=3Dnone > T 43400 46650 5 10 1 1 0 0 1 > value=3DDC 6V > } > C 40800 48100 1 0 0 spice-directive-1.sym > { > T 40900 48400 5 10 0 1 0 0 1 > device=3Ddirective > T 40900 48500 5 10 1 1 0 0 1 > refdes=3DA1 > T 40900 48200 5 10 0 1 0 0 1 > file=3Dunknown > T 40900 48200 5 10 1 1 0 0 1 > value=3D.dc V1 6 6 1 > } > N 43000 47400 43300 47400 4 > { > T 43000 47500 5 10 1 1 0 0 1 > netname=3DVin > } > C 40800 47400 1 0 0 spice-directive-1.sym > { > T 40900 47700 5 10 0 1 0 0 1 > device=3Ddirective > T 40900 47800 5 10 1 1 0 0 1 > refdes=3DA2 > T 40900 47500 5 10 0 1 0 0 1 > file=3Dunknown > T 40900 47500 5 10 1 1 0 0 1 > value=3D.print v(Vin,0) > } >=20 > What I want is to get the voltage after R1, that is, to see how much > R1 changes the input voltage of 5V in the circuit by using ngspice. >=20 > I did run this command: > gnetlist -g spice-sdb -o spice.net DC_R.sch >=20 > In the spice.net I have these lines: > * gnetlist -g spice-sdb -o spice.net DC_R.sch > ********************************************************* > * 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/ * > ********************************************************* > *=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Begin SPICE netlist of = main design =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > .print v(Vin,0) > .dc V1 6 6 1 > V1 Vin 0 DC 6V > R1 Vin 0 220 > .end >=20 > then did run this command: > ngspice -b spice.net >=20 > but get this output: > Circuit: * gnetlist -g spice-sdb -o spice.net dc_r.sch >=20 > Warning: no nodes given: .print v(vin,0) > Note: No ".plot", ".print", or ".fourier" lines; no simulations run >=20 > What am I doing wrong? >=20 > --=20 > Best, Pali >=20 John Doty Noqsi Aerospace, Ltd. jpd AT noqsi DOT com --Apple-Mail=_32A5DFB1-1EA5-485F-8347-624FD2D6364E Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Change 

.print v(Vin,0) 

to 

.print dc v(Vin)
You need to tell .print which = analysis, =E2=80=9Cdc=E2=80=9D in this case. to take the output vector = from.

There is = no output vector for node 0, so just use the absolute form v(Vin) rather = than the relative form.

On = Jun 10, 2019, at 1:59 PM, Cs=C3=A1nyi P=C3=A1l (csanyipal AT gmail DOT com) = [via geda-help AT delorie DOT com] <geda-help AT delorie DOT com> wrote:

Hi,
I am trying to learn how to use ngspice.

I have the simplest circuit in the DC_R.sch = schematic file:
v 20130925 2
C 40000 40000 0 = 0 0 title-B.sym
C 43300 47300 1 0 0 resistor-2.sym
{
T 43700 47650 5 10 0 0 0 0 1
device=3DRESISTOR
T 43500 47600 5 10 1 1 0 0 = 1
refdes=3DR1
T 43600 47100 5 10 1 1 0 0 = 1
value=3D220
}
C 43700 45900 = 1 0 0 gnd-1.sym
N 43000 46200 44200 46200 4
N = 44200 46200 44200 47400 4
C 42700 46200 1 0 0 vdc-1.sym
{
T 43400 46850 5 10 1 1 0 0 1
refdes=3DV1
T 43400 47050 5 10 0 0 0 0 1
device=3DVOLTAGE_SOURCE
T 43400 47250 5 10 0 0 = 0 0 1
footprint=3Dnone
T 43400 46650 5 10 1 = 1 0 0 1
value=3DDC 6V
}
C = 40800 48100 1 0 0 spice-directive-1.sym
{
T = 40900 48400 5 10 0 1 0 0 1
device=3Ddirective
T 40900 48500 5 10 1 1 0 0 1
refdes=3DA1
T 40900 48200 5 10 0 1 0 0 1
file=3Dunknown
T 40900 48200 5 10 1 1 0 0 1
value=3D.dc V1 6 6 = 1
}
N 43000 47400 43300 47400 4
{
T 43000 47500 5 10 1 1 0 0 1
netname=3DVin
}
C 40800 47400 1 0 = 0 spice-directive-1.sym
{
T 40900 47700 5 10 = 0 1 0 0 1
device=3Ddirective
T 40900 47800 5 = 10 1 1 0 0 1
refdes=3DA2
T 40900 47500 5 10 = 0 1 0 0 1
file=3Dunknown
T 40900 47500 5 10 = 1 1 0 0 1
value=3D.print v(Vin,0)
}

What I want is to get the voltage after R1, = that is, to see how much
R1 changes the input voltage of = 5V in the circuit by using ngspice.

I did = run this command:
gnetlist -g spice-sdb -o spice.net DC_R.sch

In the spice.net I have these lines:
* gnetlist -g = spice-sdb -o spice.net = DC_R.sch
*********************************************************
* Spice file generated by gnetlist =             &n= bsp;        *
* = spice-sdb version 4.28.2007 by SDB -- =             &n= bsp;   *
* provides advanced spice = netlisting capability.        *
* Documentation at http://www.brorson.com/gEDA/SPICE/   *
*********************************************************
*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D  Begin SPICE = netlist of main design =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
.print v(Vin,0)
.dc V1 6 6 1
V1 = Vin 0 DC 6V
R1 Vin 0 220
.end

then did run this command:
ngspice= -b spice.net

but get this output:
Circuit: * = gnetlist -g spice-sdb -o spice.net dc_r.sch

Warning: = no nodes given: .print v(vin,0)
Note: No ".plot", = ".print", or ".fourier" lines; no simulations run

What am I doing wrong?

--
Best, Pali


John Doty    =           Noqsi = Aerospace, Ltd.

jpd AT noqsi DOT com




= --Apple-Mail=_32A5DFB1-1EA5-485F-8347-624FD2D6364E--