ltbams 1.0.14__tar.gz → 1.0.16__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (182) hide show
  1. {ltbams-1.0.14/ltbams.egg-info → ltbams-1.0.16}/PKG-INFO +2 -1
  2. {ltbams-1.0.14 → ltbams-1.0.16}/README.md +1 -0
  3. {ltbams-1.0.14 → ltbams-1.0.16}/ams/_version.py +3 -3
  4. {ltbams-1.0.14 → ltbams-1.0.16}/ams/models/timeslot.py +18 -3
  5. {ltbams-1.0.14 → ltbams-1.0.16}/ams/opt/exprcalc.py +5 -3
  6. {ltbams-1.0.14 → ltbams-1.0.16}/ams/routines/dcopf2.py +33 -18
  7. {ltbams-1.0.14 → ltbams-1.0.16}/ams/routines/dcpf.py +5 -0
  8. {ltbams-1.0.14 → ltbams-1.0.16}/ams/routines/routine.py +12 -3
  9. {ltbams-1.0.14 → ltbams-1.0.16}/docs/source/examples/index.rst +1 -0
  10. {ltbams-1.0.14 → ltbams-1.0.16}/docs/source/genroutineref.py +21 -9
  11. {ltbams-1.0.14 → ltbams-1.0.16}/docs/source/release-notes.rst +14 -0
  12. {ltbams-1.0.14 → ltbams-1.0.16/ltbams.egg-info}/PKG-INFO +2 -1
  13. {ltbams-1.0.14 → ltbams-1.0.16}/tests/test_rtn_dcopf2.py +33 -0
  14. {ltbams-1.0.14 → ltbams-1.0.16}/CONTRIBUTING.rst +0 -0
  15. {ltbams-1.0.14 → ltbams-1.0.16}/LICENSE +0 -0
  16. {ltbams-1.0.14 → ltbams-1.0.16}/MANIFEST.in +0 -0
  17. {ltbams-1.0.14 → ltbams-1.0.16}/ams/__init__.py +0 -0
  18. {ltbams-1.0.14 → ltbams-1.0.16}/ams/__main__.py +0 -0
  19. {ltbams-1.0.14 → ltbams-1.0.16}/ams/cases/5bus/pjm5bus_demo.json +0 -0
  20. {ltbams-1.0.14 → ltbams-1.0.16}/ams/cases/5bus/pjm5bus_demo.xlsx +0 -0
  21. {ltbams-1.0.14 → ltbams-1.0.16}/ams/cases/5bus/pjm5bus_ev.xlsx +0 -0
  22. {ltbams-1.0.14 → ltbams-1.0.16}/ams/cases/5bus/pjm5bus_jumper.xlsx +0 -0
  23. {ltbams-1.0.14 → ltbams-1.0.16}/ams/cases/hawaii40/Hawaii40.m +0 -0
  24. {ltbams-1.0.14 → ltbams-1.0.16}/ams/cases/ieee123/ieee123.xlsx +0 -0
  25. {ltbams-1.0.14 → ltbams-1.0.16}/ams/cases/ieee123/ieee123_regcv1.xlsx +0 -0
  26. {ltbams-1.0.14 → ltbams-1.0.16}/ams/cases/ieee14/ieee14.json +0 -0
  27. {ltbams-1.0.14 → ltbams-1.0.16}/ams/cases/ieee14/ieee14.raw +0 -0
  28. {ltbams-1.0.14 → ltbams-1.0.16}/ams/cases/ieee14/ieee14_conn.xlsx +0 -0
  29. {ltbams-1.0.14 → ltbams-1.0.16}/ams/cases/ieee14/ieee14_uced.xlsx +0 -0
  30. {ltbams-1.0.14 → ltbams-1.0.16}/ams/cases/ieee39/ieee39.xlsx +0 -0
  31. {ltbams-1.0.14 → ltbams-1.0.16}/ams/cases/ieee39/ieee39_uced.xlsx +0 -0
  32. {ltbams-1.0.14 → ltbams-1.0.16}/ams/cases/ieee39/ieee39_uced_esd1.xlsx +0 -0
  33. {ltbams-1.0.14 → ltbams-1.0.16}/ams/cases/ieee39/ieee39_uced_pvd1.xlsx +0 -0
  34. {ltbams-1.0.14 → ltbams-1.0.16}/ams/cases/ieee39/ieee39_uced_vis.xlsx +0 -0
  35. {ltbams-1.0.14 → ltbams-1.0.16}/ams/cases/matpower/benchmark.json +0 -0
  36. {ltbams-1.0.14 → ltbams-1.0.16}/ams/cases/matpower/case118.m +0 -0
  37. {ltbams-1.0.14 → ltbams-1.0.16}/ams/cases/matpower/case14.m +0 -0
  38. {ltbams-1.0.14 → ltbams-1.0.16}/ams/cases/matpower/case300.m +0 -0
  39. {ltbams-1.0.14 → ltbams-1.0.16}/ams/cases/matpower/case39.m +0 -0
  40. {ltbams-1.0.14 → ltbams-1.0.16}/ams/cases/matpower/case5.m +0 -0
  41. {ltbams-1.0.14 → ltbams-1.0.16}/ams/cases/matpower/case_ACTIVSg2000.m +0 -0
  42. {ltbams-1.0.14 → ltbams-1.0.16}/ams/cases/npcc/npcc.m +0 -0
  43. {ltbams-1.0.14 → ltbams-1.0.16}/ams/cases/npcc/npcc_uced.xlsx +0 -0
  44. {ltbams-1.0.14 → ltbams-1.0.16}/ams/cases/pglib/pglib_opf_case39_epri__api.m +0 -0
  45. {ltbams-1.0.14 → ltbams-1.0.16}/ams/cases/wecc/wecc.m +0 -0
  46. {ltbams-1.0.14 → ltbams-1.0.16}/ams/cases/wecc/wecc_uced.xlsx +0 -0
  47. {ltbams-1.0.14 → ltbams-1.0.16}/ams/cli.py +0 -0
  48. {ltbams-1.0.14 → ltbams-1.0.16}/ams/core/__init__.py +0 -0
  49. {ltbams-1.0.14 → ltbams-1.0.16}/ams/core/common.py +0 -0
  50. {ltbams-1.0.14 → ltbams-1.0.16}/ams/core/documenter.py +0 -0
  51. {ltbams-1.0.14 → ltbams-1.0.16}/ams/core/matprocessor.py +0 -0
  52. {ltbams-1.0.14 → ltbams-1.0.16}/ams/core/model.py +0 -0
  53. {ltbams-1.0.14 → ltbams-1.0.16}/ams/core/param.py +0 -0
  54. {ltbams-1.0.14 → ltbams-1.0.16}/ams/core/service.py +0 -0
  55. {ltbams-1.0.14 → ltbams-1.0.16}/ams/core/symprocessor.py +0 -0
  56. {ltbams-1.0.14 → ltbams-1.0.16}/ams/core/var.py +0 -0
  57. {ltbams-1.0.14 → ltbams-1.0.16}/ams/extension/__init__.py +0 -0
  58. {ltbams-1.0.14 → ltbams-1.0.16}/ams/extension/eva.py +0 -0
  59. {ltbams-1.0.14 → ltbams-1.0.16}/ams/interface.py +0 -0
  60. {ltbams-1.0.14 → ltbams-1.0.16}/ams/io/__init__.py +0 -0
  61. {ltbams-1.0.14 → ltbams-1.0.16}/ams/io/json.py +0 -0
  62. {ltbams-1.0.14 → ltbams-1.0.16}/ams/io/matpower.py +0 -0
  63. {ltbams-1.0.14 → ltbams-1.0.16}/ams/io/psse.py +0 -0
  64. {ltbams-1.0.14 → ltbams-1.0.16}/ams/io/pypower.py +0 -0
  65. {ltbams-1.0.14 → ltbams-1.0.16}/ams/io/xlsx.py +0 -0
  66. {ltbams-1.0.14 → ltbams-1.0.16}/ams/main.py +0 -0
  67. {ltbams-1.0.14 → ltbams-1.0.16}/ams/models/__init__.py +0 -0
  68. {ltbams-1.0.14 → ltbams-1.0.16}/ams/models/area.py +0 -0
  69. {ltbams-1.0.14 → ltbams-1.0.16}/ams/models/bus.py +0 -0
  70. {ltbams-1.0.14 → ltbams-1.0.16}/ams/models/cost.py +0 -0
  71. {ltbams-1.0.14 → ltbams-1.0.16}/ams/models/distributed/__init__.py +0 -0
  72. {ltbams-1.0.14 → ltbams-1.0.16}/ams/models/distributed/esd1.py +0 -0
  73. {ltbams-1.0.14 → ltbams-1.0.16}/ams/models/distributed/ev.py +0 -0
  74. {ltbams-1.0.14 → ltbams-1.0.16}/ams/models/distributed/pvd1.py +0 -0
  75. {ltbams-1.0.14 → ltbams-1.0.16}/ams/models/group.py +0 -0
  76. {ltbams-1.0.14 → ltbams-1.0.16}/ams/models/info.py +0 -0
  77. {ltbams-1.0.14 → ltbams-1.0.16}/ams/models/line.py +0 -0
  78. {ltbams-1.0.14 → ltbams-1.0.16}/ams/models/renewable/__init__.py +0 -0
  79. {ltbams-1.0.14 → ltbams-1.0.16}/ams/models/renewable/regc.py +0 -0
  80. {ltbams-1.0.14 → ltbams-1.0.16}/ams/models/reserve.py +0 -0
  81. {ltbams-1.0.14 → ltbams-1.0.16}/ams/models/shunt.py +0 -0
  82. {ltbams-1.0.14 → ltbams-1.0.16}/ams/models/static/__init__.py +0 -0
  83. {ltbams-1.0.14 → ltbams-1.0.16}/ams/models/static/gen.py +0 -0
  84. {ltbams-1.0.14 → ltbams-1.0.16}/ams/models/static/pq.py +0 -0
  85. {ltbams-1.0.14 → ltbams-1.0.16}/ams/models/zone.py +0 -0
  86. {ltbams-1.0.14 → ltbams-1.0.16}/ams/opt/__init__.py +0 -0
  87. {ltbams-1.0.14 → ltbams-1.0.16}/ams/opt/constraint.py +0 -0
  88. {ltbams-1.0.14 → ltbams-1.0.16}/ams/opt/expression.py +0 -0
  89. {ltbams-1.0.14 → ltbams-1.0.16}/ams/opt/objective.py +0 -0
  90. {ltbams-1.0.14 → ltbams-1.0.16}/ams/opt/omodel.py +0 -0
  91. {ltbams-1.0.14 → ltbams-1.0.16}/ams/opt/optzbase.py +0 -0
  92. {ltbams-1.0.14 → ltbams-1.0.16}/ams/opt/param.py +0 -0
  93. {ltbams-1.0.14 → ltbams-1.0.16}/ams/opt/var.py +0 -0
  94. {ltbams-1.0.14 → ltbams-1.0.16}/ams/report.py +0 -0
  95. {ltbams-1.0.14 → ltbams-1.0.16}/ams/routines/__init__.py +0 -0
  96. {ltbams-1.0.14 → ltbams-1.0.16}/ams/routines/acopf.py +0 -0
  97. {ltbams-1.0.14 → ltbams-1.0.16}/ams/routines/dcopf.py +0 -0
  98. {ltbams-1.0.14 → ltbams-1.0.16}/ams/routines/dopf.py +0 -0
  99. {ltbams-1.0.14 → ltbams-1.0.16}/ams/routines/ed.py +0 -0
  100. {ltbams-1.0.14 → ltbams-1.0.16}/ams/routines/grbopt.py +0 -0
  101. {ltbams-1.0.14 → ltbams-1.0.16}/ams/routines/pflow.py +0 -0
  102. {ltbams-1.0.14 → ltbams-1.0.16}/ams/routines/pypower.py +0 -0
  103. {ltbams-1.0.14 → ltbams-1.0.16}/ams/routines/rted.py +0 -0
  104. {ltbams-1.0.14 → ltbams-1.0.16}/ams/routines/type.py +0 -0
  105. {ltbams-1.0.14 → ltbams-1.0.16}/ams/routines/uc.py +0 -0
  106. {ltbams-1.0.14 → ltbams-1.0.16}/ams/shared.py +0 -0
  107. {ltbams-1.0.14 → ltbams-1.0.16}/ams/system.py +0 -0
  108. {ltbams-1.0.14 → ltbams-1.0.16}/ams/utils/__init__.py +0 -0
  109. {ltbams-1.0.14 → ltbams-1.0.16}/ams/utils/misc.py +0 -0
  110. {ltbams-1.0.14 → ltbams-1.0.16}/ams/utils/paths.py +0 -0
  111. {ltbams-1.0.14 → ltbams-1.0.16}/docs/Makefile +0 -0
  112. {ltbams-1.0.14 → ltbams-1.0.16}/docs/make.bat +0 -0
  113. {ltbams-1.0.14 → ltbams-1.0.16}/docs/source/_templates/autosummary/base.rst +0 -0
  114. {ltbams-1.0.14 → ltbams-1.0.16}/docs/source/_templates/autosummary/class.rst +0 -0
  115. {ltbams-1.0.14 → ltbams-1.0.16}/docs/source/_templates/autosummary/module.rst +0 -0
  116. {ltbams-1.0.14 → ltbams-1.0.16}/docs/source/_templates/autosummary/module_toctree.rst +0 -0
  117. {ltbams-1.0.14 → ltbams-1.0.16}/docs/source/api.rst +0 -0
  118. {ltbams-1.0.14 → ltbams-1.0.16}/docs/source/conf.py +0 -0
  119. {ltbams-1.0.14 → ltbams-1.0.16}/docs/source/genmodelref.py +0 -0
  120. {ltbams-1.0.14 → ltbams-1.0.16}/docs/source/getting_started/copyright.rst +0 -0
  121. {ltbams-1.0.14 → ltbams-1.0.16}/docs/source/getting_started/formats/index.rst +0 -0
  122. {ltbams-1.0.14 → ltbams-1.0.16}/docs/source/getting_started/formats/matpower.rst +0 -0
  123. {ltbams-1.0.14 → ltbams-1.0.16}/docs/source/getting_started/formats/psse.rst +0 -0
  124. {ltbams-1.0.14 → ltbams-1.0.16}/docs/source/getting_started/formats/pypower.rst +0 -0
  125. {ltbams-1.0.14 → ltbams-1.0.16}/docs/source/getting_started/formats/xlsx.png +0 -0
  126. {ltbams-1.0.14 → ltbams-1.0.16}/docs/source/getting_started/formats/xlsx.rst +0 -0
  127. {ltbams-1.0.14 → ltbams-1.0.16}/docs/source/getting_started/index.rst +0 -0
  128. {ltbams-1.0.14 → ltbams-1.0.16}/docs/source/getting_started/install.rst +0 -0
  129. {ltbams-1.0.14 → ltbams-1.0.16}/docs/source/getting_started/overview.rst +0 -0
  130. {ltbams-1.0.14 → ltbams-1.0.16}/docs/source/getting_started/testcase.rst +0 -0
  131. {ltbams-1.0.14 → ltbams-1.0.16}/docs/source/getting_started/verification.rst +0 -0
  132. {ltbams-1.0.14 → ltbams-1.0.16}/docs/source/images/curent.ico +0 -0
  133. {ltbams-1.0.14 → ltbams-1.0.16}/docs/source/images/dcopf_time.png +0 -0
  134. {ltbams-1.0.14 → ltbams-1.0.16}/docs/source/images/educ_pie.png +0 -0
  135. {ltbams-1.0.14 → ltbams-1.0.16}/docs/source/images/sponsors/CURENT_Logo_NameOnTrans.png +0 -0
  136. {ltbams-1.0.14 → ltbams-1.0.16}/docs/source/images/sponsors/CURENT_Logo_Transparent.png +0 -0
  137. {ltbams-1.0.14 → ltbams-1.0.16}/docs/source/images/sponsors/CURENT_Logo_Transparent_Name.png +0 -0
  138. {ltbams-1.0.14 → ltbams-1.0.16}/docs/source/images/sponsors/doe.png +0 -0
  139. {ltbams-1.0.14 → ltbams-1.0.16}/docs/source/index.rst +0 -0
  140. {ltbams-1.0.14 → ltbams-1.0.16}/docs/source/modeling/example.rst +0 -0
  141. {ltbams-1.0.14 → ltbams-1.0.16}/docs/source/modeling/index.rst +0 -0
  142. {ltbams-1.0.14 → ltbams-1.0.16}/docs/source/modeling/model.rst +0 -0
  143. {ltbams-1.0.14 → ltbams-1.0.16}/docs/source/modeling/routine.rst +0 -0
  144. {ltbams-1.0.14 → ltbams-1.0.16}/docs/source/modeling/system.rst +0 -0
  145. {ltbams-1.0.14 → ltbams-1.0.16}/ltbams.egg-info/SOURCES.txt +0 -0
  146. {ltbams-1.0.14 → ltbams-1.0.16}/ltbams.egg-info/dependency_links.txt +0 -0
  147. {ltbams-1.0.14 → ltbams-1.0.16}/ltbams.egg-info/entry_points.txt +0 -0
  148. {ltbams-1.0.14 → ltbams-1.0.16}/ltbams.egg-info/requires.txt +0 -0
  149. {ltbams-1.0.14 → ltbams-1.0.16}/ltbams.egg-info/top_level.txt +0 -0
  150. {ltbams-1.0.14 → ltbams-1.0.16}/pyproject.toml +0 -0
  151. {ltbams-1.0.14 → ltbams-1.0.16}/requirements-dev.txt +0 -0
  152. {ltbams-1.0.14 → ltbams-1.0.16}/requirements.txt +0 -0
  153. {ltbams-1.0.14 → ltbams-1.0.16}/setup.cfg +0 -0
  154. {ltbams-1.0.14 → ltbams-1.0.16}/setup.py +0 -0
  155. {ltbams-1.0.14 → ltbams-1.0.16}/tests/test_1st_system.py +0 -0
  156. {ltbams-1.0.14 → ltbams-1.0.16}/tests/test_addressing.py +0 -0
  157. {ltbams-1.0.14 → ltbams-1.0.16}/tests/test_case.py +0 -0
  158. {ltbams-1.0.14 → ltbams-1.0.16}/tests/test_cli.py +0 -0
  159. {ltbams-1.0.14 → ltbams-1.0.16}/tests/test_export_csv.py +0 -0
  160. {ltbams-1.0.14 → ltbams-1.0.16}/tests/test_export_json.py +0 -0
  161. {ltbams-1.0.14 → ltbams-1.0.16}/tests/test_group.py +0 -0
  162. {ltbams-1.0.14 → ltbams-1.0.16}/tests/test_interface.py +0 -0
  163. {ltbams-1.0.14 → ltbams-1.0.16}/tests/test_io.py +0 -0
  164. {ltbams-1.0.14 → ltbams-1.0.16}/tests/test_jumper.py +0 -0
  165. {ltbams-1.0.14 → ltbams-1.0.16}/tests/test_known_good.py +0 -0
  166. {ltbams-1.0.14 → ltbams-1.0.16}/tests/test_matp.py +0 -0
  167. {ltbams-1.0.14 → ltbams-1.0.16}/tests/test_model.py +0 -0
  168. {ltbams-1.0.14 → ltbams-1.0.16}/tests/test_omodel.py +0 -0
  169. {ltbams-1.0.14 → ltbams-1.0.16}/tests/test_paths.py +0 -0
  170. {ltbams-1.0.14 → ltbams-1.0.16}/tests/test_report.py +0 -0
  171. {ltbams-1.0.14 → ltbams-1.0.16}/tests/test_repr.py +0 -0
  172. {ltbams-1.0.14 → ltbams-1.0.16}/tests/test_routine.py +0 -0
  173. {ltbams-1.0.14 → ltbams-1.0.16}/tests/test_rtn_acopf.py +0 -0
  174. {ltbams-1.0.14 → ltbams-1.0.16}/tests/test_rtn_dcopf.py +0 -0
  175. {ltbams-1.0.14 → ltbams-1.0.16}/tests/test_rtn_ed.py +0 -0
  176. {ltbams-1.0.14 → ltbams-1.0.16}/tests/test_rtn_opf.py +0 -0
  177. {ltbams-1.0.14 → ltbams-1.0.16}/tests/test_rtn_pflow.py +0 -0
  178. {ltbams-1.0.14 → ltbams-1.0.16}/tests/test_rtn_pypower.py +0 -0
  179. {ltbams-1.0.14 → ltbams-1.0.16}/tests/test_rtn_rted.py +0 -0
  180. {ltbams-1.0.14 → ltbams-1.0.16}/tests/test_rtn_uc.py +0 -0
  181. {ltbams-1.0.14 → ltbams-1.0.16}/tests/test_service.py +0 -0
  182. {ltbams-1.0.14 → ltbams-1.0.16}/versioneer.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ltbams
