Skip to content

Commit

Permalink
Merge pull request #22 from jinningwang/gh
Browse files Browse the repository at this point in the history
Examples
  • Loading branch information
jinningwang authored Jan 20, 2024
2 parents 2893ab3 + 4fd01e0 commit 4712a41
Show file tree
Hide file tree
Showing 45 changed files with 3,296 additions and 5,161 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ on: [push, pull_request]
jobs:
build:

strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.9, 3.10, 3.11]

runs-on: ubuntu-latest

steps:
Expand Down
25 changes: 14 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,32 @@ Python Software for Power System Dispatch Modeling and Co-Simulation with Dynani

# Why AMS

With the built-in interface with dynamic simulation engine, LTB ANDES, AMS enables Dynamics Interfaced Stability Constrained Production Cost and Market Operation Modeling.
With the built-in interface with dynamic simulation engine, ANDES, AMS enables Dynamics Interfaced Stability Constrained Production Cost and Market Operation Modeling.

AMS produces credible dispatch results.
The following table shows the comparison of DC optimal power flow results between AMS and other tools.
AMS produces credible dispatch results and competitive performance.
The following results show the comparison of DCOPF between AMS and other tools.

| | AMS GUROBI | AMS ECOS | PYPOWER | pandapower |
|---------------|--------------|--------------|--------------|--------------|
| case39.m | 41,461.94 | 41,461.94 | 41,461.94 | 41,461.94 |
| ieee14_uced.xlsx | 45.72 | 45.72 | 45.72 | 45.72 |
| ieee39_uced.xlsx | 36,513.47 | 36,513.47 | 36,513.47 | 36,513.47 |
| npcc.m | 57,664,760.85| 57,664,760.85| 57,664,760.85| 57,664,760.85|
| Cost [\$] | AMS | MATPOWER | pandapower |
|----------------:|--------------:|------------:|-----------:|
| PEGASE 1354-Bus | 1,173,590.63 | 1,173,590.63 | 1,173,590.63 |
| PEGASE 2869-Bus | 2,338,915.61 | 2,338,915.61 | 2,338,915.61 |
| GOC 4020-Bus | 793,634.11 | 793,634.11 | 793,634.11 |
| EPIGRIDS 5658-Bus| 1,195,466.12 | 1,195,466.12 | 1,195,466.12 |
| EPIGRIDS 7336-Bus| 1,855,870.94 | 1,855,870.94 | 1,855,870.94 |

<img src="docs/source/images/dcopf_time.png" alt="DCOPF Time" width="400" height="auto">

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]
<!-- + Read the model verification results in the [examples/verification folder][verification] -->
<!-- + Try in Jupyter Notebook on [Binder][Binder] -->
<!-- + Ask a question in the [GitHub Discussions][Github Discussions] -->
<!-- + Check out and and cite our [paper][arxiv paper] -->

# Sponsors and Contributors
Expand Down
11 changes: 4 additions & 7 deletions ams/core/matprocessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
from scipy.sparse import csr_matrix as c_sparse
from scipy.sparse import lil_matrix as l_sparse

from ams.pypower.make import makePTDF
from ams.io.pypower import system2ppc
from andes.utils.misc import elapsed

from ams.opt.omodel import Param

Expand Down Expand Up @@ -144,13 +143,11 @@ def make(self):
Note that this method will update all matrices in the class.
"""
system = self.system
ppc = system2ppc(system)
# FIXME: PTDF sequence okay?
self.PTDF._v = makePTDF(ppc['baseMVA'], ppc['bus'], ppc['branch'])

t_mat, _ = elapsed()
self._makeC()
self._makeBdc()
_, s_mat = elapsed(t_mat)
logger.debug(f"Built system matrices in {s_mat}.")

return True

Expand Down
Loading

0 comments on commit 4712a41

Please sign in to comment.