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.
- ams/__init__.py +4 -11
- ams/_version.py +3 -3
- ams/cases/5bus/pjm5bus_demo.xlsx +0 -0
- ams/cases/5bus/pjm5bus_jumper.xlsx +0 -0
- ams/cases/5bus/pjm5bus_uced.json +1062 -0
- ams/cases/5bus/pjm5bus_uced.xlsx +0 -0
- ams/cases/5bus/pjm5bus_uced_esd1.xlsx +0 -0
- ams/cases/5bus/pjm5bus_uced_ev.xlsx +0 -0
- ams/cases/ieee123/ieee123.xlsx +0 -0
- ams/cases/ieee123/ieee123_regcv1.xlsx +0 -0
- ams/cases/ieee14/ieee14.json +1166 -0
- ams/cases/ieee14/ieee14.raw +92 -0
- ams/cases/ieee14/ieee14_conn.xlsx +0 -0
- ams/cases/ieee14/ieee14_uced.xlsx +0 -0
- ams/cases/ieee39/ieee39.xlsx +0 -0
- ams/cases/ieee39/ieee39_uced.xlsx +0 -0
- ams/cases/ieee39/ieee39_uced_esd1.xlsx +0 -0
- ams/cases/ieee39/ieee39_uced_pvd1.xlsx +0 -0
- ams/cases/ieee39/ieee39_uced_vis.xlsx +0 -0
- ams/cases/matpower/benchmark.json +1594 -0
- ams/cases/matpower/case118.m +787 -0
- ams/cases/matpower/case14.m +129 -0
- ams/cases/matpower/case300.m +1315 -0
- ams/cases/matpower/case39.m +205 -0
- ams/cases/matpower/case5.m +62 -0
- ams/cases/matpower/case_ACTIVSg2000.m +9460 -0
- ams/cases/npcc/npcc.m +644 -0
- ams/cases/npcc/npcc_uced.xlsx +0 -0
- ams/cases/pglib/pglib_opf_case39_epri__api.m +243 -0
- ams/cases/wecc/wecc.m +714 -0
- ams/cases/wecc/wecc_uced.xlsx +0 -0
- ams/cli.py +6 -0
- ams/core/__init__.py +2 -0
- ams/core/documenter.py +652 -0
- ams/core/matprocessor.py +782 -0
- ams/core/model.py +330 -0
- ams/core/param.py +322 -0
- ams/core/service.py +918 -0
- ams/core/symprocessor.py +224 -0
- ams/core/var.py +59 -0
- ams/extension/__init__.py +5 -0
- ams/extension/eva.py +401 -0
- ams/interface.py +1085 -0
- ams/io/__init__.py +133 -0
- ams/io/json.py +82 -0
- ams/io/matpower.py +406 -0
- ams/io/psse.py +6 -0
- ams/io/pypower.py +103 -0
- ams/io/xlsx.py +80 -0
- ams/main.py +81 -4
- ams/models/__init__.py +24 -0
- ams/models/area.py +40 -0
- ams/models/bus.py +52 -0
- ams/models/cost.py +169 -0
- ams/models/distributed/__init__.py +3 -0
- ams/models/distributed/esd1.py +71 -0
- ams/models/distributed/ev.py +60 -0
- ams/models/distributed/pvd1.py +67 -0
- ams/models/group.py +231 -0
- ams/models/info.py +26 -0
- ams/models/line.py +238 -0
- ams/models/renewable/__init__.py +5 -0
- ams/models/renewable/regc.py +119 -0
- ams/models/reserve.py +94 -0
- ams/models/shunt.py +14 -0
- ams/models/static/__init__.py +2 -0
- ams/models/static/gen.py +165 -0
- ams/models/static/pq.py +61 -0
- ams/models/timeslot.py +69 -0
- ams/models/zone.py +49 -0
- ams/opt/__init__.py +12 -0
- ams/opt/constraint.py +175 -0
- ams/opt/exprcalc.py +127 -0
- ams/opt/expression.py +188 -0
- ams/opt/objective.py +174 -0
- ams/opt/omodel.py +432 -0
- ams/opt/optzbase.py +192 -0
- ams/opt/param.py +156 -0
- ams/opt/var.py +233 -0
- ams/pypower/__init__.py +8 -0
- ams/pypower/_compat.py +9 -0
- ams/pypower/core/__init__.py +8 -0
- ams/pypower/core/pips.py +894 -0
- ams/pypower/core/ppoption.py +244 -0
- ams/pypower/core/ppver.py +18 -0
- ams/pypower/core/solver.py +2451 -0
- ams/pypower/eps.py +6 -0
- ams/pypower/idx.py +174 -0
- ams/pypower/io.py +604 -0
- ams/pypower/make/__init__.py +11 -0
- ams/pypower/make/matrices.py +665 -0
- ams/pypower/make/pdv.py +506 -0
- ams/pypower/routines/__init__.py +7 -0
- ams/pypower/routines/cpf.py +513 -0
- ams/pypower/routines/cpf_callbacks.py +114 -0
- ams/pypower/routines/opf.py +1803 -0
- ams/pypower/routines/opffcns.py +1946 -0
- ams/pypower/routines/pflow.py +852 -0
- ams/pypower/toggle.py +1098 -0
- ams/pypower/utils.py +293 -0
- ams/report.py +212 -50
- ams/routines/__init__.py +23 -0
- ams/routines/acopf.py +117 -0
- ams/routines/cpf.py +65 -0
- ams/routines/dcopf.py +241 -0
- ams/routines/dcpf.py +209 -0
- ams/routines/dcpf0.py +196 -0
- ams/routines/dopf.py +150 -0
- ams/routines/ed.py +312 -0
- ams/routines/pflow.py +255 -0
- ams/routines/pflow0.py +113 -0
- ams/routines/routine.py +1033 -0
- ams/routines/rted.py +519 -0
- ams/routines/type.py +160 -0
- ams/routines/uc.py +376 -0
- ams/shared.py +63 -9
- ams/system.py +61 -22
- ams/utils/__init__.py +3 -0
- ams/utils/misc.py +77 -0
- ams/utils/paths.py +257 -0
- docs/Makefile +21 -0
- docs/make.bat +35 -0
- docs/source/_templates/autosummary/base.rst +5 -0
- docs/source/_templates/autosummary/class.rst +35 -0
- docs/source/_templates/autosummary/module.rst +65 -0
- docs/source/_templates/autosummary/module_toctree.rst +66 -0
- docs/source/api.rst +102 -0
- docs/source/conf.py +203 -0
- docs/source/examples/index.rst +34 -0
- docs/source/genmodelref.py +61 -0
- docs/source/genroutineref.py +47 -0
- docs/source/getting_started/copyright.rst +20 -0
- docs/source/getting_started/formats/index.rst +20 -0
- docs/source/getting_started/formats/matpower.rst +183 -0
- docs/source/getting_started/formats/psse.rst +46 -0
- docs/source/getting_started/formats/pypower.rst +223 -0
- docs/source/getting_started/formats/xlsx.png +0 -0
- docs/source/getting_started/formats/xlsx.rst +23 -0
- docs/source/getting_started/index.rst +76 -0
- docs/source/getting_started/install.rst +234 -0
- docs/source/getting_started/overview.rst +26 -0
- docs/source/getting_started/testcase.rst +45 -0
- docs/source/getting_started/verification.rst +13 -0
- docs/source/images/curent.ico +0 -0
- docs/source/images/dcopf_time.png +0 -0
- docs/source/images/sponsors/CURENT_Logo_NameOnTrans.png +0 -0
- docs/source/images/sponsors/CURENT_Logo_Transparent.png +0 -0
- docs/source/images/sponsors/CURENT_Logo_Transparent_Name.png +0 -0
- docs/source/images/sponsors/doe.png +0 -0
- docs/source/index.rst +108 -0
- docs/source/modeling/example.rst +159 -0
- docs/source/modeling/index.rst +17 -0
- docs/source/modeling/model.rst +210 -0
- docs/source/modeling/routine.rst +122 -0
- docs/source/modeling/system.rst +51 -0
- docs/source/release-notes.rst +398 -0
- ltbams-1.0.2a1.dist-info/METADATA +210 -0
- ltbams-1.0.2a1.dist-info/RECORD +188 -0
- {ltbams-0.9.9.dist-info → ltbams-1.0.2a1.dist-info}/WHEEL +1 -1
- ltbams-1.0.2a1.dist-info/top_level.txt +3 -0
- tests/__init__.py +0 -0
- tests/test_1st_system.py +33 -0
- tests/test_addressing.py +40 -0
- tests/test_andes_mats.py +61 -0
- tests/test_case.py +266 -0
- tests/test_cli.py +34 -0
- tests/test_export_csv.py +89 -0
- tests/test_group.py +83 -0
- tests/test_interface.py +216 -0
- tests/test_io.py +32 -0
- tests/test_jumper.py +27 -0
- tests/test_known_good.py +267 -0
- tests/test_matp.py +437 -0
- tests/test_model.py +54 -0
- tests/test_omodel.py +119 -0
- tests/test_paths.py +22 -0
- tests/test_report.py +251 -0
- tests/test_repr.py +21 -0
- tests/test_routine.py +178 -0
- tests/test_rtn_dcopf.py +101 -0
- tests/test_rtn_dcpf.py +77 -0
- tests/test_rtn_ed.py +279 -0
- tests/test_rtn_pflow.py +219 -0
- tests/test_rtn_rted.py +273 -0
- tests/test_rtn_uc.py +248 -0
- tests/test_service.py +73 -0
- ltbams-0.9.9.dist-info/LICENSE +0 -692
- ltbams-0.9.9.dist-info/METADATA +0 -859
- ltbams-0.9.9.dist-info/RECORD +0 -14
- ltbams-0.9.9.dist-info/top_level.txt +0 -1
- {ltbams-0.9.9.dist-info → ltbams-1.0.2a1.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,223 @@
|
|
1
|
+
.. _input-pypower:
|
2
|
+
|
3
|
+
PYPOWER
|
4
|
+
--------
|
5
|
+
|
6
|
+
AMS includes `PYPOWER cases <https://github.com/CURENT/ams/tree/develop/ams/cases/pypower>`_
|
7
|
+
in version 2 for scheduling modeling and analysis. PYPOWER cases follow the same format as MATPOWER.
|
8
|
+
|
9
|
+
The PYPOWER case is defined as a Python dictionary that includes ``bus``, ``gen``, ``branch``,
|
10
|
+
``areas``, and ``gencost``.
|
11
|
+
Defines the PYPOWER case file format.
|
12
|
+
|
13
|
+
A PYPOWER case file is a Python file or MAT-file that defines or returns a dict named ``ppc``, referred to
|
14
|
+
as a "PYPOWER case dict". The keys of this dict are ``bus``, ``gen``, ``branch``, ``areas``, and
|
15
|
+
``gencost``.
|
16
|
+
With the exception of C{baseMVA}, a scalar, each data variable is an array, where a row corresponds
|
17
|
+
to a single bus, branch, gen, etc. The format of the data is similar to the PTI format described in
|
18
|
+
`PTI Load Flow Data Format <http://www.ee.washington.edu/research/pstca/formats/pti.txt>`_.
|
19
|
+
|
20
|
+
|
21
|
+
Example Case9
|
22
|
+
~~~~~~~~~~~~~~~~~~
|
23
|
+
|
24
|
+
.. code:: python
|
25
|
+
|
26
|
+
ppc = {"version": '2'}
|
27
|
+
|
28
|
+
##----- Power Flow Data -----##
|
29
|
+
## system MVA base
|
30
|
+
ppc["baseMVA"] = 100.0
|
31
|
+
|
32
|
+
## bus data
|
33
|
+
# bus_i type Pd Qd Gs Bs area Vm Va baseKV zone Vmax Vmin
|
34
|
+
ppc["bus"] = array([
|
35
|
+
[1, 3, 0, 0, 0, 0, 1, 1, 0, 345, 1, 1.1, 0.9],
|
36
|
+
[2, 2, 0, 0, 0, 0, 1, 1, 0, 345, 1, 1.1, 0.9],
|
37
|
+
[3, 2, 0, 0, 0, 0, 1, 1, 0, 345, 1, 1.1, 0.9],
|
38
|
+
[4, 1, 0, 0, 0, 0, 1, 1, 0, 345, 1, 1.1, 0.9],
|
39
|
+
[5, 1, 90, 30, 0, 0, 1, 1, 0, 345, 1, 1.1, 0.9],
|
40
|
+
[6, 1, 0, 0, 0, 0, 1, 1, 0, 345, 1, 1.1, 0.9],
|
41
|
+
[7, 1, 100, 35, 0, 0, 1, 1, 0, 345, 1, 1.1, 0.9],
|
42
|
+
[8, 1, 0, 0, 0, 0, 1, 1, 0, 345, 1, 1.1, 0.9],
|
43
|
+
[9, 1, 125, 50, 0, 0, 1, 1, 0, 345, 1, 1.1, 0.9]
|
44
|
+
])
|
45
|
+
|
46
|
+
## generator data
|
47
|
+
# bus, Pg, Qg, Qmax, Qmin, Vg, mBase, status, Pmax, Pmin, Pc1, Pc2,
|
48
|
+
# Qc1min, Qc1max, Qc2min, Qc2max, ramp_agc, ramp_10, ramp_30, ramp_q, apf
|
49
|
+
ppc["gen"] = array([
|
50
|
+
[1, 0, 0, 300, -300, 1, 100, 1, 250, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
51
|
+
[2, 163, 0, 300, -300, 1, 100, 1, 300, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
52
|
+
[3, 85, 0, 300, -300, 1, 100, 1, 270, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
53
|
+
])
|
54
|
+
|
55
|
+
## branch data
|
56
|
+
# fbus, tbus, r, x, b, rateA, rateB, rateC, ratio, angle, status, angmin, angmax
|
57
|
+
ppc["branch"] = array([
|
58
|
+
[1, 4, 0, 0.0576, 0, 250, 250, 250, 0, 0, 1, -360, 360],
|
59
|
+
[4, 5, 0.017, 0.092, 0.158, 250, 250, 250, 0, 0, 1, -360, 360],
|
60
|
+
[5, 6, 0.039, 0.17, 0.358, 150, 150, 150, 0, 0, 1, -360, 360],
|
61
|
+
[3, 6, 0, 0.0586, 0, 300, 300, 300, 0, 0, 1, -360, 360],
|
62
|
+
[6, 7, 0.0119, 0.1008, 0.209, 150, 150, 150, 0, 0, 1, -360, 360],
|
63
|
+
[7, 8, 0.0085, 0.072, 0.149, 250, 250, 250, 0, 0, 1, -360, 360],
|
64
|
+
[8, 2, 0, 0.0625, 0, 250, 250, 250, 0, 0, 1, -360, 360],
|
65
|
+
[8, 9, 0.032, 0.161, 0.306, 250, 250, 250, 0, 0, 1, -360, 360],
|
66
|
+
[9, 4, 0.01, 0.085, 0.176, 250, 250, 250, 0, 0, 1, -360, 360]
|
67
|
+
])
|
68
|
+
|
69
|
+
##----- OPF Data -----##
|
70
|
+
## area data
|
71
|
+
# area refbus
|
72
|
+
ppc["areas"] = array([
|
73
|
+
[1, 5]
|
74
|
+
])
|
75
|
+
|
76
|
+
## generator cost data
|
77
|
+
# 1 startup shutdown n x1 y1 ... xn yn
|
78
|
+
# 2 startup shutdown n c(n-1) ... c0
|
79
|
+
ppc["gencost"] = array([
|
80
|
+
[2, 1500, 0, 3, 0.11, 5, 150],
|
81
|
+
[2, 2000, 0, 3, 0.085, 1.2, 600],
|
82
|
+
[2, 3000, 0, 3, 0.1225, 1, 335]
|
83
|
+
])
|
84
|
+
|
85
|
+
|
86
|
+
Version Information
|
87
|
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
88
|
+
|
89
|
+
There are two versions of the PYPOWER case file format. The current
|
90
|
+
version of PYPOWER uses version 2 of the PYPOWER case format
|
91
|
+
internally and includes a ``version`` field with a value of ``2`` to make
|
92
|
+
the version explicit. Earlier versions of PYPOWER used the version 1
|
93
|
+
case format, which defined the data matrices as individual variables,
|
94
|
+
as opposed to keys of a dict. Case files in version 1 format with
|
95
|
+
OPF data also included an (unused) ``areas`` variable. While the version 1
|
96
|
+
format has now been deprecated, it is still handled automatically by
|
97
|
+
``loadcase`` and ``savecase`` which are able to load and save case files in both
|
98
|
+
version 1 and version 2 formats.
|
99
|
+
|
100
|
+
See also doc for `idx_bus`, `idx_brch`, `idx_gen`, `idx_area` and `idx_cost`
|
101
|
+
regarding constants which can be used as named column indices for the data
|
102
|
+
matrices. Also described in the first three are additional results columns
|
103
|
+
that are added to the bus, branch, and gen matrices by the power flow and OPF
|
104
|
+
solvers.
|
105
|
+
|
106
|
+
The case dict also allows for additional fields to be included.
|
107
|
+
The OPF is designed to recognize fields named ``A``, ``l``, ``u``, ``H``, ``Cw``,
|
108
|
+
``N``, ``fparm``, ``z0``, ``zl``, and ``zu`` as parameters used to directly extend
|
109
|
+
the OPF formulation (see doc for `opf` for details). Other user-defined fields may
|
110
|
+
also be included and will be automatically loaded by the ``loadcase`` function
|
111
|
+
and, given an appropriate 'savecase' callback function (see doc for
|
112
|
+
`add_userfcn`), saved by the ``savecase`` function.
|
113
|
+
|
114
|
+
|
115
|
+
Bus
|
116
|
+
~~~~~~~~~
|
117
|
+
|
118
|
+
#. bus number (positive integer)
|
119
|
+
#. bus type
|
120
|
+
- PQ bus = 1
|
121
|
+
- PV bus = 2
|
122
|
+
- reference bus = 3
|
123
|
+
- isolated bus = 4
|
124
|
+
#. ``Pd``, real power demand (MW)
|
125
|
+
#. ``Qd``, reactive power demand (MVAr)
|
126
|
+
#. ``Gs``, shunt conductance (MW demanded at V = 1.0 p.u.)
|
127
|
+
#. ``Bs``, shunt susceptance (MVAr injected at V = 1.0 p.u.)
|
128
|
+
#. area number (positive integer)
|
129
|
+
#. ``Vm``, voltage magnitude (p.u.)
|
130
|
+
#. ``Va``, voltage angle (degrees)
|
131
|
+
#. ``baseKV``, base voltage (kV)
|
132
|
+
#. ``zone``, loss zone (positive integer)
|
133
|
+
#. ``maxVm``, maximum voltage magnitude (p.u.)
|
134
|
+
#. ``minVm``, minimum voltage magnitude (p.u.)
|
135
|
+
|
136
|
+
Generator
|
137
|
+
~~~~~~~~~~~~~~~~~~
|
138
|
+
|
139
|
+
#. bus number
|
140
|
+
#. ``Pg``, real power output (MW)
|
141
|
+
#. ``Qg``, reactive power output (MVAr)
|
142
|
+
#. ``Qmax``, maximum reactive power output (MVAr)
|
143
|
+
#. ``Qmin``, minimum reactive power output (MVAr)
|
144
|
+
#. ``Vg``, voltage magnitude setpoint (p.u.)
|
145
|
+
#. ``mBase``, total MVA base of this machine, defaults to baseMVA
|
146
|
+
#. status
|
147
|
+
- ``> 0`` - machine in service
|
148
|
+
- ``<= 0`` - machine out of service
|
149
|
+
#. ``Pmax``, maximum real power output (MW)
|
150
|
+
#. ``Pmin``, minimum real power output (MW)
|
151
|
+
#. ``Pc1``, lower real power output of PQ capability curve (MW)
|
152
|
+
#. ``Pc2``, upper real power output of PQ capability curve (MW)
|
153
|
+
#. ``Qc1min``, minimum reactive power output at Pc1 (MVAr)
|
154
|
+
#. ``Qc1max``, maximum reactive power output at Pc1 (MVAr)
|
155
|
+
#. ``Qc2min``, minimum reactive power output at Pc2 (MVAr)
|
156
|
+
#. ``Qc2max``, maximum reactive power output at Pc2 (MVAr)
|
157
|
+
#. ramp rate for load following/AGC (MW/min)
|
158
|
+
#. ramp rate for 10-minute reserves (MW)
|
159
|
+
#. ramp rate for 30-minute reserves (MW)
|
160
|
+
#. ramp rate for reactive power (2-sec timescale) (MVAr/min)
|
161
|
+
#. APF, area participation factor
|
162
|
+
|
163
|
+
|
164
|
+
Branch
|
165
|
+
~~~~~~~~~
|
166
|
+
|
167
|
+
#. ``f``, from bus number
|
168
|
+
#. ``t``, to bus number
|
169
|
+
#. ``r``, resistance (p.u.)
|
170
|
+
#. ``x``, reactance (p.u.)
|
171
|
+
#. ``b``, total line charging susceptance (p.u.)
|
172
|
+
#. ``rateA``, MVA rating A (long-term rating)
|
173
|
+
#. ``rateB``, MVA rating B (short-term rating)
|
174
|
+
#. ``rateC``, MVA rating C (emergency rating)
|
175
|
+
#. ``ratio``, transformer off nominal turns ratio (``= 0`` for lines)
|
176
|
+
#. ``angle``, transformer phase shift angle (degrees), positive -> delay
|
177
|
+
|
178
|
+
- (Gf, shunt conductance at from bus p.u.)
|
179
|
+
- (Bf, shunt susceptance at from bus p.u.)
|
180
|
+
- (Gt, shunt conductance at to bus p.u.)
|
181
|
+
- (Bt, shunt susceptance at to bus p.u.)
|
182
|
+
#. initial branch status, 1 - in service, 0 - out of service
|
183
|
+
#. minimum angle difference, angle(Vf) - angle(Vt) (degrees)
|
184
|
+
#. maximum angle difference, angle(Vf) - angle(Vt) (degrees)
|
185
|
+
|
186
|
+
|
187
|
+
Generator Cost
|
188
|
+
~~~~~~~~~~~~~~~~~~
|
189
|
+
|
190
|
+
.. note::
|
191
|
+
|
192
|
+
If ``gen`` has ``ng`` rows, then the first ``ng`` rows of ``gencost`` contain
|
193
|
+
the cost for active power produced by the corresponding generators.
|
194
|
+
If ``gencost`` has :math:`2 \times ng` rows then rows :math:`ng + 1` to :math:`2 \times ng`
|
195
|
+
contain the reactive power costs in the same format.
|
196
|
+
|
197
|
+
#. ``model``, 1 - piecewise linear, 2 - polynomial
|
198
|
+
#. ``startup``, startup cost in US dollars
|
199
|
+
#. ``shutdown``, shutdown cost in US dollars
|
200
|
+
#. ``N``, number of cost coefficients to follow for polynomial cost function,
|
201
|
+
or number of data points for piecewise linear.
|
202
|
+
The following parameters define the total cost function ``f(p)``,
|
203
|
+
where units of ``f`` and ``p`` are $/hr and MW (or MVAr), respectively.
|
204
|
+
|
205
|
+
- For MODEL = 1: ``p0, f0, p1, f1, ..., pn, fn``
|
206
|
+
where ``p0 < p1 < ... < pn`` and the cost ``f(p)`` is defined by
|
207
|
+
the coordinates ``(p0,f0), (p1,f1), ..., (pn,fn)`` of the
|
208
|
+
end/break-points of the piecewise linear cost function.
|
209
|
+
- For MODEL = 2: ``cn, ..., c1, c0``
|
210
|
+
``n + 1`` coefficients of an ``n``-th order polynomial cost function,
|
211
|
+
starting with the highest order, where cost is
|
212
|
+
:math:`f(p) = c_n \times p^n + \ldots + c_1 \times p + c_0`.
|
213
|
+
|
214
|
+
|
215
|
+
Area (deprecated)
|
216
|
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
217
|
+
|
218
|
+
.. note::
|
219
|
+
|
220
|
+
This data is not used by PYPOWER and is no longer necessary for version 2 case files with OPF data.
|
221
|
+
|
222
|
+
#. ``i``, area number
|
223
|
+
#. ``price_ref_bus``, reference bus for that area
|
Binary file
|
@@ -0,0 +1,23 @@
|
|
1
|
+
.. _input-xlsx:
|
2
|
+
|
3
|
+
AMS xlsx
|
4
|
+
----------
|
5
|
+
|
6
|
+
The AMS xlsx format allows one to use Excel for convenient viewing and
|
7
|
+
editing. If you do not use Excel, there are alternatives such as the free and
|
8
|
+
open-source `LibreOffice <https://www.libreoffice.org>`_.
|
9
|
+
|
10
|
+
Format definition
|
11
|
+
.................
|
12
|
+
|
13
|
+
The AMS xlsx format contains multiple workbooks (also known as "sheets") shown
|
14
|
+
as tabs at the bottom. The name of a workbook is a *model* name, and each
|
15
|
+
workbook contains the parameters of all *devices* that are *instances* of the
|
16
|
+
model.
|
17
|
+
|
18
|
+
.. image:: xlsx.png
|
19
|
+
:width: 700
|
20
|
+
:alt: Example of an AMS xlsx file
|
21
|
+
|
22
|
+
Benefiting from a consistent format style, data manipulation is similar to that in
|
23
|
+
`ANDES xlsx <http://andes.rtfd.io/en/latest/getting_started/formats/xlsx.html>`_.
|
@@ -0,0 +1,76 @@
|
|
1
|
+
|
2
|
+
.. raw:: html
|
3
|
+
|
4
|
+
<embed>
|
5
|
+
<h1 style="letter-spacing: 0.4em; font-size: 2.5em !important;
|
6
|
+
margin-bottom: 0; padding-bottom: 0"> AMS </h1>
|
7
|
+
|
8
|
+
<p style="color: #00746F; font-variant: small-caps; font-weight: bold;
|
9
|
+
margin-bottom: 2em">
|
10
|
+
Python Library for Flexible Scheduling Modeling and Co-Simulation with Dynamics</p>
|
11
|
+
</embed>
|
12
|
+
|
13
|
+
.. _getting-started:
|
14
|
+
|
15
|
+
===============
|
16
|
+
Getting started
|
17
|
+
===============
|
18
|
+
|
19
|
+
.. toctree::
|
20
|
+
:maxdepth: 3
|
21
|
+
:hidden:
|
22
|
+
|
23
|
+
overview
|
24
|
+
install
|
25
|
+
formats/index
|
26
|
+
testcase
|
27
|
+
verification
|
28
|
+
copyright
|
29
|
+
|
30
|
+
Quick install
|
31
|
+
=============
|
32
|
+
|
33
|
+
.. panels::
|
34
|
+
:card: + install-card
|
35
|
+
:column: col-lg-6 col-md-6 col-sm-12 col-xs-12 p-3
|
36
|
+
|
37
|
+
Working with conda?
|
38
|
+
^^^^^^^^^^^^^^^^^^^
|
39
|
+
AMS will available on conda-forge and can be installed with
|
40
|
+
Anaconda, Miniconda, and Mambaforge:
|
41
|
+
|
42
|
+
++++++++++++++++++++++
|
43
|
+
|
44
|
+
.. code-block:: bash
|
45
|
+
|
46
|
+
conda install -c conda-forge ltbams
|
47
|
+
|
48
|
+
---
|
49
|
+
|
50
|
+
Prefer pip?
|
51
|
+
^^^^^^^^^^^
|
52
|
+
|
53
|
+
AMS will be installed via pip from `PyPI <https://pypi.org/project/ltbams>`__.
|
54
|
+
|
55
|
+
++++
|
56
|
+
|
57
|
+
.. code-block:: bash
|
58
|
+
|
59
|
+
pip install ltbams
|
60
|
+
|
61
|
+
---
|
62
|
+
:column: col-12 p-3
|
63
|
+
|
64
|
+
New to Python?
|
65
|
+
^^^^^^^^^^^^^^
|
66
|
+
Set up a Mambaforge environment following :ref:`Setup Mambaforge`. We
|
67
|
+
recommend Mambaforge on Windows and Apple Silicon for new users.
|
68
|
+
|
69
|
+
---
|
70
|
+
:column: col-12 p-3
|
71
|
+
|
72
|
+
Are you a developer?
|
73
|
+
^^^^^^^^^^^^^^^^^^^^
|
74
|
+
|
75
|
+
Installing from source? Looking to develop models? Check the
|
76
|
+
guide in :ref:`Develop Install`.
|
@@ -0,0 +1,234 @@
|
|
1
|
+
.. _install:
|
2
|
+
|
3
|
+
************
|
4
|
+
Installation
|
5
|
+
************
|
6
|
+
|
7
|
+
New to Python
|
8
|
+
=============
|
9
|
+
|
10
|
+
.. _Setup Mambaforge:
|
11
|
+
|
12
|
+
Setting Up Mambaforge
|
13
|
+
---------------------
|
14
|
+
If you are new to Python and want to get started quickly, you can use
|
15
|
+
Mambaforge, which is a conda-like package manager configured with conda-forge.
|
16
|
+
|
17
|
+
Step 1:
|
18
|
+
|
19
|
+
Downloaded the latest Mambaforge for your platform from
|
20
|
+
https://github.com/conda-forge/miniforge#mambaforge.
|
21
|
+
Most users will use ``x86_64(amd64)`` for Intel and AMD processors.
|
22
|
+
Mac users with Apple Silicon should use ``arm64(Apple Silicon)``
|
23
|
+
for best performance.
|
24
|
+
|
25
|
+
Next, complete the Mambaforge installation on your system.
|
26
|
+
|
27
|
+
.. note::
|
28
|
+
|
29
|
+
Mambaforge is a drop-in replacement for conda. If you have an existing
|
30
|
+
conda installation, you can replace all following ``mamba`` commands
|
31
|
+
with ``conda`` and achieve the same functionality.
|
32
|
+
|
33
|
+
If you are using Anaconda or Miniconda on Windows, you should open
|
34
|
+
``Anaconda Prompt`` instead of ``Miniforge Prompt``.
|
35
|
+
|
36
|
+
Step 2:
|
37
|
+
|
38
|
+
Open Terminal (on Linux or maxOS) or `Miniforge Prompt` (on Windows, **not cmd!!**).
|
39
|
+
Make sure you are in a conda environment - you should see ``(base)`` prepended to the
|
40
|
+
command-line prompt, such as ``(base) C:\Users\username>``.
|
41
|
+
|
42
|
+
Create an environment for AMS (recommended)
|
43
|
+
|
44
|
+
.. code:: bash
|
45
|
+
|
46
|
+
mamba create --name ams python=3.8
|
47
|
+
|
48
|
+
Activate the new environment with
|
49
|
+
|
50
|
+
.. code:: bash
|
51
|
+
|
52
|
+
mamba activate ams
|
53
|
+
|
54
|
+
.. note::
|
55
|
+
|
56
|
+
You will need to activate the ``ams`` environment every time
|
57
|
+
in a new Miniforge Prompt or shell.
|
58
|
+
|
59
|
+
If these steps complete without error, you now have a working Python environment.
|
60
|
+
See the commands at the top to :ref:`getting-started` AMS.
|
61
|
+
|
62
|
+
.. _Install_extras:
|
63
|
+
|
64
|
+
Extra support package
|
65
|
+
=====================
|
66
|
+
|
67
|
+
Some AMS features require extra support packages, which are not installed by
|
68
|
+
default. For example, to build the documentation, one will need to install
|
69
|
+
development packages. Other packages will be required for interoperability.
|
70
|
+
|
71
|
+
The extra support packages are specified in groups. The following group names
|
72
|
+
are supported, with descriptions given below:
|
73
|
+
|
74
|
+
- ``dev``: packages to support development such as testing and documentation
|
75
|
+
|
76
|
+
.. note::
|
77
|
+
|
78
|
+
TODO: Extra support packages are not supported by conda/mamba installation. One
|
79
|
+
needs to install AMS with ``pip``.
|
80
|
+
|
81
|
+
To install packages in the ``dev`` when installing AMS, do:
|
82
|
+
|
83
|
+
.. code:: bash
|
84
|
+
|
85
|
+
pip install ltbams[dev]
|
86
|
+
|
87
|
+
To install all extra packages, do:
|
88
|
+
|
89
|
+
.. code:: bash
|
90
|
+
|
91
|
+
pip install ltbams[all]
|
92
|
+
|
93
|
+
One can also inspect the ``requirements-extra.txt`` to identify the packages
|
94
|
+
for manual installation.
|
95
|
+
|
96
|
+
.. _Develop Install:
|
97
|
+
|
98
|
+
Develop Install
|
99
|
+
===============
|
100
|
+
|
101
|
+
The development mode installation is for users who want to modify
|
102
|
+
the code and, for example, develop new models or routines.
|
103
|
+
The benefit of development mode installation is that
|
104
|
+
changes to source code will be reflected immediately without re-installation.
|
105
|
+
|
106
|
+
Step 1: Get AMS source code
|
107
|
+
|
108
|
+
As a developer, you are strongly encouraged to clone the source code using ``git``
|
109
|
+
from either your fork or the original repository. Clone the repository with
|
110
|
+
|
111
|
+
.. code:: bash
|
112
|
+
|
113
|
+
git clone https://github.com/CURENT/ams
|
114
|
+
|
115
|
+
.. note::
|
116
|
+
|
117
|
+
Replace the URL with yours to use your fork. With ``git``, you can later easily
|
118
|
+
update the source code and perform version control.
|
119
|
+
|
120
|
+
Alternatively, you can download the AMS source code from
|
121
|
+
https://github.com/CURENT/ams and extract all files to the path of your
|
122
|
+
choice. Although works, this method is discouraged because tracking changes and
|
123
|
+
pushing back code edits will require significant manual efforts.
|
124
|
+
|
125
|
+
.. _`Step 2`:
|
126
|
+
|
127
|
+
Step 2: Install dependencies
|
128
|
+
|
129
|
+
In the Mambaforge environment, use ``cd`` to change directory to the AMS root folder.
|
130
|
+
The folder should contain the ``setup.py`` file.
|
131
|
+
|
132
|
+
Install dependencies with
|
133
|
+
|
134
|
+
.. code:: bash
|
135
|
+
|
136
|
+
mamba install --file requirements.txt
|
137
|
+
mamba install --file requirements-extra.txt
|
138
|
+
|
139
|
+
Alternatively, you can install them with ``pip``:
|
140
|
+
|
141
|
+
.. code:: bash
|
142
|
+
|
143
|
+
pip install -r requirements.txt
|
144
|
+
pip install -r requirements-extra.txt
|
145
|
+
|
146
|
+
Step 3: Install AMS in the development mode using
|
147
|
+
|
148
|
+
.. code:: bash
|
149
|
+
|
150
|
+
python3 -m pip install -e .
|
151
|
+
|
152
|
+
Note the dot at the end. Pip will take care of the rest.
|
153
|
+
|
154
|
+
.. note::
|
155
|
+
|
156
|
+
The AMS version number shown in ``pip list``
|
157
|
+
will stuck at the version that was intalled, unless
|
158
|
+
AMS is develop-installed again.
|
159
|
+
It will not update automatically with ``git pull``.
|
160
|
+
|
161
|
+
To check the latest version number, check the preamble
|
162
|
+
by running the ``ams`` command or chek the output of
|
163
|
+
``python -c "import ams; print(ams.__version__)"``
|
164
|
+
|
165
|
+
.. note::
|
166
|
+
|
167
|
+
AMS updates may infrequently introduce new package
|
168
|
+
requirements. If you see an ``ImportError`` after updating
|
169
|
+
AMS, you can manually install the missing dependencies
|
170
|
+
or redo `Step 2`_.
|
171
|
+
|
172
|
+
.. note::
|
173
|
+
|
174
|
+
To install extra support packages, one can append ``[NAME_OF_EXTRA]`` to
|
175
|
+
``pip install -e .``. For example, ``pip install -e .[doc]`` will
|
176
|
+
install packages to support documentation when installing AMS in the
|
177
|
+
development, editable mode.
|
178
|
+
|
179
|
+
Updating AMS
|
180
|
+
==============
|
181
|
+
|
182
|
+
.. warning::
|
183
|
+
|
184
|
+
If AMS has been installed in the development mode using source code, you
|
185
|
+
will need to use ``git`` or the manual approach to update the source code.
|
186
|
+
In this case, Do not proceed with the following steps, as they will install
|
187
|
+
a separate site-package installation on top of the development one.
|
188
|
+
|
189
|
+
Regular AMS updates will be pushed to both ``conda-forge`` and Python package index.
|
190
|
+
It is recommended to use the latest version for bug fixes and new features.
|
191
|
+
We also recommended you to check the :ref:`ReleaseNotes` before updating to stay informed
|
192
|
+
of changes that might break your downstream code.
|
193
|
+
|
194
|
+
Depending you how you installed AMS, you will use one of the following ways to upgrade.
|
195
|
+
|
196
|
+
If you installed it from mamba or conda, run
|
197
|
+
|
198
|
+
.. code:: bash
|
199
|
+
|
200
|
+
conda install -c conda-forge --yes ltbams
|
201
|
+
|
202
|
+
If you install it from PyPI (namely, through ``pip``), run
|
203
|
+
|
204
|
+
.. code:: bash
|
205
|
+
|
206
|
+
python3 -m pip install --yes ltbams
|
207
|
+
|
208
|
+
|
209
|
+
Uninstall Multiple Copies
|
210
|
+
=========================
|
211
|
+
|
212
|
+
A common mistake new users make is to have multiple copies of AMS installed in
|
213
|
+
the same environment. This can happen when one previously installed AMS in the
|
214
|
+
development mode but later ran ``conda install`` or ``python3 -m pip install``
|
215
|
+
to install the latest version. As a result, only the most recently installed
|
216
|
+
version will be accessible.
|
217
|
+
|
218
|
+
In this case, we recommend that you uninstall all version and reinstall only one
|
219
|
+
copy using your preferred mode. Uninstalling all copies can be done by calling
|
220
|
+
``conda remove ams`` and ``python3 -m pip uninstall ams``. The prompted path
|
221
|
+
will indicate the copy to be removed. One may need to run the two commands for a
|
222
|
+
couple of time until the package managers indicate that the ``ams`` package
|
223
|
+
can no longer be found.
|
224
|
+
|
225
|
+
Troubleshooting
|
226
|
+
===============
|
227
|
+
|
228
|
+
If you get an error message on Windows, reading ::
|
229
|
+
|
230
|
+
ImportError: DLL load failed: The specified module could not be found.
|
231
|
+
|
232
|
+
It is a path issue of your Python. In fact, Python on Windows is so broken that
|
233
|
+
many people are resorting to WSL2 just for Python. Fixes can be convoluted, but
|
234
|
+
the easiest one is to install AMS in a Conda/Mambaforge environment.
|
@@ -0,0 +1,26 @@
|
|
1
|
+
.. _package-overview:
|
2
|
+
|
3
|
+
================
|
4
|
+
Package Overview
|
5
|
+
================
|
6
|
+
|
7
|
+
AMS is an open-source packages for flexible scheduling modeling and co-simulation with
|
8
|
+
the in-house dynanic simulation engine `ANDES <https://github.com/curent/andes>`_.
|
9
|
+
|
10
|
+
AMS is currently under active development. To get involved,
|
11
|
+
|
12
|
+
* Report issues in the
|
13
|
+
`GitHub issues page <https://github.com/CURENT/ams/issues>`_
|
14
|
+
* Learn version control with
|
15
|
+
`the command-line git <https://git-scm.com/docs/gittutorial>`_ or
|
16
|
+
`GitHub Desktop <https://help.github.com/en/desktop/getting-started-with-github-desktop>`_
|
17
|
+
|
18
|
+
This work was supported in part by the Engineering Research Center Program of
|
19
|
+
the National Science Foundation and the Department of Energy under NSF Award
|
20
|
+
Number EEC-1041877 and the CURENT_ Industry Partnership Program. AMS is made
|
21
|
+
open source as part of the CURENT Large Scale Testbed project.
|
22
|
+
|
23
|
+
AMS is developed and actively maintained by `Jinning Wang <https://jinningwang.github.io/>`_.
|
24
|
+
See the GitHub repository for a full list of contributors.
|
25
|
+
|
26
|
+
.. _CURENT: https://curent.utk.edu
|
@@ -0,0 +1,45 @@
|
|
1
|
+
.. _testcase:
|
2
|
+
|
3
|
+
************
|
4
|
+
Test cases
|
5
|
+
************
|
6
|
+
|
7
|
+
AMS ships with with test cases in the ``ams/cases`` folder.
|
8
|
+
The cases can be found in the `online repository`_.
|
9
|
+
|
10
|
+
.. _`online repository`: https://github.com/CURENT/ams/tree/master/ams/cases
|
11
|
+
|
12
|
+
Summary
|
13
|
+
=======
|
14
|
+
|
15
|
+
Below is a summary of the folders and the corresponding test cases. Some folders
|
16
|
+
contain a README file with notes. When viewing the case folder on GitHub, one
|
17
|
+
can conveniently read the README file below the file listing.
|
18
|
+
|
19
|
+
- ``5bus``: a small PJM 5-bus test case for power flow study [PJM5]_.
|
20
|
+
- ``ieee14`` and ``ieee39``: the IEEE 14-bus and 39-bus test cases [IEEE]_.
|
21
|
+
- ``ieee123``: the IEEE 123-bus test case [TSG]_.
|
22
|
+
- ``matpower``: a subset of test cases from [MATPOWER]_.
|
23
|
+
- ``npcc`` and ``wecc``: NPCC 140-bus and WECC 179-bus test cases [SciData]_.
|
24
|
+
|
25
|
+
How to contribute
|
26
|
+
=================
|
27
|
+
|
28
|
+
We welcome the contribution of test cases! You can make a pull request to
|
29
|
+
contribute new test cases. Please follow the structure in the ``cases`` folder
|
30
|
+
and provide an example Jupyter notebook (see ``examples/demonstration``) to
|
31
|
+
showcase the results of your system.
|
32
|
+
|
33
|
+
.. [PJM5] F. Li and R. Bo, "Small test systems for power system economic
|
34
|
+
studies," IEEE PES General Meeting, 2010, pp. 1-4, doi:
|
35
|
+
10.1109/PES.2010.5589973.
|
36
|
+
.. [IEEE] University of Washington, "Power Systems Test Case Archive", [Online]. Available:
|
37
|
+
https://labs.ece.uw.edu/pstca/
|
38
|
+
.. [TSG] X. Wang, F. Li, Q. Zhang, Q. Shi and J. Wang, "Profit-Oriented BESS Siting
|
39
|
+
and Sizing in Deregulated Distribution Systems," in IEEE Transactions on Smart
|
40
|
+
Grid, vol. 14, no. 2, pp. 1528-1540, March 2023, doi: 10.1109/TSG.2022.3150768.
|
41
|
+
.. [MATPOWER] R. D. Zimmerman, "MATPOWER", [Online]. Available:
|
42
|
+
https://matpower.org/
|
43
|
+
.. [SciData] Q. Zhang and F. Li, “A Dataset for Electricity Market Studies on Western
|
44
|
+
and Northeastern Power Grids in the United States,” Scientific Data, vol. 10,
|
45
|
+
no. 1, p. 646, Sep. 2023, doi: 10.1038/s41597-023-02448-w.
|
@@ -0,0 +1,13 @@
|
|
1
|
+
.. _verification:
|
2
|
+
|
3
|
+
============
|
4
|
+
Verification
|
5
|
+
============
|
6
|
+
|
7
|
+
This section presents the verification of AMS by comparing the DCOPF results
|
8
|
+
with other tools.
|
9
|
+
|
10
|
+
.. toctree::
|
11
|
+
:maxdepth: 2
|
12
|
+
|
13
|
+
../_examples/verification/ams_dcopf_verification.ipynb
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|