delorie.com/archives/browse.cgi   search  
Mail Archives: geda-help/2019/06/10/15:24:45

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 <jpd AT noqsi DOT com>
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: <CAONhAouTSuT5hc4PcZXnPtsUndWY18H01KRPAyeVYUAVz3qq2w AT mail DOT gmail DOT com>
To: "richard lucassen (mailinglists AT lucassen DOT org) [via geda-help AT delorie DOT com]" <geda-help AT delorie DOT com>
In-Reply-To: <CAONhAouTSuT5hc4PcZXnPtsUndWY18H01KRPAyeVYUAVz3qq2w@mail.gmail.com>
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

--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] =
<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

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html =
charset=3Dutf-8"></head><body style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" =
class=3D"">Change&nbsp;<div class=3D""><br class=3D""></div><div =
class=3D"">.print v(Vin,0)&nbsp;</div><div class=3D""><br =
class=3D""></div><div class=3D"">to&nbsp;</div><div class=3D""><br =
class=3D""></div><div class=3D"">.print dc v(Vin)</div><div class=3D""><br=
 class=3D""></div><div class=3D"">You need to tell .print which =
analysis, =E2=80=9Cdc=E2=80=9D in this case. to take the output vector =
from.</div><div class=3D""><br class=3D""></div><div class=3D"">There is =
no output vector for node 0, so just use the absolute form v(Vin) rather =
than the relative form.</div><div class=3D""><br =
class=3D""><div><blockquote type=3D"cite" class=3D""><div class=3D"">On =
Jun 10, 2019, at 1:59 PM, Cs=C3=A1nyi P=C3=A1l (<a =
href=3D"mailto:csanyipal AT gmail DOT com" class=3D"">csanyipal AT gmail DOT com</a>) =
[via <a href=3D"mailto:geda-help AT delorie DOT com" =
class=3D"">geda-help AT delorie DOT com</a>] &lt;<a =
href=3D"mailto:geda-help AT delorie DOT com" =
class=3D"">geda-help AT delorie DOT com</a>&gt; wrote:</div><br =
class=3D"Apple-interchange-newline"><div class=3D""><div class=3D"">Hi,<br=
 class=3D""><br class=3D"">I am trying to learn how to use ngspice.<br =
class=3D""><br class=3D"">I have the simplest circuit in the DC_R.sch =
schematic file:<br class=3D"">v 20130925 2<br class=3D"">C 40000 40000 0 =
0 0 title-B.sym<br class=3D"">C 43300 47300 1 0 0 resistor-2.sym<br =
class=3D"">{<br class=3D"">T 43700 47650 5 10 0 0 0 0 1<br =
class=3D"">device=3DRESISTOR<br class=3D"">T 43500 47600 5 10 1 1 0 0 =
1<br class=3D"">refdes=3DR1<br class=3D"">T 43600 47100 5 10 1 1 0 0 =
1<br class=3D"">value=3D220<br class=3D"">}<br class=3D"">C 43700 45900 =
1 0 0 gnd-1.sym<br class=3D"">N 43000 46200 44200 46200 4<br class=3D"">N =
44200 46200 44200 47400 4<br class=3D"">C 42700 46200 1 0 0 vdc-1.sym<br =
class=3D"">{<br class=3D"">T 43400 46850 5 10 1 1 0 0 1<br =
class=3D"">refdes=3DV1<br class=3D"">T 43400 47050 5 10 0 0 0 0 1<br =
class=3D"">device=3DVOLTAGE_SOURCE<br class=3D"">T 43400 47250 5 10 0 0 =
0 0 1<br class=3D"">footprint=3Dnone<br class=3D"">T 43400 46650 5 10 1 =
1 0 0 1<br class=3D"">value=3DDC 6V<br class=3D"">}<br class=3D"">C =
40800 48100 1 0 0 spice-directive-1.sym<br class=3D"">{<br class=3D"">T =
40900 48400 5 10 0 1 0 0 1<br class=3D"">device=3Ddirective<br =
class=3D"">T 40900 48500 5 10 1 1 0 0 1<br class=3D"">refdes=3DA1<br =
class=3D"">T 40900 48200 5 10 0 1 0 0 1<br class=3D"">file=3Dunknown<br =
class=3D"">T 40900 48200 5 10 1 1 0 0 1<br class=3D"">value=3D.dc V1 6 6 =
1<br class=3D"">}<br class=3D"">N 43000 47400 43300 47400 4<br =
class=3D"">{<br class=3D"">T 43000 47500 5 10 1 1 0 0 1<br =
class=3D"">netname=3DVin<br class=3D"">}<br class=3D"">C 40800 47400 1 0 =
0 spice-directive-1.sym<br class=3D"">{<br class=3D"">T 40900 47700 5 10 =
0 1 0 0 1<br class=3D"">device=3Ddirective<br class=3D"">T 40900 47800 5 =
10 1 1 0 0 1<br class=3D"">refdes=3DA2<br class=3D"">T 40900 47500 5 10 =
0 1 0 0 1<br class=3D"">file=3Dunknown<br class=3D"">T 40900 47500 5 10 =
1 1 0 0 1<br class=3D"">value=3D.print v(Vin,0)<br class=3D"">}<br =
class=3D""><br class=3D"">What I want is to get the voltage after R1, =
that is, to see how much<br class=3D"">R1 changes the input voltage of =
5V in the circuit by using ngspice.<br class=3D""><br class=3D"">I did =
run this command:<br class=3D"">gnetlist -g spice-sdb -o <a =
href=3D"http://spice.net" class=3D"">spice.net</a> DC_R.sch<br =
class=3D""><br class=3D"">In the <a href=3D"http://spice.net" =
class=3D"">spice.net</a> I have these lines:<br class=3D"">* gnetlist -g =
spice-sdb -o <a href=3D"http://spice.net" class=3D"">spice.net</a> =
DC_R.sch<br =
class=3D"">*********************************************************<br =
class=3D"">* Spice file generated by gnetlist =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*<br class=3D"">* =
spice-sdb version 4.28.2007 by SDB -- =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;*<br class=3D"">* provides advanced spice =
netlisting capability. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*<br =
class=3D"">* Documentation at <a =
href=3D"http://www.brorson.com/gEDA/SPICE/" =
class=3D"">http://www.brorson.com/gEDA/SPICE/</a> &nbsp;&nbsp;*<br =
class=3D"">*********************************************************<br =
class=3D"">*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D &nbsp;Begin SPICE =
netlist of main design =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<br =
class=3D"">.print v(Vin,0)<br class=3D"">.dc V1 6 6 1<br class=3D"">V1 =
Vin 0 DC 6V<br class=3D"">R1 Vin 0 220<br class=3D"">.end<br =
class=3D""><br class=3D"">then did run this command:<br class=3D"">ngspice=
 -b <a href=3D"http://spice.net" class=3D"">spice.net</a><br =
