A line optimization package for electrical conductors.
Project description
LineOptim - Electric Power Line Parameter Optimization
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,
}
main_line = lo.Line(**line_params)
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)
sub_line = lo.Line('Sub-line 1', 400, v_nominal=v_nominal, resistivity=torch.tensor([0.145, 0.145, 0.145]))
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.0.tar.gz
(9.1 kB
view details)
Built Distribution
File details
Details for the file lineoptim-1.1.0.tar.gz
.
File metadata
- Download URL: lineoptim-1.1.0.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 48c05ec15cc28896473ff7e9a2adbd8780f9ac87b97b453b9b5138640088b0b3 |
|
MD5 | 5d72bfa4e6680338b947c6f760f179be |
|
BLAKE2b-256 | cbb8e93fab0d09d7d3ebe2439b7387a4bf40c11a2bf9e3802ee8f3a2ea2309b6 |
File details
Details for the file lineoptim-1.1.0-py3-none-any.whl
.
File metadata
- Download URL: lineoptim-1.1.0-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 751df58546a003350bf55af480c433f0ce7e74367e46a218f0e49fcd78d01dfc |
|
MD5 | 636dc7bf1ff3955173d5dac86f162b9b |
|
BLAKE2b-256 | ad59bbee445dbca58214d47576e08674be8ceb769542b79bdea1fc74620a9ff0 |