Skip to main content

Ultra fast power flow based in Laurent series expansion.

Project description

What is TensorPowerFlow?

An ultra-fast power flow based on Laurent series expansion. The power flow is intended for applications where massive amounts of power flow computations are required. e.g., electrical load time series, metaheuristics, electrical grid environments for reinforcement learning.

How to install

The package can be installed via pip using:

pip install tensorpowerflow

Example:

Run the load base case as:

from tensorpowerflow import GridTensor
import numpy as np

#%% Solve base case (34 node bus)
network = GridTensor()
solution = network.run_pf_sequential()
print(solution["v"])

#%% Solve 10_000 power flows on the 34 node bus case.
network_size = network.nb - 1  # Remove slack node
active_ns = np.random.normal(50, scale=1, size=(10_000, network_size)) # Power in kW
reactive_ns = active_ns * 0.1  # kVAr
solution_tensor = network.run_pf_tensor(active_power=active_ns, reactive_power=reactive_ns)
print(solution_tensor["v"])

#%% Generate random radial network of 100 nodes and a maximum of 1 to 3 branches per node.
network_rnd = GridTensor.generate_from_graph(nodes=100, child=3, plot_graph=True)
solution_rnd = network_rnd.run_pf_sequential()
print(solution_rnd["v"])

More examples can be found in the examples folder (under development).

Reading and citations:

The mathematical formulation of the power flow can be found at:

“A Fixed-Point Current Injection Power Flow for Electric Distribution Systems using Laurent Series.” J.S. Giraldo, O.D. Montoya, P.P. Vergara, F. Milano. Power Systems Computational Conference (PSCC) 2022. link

How to contact us

Any questions, suggestions or collaborations contact Juan S. Giraldo at <j.s.giraldochavarriaga@utwente.nl>

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

tensorpowerflow-0.0.2.tar.gz (12.9 kB view details)

Uploaded Source

Built Distribution

tensorpowerflow-0.0.2-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

Details for the file tensorpowerflow-0.0.2.tar.gz.

File metadata

  • Download URL: tensorpowerflow-0.0.2.tar.gz
  • Upload date:
  • Size: 12.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.0

File hashes

Hashes for tensorpowerflow-0.0.2.tar.gz
Algorithm Hash digest
SHA256 3093e6974f0fe3a0cb7663222c15a3c958d0944757e3fc39a153eb722812520f
MD5 fe9ea2793416d3eb4e853db8700bcfb2
BLAKE2b-256 6341b2553fa470055dface7171587bc153add497eee8377a408818cd66c96e78

See more details on using hashes here.

File details

Details for the file tensorpowerflow-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for tensorpowerflow-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1756229e61b20a6f76633305cd8807b979328aba5041490d052ff14bca2c59a8
MD5 48b48ae8c1f6e1d62652ca0454978b5b
BLAKE2b-256 9446e9cb3321d48e4c309fbb81a122475721aafe5914ba1dbd343f2a4fd9d7dc

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