gnucap-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnucap-devel] python bindings update


From: Patrick Mulder
Subject: Re: [Gnucap-devel] python bindings update
Date: Wed, 26 Dec 2018 17:08:09 +0100

Thanks Felix, your updates look very interesting, especially, the inverter
fitting example (this is a bit too advanced for myself right now, but I
will have it on my lists of things to learn.)

For now, I got the gnucap Python module running on my Ubuntu machine.
My first goal would be to plot some transient waveforms with help of this
circuit:

pulse_ckt.sp
 spice
v1 (1 0) pulse (0 1)

.print tran v(1)
.tran 0 1 .1
.tran trace all

.end

and with this Python script:
sim_pulse.py

import sys
import numpy as np
import gnucap
from gnucap import command as cmd


def setup_circuit():
    cmd("get pulse_ckt.sp")
    cmd("print tran v(1)")
    cmd("tran 0 1 .1")
    cmd("store tran v(nodes) i(v1)")


print("start")
setup_circuit()

print("end")

Maybe you could point me to the following commands:
1) how to print/check what netlist was loaded, basically a kind of status
command, where we could see what would be simulate
2) where do I start the actual simulation (in the .sp file or from the
python script)
3) how to fetch the results from the simulation, and either wrap them in
Numpy or maybe in Pandas

When I have this working, I can try to share the results in a Jupyter
notebook.

Thanks a lot for sharing your efforts and project.

Patrick



On Sat, Dec 22, 2018 at 2:07 PM Felix Salfelder <address@hidden> wrote:

> Dear all.
>
> Following up a lengthy thread on exploration and alpha testing the
> Python bindings (thanks to Patrick) earlier this year...  I am glad to
> annouce a functional gnucap-python package, now version 0.0.2 [1].
>
> Debian packages have been uploaded to testing (thanks to Carsten and
> Ruben). These reduce the hassle of manual builds considerably and work
> out of the box with Python 2.7, and 3.{6,7}, making accessible what
> Python has to offer.
>
> While some features may be missing, the important and difficult bits are
> in place. Examples are included, especially for the following.
>
> - copy-free access to circuit components and data from Python
>    e.g. matrix access (numpy, scipy.sparse).
> - interact with circuits in a Python script
>    post-processing, visualisation (matplotlib) or optimisation (nlopt).
> - simulation commands can be written in Python
>    extending what we currently have, e.g. pz analysis using scipy.
> - implement circuit components in Python
>         the basis for interactive testbenching and further customisation
>
> The gnucap-python package is designed for growth, your feedback might
> determine what's next.
>
> cheers
> felix
>
> [1] http://gnucap.org/dokuwiki/doku.php/gnucap:user:gnucap_python
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]