Skip to main content

Power system analysis you can read, audit, and trust.

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

VectorGrid

VectorGrid

Power system analysis you can read, audit, and trust.

Website · Documentation · Privacy


VectorGrid is a Python library for power system analysis. It ships a Newton-Raphson power flow solver today, with short-circuit analysis, optimal power flow, and more on the way.

Every matrix assembly, every iteration, every convergence check is readable code — not a black box. Built on NumPy and SciPy. No wrappers around legacy Fortran. No opaque binaries.

Installation

pip install vectorgrid

Requires Python 3.10+.

Quick Start

from vectorgrid import Network

net = Network(sb_mva=100, f_hz=50)

# Create buses
b1 = net.add_bus(vr_kv=110.0)
b2 = net.add_bus(vr_kv=20.0)

# Add a transformer
net.add_transformer_2w(bus_1=b1, bus_2=b2, sr_mva=40, vk_percent=12.0,
                       pcu_kw=50, pfe_kw=30, j0_percent=0.1)

# External grid (slack bus)
net.add_external_grid(bus=b1, v_percent=102)

# Load
net.add_load(bus=b2, p_mw=20, q_mvar=10)

# Run power flow
results = net.run_power_flow(method="nr", tolerance=1e-8, max_iterations=30)

print(results["converged"])
print(results["buses"])
print(results["lines"])

Features

Power Flow (v0.1)

  • Newton-Raphson — full Jacobian with sparse direct solver
  • Decoupled Newton-Raphson — P-theta / Q-V separation with LU factorization
  • Voltage-dependent load models (constant power, ZIP, exponential)
  • Transformer tap changers and phase shifters
  • Configurable convergence tolerance and iteration limits

Coming Soon

  • Short-Circuit Analysis — three-phase, single line-to-ground, and other fault types per IEC 60909
  • Optimal Power Flow — generation dispatch, voltage setpoints, and reactive power optimization
  • Hosting Capacity Analysis — assess grid capacity for solar, wind, storage, and EV chargers
  • Volt/VAR Optimization — optimal placement and sizing of reactive compensation
  • Network Reconfiguration — topology optimization to minimize losses

Why VectorGrid?

Power system engineers routinely make decisions worth millions of dollars based on simulation results from tools they cannot inspect. VectorGrid takes a different approach:

  • Read the solver. Every line of the Newton-Raphson implementation, Jacobian assembly, and admittance matrix construction is source code you can open, read, and understand.
  • Validate the math. Compare results against IEEE test cases, pandapower, or hand calculations. The test suite does this systematically.
  • Use it freely. Research, education, internal engineering work — no restrictions. Build scripts, automate studies, integrate into your workflows.

Dependencies

No other runtime dependencies.

License

VectorGrid is source-available under the Business Source License 1.1.

  • Free to use for research, education, and internal engineering work
  • Cannot be used to build a competing commercial power system analysis product
  • Converts to Apache License 2.0 on May 7, 2030

For commercial licensing inquiries, contact info@vectorgrid.me.

Links

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

vectorgrid-0.1.2.tar.gz (19.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vectorgrid-0.1.2-py3-none-any.whl (19.5 kB view details)

Uploaded Python 3

File details

Details for the file vectorgrid-0.1.2.tar.gz.

File metadata

  • Download URL: vectorgrid-0.1.2.tar.gz
  • Upload date:
  • Size: 19.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.4

File hashes

Hashes for vectorgrid-0.1.2.tar.gz
Algorithm Hash digest
SHA256 b9386dfe555093bd1a8b4b5f9d693e0d8a97879ab803acfd843245ca7c4f22f7
MD5 79dfe89e15c6251093ee1c3f05929eb6
BLAKE2b-256 0135d25d559a0d604138592d6966988f01900ec478d04e28f671461bba58557d

See more details on using hashes here.

File details

Details for the file vectorgrid-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: vectorgrid-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 19.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.4

File hashes

Hashes for vectorgrid-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 fe683f585ca5965524b90c49717606796731cebd687e5bc625bf04088e4df6be
MD5 4dd82acdf6923c93eda5ada140aee8bd
BLAKE2b-256 6443638605bcbef72fc92ae3057ede9789aef650d0a8a12ec3d98305b4c111ee

See more details on using hashes here.

Supported by

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