Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Consider using release 0.3.4 instead.

SymCirc

pypi version Downloads Powered by SymPy Tests codecov

A lightweight python package for symbolic circuit analysis.

Documentation

Documentation is available on GitHub Pages.

What can it do?

SymCirc currently offers symbolic and semisymbolic DC, AC and transient small signal circuit analysis. It supports the following ideal circuit elements: resistors, inductors, capacitors, independent sources, controlled sources, ideal operational amplifiers and coupled inductors. BJT, MOS and diode have models implemented only for AC and TF analysis. Transient simulation allows for initial conditions of capacitors and standard/coupled inductors.

Install

Use this command to install via pip

pip install symcirc

Hard dependencies

SymPy

SymCirc is a light-weight package. It needs only the SymPy package, which is used for computations. It should get automatically installed with SymCirc when installed using pip.

Optional dependencies

gmpy2

To achieve better performance install the gmpy2 package. If gmpy2 is installed, SymPy automatically uses it for integer operations. It significantly impacts semi-symbolic analysis performance.

symengine

SymEngine is an optional symbolic core for SymPy. To use the SymEngine core, run your script with the environment variable USE_SYMENGINE=1, or run AnalyseCircuit with an optional argument use_symengine=True Example: symcirc.AnalyseCircuit(netlist, use_symengine=True)

numpy and matplotlib

For bode plots and other graphing utilities.

Build

Or you can build with this command:

python setup.py sdist bdist_wheel

Examples

See examples for more insight into circuit analysis with SymCirc.

Basic simulation example

from symcirc import *

# Insert your netlist
netlist = """CIRCUIT NAME - First line is always the circuit name
* This is a comment
R1 1 0 2k
R2 3 0 (1/G)
V1 2 1 dc 1 ac 1
R3 3 4 6k
C1 3 4 1n
R4 4 0 10k
V2 4 0 dc 5
I1 3 2 dc 1m ac 0
"""

# Execute netlist simulation
analysis_type = "DC"  # or "AC", "TF", "tran"
method = "tableau"  # Default is "two_graph_node", which is faster, but currently lacks coupled inductors.
symbolic = True  # If set to False, only elements which have no numeric value are left as symbolic. In this case only R2 stays symbolic.

circuit = AnalyseCircuit(netlist, analysis_type, symbolic=True, method=method)

all_values = circuit.component_values("all")
latex_formatted_values = to_latex(all_values)

print(all_values)

Netlist syntax

There are many example netlists available in the netlists folder. This folder contains a database of netlists which are used to automatically test every new version of SymCirc.

Elements

  • Resistor: RXXX N+ N- RESISTANCE
  • Capacitor: CXXX N+ N- CAPACITY IC=<INIT_VOLTAGE>
  • Inductor: LXXX N+ N- INDUCTANCE IC=<INIT_CURRENT>
  • Coupling: KXXX LYYY LZZZ K
  • Voltage source: VXXX N+ N- dc VOLTAGE ac AMPLITUDE
  • Current source: IXXX N+ N- dc CURRENT ac AMPLITUDE
  • IOAMP: AXXX Nout1 Nout2 Nin+ Nin-
  • VCVS: EXXX N1 N2 Ncontrol+ Ncontrol- GAIN
  • CCCS: FXXX N1 N2 VSENSE GAIN
  • VCCS: GXXX N1 N2 Ncontrol+ Ncontrol- GAIN
  • CCVS: HXXX N1 N2 VSENSE GAIN

Units

  • terra: T
  • giga: G
  • mega: meg
  • kilo: k
  • mili: m
  • micro: u
  • nano: n
  • pico: p
  • femto: f

Release files for symcirc 0.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for symcirc 0.3.2
File Size Uploaded
symcirc-0.3.2.tar.gz 65.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for symcirc 0.3.2
File Interpreter ABI Platform
symcirc-0.3.2-py3-none-any.whl Python 3 none any Details

Total release size: 127.1 kB

Release files / symcirc-0.3.2.tar.gz

Download URL symcirc-0.3.2.tar.gz
Size 65.8 kB
Tags Source
SHA-256 checksum
How to use checksums
c15bc2d6ff7c27416f371b6539844b98f1801c5517e2c29b2b7bf65a9303eb85
BLAKE2b-256 checksum
How to use checksums
aceb7fa9d51732652a4fe2adaa69909ac84a24b8a309c5e0cc91006fe3633f55
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.0

Release files / symcirc-0.3.2-py3-none-any.whl

Download URL symcirc-0.3.2-py3-none-any.whl
Size 61.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dcf83d0e2f2669133f2255bc497770c5c500f957706ec03b8e2421f667908d46
BLAKE2b-256 checksum
How to use checksums
b30c9946a992a5814110f76173a3f08ea0fd903f8b1e82460c9b5bbd51061766
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.0

Release history Release notifications | RSS feed

0.3.4

2 release files

0.3.3

2 release files

This release

0.3.2 This release

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.9

1 release file

0.1.8

1 release file

0.1.7

2 release files

0.1.6

1 release file

0.1.5

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.0.15

2 release files

0.0.14

2 release files

0.0.13

2 release files

0.0.12

2 release files

0.0.11

1 release file

0.0.10

1 release file

0.0.9

1 release file

0.0.8

1 release file

0.0.7

1 release file

0.0.6

1 release file

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page