delorie.com/archives/browse.cgi   search  
Mail Archives: geda-help/2019/06/10/14:14:09

X-Authentication-Warning: delorie.com: mail set sender to geda-help-bounces using -f
X-Recipient: geda-help AT delorie DOT com
X-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20161025;
h=mime-version:reply-to:from:date:message-id:subject:to;
bh=h9N2Bpt3CpdJZUnW94yOzlrdPxXOEin84HV5SQv9yNI=;
b=AtYq8Hoz8FfaHqSgrG3SKxIr/SqeUkOOtfpCqrUMjTahfbV+7VfoHoqVu4txAxLfQ6
6T8bEXVuvxfPorkrb78jBxPZSzhiFjF/YnHWa5boq6O04DR7TRO+35Sisd9sPOoUDWZ6
QpgzK53+UTXxpWgr2dgbcH+y6vr1HeaCUPfPw6fMqNLYzUHhBnoA7gxzp/84aqAtBal/
wXwW/+F+6LzzfXqz1h35eXXcCBN4qcJdD8OVCK4pLDEFSGgigFt6CSu4ajX3WZjsLsXu
Z6clHzmINzIzXRfvG5D82QMjby4MKVjFIKK/i4lO4D/QysVLLckxOmuGf20otsVRO2wo
0yiA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20161025;
h=x-gm-message-state:mime-version:reply-to:from:date:message-id
:subject:to;
bh=h9N2Bpt3CpdJZUnW94yOzlrdPxXOEin84HV5SQv9yNI=;
b=UVKvZsvasaAx+oMyWk2AGf3XPiNphW/HiIkuvD2mv7WgvEKGRqmIMFZjsFJiaa1wAj
ZhL3bSVDNBeCzUlviYiMIs41OPld7szqfQBHClLbam6bSnFdkj48i0lZ75aQUK6ZXywr
UZY2Ij6qU8cXqx+B6DNh1VZ4dDQOzgpE0wIDS6ZFMgm3xIYVArLaaznrEjSb96sUaFm/
j8mS2q3YjTmwgBQ0u8PakAThGVK62e3gfibQFLoe9+oROfnvZqrAqgUq/LdgHjqwQegQ
2J+PYijwp5dLRSLOd4TgjemZZYESIJ1NiUpD7kdfR4UuaxCupjNogJgVNtrzjFfwguDF
TeCw==
X-Gm-Message-State: APjAAAUpz8KYvbOYh06nAy50jSXTYyyFLdadf/lxIbNm3nTLxgQ8zggO
NbKNuF19TB1He5E13NuhOy4aqt69mSVd2pBBhrtA1j77
X-Google-Smtp-Source: APXvYqwQCVgeanv5xEpgSQN0AmBeZUIQka8RI5MBcYV35YR6a8FvZJvTVQnQCtlNVT3thvd7z/eIfaY+gsohrD41xuk=
X-Received: by 2002:aa7:81d1:: with SMTP id c17mr77255175pfn.174.1560189604857;
Mon, 10 Jun 2019 11:00:04 -0700 (PDT)
MIME-Version: 1.0
From: "=?UTF-8?B?Q3PDoW55aSBQw6Fs?= (csanyipal AT gmail DOT com) [via geda-help AT delorie DOT com]" <geda-help AT delorie DOT com>
Date: Mon, 10 Jun 2019 19:59:53 +0200
Message-ID: <CAONhAouTSuT5hc4PcZXnPtsUndWY18H01KRPAyeVYUAVz3qq2w@mail.gmail.com>
Subject: [geda-help] ngspice - to simulate the simplest circuit
To: gEDA Help <geda-help AT delorie DOT com>
Reply-To: geda-help AT delorie DOT com

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=RESISTOR
T 43500 47600 5 10 1 1 0 0 1
refdes=R1
T 43600 47100 5 10 1 1 0 0 1
value=220
}
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=V1
T 43400 47050 5 10 0 0 0 0 1
device=VOLTAGE_SOURCE
T 43400 47250 5 10 0 0 0 0 1
footprint=none
T 43400 46650 5 10 1 1 0 0 1
value=DC 6V
}
C 40800 48100 1 0 0 spice-directive-1.sym
{
T 40900 48400 5 10 0 1 0 0 1
device=directive
T 40900 48500 5 10 1 1 0 0 1
refdes=A1
T 40900 48200 5 10 0 1 0 0 1
file=unknown
T 40900 48200 5 10 1 1 0 0 1
value=.dc V1 6 6 1
}
N 43000 47400 43300 47400 4
{
T 43000 47500 5 10 1 1 0 0 1
netname=Vin
}
C 40800 47400 1 0 0 spice-directive-1.sym
{
T 40900 47700 5 10 0 1 0 0 1
device=directive
T 40900 47800 5 10 1 1 0 0 1
refdes=A2
T 40900 47500 5 10 0 1 0 0 1
file=unknown
T 40900 47500 5 10 1 1 0 0 1
value=.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                      *
* spice-sdb version 4.28.2007 by SDB --                 *
* provides advanced spice netlisting capability.        *
* Documentation at http://www.brorson.com/gEDA/SPICE/   *
*********************************************************
*==============  Begin SPICE netlist of main design ============
.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

- Raw text -


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