3
- Version: 1.0.14
3
+ Version: 1.0.16
4
4
  Summary: Python software for scheduling modeling and co-simulation with dynamics.
5
5
  Home-page: https://github.com/CURENT/ams
6
6
  Author: Jinning Wang
@@ -57,6 +57,7 @@ Python Software for Power System Scheduling Modeling and Co-Simulation with Dyna
57
57
 
58
58
  ![License: GPL-3.0](https://img.shields.io/badge/License-GPL--3.0-blue.svg)
59
59
  [![DOI:10.1109/TSTE.2025.3528027](https://zenodo.org/badge/DOI/10.1109/TSTE.2025.3528027.svg)](https://ieeexplore.ieee.org/document/10836855)
60
+ [![pyOpenSci Peer-Reviewed](https://pyopensci.org/badges/peer-reviewed.svg)](https://github.com/pyOpenSci/software-review/issues/174)
60
61
 
61
62
  | Badges | | |
62
63
  |---|---|---|
@@ -6,6 +6,7 @@ Python Software for Power System Scheduling Modeling and Co-Simulation with Dyna
6
6
 
7
7
  ![License: GPL-3.0](https://img.shields.io/badge/License-GPL--3.0-blue.svg)
8
8
  [![DOI:10.1109/TSTE.2025.3528027](https://zenodo.org/badge/DOI/10.1109/TSTE.2025.3528027.svg)](https://ieeexplore.ieee.org/document/10836855)
9
+ [![pyOpenSci Peer-Reviewed](https://pyopensci.org/badges/peer-reviewed.svg)](https://github.com/pyOpenSci/software-review/issues/174)
9
10
 
10
11
  | Badges | | |
11
12
  |---|---|---|
@@ -8,11 +8,11 @@ import json
8
8
 
9
9
  version_json = '''
10
10
  {
11
- "date": "2025-08-31T23:37:40-0700",
11
+ "date": "2025-09-28T19:45:45-0700",
12
12
  "dirty": false,
13
13
  "error": null,
14
- "full-revisionid": "595ed3a3be7f707c7c4aa79ac73bffa58919dc81",
15
- "version": "1.0.14"
14
+ "full-revisionid": "ddabb4c2a9b5a75423288423d6a13e030aa13e84",
15
+ "version": "1.0.16"
16
16
  }
17
17
  ''' # END VERSION_JSON
18
18
 
@@ -1,5 +1,5 @@
1
1
  """
2
- Model for rolling horizon used in scheduling.
2
+ Models for multi-period scheduling.
3
3
  """
4
4
 
5
5
  from andes.core import ModelData, NumParam
@@ -21,6 +21,7 @@ def str_list_oconv(x):
21
21
 
22
22
  class GCommit(ModelData, Model):
23
23
  """
24
+ UNDER DEVELOPMENT!
24
25
  Time slot model for generator commitment decisions.
25
26
 
26
27
  This class holds commitment decisions for generators,
@@ -31,14 +32,14 @@ class GCommit(ModelData, Model):
31
32
  `ugd` representing the unit commitment decisions for each generator.
32
33
  After solving the UC problem, the `ugd` values can be used for
33
34
  Economic Dispatch (ED) as a parameter.
34
-
35
- .. versionadded:: 1.0.13
36
35
  """
37
36
 
37
+ # TODO: .. versionadded:: 1.0.13
38
38
  def __init__(self, system=None, config=None):
39
39
  ModelData.__init__(self)
40
40
  Model.__init__(self, system, config)
41
41
 
42
+ # TODO: add IdxParam of generator
42
43
  self.ug = NumParam(info='unit commitment decisions',
43
44
  tex_name=r'u_{g}',
44
45
  iconvert=str_list_iconv,
@@ -74,6 +75,13 @@ class EDTSlot(TimeSlot):
74
75
  `ug` is the unit commitment decisions.
75
76
  Cells in `ug` should have `ng` values seperated by comma,
76
77
  where `ng` is the number of `StaticGen` in the system.
78
+
79
+ Warnings
80
+ --------
81
+ The order of generators in `ug` is determined by the input
82
+ file, not by explicit mapping. This may cause misinterpretation
83
+ if the loaded data order changes.
84
+ Involved routines include: `ED` `UC` and their derivatives.
77
85
  """
78
86
 
79
87
  def __init__(self, system=None, config=None):
@@ -93,6 +101,13 @@ class UCTSlot(TimeSlot):
93
101
  `sd` is the zonal load scaling factor.
94
102
  Cells in `sd` should have `nz` values seperated by comma,
95
103
  where `nz` is the number of `Zone` in the system.
104
+
105
+ Warnings
106
+ --------
107
+ The order of generators in `ug` is determined by the input
108
+ file, not by explicit mapping. This may cause misinterpretation
109
+ if the loaded data order changes.
110
+ Involved routines include: `ED` `UC` and their derivatives.
96
111
  """
97
112
 
98
113
  def __init__(self, system=None, config=None):
@@ -24,9 +24,11 @@ class ExpressionCalc(OptzBase):
24
24
  """
25
25
  Class for calculating expressions.
26
26
 
27
- Note that `ExpressionCalc` is not a CVXPY expression, and it should not be used
28
- in the optimization model.
29
- It is used to calculate expression values **after** successful optimization.
27
+ This class is useful for performing post-solve calculations, but it does not
28
+ participate in the optimization model itself.
29
+
30
+ Note: `ExpressionCalc` is not a CVXPY expression and should NOT be referenced
31
+ in `e_str` by any other components, including other instances of `ExpressionCalc`.
30
32
  """
31
33
 
32
34
  def __init__(self,
@@ -26,8 +26,18 @@ class DCOPF2(DCOPF):
26
26
  Notes
27
27
  -----
28
28
  - This routine requires PTDF matrix.
29
- - Nodal price ``pi`` is calculated with three parts.
29
+ - LMP ``pi`` is calculated with two parts, energy price and congestion price.
30
30
  - Bus angle ``aBus`` is calculated after solving the problem.
31
+ - In export results, ``pi`` and ``pic`` are kept for each bus, while ``pie``
32
+ can be restored manually by ``pie = pi - pic`` if needed.
33
+
34
+ Warning
35
+ -------
36
+ In this implementation, the dual variables for constraints have opposite signs compared
37
+ to the mathematical formulation: 1. The dual of `pb` returns a negative value, so energy
38
+ price is computed as `-pb.dual_variables[0]`. 2. Similarly, a minus sign is applied to
39
+ the duals of `plfub` and `plflb` when calculating congestion price. The reason for this
40
+ sign difference is not yet fully understood.
31
41
 
32
42
  References
33
43
  ----------
@@ -61,29 +71,34 @@ class DCOPF2(DCOPF):
61
71
  name='PTDF', tex_name=r'P_{TDF}',
62
72
  model='mats', src='PTDF',
63
73
  no_parse=True, sparse=True)
74
+ self.PTDFt = NumOp(u=self.PTDF,
75
+ name='PTDFt', tex_name=r'P_{TDF}^T',
76
+ info='PTDF transpose',
77
+ fun=np.transpose, no_parse=True)
78
+
79
+ # --- rewrite Constraint pb: power balance ---
80
+ self.pb.e_str = 'sum(pg) - sum(pd)'
64
81
 
65
82
  # --- rewrite Expression plf: line flow---
66
83
  self.plf.e_str = 'PTDF @ (Cg@pg - Cl@pd - Csh@gsh - Pbusinj)'
67
84
 
68
85
  # --- rewrite nodal price ---
69
- self.Cft = RParam(info='Line connection matrix',
70
- name='Cft', tex_name=r'C_{ft}',
71
- model='mats', src='Cft',
72
- no_parse=True, sparse=True,)
73
- self.pilb = ExpressionCalc(info='Congestion price, dual of <plflb>',
74
- name='pilb',
75
- model='Line', src=None,
76
- e_str='plflb.dual_variables[0]')
77
- self.piub = ExpressionCalc(info='Congestion price, dual of <plfub>',
78
- name='piub',
79
- model='Line', src=None,
80
- e_str='plfub.dual_variables[0]')
81
- self.pib = ExpressionCalc(info='Energy price, dual of <pb>',
82
- name='pib',
83
- model='Bus', src=None,
84
- e_str='pb.dual_variables[0]')
85
- pi = 'pb.dual_variables[0] + Cft@(plfub.dual_variables[0] - plflb.dual_variables[0])'
86
+ self.pie = ExpressionCalc(info='Energy price',
87
+ name='pie', unit='$/p.u.',
88
+ e_str='-pb.dual_variables[0]')
89
+ pic = '-PTDFt@(plfub.dual_variables[0] - plflb.dual_variables[0])'
90
+ self.pic = ExpressionCalc(info='Congestion price',
91
+ name='pic', unit='$/p.u.',
92
+ e_str=pic,
93
+ model='Bus', src=None)
94
+
95
+ # NOTE: another implementation of self.pi.e_str can be:
96
+ # self.pi.e_str = self.pie.e_str + self.pic.e_str
97
+ # but it is less intuitive to read, as this implementation is not likely
98
+ # to be used again in other routines.
99
+ pi = '-pb.dual_variables[0] - PTDFt@(plfub.dual_variables[0] - plflb.dual_variables[0])'
86
100
  self.pi.e_str = pi
101
+ self.pi.info = 'locational marginal price (LMP)'
87
102
 
88
103
  def _post_solve(self):
89
104
  """Calculate aBus"""
@@ -3,6 +3,8 @@ Power flow routines.
3
3
  """
4
4
  import logging
5
5
 
6
+ import numpy as np
7
+
6
8
  from ams.opt import Var, Constraint, Expression, Objective
7
9
  from ams.routines.routine import RoutineBase
8
10
 
@@ -173,6 +175,9 @@ class DCPFBase(RoutineBase):
173
175
  """
174
176
  Post-solve calculations.
175
177
  """
178
+ # NOTE: for DC type routines, set vBus to 1.0 p.u. as placeholder
179
+ self.vBus.v = np.ones(self.vBus.shape)
180
+
176
181
  # NOTE: unpack Expressions if owner and arc are available
177
182
  for expr in self.exprs.values():
178
183
  if expr.owner and expr.src:
@@ -21,7 +21,7 @@ from ams.opt import Param, Var, Constraint, Objective, ExpressionCalc, Expressio
21
21
 
22
22
  from ams.utils.paths import get_export_path
23
23
 
24
- from ams.shared import pd
24
+ from ams.shared import pd, summary_row, summary_name
25
25
 
26
26
  logger = logging.getLogger(__name__)
27
27
 
@@ -509,7 +509,15 @@ class RoutineBase:
509
509
  self.class_name + '_out',
510
510
  path=path, fmt='json')
511
511
 
512
- data_dict = dict()
512
+ data_dict = OrderedDict()
513
+
514
+ # insert summary
515
+ df = pd.DataFrame([summary_row])
516
+ df.index.name = "uid"
517
+ data_dict.update({summary_name: df.to_dict(orient='records')})
518
+
519
+ # insert objective value
520
+ data_dict.update(OrderedDict(Objective=self.obj.v))
513
521
 
514
522
  group_data(self, data_dict, self.vars, 'v')
515
523
  group_data(self, data_dict, self.exprs, 'v')
@@ -1116,7 +1124,8 @@ def collect_data(rtn: RoutineBase, data_dict: Dict, items: Dict, attr: str):
1116
1124
 
1117
1125
  def group_data(rtn: RoutineBase, data_dict: Dict, items: Dict, attr: str):
1118
1126
  """
1119
- Collect data for export from grouped items.
1127
+ Collect data for export by groups, adding device idx in each group.
1128
+ This is useful when exporting to dictionary formats like JSON.
1120
1129
 
1121
1130
  Parameters
1122
1131
  ----------
@@ -30,3 +30,4 @@ folder of the repository
30
30
  ../_examples/demo/demo_debug.ipynb
31
31
  ../_examples/demo/demo_mat.ipynb
32
32
  ../_examples/demo/demo_wrapper_routines.ipynb
33
+ ../_examples/demo/demo_dcopf.ipynb
@@ -22,15 +22,27 @@ and view details.
22
22
 
23
23
  Typical acronyms used in AMS include:
24
24
 
25
- +------------+--------------------+
26
- | Acronym | Meaning |
27
- +============+====================+
28
- | OPF | Optimal Power Flow |
29
- +------------+--------------------+
30
- | ED | Economic Dispatch |
31
- +------------+--------------------+
32
- | UC | Unit Commitment |
33
- +------------+--------------------+
25
+ +------------+---------------------------+
26
+ | Acronym | Meaning |
27
+ +============+===========================+
28
+ | AC- | Alternating Current |
29
+ +------------+---------------------------+
30
+ | DC- | Direct Current |
31
+ +------------+---------------------------+
32
+ | RT- | Real-Time |
33
+ +------------+---------------------------+
34
+ | -DG | Distributed Generation |
35
+ +------------+---------------------------+
36
+ | -ES | Energy Storage |
37
+ +------------+---------------------------+
38
+ | -OPF | Optimal Power Flow |
39
+ +------------+---------------------------+
40
+ | -ED | Economic Dispatch |
41
+ +------------+---------------------------+
42
+ | -UC | Unit Commitment |
43
+ +------------+---------------------------+
44
+ | LMP | Locational Marginal Price |
45
+ +------------+---------------------------+
34
46
 
35
47
  """
36
48
 
@@ -9,6 +9,20 @@ The APIs before v3.0.0 are in beta and may change without prior notice.
9
9
  v1.0
10
10
  ==========
11
11
 
12
+ v1.0.16 (2025-09-28)
13
+ ----------------------
14
+
15
+ - Add GitHub action to automatically upload release to Zenodo
16
+
17
+ v1.0.15 (2025-09-28)
18
+ ----------------------
19
+
20
+ - Fix ``DCOPF2.pb`` to use PTDF-based formulation
21
+ - Add a demo to compare ``DCOPF2`` and ``DCOPF``, see
22
+ ``examples/demonstration/demo_dcopf.ipynb``
23
+ - In DC type routines, set `vBus` value as 1 for placeholder
24
+ - Include Summary and Objective value in exported JSON
25
+
12
26
  v1.0.14 (2025-08-29)
13
27
  ----------------------
14
28
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ltbams
3
- Version: 1.0.14
3
+ Version: 1.0.16
4
4
  Summary: Python software for scheduling modeling and co-simulation with dynamics.
5
5
  Home-page: https://github.com/CURENT/ams
6
6
  Author: Jinning Wang
@@ -57,6 +57,7 @@ Python Software for Power System Scheduling Modeling and Co-Simulation with Dyna
57
57
 
58
58
  ![License: GPL-3.0](https://img.shields.io/badge/License-GPL--3.0-blue.svg)
59
59
  [![DOI:10.1109/TSTE.2025.3528027](https://zenodo.org/badge/DOI/10.1109/TSTE.2025.3528027.svg)](https://ieeexplore.ieee.org/document/10836855)
60
+ [![pyOpenSci Peer-Reviewed](https://pyopensci.org/badges/peer-reviewed.svg)](https://github.com/pyOpenSci/software-review/issues/174)
60
61
 
61
62
  | Badges | | |
62
63
  |---|---|---|
@@ -101,3 +101,36 @@ class TestDCOPF2(unittest.TestCase):
101
101
  a_dcopf = self.ss.DCOPF2.get(src='aBus', attr='v', idx=bus_idx)
102
102
  a_acopf = self.ss.ACOPF.get(src='aBus', attr='v', idx=bus_idx)
103
103
  np.testing.assert_almost_equal(a_dcopf, a_acopf, decimal=3)
104
+
105
+ def test_align_dcopf(self):
106
+ """
107
+ Test if results from `DCOPF2` are aligned with those from `DCOPF`.
108
+ """
109
+ self.ss.DCOPF.run(solver='CLARABEL')
110
+ self.ss.mats.build_ptdf()
111
+ self.ss.DCOPF2.run(solver='CLARABEL')
112
+
113
+ pg_idx = self.ss.StaticGen.get_all_idxes()
114
+ bus_idx = self.ss.Bus.idx.v
115
+ line_idx = self.ss.Line.idx.v
116
+
117
+ DECIMALS = 4
118
+ pg = self.ss.DCOPF.get(src='pg', attr='v', idx=pg_idx)
119
+ pg2 = self.ss.DCOPF2.get(src='pg', attr='v', idx=pg_idx)
120
+ np.testing.assert_almost_equal(pg, pg2, decimal=DECIMALS,
121
+ err_msg="pg between DCOPF2 and DCOPF not match!")
122
+
123
+ aBus = self.ss.DCOPF.get(src='aBus', attr='v', idx=bus_idx)
124
+ aBus2 = self.ss.DCOPF2.get(src='aBus', attr='v', idx=bus_idx)
125
+ np.testing.assert_almost_equal(aBus, aBus2, decimal=DECIMALS,
126
+ err_msg="aBus between DCOPF2 and DCOPF not match!")
127
+
128
+ pi = self.ss.DCOPF.get(src='pi', attr='v', idx=bus_idx)
129
+ pi2 = self.ss.DCOPF2.get(src='pi', attr='v', idx=bus_idx)
130
+ np.testing.assert_almost_equal(pi, pi2, decimal=DECIMALS,
131
+ err_msg="pi between DCOPF2 and DCOPF not match!")
132
+
133
+ plf = self.ss.DCOPF.get(src='plf', attr='v', idx=line_idx)
134
+ plf2 = self.ss.DCOPF2.get(src='plf', attr='v', idx=line_idx)
135
+ np.testing.assert_almost_equal(plf, plf2, decimal=DECIMALS,
136
+ err_msg="plf between DCOPF2 and DCOPF not match!")
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes