Power System Stochastic Dual Dynamic Programming
The main goal of this library is to provide support for studies regarding the optimal dispatch of power systems, majorly comprised of Thermoelectric and Hydroelectric Generators.
Note 1 This is an under development library.
A special thank should be given to professor André Marcato. This project does not intend to substitute the similar library PySDDP.
Note 1 This project is being developed alongside the masters course: Planejamento de Sistemas Elétricos, as part of the masters program in Energy Systems at the Electrical Engineering Graduate Program from the Universidade Federal de Juiz de Fora - Brazil
Note 2 The code will evolve alongside the video lectures provided by professor Marcato at: Curso de Planejamento de Sistemas Elétricos
Installation
pip install powersddp
Example
There are two ways of initializing a Power System. Either by providing a .yml file, or by passing a dictionary as an initialization data. Both are depicted bellow:
Note: When using the file input method (
.ymlformat) check the example of how to declare the parameters.
Initializing a PowerSystem
import powersddp as psddp
system = psddp.PowerSystem(path='system.yml')
print("System Load: {}\n"
"Number of HGUs: {}\n"
"Number of TGUs: {}".format(system.data['load'],
len(system.data['hydro_units']),
len(system.data['thermal_units'])))
import powersddp as psddp
data = {'load': [50, 50, 50],
'discretizations': 3,
'stages': 3,
'scenarios': 2,
'outage_cost': 500,
'hydro_units': [{'name': 'HU1',
'v_max': 100,
'v_min': 20,
'v_ini': 100,
'prod': 0.95,
'flow_max': 60,
'inflow_scenarios': [[23, 16], [19, 14], [15, 11]]}],
'thermal_units': [{'name': 'GT1', 'capacity': 15, 'cost': 10},
{'name': 'GT2', 'capacity': 10, 'cost': 25}]}
PowerSystem = psddp.PowerSystem(data=data)
print("System Load: {}\n"
"Number of HGUs: {}\n"
"Number of TGUs: {}".format(PowerSystem.data['load'],
len(PowerSystem.data['hydro_units']),
len(PowerSystem.data['thermal_units'])))
Dispatching a PowerSystem
dispatch() accepts the following arguments:
-
solver : str, optional defaults to 'sdp'- Selects the solver option for the minimization objective function.
-
scenario : int, optional defaults to 0- Chooses either a specific scenario to investigate (
scenario>1) or all scenarios to evaluate (scenario= 0). Starting from 0 to the number of declared scenarios in thehydro_units['inflow_scenarios']parameter.
- Chooses either a specific scenario to investigate (
-
verbose : bool, optional defaults to False- Displays the PDDE solution for every stage of the execution. Use with care, solutions of complex systems with too many stages and scenarios might overflow the console.
-
plot : bool, optional, defaults to False- Displays a sequence of plots showing the future cost function for every stage of the execution.
The following example executes the Power System dispatch using the Unique Linear Programming method for the first scenario (id = 1) and outputs the optimization steps.
import powersddp as psddp
data = {'load': [50, 50, 50],
'discretizations': 3,
'stages': 3,
'scenarios': 2,
'outage_cost': 500,
'hydro_units': [{'name': 'HU1',
'v_max': 100,
'v_min': 20,
'v_ini': 100,
'prod': 0.95,
'flow_max': 60,
'inflow_scenarios': [[23, 16], [19, 14], [15, 11]]}],
'thermal_units': [{'name': 'GT1', 'capacity': 15, 'cost': 10},
{'name': 'GT2', 'capacity': 10, 'cost': 25}]}
PowerSystem = psddp.PowerSystem(data=data)
operation = PowerSystem.dispatch(solver='ulp', scenario=1, verbose=True)
print(operation)
Metadata
Release files for powersddp 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| powersddp-0.0.3.tar.gz | 11.4 kB | Without provenance | Details for powersddp-0.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| powersddp-0.0.3-py3-none-any.whl | Python 3 | none | any | Details for powersddp-0.0.3-py3-none-any.whl |
Total release size: 22.2 kB
Release files / powersddp-0.0.3.tar.gz
| Download URL | powersddp-0.0.3.tar.gz |
|---|---|
| Size | 11.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
77c7923c1f1b3d829c5fe6471e3cf7d6fd0a09d2943262655e215412e51a45fb
|
|
BLAKE2b-256 checksum How to use checksums |
c35d1b69b258c5aa51320fa351428f7c3e894b0a9ca828a0159473003fa48f6f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.6 CPython/3.8.10 Linux/5.4.72-microsoft-standard-WSL2
|
Release files / powersddp-0.0.3-py3-none-any.whl
| Download URL | powersddp-0.0.3-py3-none-any.whl |
|---|---|
| Size | 10.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a5f8e208c6cf04a598008ded1484a17c9ca4b79d6d307e3c4a06758e7e9d707c
|
|
BLAKE2b-256 checksum How to use checksums |
6a13e5ddccd889b37f4e2c883d57e8999ea2aa3e0bd3e8495c93758bc1dc6085
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.6 CPython/3.8.10 Linux/5.4.72-microsoft-standard-WSL2
|
Security for powersddp 0.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.