Skip to main content

AMPL package for power systems

  • Free software: MIT license

Installation

pip install amplpower

You can also install the in-development version with:

pip install https://github.com/salvapineda/amplpower/archive/main.zip

Documentation

https://amplpower.readthedocs.io/

Development

To run all the tests run:

tox

Note, to combine the coverage data from all the tox environments run:

Windows

set PYTEST_ADDOPTS=--cov-append
tox

Other

PYTEST_ADDOPTS=--cov-append tox

Changelog

0.0.45 (2026-05-07)

  • Allow for any slack bus and fix bug with signs

0.0.44 (2026-04-21)

  • Improved voltage angle reconstruction in AC OPF (acjabr):
    • Switched from using only np.arccos(cosft) to np.arctan2(sinft, cosft) for voltage angle calculation.

    • Now handles all angle quadrants and preserves correct sign and range.

    • More accurate voltage angle assignment in OPF results.

0.0.43 (2026-01-29)

  • Incorporate cartesian variables to Jabr mode

0.0.42 (2025-09-19)

  • Get Vr and Vi in buses results

0.0.41 (2025-07-10)

  • Slack bus in bustype 3

0.0.40 (2025-07-10)

  • Fix bug in initialization and is_feasible with shunt elements

0.0.39 (2025-07-08)

  • Add is_feasible method to check feasibility of a given solution

0.0.38 (2025-06-06)

  • Fix compute ptdf and lodf methods

0.0.37 (2025-06-06)

  • Add compute ptdf and lodf methods

0.0.36 (2025-06-05)

  • Modify BigM default calculation for DC OTS

0.0.34 (2025-06-03)

  • Add times to results

0.0.33 (2025-06-03)

  • Modification of set_switching function

0.0.32 (2025-06-03)

  • Modify presolve_eps option to 1e-10

0.0.31 (2025-06-03)

  • Remove minus infinity from variables in AMPL model

0.0.30 (2025-06-03)

  • Floor and ceil function for initial BigM values in OTS

0.0.29 (2025-06-02)

  • Bug with bound for power flows in OTS problem

0.0.28 (2025-05-22)

  • Upper and lower bound for power flows

0.0.27 (2025-05-20)

  • Remove cost definition from the model due to bad scaling in constraints

0.0.26 (2025-05-19)

  • Bug with try except in results

0.0.25 (2025-05-07)

  • Split solve_opf function

  • Add upper bound to total generation cost

  • Split creat model and solve model for clarity

  • Change result output

  • The AMPL model is now stored in self.ampl and can be modified by user

  • Add best bound to results if available

0.0.24 (2025-05-05)

  • No default options for solver

0.0.23 (2025-04-24)

  • Fix initialize generation leven when multiple units at the same bus

0.0.22 (2025-04-24)

  • Fix division by zero in generator violation calculation

  • Chage options input to the solver

0.0.20 (2025-04-11)

  • Add maximum violation of AC constraints to results.

0.0.19 (2025-04-09)

  • Bug bus mapping

0.0.18 (2025-04-08)

  • BigM for AC OTS are computed exploring all critical points

  • Compute bounds for real and imaginary parts of voltage

0.0.17 (2025-04-04)

  • Bug relatex to BR_X negative in some networks.

0.0.16 (2025-04-04)

  • Modification of default Bigm values for AC OTS.

0.0.15 (2025-04-04)

  • Bus mapping for some pglib networks

  • Compute Bigm for AC OTS only if needed

0.0.14 (2025-04-04)

  • Bug in solver status

0.0.13 (2025-04-04)

  • Bug options solver

0.0.12 (2025-04-04)

  • Modify option solver input

0.0.11 (2025-04-01)

  • Return results for any status

0.0.10 (2025-04-01)

  • Add formulations of OPF to docs

0.0.9 (2025-03-26)

  • Tightest computation of bigMs for AC OTS.

  • Tightest bounds for variables cosft and sinft.

  • Add violations of AC constraints to results.

  • Test use open-source solvers.

0.0.8 (2025-03-25)

  • Corrected voltage results for AC jabr relaxation (acjabr).

0.0.7 (2025-03-25)

  • Included default COST2 for generators (gencos) if not provided.

  • Corrected voltage results for AC rectangular (acrect).

0.0.6 (2025-03-21)

  • Added support for solving optimal power flow (OPF) problems: DC OPF, AC OPF (both rectangular and polar coordinates) and AC relaxation proposed by Jabr.

  • Added functionality for solving the optimal transmission switching (OTS) problem: Big-M and non-linear formulations. Option to include or exclude connectivity constraints for the OTS problem

0.0.0 (2025-03-14)

  • First release on PyPI.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

amplpower-0.0.45.tar.gz (7.9 MB view details)

Uploaded Source

Built Distribution

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

amplpower-0.0.45-py3-none-any.whl (124.0 kB view details)

Uploaded Python 3

File details

Details for the file amplpower-0.0.45.tar.gz.

File metadata

  • Download URL: amplpower-0.0.45.tar.gz
  • Upload date:
  • Size: 7.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for amplpower-0.0.45.tar.gz
Algorithm Hash digest
SHA256 cc8bd9b08a6d1cd2d962f5dcba3fbb6275cb638c1a4cebf6c0652b47802ec169
MD5 08d428c58b0bd71e7a0ade2a0cb7bb95
BLAKE2b-256 f9eaedd86da77406ad8d72b030d8fdb7c51402492bb1947d4f1ba5fa10c6f711

See more details on using hashes here.

File details

Details for the file amplpower-0.0.45-py3-none-any.whl.

File metadata

  • Download URL: amplpower-0.0.45-py3-none-any.whl
  • Upload date:
  • Size: 124.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for amplpower-0.0.45-py3-none-any.whl
Algorithm Hash digest
SHA256 950835881a719f333468ddb519291e5e468c832e6b866d9a4adb80b22f52b5ee
MD5 d5cb5225710b5315604a1267438a72ca
BLAKE2b-256 445b560c89c7aca38cad2b8fcf65c16b1fc9bd4bf91a51f9b3c7931a0b40e498

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.0.45 This release

2 files

0.0.44

2 files

0.0.43

2 files

0.0.42

2 files

0.0.41

2 files

0.0.40

2 files

0.0.39

2 files

0.0.38

2 files

0.0.37

2 files

0.0.36

2 files

0.0.35

2 files

0.0.34

2 files

0.0.33

2 files

0.0.32

2 files

0.0.31

2 files

0.0.30

2 files

0.0.29

2 files

0.0.28

2 files

0.0.27

2 files

0.0.26

2 files

0.0.25

2 files

0.0.24

2 files

0.0.23

2 files

0.0.22

2 files

0.0.20

2 files

0.0.19

2 files

0.0.18

2 files

0.0.17

2 files

0.0.16

2 files

0.0.15

2 files

0.0.14

2 files

0.0.13

2 files

0.0.12

2 files

0.0.11

2 files

0.0.10

2 files

0.0.9

2 files

0.0.8

2 files

0.0.7

2 files

0.0.6

2 files

0.0.5

2 files

0.0.4

2 files

0.0.3

2 files

0.0.2

2 files

0.0.1

2 files

0.0.0

2 files

Supported by

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