X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f X-Recipient: geda-user AT delorie DOT com Subject: =?UTF-8?Q?Re:_[geda-user]_Bunch_Simulation_?= =?UTF-8?Q?ngspice?= From: =?UTF-8?Q?michalwd1979?= To: geda-user AT delorie DOT com In-Reply-To: <20150116121619.Horde.nPQGevRm4SzyvBjA40aa6Q2@webmail.in-berlin.de> References: <20150116121619 DOT Horde DOT nPQGevRm4SzyvBjA40aa6Q2 AT webmail DOT in-berlin DOT de> Mime-Version: 1.0 Message-ID: <5ff846f7.421e8d2d.54b90bbc.c5ac2@o2.pl> Date: Fri, 16 Jan 2015 14:01:48 +0100 X-Originator: 153.19.152.254 Content-Type: multipart/mixed; boundary="==o2.pl-WebMail-6aae311e.57b53dbf.c5ad1==" Reply-To: geda-user AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: geda-user AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk This is a multi-part message in MIME format. --==o2.pl-WebMail-6aae311e.57b53dbf.c5ad1== Content-Type: multipart/alternative; boundary="==o2.pl-WebMail-5f661e97.3951a0f.c5ad4==" --==o2.pl-WebMail-5f661e97.3951a0f.c5ad4== Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello=20Hagen, I've=20done=20something=20like=20this=20using=20Python.=20I've=20used=20t= he=20output=20file=20to=20load=20data=20and=20plot=20them=20with=20Matplo= tliob=20and=20I've=20manually=20(from=20python)=20modified=20the=20simula= tion=20file. The=20problem=20is=20that=20You=20have=20to=20prepare=20the=20CIR=20file=20= right,=20for=20example=20use=20.control,=20.endc=20block=20and=20include=20= write=20command=20there.=20It=20is=20quite=20possible=20that=20I=20will=20= find=20some=20examples=20of=20my=20old=20simulations=20if=20You=20are=20i= nterested. Now=20look=20at=20the=20ngspice.py=20module,=20"runng"=20and=20"fromng"=20= should=20be=20most=20important=20functions.=20There=20is=20also=20a=20"to= pwl"=20function=20that=20can=20create=20a=20PWL=20source=20subcircuit=20f= rom=20given=20waveform=20data=20-=20nice=20to=20include=20real=20world=20= signals=20gathered=20on=20scope=20to=20simulation. Best=20Regards, Michael=20W. Dnia=2016=20stycznia=202015=2012:16=20Hagen=20SANKOWSKI=20<hsank AT nospa= m.chipforge.org>=20napisa=C5=82(a): Hello=20geda-users! I=20like=20to=20run=20a=20bunch=20of=20simulations=20with=20ngspice,=20in= =20the=20way=20of -=20run=20a=20netlist -=20change=20not=20only=20one=20parameter=20(sweep=20I=20know)=20but=20al= so=20replace=20 circuits/models -=20run=20the=20modified=20netlist=20again -=20compare=20the=20results=20'auto-magic' all=20controled=20by=20a=20script. The=20Tcl=20Interface=20(in=20contrast=20to=20the=20geda=20scheme=20stuff= )=20I=20already=20noticed. I=20wonder=20if=20someone=20has=20an=20idea/script/example/hint=20how=20t= o=20do=20this=20efficently? Regards, Hagen. --==o2.pl-WebMail-5f661e97.3951a0f.c5ad4== Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello=20Hagen,I've=20done=20something=20like=20this=20usi= ng=20Python.=20I've=20used=20the=20output=20file=20to=20load=20data=20and= =20plot=20them=20with=20Matplotliob=20and=20I've=20manually=20(from=20pyt= hon)=20modified=20the=20simulation=20file.The=20problem=20is=20th= at=20You=20have=20to=20prepare=20the=20CIR=20file=20right,=20for=20exampl= e=20use=20.control,=20.endc=20block=20and=20include=20write=20command=20t= here.=20It=20is=20quite=20possible=20that=20I=20will=20find=20some=20exam= ples=20of=20my=20old=20simulations=20if=20You=20are=20interested.= Now=20look=20at=20the=20ngspice.py=20module,=20"runng"=20and=20"f= romng"=20should=20be=20most=20important=20functions.=20There=20is=20also=20= a=20"topwl"=20function=20that=20can=20create=20a=20PWL=20source=20subcirc= uit=20from=20given=20waveform=20data=20-=20nice=20to=20include=20real=20w= orld=20signals=20gathered=20on=20scope=20to=20simulation.= Best=20Regards,Michael=20W.Dnia=2016=20st= ycznia=202015=2012:16=20Hagen=20SANKOWSKI=20<hsank AT nospam DOT chipforge DOT or= g>=20napisa=C5=82(a): Hello=20geda-users!I=20like=20to=20run=20a=20b= unch=20of=20simulations=20with=20ngspice,=20in=20the=20way=20of-=20= run=20a=20netlist-=20change=20not=20only=20one=20parameter=20(swe= ep=20I=20know)=20but=20also=20replace=20circuits/models-=20= run=20the=20modified=20netlist=20again-=20compare=20the=20results= =20'auto-magic'all=20controled=20by=20a=20script.= The=20Tcl=20Interface=20(in=20contrast=20to=20the=20geda=20scheme=20stuff= )=20I=20already=20noticed.I=20wonder=20if=20someone=20has=20an=20= idea/script/example/hint=20how=20to=20do=20this=20efficently?Regards,Hagen. --==o2.pl-WebMail-5f661e97.3951a0f.c5ad4==-- --==o2.pl-WebMail-6aae311e.57b53dbf.c5ad1== Content-Type: text/x-python; name="=?UTF-8?Q?ngspice.py?=" Content-Disposition: attachment; filename="=?UTF-8?Q?ngspice.py?=" Content-Transfer-Encoding: base64 IyEvdXNyL2Jpbi9lbnYgcHl0aG9uCgojTmdTcGljZSBpbXBvcnQgLyBleHBvcnQKCmltcG9y dCBudW1weSwgcHlsYWIKaW1wb3J0IHN0cmluZywgb3MKCgpkZWYgZnJvbW5nKGZpbGUpOgoJ IiIiCgkJSW1wb3J0IG5nc3BpY2UgZmlsZSB0byBkaWN0aW9uYXJ5CgoJCXR1cGxlID0gZnJv bW5nKGZpbGUpCgkiIiIKCgluZ2ltcG9ydCA9IHt9CglmbmcgPSBvcGVuKGZpbGUsICdyJykJ CQkJCQkJCQkjb3BlbnMgZmlsZQoJd2hpbGUgVHJ1ZToKCQlsaW5lID0gZm5nLnJlYWRsaW5l KCkKCQlsaW5lID0gbGluZS5zcGxpdCgpCgkJbHR5cGUgPSBzdHJpbmcubG93ZXIobGluZVsw XSkKCQlpZiBsdHlwZS5maW5kKCJ0aXRsZSIpICE9IC0xOgoJCQluZ2ltcG9ydC51cGRhdGUo dGl0bGUgPSBzdHJpbmcuam9pbihsaW5lWzE6XSkpCQkJCSN0aXRsZQoJCWVsaWYgbHR5cG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