Ams
Power system generation scheduling and co-simulation with dynamics.
Install / Use
/learn @CURENT/AmsREADME
LTB AMS
<img src="docs/source/images/sponsors/CURENT_Logo_NameOnTrans.png" alt="CURENT ERC Logo" width="300" height="auto">Python Software for Power System Scheduling Modeling and Co-Simulation with Dynamics, serving as the market simulator for the [CURENT Largescale Testbed][LTB Repository].
| Badges | | |
|---|---|---|
| Repo | |
|
| Python |
|
| Version |
|
|
| Tag |
|
|
| Documentation |
|
|
| Download |
|
|
| Quality |
|
| Coverage |
|
|
| Last Commit |
|
|
| CI |
|
|
| CD |
|
|
| Structure |
|
|
| Dependency |
| |
| Try on Binder |
| |
Why AMS
AMS facilitates Dynamics Incorporated Scheduling and Scheduling-Dynamics Co-Simulation through an integrated interface with ANDES.
This package is helpful for power system engineers, researchers, and students conducting scheduling and transient stability studies at specific operating points. It also benefits those interested in developing new scheduling formulations and algorithms, particularly by extending existing formulations to include new decision variables, constraints, and objective functions.
AMS is a Modeling Framework that provides a descriptive way to formulate scheduling problems. The optimization problems are then handled by CVXPY and solved with third-party solvers.
AMS produces credible scheduling results and competitive performance. The following results show the comparison of DCOPF between AMS and other tools. In the table, AMS Gap is the difference between the AMS and MATPOWER results, and pandapower Gap is the difference between the pandapower and MATPOWER results.
| Case | MATPOWER [$] | AMS Gap [$] | pandapower Gap [$] | |------------------|--------------|--------------|---------------------| | IEEE 14-Bus | 7,642.59 | 0.00 | 0.00 | | IEEE 39-Bus | 41,263.94 | 0.00 | 0.00 | | PEGASE 89-Bus | 5,733.37 | 0.00 | 0.00 | | IEEE 118-Bus | 125,947.88 | 0.00 | 0.00 | | NPCC 140-Bus | 810,033.37 | 0.00 | -17.31 | | WECC 179-Bus | 411,706.13 | 0.00 | 0.00 | | IEEE 300-Bus | 706,292.32 | 0.00 | 0.00 | | PEGASE 1354-Bus | 1,218,096.86 | 0.00 | 0.00 | | PEGASE 2869-Bus | 2,386,235.33 | 0.00 | 0.00 | | GOC 4020-Bus | 793,634.11 | 0.00 | 0.00 | | EPIGRIDS 5658-Bus| 1,195,466.12 | 0.00 | 0.00 | | EPIGRIDS 7336-Bus| 1,855,870.94 | 0.00 | 0.00 |
<div style="text-align: left;"> <img src="docs/source/images/dcopf_time.png" alt="DCOPF Time" width="480" height="auto"> <p><strong>Figure:</strong> Computation time of OPF on medium to large cases.</p> </div>In the bar chart, the gray bar labeled "AMS Symbolic Processing" represents the time spent on symbolic processing, while the wheat-colored bar "AMS Numeric Evaluation" represents the time spent on system matrices calculation and optimization model construction. The orange bar labeled "AMS GUROBI" represents the optimization-solving time using the GUROBI solver. Similarly, the red bar labeled "AMS MOSEK" and the pink bar labeled "AMS PIQP" represent the time used by the solvers MOSEK and PIQP, respectively. Regarding the baselines, the blue and green bars represent the running time of MATPOWER using solver MIPS and pandapower using solver PIPS, respectively. The results for AMS, pandapower, and matpower are the average time consumed over ten repeat tests.
<div style="text-align: left;"> <img src="docs/source/images/educ_pie.png" alt="DCOPF Time" width="480" height="auto"> <p><strong>Figure:</strong> Computation time distribution for multi-period economic dispatch and unit commitment using a 31,777-bus case.</p> </div>To further demonstrate AMS's scalability, we validated multi-period economic dispatch and unit commitment on an ultra-large power system case with 31,777 buses, 4,664 generators, 41,573 transmission lines, and 5 time intervals. The computation time distribution for this case is shown in the figure below. Notably, the time spent on symbolic processing remains negligible even at this scale, highlighting AMS's efficiency for large-scale studies.
AMS is currently under active development. Use the following resources to get involved.
- Start from the [documentation][readthedocs] for installation and tutorial.
- Check out examples in the [examples folder][examples]
- Read the model verification results in the [examples/verification folder][verification]
- Ask a question in the [GitHub Discussions][Github Discussions]
- Report bugs or issues by submitting a [GitHub issue][GitHub issues]
- Submit contributions using [pull requests][GitHub pull requests]
- Read release notes highlighted [here][release notes]
- Try in Jupyter Notebook on [Binder][Binder]
- Check out the source code used for [benchmark][benchmark]
- Check out and cite our [paper][paper]
Installation
AMS is released as ltbams on PyPI and conda-forge.
Install from PyPI using pip:
pip install ltbams
You can also install with optional dependencies, such as dev, docs, and nlp:
pip install ltbams[dev]
pip install ltbams[docs]
pip install ltbams[nlp]
Or install with all optional dependencies:
pip install ltbams[all]
Install from conda-forge using conda:
conda install conda-forge::ltbams
Install from GitHub source:
pip install git+https://github.com/CURENT/ams.git
NOTE:
cvxpyis distributed with the open source solvers CLARABEL, OSQP, and SCS, but MIP-capable solvers need separate installationcvxpyversions below 1.5 are incompatible withnumpyversions 2.0 and above- If the solver
SCIPencounters an import error caused by a missinglibscip.9.1.dylib, try reinstalling its Python interface by runningpip install pyscipopt --no-binary scip --force - For the ImportError related to
kvxopt, it is recommended to reinstall it viacondaas sometimespipstruggles to set the correct path for compiled libraries. More details can be found in this closed issue Bug with dependency kvxopt 1.3.2.0 - Versions 1.0.0 and 1.0.1 are only available on PyPI
- Version 0.9.9 has known issues and has been yanked from PyPI
Example Usage
import ams
import andes
ss = ams.load(ams.get_case('ieee14/ieee14_uced.xlsx'))
# solve RTED
ss.RTED.run(solver='CLARABEL')
ss.RTED.pg.v
>>> array([1.8743862, 0.3226138, 0.01 , 0.02 , 0.01 ])
# convert to ANDES case
sa = ss.to_andes(addfile=andes.get_case(
Related Skills
node-connect
340.5kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
84.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
340.5kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
84.2kCommit, push, and open a PR
