Skip to main content

EL-SPICE

Efficient Language - Simulation Program with Integrated Circuit Emphasis

pip install elspice

EL-Spice is efficient-language based analog electronic circuit simulator. The simulated circuit is created from an expression, then required mathematical operations are applied. Overall, simulation is done. The lingual expression is a geometric code, describes an edge connected to points, which component lies in the edge and what is SI unit magnitude associated with the component. For example:

(0,0) (0,1) R 5M;

This means that a 5 MΩ resistor is connected between points (0,0) and (0,1). Points are not necessarily 2D, it can be in any dimension. Each identifier follows each other by a space. Each component follows the other by a semicolon(;)

(0,0) (0,1) I 2m;(0,1) (1,1) R 1K;(1,1) (0,0) R 2K;

This time, a current source of 2mA is connected with two resistors; one them is 1KΩ, other is 2KΩ. Wires don't have any parameter.

(0,0) (0,1) -;

In summary, all components and usage scheme is listed below:

(0,0) (0,1) -;
(0,0) (0,1) V 5;
(0,0) (0,1) I 2.3m;
(0,0) (0,1) R 3.3M;
(0,0) (0,1) C 4.7p;
(0,0) (0,1) L 3.4u;

RLC Circuit(ω=107)

(1,0) (1,1) V 5;(1,1) (0,1) C 2n;
(0,1) (0,0) L 5u;(1,0) (0,0) R 5;

Usage

  1. Firstly define your circuit with circ = elspice.Circuit(D) where D is number of dimensions.
  2. Create a string of circuit expression with the efficient language and AC frequency. If the circuit is DC, then just write 0 or nothing, it is default to 0. circ.decode(string_of_circuit, frequency)
  3. Get node voltages by calling circ.nodes()
  4. You can export each node voltage circ.node_voltages(). It returns an array and a dictionary describes that which index of array is which node.

Overall

import elspice
circ=circ = elspice.Circuit(D)

string_of_circuit="""(1,0) (1,1) V 5;(1,1) (0,1) C 2n;
(0,1) (0,0) L 5u;(1,0) (0,0) R 5;"""

circ.decode(string_of_circuit, 1591549.430)
circ.nodes()

Output

Node Voltages:
(1, 0): 0V 0°
(1, 1): 5.0 V  -1.3232932312128532e-46 °
(0, 1): 50.24937807687795 V  84.28940752087149 °
(0, 0): 4.999999999999999 V  6.616466159068361e-07 °

Metadata

Release files for elspice 0.0.1

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

Source distribution (sdist)

Source distribution for elspice 0.0.1
File Size Uploaded
elspice-0.0.1.tar.gz 4.4 kB Details

Built distribution (wheel)

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

Total release size: 9.0 kB

Release files / elspice-0.0.1.tar.gz

Download URL elspice-0.0.1.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
5a725ad877c1b5b787501650c1038932a55036cf9eeb1c6db4771556bffdb085
BLAKE2b-256 checksum
How to use checksums
632b528e25f0f92a13b407ffdd1ea87b1af9502340d85836c83dedd00dea0a3c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10

Release files / elspice-0.0.1-py3-none-any.whl

Download URL elspice-0.0.1-py3-none-any.whl
Size 4.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4642a936d2c7e3092b4650e3d756c0bad0ca1c070693e18ac8b07d00c0712ee2
BLAKE2b-256 checksum
How to use checksums
a1d291a3f8470d3753e617da3592d7df8388890f9c80d497c8c7db6632097052
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10

Release history Release notifications | RSS feed

This release

0.0.1 This release

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