Skip to main content

this solve electrical circuits by symbolic way

Project description

Hi welcome to E2SCAPy V 0.0.1

E2SCAPy is : Electronic & Electronic Symbolic Circuit Analisys on Python

here you can understand how to use this library...

1.- formulation:

######################################################################

E2SCAPy is simple and powerfull

######################################################################

ESCAPy works whit MNA (Modify Nodal Analisys) theory and MNA is a formulation used for electrical circuit and all theory was obteined for Mourad Fakhfakh, Esteban Tlelo Cuautle Francisco V. Fernandez and other authors and MNA gets an algebraic system by the way Ax = z where A is a square matrix, x is incognigts vector and z is an input system where z have independent sources like voltage and current sources.

other important think is Netlist input, the algorithm works whit an Netlist input this netlist can be generated by spice tool in my personal experience I had been used LTSPICE works good and is open source, this Netlist should be a order for example if we have a circuit like this Netlist:

V1 1 0
R1 1 2
C1 2 0
L1 2 3
R2 3 0
I1 0 3

I recomend reorder al elements by type and numbrer like this:

V1 1 0
R1 1 2
R2 3 0
C1 2 0
L1 2 3
I1 0 3

and before save the Netlist whit .cir extension this is necesary put this .cir whit program.py in other words in the same folder.

Important if you have been interested in how to learn do Netlist easy and fast I recomend you visist scam MATLAB for Erik Cheever web site:

######################################################################

https://lpsa.swarthmore.edu/Systems/Electrical/mna/MNA6.html

######################################################################

but dont worry I have been generated some examples you can check it in examples.

2.- solutions:

the solution for A matrix should be do it by Gauss Elimination (GE), adjunte matrix (ADJ) and Lower and Upper method (LU) all of this are implemented by Sympy and collected on ESCAPy but if you are searching power compute... Welcome to DDD (Determinant Diagram Decision) this idea was collected from Sheldon Tan and developed for me.

DDD Method should compute matrix whit size 4x4 and up. If you try compute a system 3x3 or 2x2 is important don't use DDD, just use Sympy method (ADJ, GE or LU).

DDD works whit symengine is fast and also DDD works better.

3.- outputs:

you can have an output in latex way or simple aoutput, and also you can have an estetic output, depend of size circuit, and oviously output size.

4.- instructions for use E2SCAPy:

you can use this repository or simple install library by pip,

######################################################################

pip install e2scapy

######################################################################

do a netlist, import escapy and put netlist name and extension let me show you:

from e2scapy import e2scapy as e2
escapy.MNAf('3_OpAmps.cir')

A,x,z = e2.formula_DDD()
Xout = e2.resuelve_serie_DDD(A,x,z)
x_out = e2.simplifica(Xout)

also you can use a multiprocess method for solve a determinant in DDD:

from e2scapy import e2scapy as e2 
e2.MNAf('3_OpAmps.cir')

A,x,z = e2.formula_DDD()
Xout = e2.resuelve_paralelo_DDD(A,x,z)
x_out = e2.simplifica(Xout)

and if you prefer use an sympy method:

from e2scapy import e2scapy as
e2.MNAf('3_OpAmps.cir')

A,x,z = e2.formula_sympy()
Xout = e2.resuelve_LU(A,x,z)
x_out = e2.simplifica(X1)

finaly in terminal you can write:

x_out 
x

or

print(x_out)
print(x)

remember all incongnits x verctor represent an output from x_out

be happy and anjoy!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

e2scapy-0.0.1.tar.gz (29.6 kB view details)

Uploaded Source

Built Distribution

e2scapy-0.0.1-py3-none-any.whl (27.6 kB view details)

Uploaded Python 3

File details

Details for the file e2scapy-0.0.1.tar.gz.

File metadata

  • Download URL: e2scapy-0.0.1.tar.gz
  • Upload date:
  • Size: 29.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.12

File hashes

Hashes for e2scapy-0.0.1.tar.gz
Algorithm Hash digest
SHA256 a8006c14763edd351f80cbadb2a4b99b07fdf26cfb8ea4c7310acb9793200c63
MD5 517857bf4b0007377a1f041175841e9e
BLAKE2b-256 4901d39098551d53dc24f769c5f042abec5e9bd9ddfcab3dcdaeac26d3a8f481

See more details on using hashes here.

File details

Details for the file e2scapy-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: e2scapy-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 27.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.12

File hashes

Hashes for e2scapy-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3ba2a9a884c4da0f86fc54a59125fa914f3d230f4f4d93c29cdc825bf432e142
MD5 fd921a48b3601c1aafa34985c41ef66c
BLAKE2b-256 1b9fb0ab96a0e88d21912c2d6943be16a0ffa9dcc25802a536dda2da9d6ce995

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page