PyAMS
BETA
Draw a circuit, simulate it and look at the waveforms, or write it in Python. DC, transient and AC analyses with custom models.
Free and open source (MIT) · Python 3.8+ · Linux, Windows, macOS
Download PyAMS software DocumentationPrefer VS Code or plain Python scripts? See other ways to use PyAMS.
PyAMS (Python for Analog and Mixed Signals) is an open-source tool
for modeling and simulating analog and mixed-signal electronic circuits. It is built around the
pyams-lib library, which solves circuits by modified nodal analysis
and Newton–Raphson, so you only describe what each element does.
Connect ready-made or custom elements by node names, run a DC, transient or AC analysis, sweep any parameter, and plot or post-process the results — all in plain Python.
Install pyams-lib with pip and write your circuits as Python scripts.
Use the PyAMS application or the VS Code extension for schematics, symbols and a waveform viewer. The library is already included.
Operating point, DC sweeps, time-domain simulation and small-signal frequency response.
Write a new element as a Python class: declare signals and parameters, then write the equations.
Passive elements, sources, diodes, thyristors, transistors, op-amp, 555 timer, logic gates, counters and ADC/DAC.
Repeat any analysis for a list of parameter values and overlay the curves.
Adaptive time step, second-order integration and automatic convergence aids for switching circuits.
Built-in Matplotlib plots, or NumPy arrays for your own post-processing. Interactive Plotly viewer in the CAD system.
Pure Python 3 on Linux, Windows and macOS (CPython and PyPy). Only NumPy and Matplotlib are needed.
A page for every model and 40 ready-to-run circuit examples with their results.
Distributed under the MIT license.
PyAMS is a CAD system for designing and simulating circuits graphically: a complete, dedicated application, built on the PyAMS Python library.
Download PyAMS softwareRight-click a symbol and choose Open Python Model: its Python file opens in a built-in editor window. No other program is needed.
pyams library.
The pyams library is already included: you only need Python with
numpy and matplotlib.
From an idea to a simulation in three steps: write the model, draw its symbol, then use it in a circuit.
A model is a plain Python class: declare its signals and parameters, then write the equation of the element in analog().
Here, a diode: its current follows the Shockley equation. Write it in the built-in editor (Tools > New Python Model...), which checks your code as you type.
In the symbol editor draw the shape, place the pins, set the reference (D) and link the symbol to your model by its name, MyDiode, and its file.
Save the symbol next to your circuit: it is found automatically.
Place the symbol in the schematic, connect it to the other elements, add an analysis block and run it: DC, transient or AC. The waveforms appear in the viewer, right in the drawing.
Example: a half-wave rectifier, with a 50 Hz source, a diode, a capacitor and a load.
The same circuit with the Python library, without the CAD system. Choose the analysis with analysis(mode="dc"), analysis(mode="tran", ...) or analysis(mode="ac", ...), and sweep any parameter with sweep(param="R1.R", list=[...]).
from pyams.lib import circuit from pyams.models import Resistor, SinVoltage, Diode V1 = SinVoltage("In", "0"); V1.setParams("Va=10V Fr=2Hz") D1 = Diode("In", "Out") R1 = Resistor("Out", "0"); R1.setParams("R=1KΩ") cir = circuit() cir.addElements({"V1": V1, "D1": D1, "R1": R1}) cir.setOutPuts("In", "Out") cir.analysis(mode="tran", start=0, stop=2, step=0.001) cir.run() cir.plot()
93 models are included in the library, grouped by family. Import any of them from pyams.models, or place them from the CAD system.
ResistorConductorCapacitorCapacitorIcInductorInductorIcNonlinearResistanceTransformerTransmissionLineVCVSVCCSCCVSCCCSLaplaceNDLaplaceZPLaplaceNDIILaplaceZPIILaplaceNDIVLaplaceZPIVLaplaceNDVILaplaceZPVISwitchSwitchVSwitchISwitchSPSTSwitchSPDTRelayIdealSwitchDCVoltageSinVoltageACVoltageExpVoltagePWLVoltageTrapezoidVoltageDCCurrentSinCurrentACCurrentExpCurrentPWLCurrentTrapezoidCurrentDiodeLEDDiodeBridgeDiacZenerDiodeTunnelDiodeThyristorUJTBJTMOSFETMOSFET4JFETIGBTOpAmpComparatorTimer555DigitalClockNOTANDORNANDNORXORXNORAND3OR3NAND3NOR3SRLatchDLatchDFFJKFFTFFRegisterLFSRCounterShiftRegisterMultiplexerDemultiplexerDecoderPriorityEncoderMagnitudeComparatorParityGeneratorBinaryToGrayGrayToBinarySevenSegmentDecoderAdderDACADCDAC_analogADC_analogDAC_clockedADC_clockedEach example is a circuit that comes with the PyAMS software: the schematic above, the result of its simulation below, exactly as they appear in the editor. Open them from the start page and run them.
Chua's chaotic oscillator with two bipolar transistors: the attractor is drawn as V(y) against V(x).
Three CMOS inverters in a loop: the three nodes oscillate with a phase shift of one third of a period.
Fed by a transformer, with the Diode Bridge symbol, a filter capacitor and a load.
Astable multivibrator: the threshold capacitor charges and discharges between 1/3 and 2/3 of Vcc.
A chaotic double-scroll oscillator built with two op-amps.
5th-order LC ladder, 1 dB ripple, cut-off at 1 kHz.
Digital models connected by an 8-line bus: the staircase follows the sine input.
A sawtooth on the emitter and the pulses on the two bases.
The capacitor charges through R1 until the DIAC breaks over, then discharges into R2 as a pulse.
More than 30 circuits are included. Examples written as Python scripts (JFET curves, SCR lamp dimmer, amplifier gain...) are in the documentation.
Articles published about PyAMS. If you use PyAMS in your work, please cite them.
Install the PyAMS software in three steps. The pyams library is included.
Simulations need Python 3.8 or higher with numpy and matplotlib. Works on Linux, Windows and macOS.
The software covers most needs. These two options are for people who prefer to work in VS Code or in their own Python scripts.
The CAD tools inside Visual Studio Code, next to your Python files: draw schematics, design symbols and simulate without leaving the editor.
For your own Python scripts, without the graphical tools.
$ pip install pyams-lib
NumPy and Matplotlib are installed automatically. To upgrade later:
$ pip install --upgrade pyams-lib
pyams-lib on PyPI
The PyAMS software and the VS Code extension already include the pyams library: do not install it with pip alongside them.
Download the PyAMS software, and find the documentation and the source code.
Run the installer, or unzip the portable version and start PyAMS.exe. If Windows SmartScreen warns about an unknown publisher, click More info, then Run anyway.
AppImage: make it executable and start it:
chmod +x PyAMS-*.AppImage && ./PyAMS-*.AppImage
Debian or Ubuntu package:
sudo apt install ./pyams-*.deb
Python with numpy and matplotlib is needed to run simulations. All files are on the SourceForge project page.