All Projects → ahkab → Ahkab

ahkab / Ahkab

Licence: gpl-2.0
a SPICE-like electronic circuit simulator written in Python

Programming Languages

python
139335 projects - #7 most used programming language

Labels

Projects that are alternatives of or similar to Ahkab

mdct
A fast MDCT implementation using SciPy and FFTs
Stars: ✭ 42 (-84.62%)
Mutual labels:  scipy
numpyeigen
Fast zero-overhead bindings between NumPy and Eigen
Stars: ✭ 75 (-72.53%)
Mutual labels:  scipy
GUI Blob Tracker
Python GUI Multiple Blob Tracker
Stars: ✭ 24 (-91.21%)
Mutual labels:  scipy
tests-as-linear
Python port of "Common statistical tests are linear models" by Jonas Kristoffer Lindeløv.
Stars: ✭ 64 (-76.56%)
Mutual labels:  scipy
polytope
Geometric operations on polytopes of any dimension
Stars: ✭ 51 (-81.32%)
Mutual labels:  scipy
vor-python-decoder
Decodes VOR signal from WAV file to get the bearing to your position
Stars: ✭ 33 (-87.91%)
Mutual labels:  scipy
chaospy
Chaotic attractors (Lorenz, Rossler, Rikitake etc.)
Stars: ✭ 47 (-82.78%)
Mutual labels:  scipy
workshops-setup cloud analytics machine
Tips and Tricks to setup a cloud machine for Analytics and Data Science with R, RStudio and Shiny Servers, Python and JupyterLab
Stars: ✭ 12 (-95.6%)
Mutual labels:  scipy
Scipy-Bordeaux-2017
Course taught at the University of Bordeaux in the academic year 2017 for PhD students.
Stars: ✭ 16 (-94.14%)
Mutual labels:  scipy
jun
JUN - python pandas, plotly, seaborn support & dataframes manipulation over erlang
Stars: ✭ 21 (-92.31%)
Mutual labels:  scipy
pytorch-notebook
Jupyter Notebook Pytorch Stack
Stars: ✭ 29 (-89.38%)
Mutual labels:  scipy
SciCompforChemists
Scientific Computing for Chemists text for teaching basic computing skills to chemistry students using Python, Jupyter notebooks, and the SciPy stack. This text makes use of a variety of packages including NumPy, SciPy, matplotlib, pandas, seaborn, NMRglue, SymPy, scikit-image, and scikit-learn.
Stars: ✭ 65 (-76.19%)
Mutual labels:  scipy
sparse dot
Python wrapper for Intel Math Kernel Library (MKL) matrix multiplication
Stars: ✭ 38 (-86.08%)
Mutual labels:  scipy
dsp-theory
Theory of digital signal processing (DSP): signals, filtration (IIR, FIR, CIC, MAF), transforms (FFT, DFT, Hilbert, Z-transform) etc.
Stars: ✭ 643 (+135.53%)
Mutual labels:  scipy
SciPyDiffEq.jl
Wrappers for the SciPy differential equation solvers for the SciML Scientific Machine Learning organization
Stars: ✭ 19 (-93.04%)
Mutual labels:  scipy
audiophile
Audio fingerprinting and recognition
Stars: ✭ 17 (-93.77%)
Mutual labels:  scipy
Algorithmic-Trading
I have been deeply interested in algorithmic trading and systematic trading algorithms. This Repository contains the code of what I have learnt on the way. It starts form some basic simple statistics and will lead up to complex machine learning algorithms.
Stars: ✭ 47 (-82.78%)
Mutual labels:  scipy
Verde
Processing and interpolating spatial data with a twist of machine learning
Stars: ✭ 260 (-4.76%)
Mutual labels:  scipy
Python-Matematica
Explorando aspectos fundamentais da matemática com Python e Jupyter
Stars: ✭ 41 (-84.98%)
Mutual labels:  scipy
sentences-similarity-cluster
Calculate similarity of sentences & Cluster the result.
Stars: ✭ 14 (-94.87%)
Mutual labels:  scipy

Monkeying around ahkab

a SPICE-like electronic circuit simulator written in Python

The code should be easy to read and modify, the main language is Python -- 2 or 3 -- and it is platform-independent.

News

  • It's with a heavy heart that I write that @ggventurini passed away on September 15th, 2015, at the age of thirty-two. He will be remembered fondly as a friendly and helpful engineer, always excited about his work at CERN and his numerous labors to improve the accessibility of tools for science, research, and development.
  • Ahkab v0.18 was released on July 12 2015, including new features, bugfixes and improved documentation. It is recommended to upgrade. Check out the release notes for more!
  • The whole codebase has been going through a (yet incomplete) refactoring and documenting effort. The new documentation is available on RTD.

If you are interested in the project or the technology, have an issue with an example, or you would like to contribute by requesting, refactoring or documenting a particular feature, please reach out to us on GitHub!

Build Status Coverage Status PyPi version GPLv2 license DOI

Supported simulations:

  • Numeric:
    • Operating point, with guess computation to speed up the solution. See example: Downscaling current mirror
    • DC sweep
    • Transient analysis, available differentiation formulas: implicit Euler, trapezoidal, gear orders from 2 to 5. See for example the simulation of a Colpitts Oscillator.
    • AC analysis
    • PZ analysis
    • Periodic steady state analysis of non-autonomous circuits, time domain shooting and brute-force algorithms.
  • Symbolic:

The results are saved to disk, plotted or printed to stdout and can be read/processed by the most common tools (eg. Octave, gnuplot, Matlab, gwave and others)

Install

The program requires:

  • the Python interpreter version 2 or 3 (at least v.2.6 for Python2, v.3.3 for Python3),
  • numpy>=1.7.0, scipy>=0.14.0, sympy>=0.7.6 and tabulate>=0.7.3.

Matplotlib is strongly recommended and no plotting will work without.

If you need more information about the dependencies, check the Install notes.

Usage

1. ahkab can be run as a Python library

Example schematic: a 5th order 1kHz band-pass Butterworth filter
from ahkab import new_ac, run
from ahkab.circuit import Circuit
from ahkab.plotting import plot_results # calls matplotlib for you
import numpy as np

# Define the circuit
cir = Circuit('Butterworth 1kHz band-pass filter')
cir.add_vsource('V1', 'n1', cir.gnd, dc_value=0., ac_value=1.)
cir.add_resistor('R1', 'n1', 'n2', 50.)
cir.add_inductor('L1', 'n2', 'n3', 0.245894)
cir.add_capacitor('C1', 'n3', 'n4', 1.03013e-07)
cir.add_inductor('L2', 'n4', cir.gnd, 9.83652e-05)
cir.add_capacitor('C2', 'n4', cir.gnd, 0.000257513)
cir.add_inductor('L3', 'n4', 'n5', 0.795775)
cir.add_capacitor('C3', 'n5', 'n6', 3.1831e-08)
cir.add_inductor('L4', 'n6', cir.gnd, 9.83652e-05)
cir.add_capacitor('C4', 'n6', cir.gnd, 0.000257513)
cir.add_capacitor('C5', 'n7', 'n8', 1.03013e-07)
cir.add_inductor('L5', 'n6', 'n7', 0.245894)
cir.add_resistor('R2', 'n8', cir.gnd, 50.)

# Define the analysis
ac1 = new_ac(.97e3, 1.03e3, 1e2, x0=None)

# run it
res = run(cir, ac1)

# plot the results
plot_results('5th order 1kHz Butterworth filter', [('|Vn8|',"")], res['ac'],
             outfilename='bpf_transfer_fn.png')
Example: AC simulation results

2. ahkab can be run from the command line with a netlist file

The syntax is:

`$ python ahkab -o graph.dat <netlist file>`

See ahkab --help for command line switches, also online on the documentation pages.

Documentation

The documentation is available on RTD.

There, you can find a documentation and examples regarding how to simulate from a Python script.

Refer to the netlist syntax page if you prefer to write netlist files that describe the circuit.

Experience with running SPICE or related commercial simulators can be very useful: this is not for the faint of heart.

Development model

  • The development happens on the github repository,
  • Mostly on the master branch, with feature branch being created only for special purposes or non-trivial features.
  • Snapshots are released on a (hopefully) regular basis and are available on the Releases pages, complete with changelog, and on PYPI.

Patches and pull requests are welcome!

How this project was born

Writes @ggventurini:

"This project was born when I was an enthusistic undergrad, apparently with plenty of free time, attending "Simulazione Circuitale" (Circuit Simulation) taught by Prof. A. Brambilla back in Italy at the Polytechnic University of Milan.

I am grateful to prof. Brambilla for teaching one of the most interesting courses of my university years. -GV"

Bugs and patches

Does it work? Bugs? Do you have patches? Did you run some noteworthy simulation? Let us know on GitHub! You can also reach the maintainer at @itdaniher @gmail.com, he's happy to talk about Python.

Support the development with a donation

If you wish to support the development of ahkab, please donate to cancer research:

or

Credits

Authors: Giuseppe Venturini, with contributions from Ian Daniher, Rob Crowther, and KOLANICH.

Maintainer: Ian Daniher

Code: the module py3compat.py is (c) 2013 - the Jinja team.

Dependencies: many thanks to the authors of numpy, scipy, sympy, matplotlib and tabulate!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].