Skip to main content

A line optimization package for electrical conductors.

Project description

LineOptim - Electric Power Line Parameter Optimization

PyPI version License: MIT

lineoptim is an open-source package for electric power line simulation and optimization. It provides the tools for simulating, visualizing and optimizing electric power lines and is designed to scale with larger and nested networks.

Features

  • Line Simulation: Simulate electric power lines with multiple loads and sub-lines. Get voltage drop, current power at any point in the line.
  • Optimization: Optimize electric power lines for wanted voltage drop and optimal conductor size
  • Visualization: Visualize electric power lines and their parameters

Installation

pip install lineoptim

Usage

import lineoptim as lo
import torch

# Create a line
v_nominal = torch.tensor([400.0, 400.0, 400.0])  # nominal voltage

line_params = {
    "name": "Main power line 1",
    "position": 0,
    "resistivity": torch.tensor([0.12, 0.12, 0.12]),  # resistivity,
    "reactance": torch.tensor([0.0, 0.0, 0.0]),
    "v_nominal": v_nominal,
}

# create main line
main_line = lo.Line(**line_params)

# add loads to main line
main_line.add("Load 1", 100, active_power=20000, v_nominal=v_nominal, power_factor=0.9)
main_line.add("Load 2", 200, active_power=20000, v_nominal=v_nominal, power_factor=0.9)
main_line.add("Load 3", 300, active_power=20000, v_nominal=v_nominal, power_factor=0.9)

# create sub-line
sub_line = lo.Line('Sub-line 1', 400, v_nominal=v_nominal, resistivity=torch.tensor([0.145, 0.145, 0.145]))

# add loads to sub-line
sub_line.add("Load 4", 410, active_power=2000, v_nominal=v_nominal, power_factor=0.9)

# add sub-line to main line
main_line.add(**sub_line.dict())

network = lo.Network()  # create network
network.add(main_line)  # add line to network

network.optimize(epochs=200, lr=0.01, max_v_drop=5.0)  # optimize network on 5% voltage drop at line ends

main_line.save_to_json('resources/example_line.json')  # save line configuration as json

Contributing

Contributions are welcome! For feature requests, bug reports or submitting pull requests, please use the GitHub Issue Tracker.

License

lineoptim is licensed under the open source MIT Licence

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

lineoptim-1.1.1.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

lineoptim-1.1.1-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file lineoptim-1.1.1.tar.gz.

File metadata

  • Download URL: lineoptim-1.1.1.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.8

File hashes

Hashes for lineoptim-1.1.1.tar.gz
Algorithm Hash digest
SHA256 733fbb6343d7d0a9d077138e287f15b7494249b5ae9ef79cf923fa18b895e00d
MD5 7a025ee62b0866d9d3b0cf48d6ceabc5
BLAKE2b-256 24e6033d7e67d16e25338608cf4af98dbf50775935d908e638e2d0357dfdd908

See more details on using hashes here.

File details

Details for the file lineoptim-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: lineoptim-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.8

File hashes

Hashes for lineoptim-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9001f9f22aaf4856fcce1c95c0a9117061546be39511d2ad12d4d4a32ad58ca7
MD5 e922ed0413c8799ce91c85d144d469e6
BLAKE2b-256 95a2576996279e9b8de2e843af6a999bbda5fbefd38d4028b42874abe943e9e2

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