ltbams 0.9.9__py3-none-any.whl → 1.0.2a1__py3-none-any.whl

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 (191) hide show
  1. ams/__init__.py +4 -11
  2. ams/_version.py +3 -3
  3. ams/cases/5bus/pjm5bus_demo.xlsx +0 -0
  4. ams/cases/5bus/pjm5bus_jumper.xlsx +0 -0
  5. ams/cases/5bus/pjm5bus_uced.json +1062 -0
  6. ams/cases/5bus/pjm5bus_uced.xlsx +0 -0
  7. ams/cases/5bus/pjm5bus_uced_esd1.xlsx +0 -0
  8. ams/cases/5bus/pjm5bus_uced_ev.xlsx +0 -0
  9. ams/cases/ieee123/ieee123.xlsx +0 -0
  10. ams/cases/ieee123/ieee123_regcv1.xlsx +0 -0
  11. ams/cases/ieee14/ieee14.json +1166 -0
  12. ams/cases/ieee14/ieee14.raw +92 -0
  13. ams/cases/ieee14/ieee14_conn.xlsx +0 -0
  14. ams/cases/ieee14/ieee14_uced.xlsx +0 -0
  15. ams/cases/ieee39/ieee39.xlsx +0 -0
  16. ams/cases/ieee39/ieee39_uced.xlsx +0 -0
  17. ams/cases/ieee39/ieee39_uced_esd1.xlsx +0 -0
  18. ams/cases/ieee39/ieee39_uced_pvd1.xlsx +0 -0
  19. ams/cases/ieee39/ieee39_uced_vis.xlsx +0 -0
  20. ams/cases/matpower/benchmark.json +1594 -0
  21. ams/cases/matpower/case118.m +787 -0
  22. ams/cases/matpower/case14.m +129 -0
  23. ams/cases/matpower/case300.m +1315 -0
  24. ams/cases/matpower/case39.m +205 -0
  25. ams/cases/matpower/case5.m +62 -0
  26. ams/cases/matpower/case_ACTIVSg2000.m +9460 -0
  27. ams/cases/npcc/npcc.m +644 -0
  28. ams/cases/npcc/npcc_uced.xlsx +0 -0
  29. ams/cases/pglib/pglib_opf_case39_epri__api.m +243 -0
  30. ams/cases/wecc/wecc.m +714 -0
  31. ams/cases/wecc/wecc_uced.xlsx +0 -0
  32. ams/cli.py +6 -0
  33. ams/core/__init__.py +2 -0
  34. ams/core/documenter.py +652 -0
  35. ams/core/matprocessor.py +782 -0
  36. ams/core/model.py +330 -0
  37. ams/core/param.py +322 -0
  38. ams/core/service.py +918 -0
  39. ams/core/symprocessor.py +224 -0
  40. ams/core/var.py +59 -0
  41. ams/extension/__init__.py +5 -0
  42. ams/extension/eva.py +401 -0
  43. ams/interface.py +1085 -0
  44. ams/io/__init__.py +133 -0
  45. ams/io/json.py +82 -0
  46. ams/io/matpower.py +406 -0
  47. ams/io/psse.py +6 -0
  48. ams/io/pypower.py +103 -0
  49. ams/io/xlsx.py +80 -0
  50. ams/main.py +81 -4
  51. ams/models/__init__.py +24 -0
  52. ams/models/area.py +40 -0
  53. ams/models/bus.py +52 -0
  54. ams/models/cost.py +169 -0
  55. ams/models/distributed/__init__.py +3 -0
  56. ams/models/distributed/esd1.py +71 -0
  57. ams/models/distributed/ev.py +60 -0
  58. ams/models/distributed/pvd1.py +67 -0
  59. ams/models/group.py +231 -0
  60. ams/models/info.py +26 -0
  61. ams/models/line.py +238 -0
  62. ams/models/renewable/__init__.py +5 -0
  63. ams/models/renewable/regc.py +119 -0
  64. ams/models/reserve.py +94 -0
  65. ams/models/shunt.py +14 -0
  66. ams/models/static/__init__.py +2 -0
  67. ams/models/static/gen.py +165 -0
  68. ams/models/static/pq.py +61 -0
  69. ams/models/timeslot.py +69 -0
  70. ams/models/zone.py +49 -0
  71. ams/opt/__init__.py +12 -0
  72. ams/opt/constraint.py +175 -0
  73. ams/opt/exprcalc.py +127 -0
  74. ams/opt/expression.py +188 -0
  75. ams/opt/objective.py +174 -0
  76. ams/opt/omodel.py +432 -0
  77. ams/opt/optzbase.py +192 -0
  78. ams/opt/param.py +156 -0
  79. ams/opt/var.py +233 -0
  80. ams/pypower/__init__.py +8 -0
  81. ams/pypower/_compat.py +9 -0
  82. ams/pypower/core/__init__.py +8 -0
  83. ams/pypower/core/pips.py +894 -0
  84. ams/pypower/core/ppoption.py +244 -0
  85. ams/pypower/core/ppver.py +18 -0
  86. ams/pypower/core/solver.py +2451 -0
  87. ams/pypower/eps.py +6 -0
  88. ams/pypower/idx.py +174 -0
  89. ams/pypower/io.py +604 -0
  90. ams/pypower/make/__init__.py +11 -0
  91. ams/pypower/make/matrices.py +665 -0
  92. ams/pypower/make/pdv.py +506 -0
  93. ams/pypower/routines/__init__.py +7 -0
  94. ams/pypower/routines/cpf.py +513 -0
  95. ams/pypower/routines/cpf_callbacks.py +114 -0
  96. ams/pypower/routines/opf.py +1803 -0
  97. ams/pypower/routines/opffcns.py +1946 -0
  98. ams/pypower/routines/pflow.py +852 -0
  99. ams/pypower/toggle.py +1098 -0
  100. ams/pypower/utils.py +293 -0
  101. ams/report.py +212 -50
  102. ams/routines/__init__.py +23 -0
  103. ams/routines/acopf.py +117 -0
  104. ams/routines/cpf.py +65 -0
  105. ams/routines/dcopf.py +241 -0
  106. ams/routines/dcpf.py +209 -0
  107. ams/routines/dcpf0.py +196 -0
  108. ams/routines/dopf.py +150 -0
  109. ams/routines/ed.py +312 -0
  110. ams/routines/pflow.py +255 -0
  111. ams/routines/pflow0.py +113 -0
  112. ams/routines/routine.py +1033 -0
  113. ams/routines/rted.py +519 -0
  114. ams/routines/type.py +160 -0
  115. ams/routines/uc.py +376 -0
  116. ams/shared.py +63 -9
  117. ams/system.py +61 -22
  118. ams/utils/__init__.py +3 -0
  119. ams/utils/misc.py +77 -0
  120. ams/utils/paths.py +257 -0
  121. docs/Makefile +21 -0
  122. docs/make.bat +35 -0
  123. docs/source/_templates/autosummary/base.rst +5 -0
  124. docs/source/_templates/autosummary/class.rst +35 -0
  125. docs/source/_templates/autosummary/module.rst +65 -0
  126. docs/source/_templates/autosummary/module_toctree.rst +66 -0
  127. docs/source/api.rst +102 -0
  128. docs/source/conf.py +203 -0
  129. docs/source/examples/index.rst +34 -0
  130. docs/source/genmodelref.py +61 -0
  131. docs/source/genroutineref.py +47 -0
  132. docs/source/getting_started/copyright.rst +20 -0
  133. docs/source/getting_started/formats/index.rst +20 -0
  134. docs/source/getting_started/formats/matpower.rst +183 -0
  135. docs/source/getting_started/formats/psse.rst +46 -0
  136. docs/source/getting_started/formats/pypower.rst +223 -0
  137. docs/source/getting_started/formats/xlsx.png +0 -0
  138. docs/source/getting_started/formats/xlsx.rst +23 -0
  139. docs/source/getting_started/index.rst +76 -0
  140. docs/source/getting_started/install.rst +234 -0
  141. docs/source/getting_started/overview.rst +26 -0
  142. docs/source/getting_started/testcase.rst +45 -0
  143. docs/source/getting_started/verification.rst +13 -0
  144. docs/source/images/curent.ico +0 -0
  145. docs/source/images/dcopf_time.png +0 -0
  146. docs/source/images/sponsors/CURENT_Logo_NameOnTrans.png +0 -0
  147. docs/source/images/sponsors/CURENT_Logo_Transparent.png +0 -0
  148. docs/source/images/sponsors/CURENT_Logo_Transparent_Name.png +0 -0
  149. docs/source/images/sponsors/doe.png +0 -0
  150. docs/source/index.rst +108 -0
  151. docs/source/modeling/example.rst +159 -0
  152. docs/source/modeling/index.rst +17 -0
  153. docs/source/modeling/model.rst +210 -0
  154. docs/source/modeling/routine.rst +122 -0
  155. docs/source/modeling/system.rst +51 -0
  156. docs/source/release-notes.rst +398 -0
  157. ltbams-1.0.2a1.dist-info/METADATA +210 -0
  158. ltbams-1.0.2a1.dist-info/RECORD +188 -0
  159. {ltbams-0.9.9.dist-info → ltbams-1.0.2a1.dist-info}/WHEEL +1 -1
  160. ltbams-1.0.2a1.dist-info/top_level.txt +3 -0
  161. tests/__init__.py +0 -0
  162. tests/test_1st_system.py +33 -0
  163. tests/test_addressing.py +40 -0
  164. tests/test_andes_mats.py +61 -0
  165. tests/test_case.py +266 -0
  166. tests/test_cli.py +34 -0
  167. tests/test_export_csv.py +89 -0
  168. tests/test_group.py +83 -0
  169. tests/test_interface.py +216 -0
  170. tests/test_io.py +32 -0
  171. tests/test_jumper.py +27 -0
  172. tests/test_known_good.py +267 -0
  173. tests/test_matp.py +437 -0
  174. tests/test_model.py +54 -0
  175. tests/test_omodel.py +119 -0
  176. tests/test_paths.py +22 -0
  177. tests/test_report.py +251 -0
  178. tests/test_repr.py +21 -0
  179. tests/test_routine.py +178 -0
  180. tests/test_rtn_dcopf.py +101 -0
  181. tests/test_rtn_dcpf.py +77 -0
  182. tests/test_rtn_ed.py +279 -0
  183. tests/test_rtn_pflow.py +219 -0
  184. tests/test_rtn_rted.py +273 -0
  185. tests/test_rtn_uc.py +248 -0
  186. tests/test_service.py +73 -0
  187. ltbams-0.9.9.dist-info/LICENSE +0 -692
  188. ltbams-0.9.9.dist-info/METADATA +0 -859
  189. ltbams-0.9.9.dist-info/RECORD +0 -14
  190. ltbams-0.9.9.dist-info/top_level.txt +0 -1
  191. {ltbams-0.9.9.dist-info → ltbams-1.0.2a1.dist-info}/entry_points.txt +0 -0