class=3D""><br class=3D"">but get this output:<br class=3D"">Circuit: * =
gnetlist -g spice-sdb -o <a href=3D"http://spice.net" =
class=3D"">spice.net</a> dc_r.sch<br class=3D""><br class=3D"">Warning: =
no nodes given: .print v(vin,0)<br class=3D"">Note: No ".plot", =
".print", or ".fourier" lines; no simulations run<br class=3D""><br =
class=3D"">What am I doing wrong?<br class=3D""><br class=3D"">-- <br =
class=3D"">Best, Pali<br class=3D""><br =
class=3D""></div></div></blockquote></div><br class=3D""><div class=3D"">
<span class=3D"Apple-style-span" style=3D"border-collapse: separate; =
border-spacing: 0px; font-variant-ligatures: normal; =
font-variant-east-asian: normal; font-variant-position: normal; =
line-height: normal;"><div style=3D"word-wrap: break-word;" =
class=3D""><span class=3D"Apple-style-span" style=3D"border-collapse: =
separate; border-spacing: 0px; color: rgb(0, 0, 0); font-family: =
Helvetica; font-size: 12px; font-style: normal; font-variant-ligatures: =
normal; font-variant-caps: normal; font-variant-east-asian: normal; =
font-variant-position: normal; font-weight: normal; letter-spacing: =
normal; line-height: normal; text-indent: 0px; text-transform: none; =
orphans: 2; white-space: normal; widows: 2; word-spacing: 0px;"><p =
style=3D"margin: 0px;" class=3D""><font face=3D"Helvetica" size=3D"3" =
style=3D"font-style: normal; font-variant-caps: normal; font-weight: =
normal; font-size: 12px; line-height: normal; font-family: Helvetica;" =
class=3D"">John Doty<span class=3D"Apple-converted-space">&nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp;<span =
class=3D"Apple-converted-space">&nbsp;</span><span =
class=3D"Apple-converted-tab">&nbsp; &nbsp;<span =
class=3D"Apple-converted-space">&nbsp;</span></span></span>Noqsi =
Aerospace, Ltd.</font></p><p style=3D"margin: 0px;" class=3D""><a =
href=3D"mailto:jpd AT noqsi DOT com" class=3D"">jpd AT noqsi DOT com</a></p><br =
class=3D"Apple-interchange-newline"></span></div></span><br =
class=3D"Apple-interchange-newline">
</div>
<br class=3D""></div></body></html>=

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019