docs/source/conf.py ADDED
@@ -0,0 +1,203 @@
1
+ # Configuration file for the Sphinx documentation builder.
2
+ #
3
+ # For the full list of built-in configuration values, see the documentation:
4
+ # https://www.sphinx-doc.org/en/master/usage/configuration.html
5
+
6
+ # -- Project information -----------------------------------------------------
7
+ # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
8
+
9
+ # -- General configuration ---------------------------------------------------
10
+ # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
11
+
12
+ import os
13
+ import ams
14
+ import shutil
15
+
16
+
17
+ # Set canonical URL from the Read the Docs Domain
18
+ html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "")
19
+
20
+ extensions = [
21
+ 'sphinx.ext.autodoc',
22
+ 'sphinx.ext.autosummary',
23
+ 'sphinx.ext.githubpages',
24
+ 'sphinx.ext.intersphinx',
25
+ 'sphinx.ext.mathjax',
26
+ 'sphinx.ext.doctest',
27
+ 'sphinx.ext.todo',
28
+ 'sphinx.ext.viewcode',
29
+ 'sphinx_panels',
30
+ 'IPython.sphinxext.ipython_directive',
31
+ 'IPython.sphinxext.ipython_console_highlighting',
32
+ 'matplotlib.sphinxext.plot_directive',
33
+ 'numpydoc',
34
+ 'sphinx_copybutton',
35
+ "nbsphinx",
36
+ ]
37
+
38
+ mathjax_path = 'https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js'
39
+
40
+ # Configuration options for plot_directive. See:
41
+ # https://github.com/matplotlib/matplotlib/blob/f3ed922d935751e08494e5fb5311d3050a3b637b/lib/matplotlib/sphinxext/plot_directive.py#L81
42
+ plot_html_show_source_link = False
43
+ plot_html_show_formats = False
44
+
45
+ # Generate the API documentation when building
46
+ autosummary_generate = True
47
+ numpydoc_show_class_members = False
48
+
49
+ templates_path = ['_templates']
50
+ # The suffix(es) of source filenames.
51
+ # You can specify multiple suffix as a list of string:
52
+ #
53
+ # source_suffix = ['.rst', '.md']
54
+ source_suffix = '.rst'
55
+
56
+ # The master toctree document.
57
+ master_doc = 'index'
58
+
59
+ exclude_patterns = []
60
+
61
+ # The language for content autogenerated by Sphinx. Refer to documentation
62
+ # for a list of supported languages.
63
+ #
64
+ # This is also used if you do content translation via gettext catalogs.
65
+ # Usually you set "language" from the command line for these cases.
66
+ language = "en"
67
+
68
+ # General information about the project.
69
+ project = 'AMS'
70
+ copyright = '2023-2024, Jinning Wang'
71
+ author = 'Jinning Wang'
72
+
73
+ version = ams.__version__
74
+ release = ams.__version__
75
+
76
+ # The name of the Pygments (syntax highlighting) style to use.
77
+ pygments_style = 'sphinx'
78
+
79
+ # If true, `todo` and `todoList` produce output, else they produce nothing.
80
+ todo_include_todos = False
81
+
82
+ # Use a different latex engine due to possible Unicode characters in the documentation:
83
+ # https://docs.readthedocs.io/en/stable/guides/pdf-non-ascii-languages.html
84
+ latex_engine = "xelatex"
85
+
86
+ # -- Options for HTML output -------------------------------------------------
87
+ # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
88
+
89
+ html_theme = 'pydata_sphinx_theme'
90
+
91
+ # Theme options are theme-specific and customize the look and feel of a theme
92
+ # further. For a list of options available for each theme, see the
93
+ # documentation.
94
+ #
95
+ html_theme_options = {
96
+ "use_edit_page_button": True,
97
+ # "footer_items": ["copyright", "sphinx-version", "theme-version"],
98
+ }
99
+
100
+ html_context = {
101
+ "github_url": "https://github.com",
102
+ "github_user": "CURENT",
103
+ "github_repo": "ams",
104
+ "github_version": "master",
105
+ "doc_path": "docs/source",
106
+ }
107
+
108
+ # Tell Jinja2 templates the build is running on Read the Docs
109
+ if os.environ.get("READTHEDOCS", "") == "True":
110
+ html_context["READTHEDOCS"] = True
111
+
112
+ # Add any paths that contain custom static files (such as style sheets) here,
113
+ # relative to this directory. They are copied after the builtin static files,
114
+ # so a file named "default.css" will overwrite the builtin "default.css".
115
+ html_static_path = ['_static']
116
+
117
+ # -- Options for HTMLHelp output ------------------------------------------
118
+
119
+ # Output file base name for HTML help builder.
120
+ htmlhelp_basename = 'ams'
121
+
122
+ # -- Options for LaTeX output ---------------------------------------------
123
+
124
+ latex_elements = {
125
+ # The paper size ('letterpaper' or 'a4paper').
126
+ #
127
+ # 'preamble': r'\DeclareUnicodeCharacter{2588}{-}',
128
+ 'papersize': 'letterpaper',
129
+
130
+ # The font size ('10pt', '11pt' or '12pt').
131
+ #
132
+ 'pointsize': '11pt',
133
+
134
+ # Additional stuff for the LaTeX preamble.
135
+ #
136
+ # 'preamble': '',
137
+
138
+ # Latex figure (float) alignment
139
+ #
140
+ # 'figure_align': 'htbp',
141
+ }
142
+
143
+ # Grouping the document tree into LaTeX files. List of tuples
144
+ # (source start file, target name, title,
145
+ # author, documentclass [howto, manual, or own class]).
146
+ latex_documents = [
147
+ (master_doc, 'ams.tex', 'AMS Manual',
148
+ 'Jinning Wang', 'manual'),
149
+ ]
150
+
151
+ # -- Options for manual page output ---------------------------------------
152
+
153
+ # One entry per manual page. List of tuples
154
+ # (source start file, name, description, authors, manual section).
155
+ man_pages = [
156
+ (master_doc, 'ams', 'AMS Manual',
157
+ [author], 1)
158
+ ]
159
+
160
+ # -- Options for Texinfo output -------------------------------------------
161
+
162
+ # Grouping the document tree into Texinfo files. List of tuples
163
+ # (source start file, target name, title, author,
164
+ # dir menu entry, description, category)
165
+ texinfo_documents = [
166
+ (master_doc, 'ams', 'AMS Manual',
167
+ author, 'ams', 'Python Software for Scheduling Modeling and Co-Simulation with Dynanics',
168
+ 'Miscellaneous'),
169
+ ]
170
+
171
+ # Example configuration for intersphinx: refer to the Python standard library.
172
+ intersphinx_mapping = {
173
+ 'python': ('https://docs.python.org/3/', None),
174
+ 'numpy': ('https://numpy.org/doc/stable/', None), # Updated URL for numpy
175
+ 'scipy': ('https://docs.scipy.org/doc/scipy/reference/', None),
176
+ 'pandas': ('https://pandas.pydata.org/pandas-docs/stable', None),
177
+ 'matplotlib': ('https://matplotlib.org/stable/', None), # Updated URL for matplotlib
178
+ }
179
+
180
+ # --- Options for primary sidebar ------------------------------------------
181
+ # REF: https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/layout.html#layout-sidebar-primary
182
+ html_sidebars = {
183
+ # "<page_pattern>": ["list", "of", "templates"]
184
+ }
185
+
186
+ # Favorite icon
187
+ html_favicon = 'images/curent.ico'
188
+
189
+ # Disable smartquotes to display double dashes correctly
190
+ smartquotes = False
191
+
192
+ # import and execute model reference generation script
193
+ exec(open("genmodelref.py").read())
194
+ exec(open("genroutineref.py").read())
195
+
196
+ shutil.rmtree("_examples", ignore_errors=True)
197
+ shutil.copytree("../../examples", "_examples", )
198
+ shutil.rmtree("_examples/demonstration")
199
+ shutil.copytree("../../examples/demonstration", "_examples/demo", )
200
+
201
+ # sphinx-panels shouldn't add bootstrap css since the pydata-sphinx-theme
202
+ # already loads it
203
+ panels_add_bootstrap_css = False
@@ -0,0 +1,34 @@
1
+ .. _scripting_examples:
2
+
3
+ Examples
4
+ ========
5
+
6
+ .. _`development demos`: https://github.com/CURENT/ams/tree/master/dev/demo
7
+
8
+ Refer to the development `development demos`_ for examples prior to preparing this section.
9
+
10
+ A collection of examples are presented to supplement the tutorial. The
11
+ examples below are identical to the Jupyter Notebook in the ``examples``
12
+ folder of the repository
13
+ `here <https://github.com/CURENT/ams/tree/master/examples>`__.
14
+
15
+ .. toctree::
16
+ :maxdepth: 2
17
+ :caption: Scripting
18
+
19
+ ../_examples/ex1.ipynb
20
+ ../_examples/ex2.ipynb
21
+ ../_examples/ex3.ipynb
22
+ ../_examples/ex4.ipynb
23
+ ../_examples/ex5.ipynb
24
+ ../_examples/ex6.ipynb
25
+ ../_examples/ex7.ipynb
26
+ ../_examples/ex8.ipynb
27
+
28
+ .. toctree::
29
+ :maxdepth: 2
30
+ :caption: Demonstration
31
+
32
+ ../_examples/demo/demo_ESD1.ipynb
33
+ ../_examples/demo/demo_AGC.ipynb
34
+ ../_examples/demo/demo_debug.ipynb
@@ -0,0 +1,61 @@
1
+ """
2
+ This file is used to generate reStructuredText tables for Model and Routine references.
3
+ """
4
+
5
+ import os
6
+ import ams
7
+
8
+ if not (os.path.isfile('modelref.rst') and os.path.isfile('configref.rst')):
9
+
10
+ ss = ams.load(ams.get_case('ieee14/ieee14_uced.xlsx'))
11
+
12
+ # write the top-level index file
13
+
14
+ out = """.. _modelref:
15
+
16
+ ***************
17
+ Model reference
18
+ ***************
19
+
20
+ Use the left navigation pane to locate the group and model
21
+ and view details.
22
+
23
+ """
24
+
25
+ out += ss.supported_models(export='rest')
26
+
27
+ out += '\n'
28
+ out += '.. toctree ::\n'
29
+ out += ' :maxdepth: 2\n'
30
+ out += ' :hidden:\n'
31
+ out += '\n'
32
+
33
+ file_tpl = ' groupdoc/{}\n'
34
+
35
+ for group in ss.groups.values():
36
+ out += file_tpl.format(group.class_name)
37
+
38
+ with open('modelref.rst', 'w') as f:
39
+ f.write(out)
40
+
41
+ # write individual files
42
+
43
+ os.makedirs('groupdoc', exist_ok=True)
44
+
45
+ for group in ss.groups.values():
46
+ with open(f'groupdoc/{group.class_name}.rst', 'w') as f:
47
+ f.write(group.doc_all(export='rest'))
48
+
49
+ # # Config Reference Section
50
+
51
+ # out = ''
52
+ # out += '.. _configref:\n\n'
53
+ # out += '****************\n'
54
+ # out += 'Config reference\n'
55
+ # out += '****************\n'
56
+ # out += '\n'
57
+
58
+ # out += ss.config.doc(export='rest', target=True, symbol=False)
59
+
60
+ # for r in ss.routines.values():
61
+ # out += r.config.doc(export='rest', target=True, symbol=False)
@@ -0,0 +1,47 @@
1
+ """
2
+ This file is used to generate reStructuredText tables for Model and Routine references.
3
+ """
4
+
5
+ import os
6
+ import ams
7
+
8
+ if not (os.path.isfile('routineref.rst') and os.path.isfile('configref.rst')):
9
+
10
+ ss = ams.load(ams.get_case('ieee14/ieee14_uced.xlsx'))
11
+
12
+ # write the top-level index file
13
+
14
+ out = """.. _routineref:
15
+
16
+ *******************
17
+ Routine reference
18
+ *******************
19
+
20
+ Use the left navigation pane to locate the group and model
21
+ and view details.
22
+
23
+ """
24
+
25
+ out += ss.supported_routines(export='rest')
26
+
27
+ out += '\n'
28
+ out += '.. toctree ::\n'
29
+ out += ' :maxdepth: 2\n'
30
+ out += ' :hidden:\n'
31
+ out += '\n'
32
+
33
+ file_tpl = ' typedoc/{}\n'
34
+
35
+ for rtn_type in ss.types.values():
36
+ out += file_tpl.format(rtn_type.class_name)
37
+
38
+ with open('routineref.rst', 'w') as f:
39
+ f.write(out)
40
+
41
+ # write individual files
42
+
43
+ os.makedirs('typedoc', exist_ok=True)
44
+
45
+ for rtn_type in ss.types.values():
46
+ with open(f'typedoc/{rtn_type.class_name}.rst', 'w') as f:
47
+ f.write(rtn_type.doc_all(export='rest'))
@@ -0,0 +1,20 @@
1
+ .. role:: raw-html(raw)
2
+ :format: html
3
+
4
+ *******
5
+ License
6
+ *******
7
+
8
+ GNU Public License v3
9
+ *********************
10
+ | Copyright :raw-html:`&copy;` 2023-2024 Jinning Wang.
11
+
12
+ AMS is free software; you can redistribute it and/or modify it under the terms
13
+ of the `GNU General Public License <http://www.gnu.org/licenses/gpl-3.0.html>`_
14
+ as published by the Free Software Foundation; either version 3 of the License,
15
+ or (at your option) any later version.
16
+
17
+ AMS is distributed in the hope that it will be useful, but WITHOUT ANY
18
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
19
+ PARTICULAR PURPOSE. See the `GNU General Public License
20
+ <http://www.gnu.org/licenses/gpl-3.0.html>`_ for more details.
@@ -0,0 +1,20 @@
1
+ .. _input-formats:
2
+
3
+ =============
4
+ Input formats
5
+ =============
6
+
7
+ AMS currently supports the following input formats:
8
+
9
+ - ``.xlsx``: Excel spreadsheet file with AMS data
10
+ - ``.raw``: PSS/E RAW format
11
+ - ``.m``: MATPOWER format
12
+ - ``.py``: PYPOWER format
13
+
14
+ .. toctree::
15
+ :maxdepth: 3
16
+
17
+ xlsx
18
+ psse
19
+ matpower
20
+ pypower
@@ -0,0 +1,183 @@
1
+ .. _input-matpower:
2
+
3
+ MATPOWER
4
+ --------
5
+ The data file format of MATPOWER is excerpted below for quick reference. For more information, see
6
+ the `MATPOWER User’s Manual <https://matpower.org/docs/MATPOWER-manual.pdf>`_.
7
+
8
+ Bus Data
9
+ ~~~~~~~~~
10
+ +----------------+--------+-----------------------------------------------------------------+
11
+ | name | column | description |
12
+ +================+========+=================================================================+
13
+ | BUS_I | 1 | bus number (positive integer) |
14
+ +----------------+--------+-----------------------------------------------------------------+
15
+ | BUS_TYPE | 2 | bus type (1 = PQ, 2 = PV, 3 = ref, 4 = isolated) |
16
+ +----------------+--------+-----------------------------------------------------------------+
17
+ | PD | 3 | real power demand (MW) |
18
+ +----------------+--------+-----------------------------------------------------------------+
19
+ | QD | 4 | reactive power demand (MVAr) |
20
+ +----------------+--------+-----------------------------------------------------------------+
21
+ | GS | 5 | shunt conductance (MW demanded at V = 1.0 p.u.) |
22
+ +----------------+--------+-----------------------------------------------------------------+
23
+ | BS | 6 | shunt susceptance (MVAr injected at V = 1.0 p.u.) |
24
+ +----------------+--------+-----------------------------------------------------------------+
25
+ | BUS AREA | 7 | area number (positive integer) |
26
+ +----------------+--------+-----------------------------------------------------------------+
27
+ | VM | 8 | voltage magnitude (p.u.) |
28
+ +----------------+--------+-----------------------------------------------------------------+
29
+ | VA | 9 | voltage angle (degrees) |
30
+ +----------------+--------+-----------------------------------------------------------------+
31
+ | BASE_KV | 10 | base voltage (kV) |
32
+ +----------------+--------+-----------------------------------------------------------------+
33
+ | ZONE | 11 | loss zone (positive integer) |
34
+ +----------------+--------+-----------------------------------------------------------------+
35
+ | VMAX | 12 | maximum voltage magnitude (p.u.) |
36
+ +----------------+--------+-----------------------------------------------------------------+
37
+ | VMIN | 13 | minimum voltage magnitude (p.u.) |
38
+ +----------------+--------+-----------------------------------------------------------------+
39
+ | LAM_P [1] | 14 | Lagrange multiplier on real power mismatch (:math:`u`/MW) |
40
+ +----------------+--------+-----------------------------------------------------------------+
41
+ | LAM_Q [1] | 15 | Lagrange multiplier on reactive power mismatch (:math:`u`/MVar) |
42
+ +----------------+--------+-----------------------------------------------------------------+
43
+ | MU_VMAX [1] | 16 | Kuhn-Tucker multiplier on upper voltage limit (:math:`u`/p.u.) |
44
+ +----------------+--------+-----------------------------------------------------------------+
45
+ | MU_VMIN [1] | 17 | Kuhn-Tucker multiplier on lower voltage limit (:math:`u`/p.u.) |
46
+ +----------------+--------+-----------------------------------------------------------------+
47
+
48
+
49
+ #. Included in OPF output, typically not included (or ignored) in input matrix. Here we assume the objective function has units :math:`u`.
50
+
51
+ Generator Data
52
+ ~~~~~~~~~~~~~~
53
+ +------------------------+--------+--------------------------------------------------------------+
54
+ | name | column | description |
55
+ +------------------------+--------+--------------------------------------------------------------+
56
+ | GEN_BUS | 1 | bus number |
57
+ +------------------------+--------+--------------------------------------------------------------+
58
+ | PG | 2 | real power output (MW) |
59
+ +------------------------+--------+--------------------------------------------------------------+
60
+ | QG | 3 | reactive power output (MVAr) |
61
+ +------------------------+--------+--------------------------------------------------------------+
62
+ | QMAX | 4 | maximum reactive power output (MVAr) |
63
+ +------------------------+--------+--------------------------------------------------------------+
64
+ | QMIN | 5 | minimum reactive power output (MVAr) |
65
+ +------------------------+--------+--------------------------------------------------------------+
66
+ | VG [3] | 6 | voltage magnitude setpoint (p.u.) |
67
+ +------------------------+--------+--------------------------------------------------------------+
68
+ | MBASE | 7 | total MVA base of machine, defaults to baseMVA |
69
+ +------------------------+--------+--------------------------------------------------------------+
70
+ | GEN_STATUS | 8 | machine status, > 0 for in-service , <= 0 for out-of-service |
71
+ +------------------------+--------+--------------------------------------------------------------+
72
+ | PMAX | 9 | maximum real power output (MW) |
73
+ +------------------------+--------+--------------------------------------------------------------+
74
+ | PMIN | 10 | minimum real power output (MW) |
75
+ +------------------------+--------+--------------------------------------------------------------+
76
+ | PC1 [1] | 11 | lower real power output of PQ capability curve (MW) |
77
+ +------------------------+--------+--------------------------------------------------------------+
78
+ | PC2 [1] | 12 | upper real power output of PQ capability curve (MW) |
79
+ +------------------------+--------+--------------------------------------------------------------+
80
+ | QC1MIN [1] | 13 | minimum reactive power output at PC1 (MVAr) |
81
+ +------------------------+--------+--------------------------------------------------------------+
82
+ | QC1MAX [1] | 14 | maximum reactive power output at PC1 (MVAr) |
83
+ +------------------------+--------+--------------------------------------------------------------+
84
+ | QC2MIN [1] | 15 | minimum reactive power output at PC2 (MVAr) |
85
+ +------------------------+--------+--------------------------------------------------------------+
86
+ | QC2MAX [1] | 16 | maximum reactive power output at PC2 (MVAr) |
87
+ +------------------------+--------+--------------------------------------------------------------+
88
+ | RAMP_AGC [1] | 17 | ramp rate for load following/AGC (MW/min) |
89
+ +------------------------+--------+--------------------------------------------------------------+
90
+ | RAMP_10 [1] | 18 | ramp rate for 10 minute reserves (MW) |
91
+ +------------------------+--------+--------------------------------------------------------------+
92
+ | RAMP_30 [1] | 19 | ramp rate for 30 minute reserves (MW) |
93
+ +------------------------+--------+--------------------------------------------------------------+
94
+ | RAMP_Q [1] | 20 | ramp rate for reactive power (2 sec timescale) (MVAr/min) |
95
+ +------------------------+--------+--------------------------------------------------------------+
96
+ | APF [1] | 21 | area participation factor |
97
+ +------------------------+--------+--------------------------------------------------------------+
98
+ | MU_PMAX [2] | 22 | Kuhn-Tucker multiplier on upper Pg limit (:math:`u`/MW) |
99
+ +------------------------+--------+--------------------------------------------------------------+
100
+ | MU_PMIN [2] | 23 | Kuhn-Tucker multiplier on lower Pg |
101
+ +------------------------+--------+--------------------------------------------------------------+
102
+
103
+ #. Not included in version 1 case format.
104
+
105
+ #. Included in OPF output, typically not included (or ignored) in input matrix. Here we assume the objective function has units :math:`u`.
106
+
107
+ #. Used to determine voltage setpoint for optimal power flow only if ``opf.use_vg`` option is non-zero (0 by default). Otherwise generator voltage range is determined by limits set for corresponding bus in bus matrix.
108
+
109
+ Branch Data
110
+ ~~~~~~~~~~~~
111
+ +--------------------------+--------+------------------------------------------------------------------------------+
112
+ | name | column | description |
113
+ +--------------------------+--------+------------------------------------------------------------------------------+
114
+ | F_BUS | 1 | "from" bus number |
115
+ +--------------------------+--------+------------------------------------------------------------------------------+
116
+ | T_BUS | 2 | "to" bus number |
117
+ +--------------------------+--------+------------------------------------------------------------------------------+
118
+ | BR_R | 3 | resistance (p.u.) |
119
+ +--------------------------+--------+------------------------------------------------------------------------------+
120
+ | BR_X | 4 | reactance (p.u.) |
121
+ +--------------------------+--------+------------------------------------------------------------------------------+
122
+ | BR_B | 5 | total line charging susceptance (p.u.) |
123
+ +--------------------------+--------+------------------------------------------------------------------------------+
124
+ | RATE_A [1] | 6 | MVA rating A (long term rating), set to 0 for unlimited |
125
+ +--------------------------+--------+------------------------------------------------------------------------------+
126
+ | RATE_B [1] | 7 | MVA rating B (short term rating), set to 0 for unlimited |
127
+ +--------------------------+--------+------------------------------------------------------------------------------+
128
+ | RATE_C [1] | 8 | MVA rating C (emergency rating), set to 0 for unlimited |
129
+ +--------------------------+--------+------------------------------------------------------------------------------+
130
+ | TAP | 9 | transformer off nominal turns ratio |
131
+ +--------------------------+--------+------------------------------------------------------------------------------+
132
+ | SHIFT | 10 | transformer phase shift angle (degrees), positive => delay |
133
+ +--------------------------+--------+------------------------------------------------------------------------------+
134
+ | BR_STATUS | 11 | initial branch status, 1 = in-service, 0 = out-of-service |
135
+ +--------------------------+--------+------------------------------------------------------------------------------+
136
+ | ANGMIN [2] | 12 | minimum angle difference, Of - Ot (degrees) |
137
+ +--------------------------+--------+------------------------------------------------------------------------------+
138
+ | ANGMAX [2] | 13 | maximum angle difference, 0,-0 - (degrees) |
139
+ +--------------------------+--------+------------------------------------------------------------------------------+
140
+ | PF [3] | 14 | real power injected at "from" bus end (MW) |
141
+ +--------------------------+--------+------------------------------------------------------------------------------+
142
+ | QF [3] | 15 | reactive power injected at "from" bus end (MVAr) |
143
+ +--------------------------+--------+------------------------------------------------------------------------------+
144
+ | PT [3] | 16 | real power injected at "to" bus end (MW) |
145
+ +--------------------------+--------+------------------------------------------------------------------------------+
146
+ | QT [3] | 17 | reactive power injected at "to" bus end (MVAr) |
147
+ +--------------------------+--------+------------------------------------------------------------------------------+
148
+ | MU_SF [4] | 18 | Kuhn-Tucker multiplier on MVA limit at "from" bus (:math:`u`/MVA) |
149
+ +--------------------------+--------+------------------------------------------------------------------------------+
150
+ | MU_ST [4] | 19 | Kuhn-Tucker multiplier on MVA limit at "to" bus (:math:`u`/MVA) |
151
+ +--------------------------+--------+------------------------------------------------------------------------------+
152
+ | MU_ANGMIN [4] | 20 | Kuhn-Tucker multiplier lower angle difference limit (:math:`u`/degree) |
153
+ +--------------------------+--------+------------------------------------------------------------------------------+
154
+ | MU_ANGMAX [4] | 21 | Kuhn |
155
+ +--------------------------+--------+------------------------------------------------------------------------------+
156
+
157
+ #. Used to specify branch flow limits. By default these are limits on apparent power with units in MVA. However, the 'opf.flow lim' option can be used to specify that the limits are active power or current, in which case the ratings are specified in MW or :math:`kA·V_{basekV}`, respectively. For current this is equivalent to an MVA value at a 1 p.u. voltage.
158
+
159
+ #. Not included in version 1 case format. The voltage angle difference is taken to be unbounded below if :math:`ANGMIN ≤ −360` and unbounded above if :math:`ANGMAX ≥ 360`. If both parameters are zero, the voltage angle difference is unconstrained.
160
+
161
+ #. Included in power flow and OPF output, ignored on input.
162
+
163
+ #. Included in OPF output, typically not included (or ignored) in input matrix. Here we assume the objective function has units :math:`u`.
164
+
165
+
166
+ Generator Cost Data
167
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
168
+ +----------+--------+---------------------------------------------------------------------------------------------------------------------------+
169
+ | name | column | description |
170
+ +----------+--------+---------------------------------------------------------------------------------------------------------------------------+
171
+ | MODEL | 1 | cost model, 1 = piecewise linear, 2 = polynomial |
172
+ +----------+--------+---------------------------------------------------------------------------------------------------------------------------+
173
+ | STARTUP | 2 | startup cost in US dollars [1] |
174
+ +----------+--------+---------------------------------------------------------------------------------------------------------------------------+
175
+ | SHUTDOWN | 3 | shutdown cost in US dollars [1] |
176
+ +----------+--------+---------------------------------------------------------------------------------------------------------------------------+
177
+ | NCOST | 4 | number of points of an n-segment piecewise linear cost function or coefficients of an n-th order polynomial cost function |
178
+ +----------+--------+---------------------------------------------------------------------------------------------------------------------------+
179
+ | COST [2] | 5 | parameters defining total cost function :math:`f(p)` |
180
+ +----------+--------+---------------------------------------------------------------------------------------------------------------------------+
181
+
182
+ #. Not currently used by any Matpower functions.
183
+ #. MODEL = 1, :math:`f(p)` is defined by the coordinates :math:`(p_1, f_1), (p_2, f_2), . . . , (p_N , f_N)`; MODEL = 2, :math:`f(p) = c_{n}p^{n} + ... + c_{1}p^{1} + c_{0}`.
@@ -0,0 +1,46 @@
1
+
2
+ .. _psse:
3
+
4
+ PSS/E RAW
5
+ -----------------
6
+
7
+ The Siemens PSS/E data format is a widely used for power system simulation.
8
+ PSS/E uses a variety of plain-text files to store data for different actions.
9
+ The RAW format (with file extension ``.raw``) is used to store the steady-state
10
+ data for power flow analysis.
11
+ Leveraging ANDES PSS/E parser, one can load PSS/E RAW files into AMS for power
12
+ flow study.
13
+
14
+ RAW Compatibility
15
+ .................
16
+ AMS supports PSS/E RAW in versions 32 and 33. Newer versions of
17
+ ``raw`` files can store PSS/E settings along with the system data, but such
18
+ feature is not yet supported in AMS. Also, manually edited ``raw`` files can
19
+ confuse the parser in AMS. Following manual edits, it is strongly recommended
20
+ to load the data into PSS/E and save the case as a v33 RAW file.
21
+
22
+ AMS supports most power flow models in PSS/E. It needs to be recognized that
23
+ the power flow models in PSS/E is is a larger set compared with those in AMS.
24
+ For example, switched shunts in PSS/E are converted to fixed ones, not all
25
+ three-winding transformer flags are supported, and HVDC devices are not yet
26
+ converted. This is not an exhaustive list, but all of them are advanced models.
27
+
28
+ We welcome contributions but please also reach out to us if you need
29
+ to arrange the development of such models.
30
+
31
+ Loading files
32
+ .............
33
+
34
+ In the command line, PSS/E files can be loaded with
35
+
36
+ .. code-block:: bash
37
+
38
+ ams run kundur.raw
39
+
40
+ Likewise, one can convert PSS/E files to AMS xlsx:
41
+
42
+ .. code-block:: bash
43
+
44
+ ams run kundur.raw -c
45
+
46
+ This will convert all models in the RAW files.