ltbams 0.9.9__py3-none-any.whl → 1.0.2__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 +206 -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 +231 -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.2.dist-info/METADATA +215 -0
- ltbams-1.0.2.dist-info/RECORD +188 -0
- {ltbams-0.9.9.dist-info → ltbams-1.0.2.dist-info}/WHEEL +1 -1
- ltbams-1.0.2.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.2.dist-info}/entry_points.txt +0 -0
ams/pypower/eps.py
ADDED
ams/pypower/idx.py
ADDED
@@ -0,0 +1,174 @@
|
|
1
|
+
"""
|
2
|
+
Column indices.
|
3
|
+
"""
|
4
|
+
|
5
|
+
from collections import OrderedDict # NOQA
|
6
|
+
|
7
|
+
|
8
|
+
gen_src = OrderedDict([
|
9
|
+
('GEN_BUS', 0), # bus number
|
10
|
+
('PG', 1), # Pg, real power output (MW)
|
11
|
+
('QG', 2), # Qg, reactive power output (MVAr)
|
12
|
+
('QMAX', 3), # Qmax, maximum reactive power output at Pmin (MVAr)
|
13
|
+
('QMIN', 4), # Qmin, minimum reactive power output at Pmin (MVAr)
|
14
|
+
('VG', 5), # Vg, voltage magnitude setpoint (p.u.)
|
15
|
+
('MBASE', 6), # mBase, total MVA base of this machine, defaults to baseMVA
|
16
|
+
('GEN_STATUS', 7), # status, 1 - machine in service, 0 - machine out of service
|
17
|
+
('PMAX', 8), # Pmax, maximum real power output (MW)
|
18
|
+
('PMIN', 9), # Pmin, minimum real power output (MW)
|
19
|
+
('PC1', 10), # Pc1, lower real power output of PQ capability curve (MW)
|
20
|
+
('PC2', 11), # Pc2, upper real power output of PQ capability curve (MW)
|
21
|
+
('QC1MIN', 12), # Qc1min, minimum reactive power output at Pc1 (MVAr)
|
22
|
+
('QC1MAX', 13), # Qc1max, maximum reactive power output at Pc1 (MVAr)
|
23
|
+
('QC2MIN', 14), # Qc2min, minimum reactive power output at Pc2 (MVAr)
|
24
|
+
('QC2MAX', 15), # Qc2max, maximum reactive power output at Pc2 (MVAr)
|
25
|
+
('RAMP_AGC', 16), # ramp rate for load following/AGC (MW/min)
|
26
|
+
('RAMP_10', 17), # ramp rate for 10 minute reserves (MW)
|
27
|
+
('RAMP_30', 18), # ramp rate for 30 minute reserves (MW)
|
28
|
+
('RAMP_Q', 19), # ramp rate for reactive power (2 sec timescale) (MVAr/min)
|
29
|
+
('APF', 20), # area participation factor
|
30
|
+
# ----- OPF Data -----
|
31
|
+
# NOTE: included in opf solution, not necessarily in input
|
32
|
+
# NOTE: assume objective function has units, u
|
33
|
+
('MU_PMAX', 21), # Kuhn-Tucker multiplier on upper Pg limit (u/MW)
|
34
|
+
('MU_PMIN', 22), # Kuhn-Tucker multiplier on lower Pg limit (u/MW)
|
35
|
+
('MU_QMAX', 23), # Kuhn-Tucker multiplier on upper Qg limit (u/MVAr)
|
36
|
+
('MU_QMIN', 24), # Kuhn-Tucker multiplier on lower Qg limit (u/MVAr)
|
37
|
+
])
|
38
|
+
|
39
|
+
dcline_src = OrderedDict([
|
40
|
+
('F_BUS', 0), # f, "from" bus number
|
41
|
+
('T_BUS', 1), # t, "to" bus number
|
42
|
+
('BR_STATUS', 2), # initial branch status, 1 - in service, 0 - out of service
|
43
|
+
('PF', 3), # MW flow at "from" bus ("from" -> "to")
|
44
|
+
('PT', 4), # MW flow at "to" bus ("from" -> "to")
|
45
|
+
('QF', 5), # MVAr injection at "from" bus ("from" -> "to")
|
46
|
+
('QT', 6), # MVAr injection at "to" bus ("from" -> "to")
|
47
|
+
('VF', 7), # voltage setpoint at "from" bus (p.u.)
|
48
|
+
('VT', 8), # voltage setpoint at "to" bus (p.u.)
|
49
|
+
('PMIN', 9), # lower limit on PF (MW flow at "from" end)
|
50
|
+
('PMAX', 10), # upper limit on PF (MW flow at "from" end)
|
51
|
+
('QMINF', 11), # lower limit on MVAr injection at "from" bus
|
52
|
+
('QMAXF', 12), # upper limit on MVAr injection at "from" bus
|
53
|
+
('QMINT', 13), # lower limit on MVAr injection at "to" bus
|
54
|
+
('QMAXT', 14), # upper limit on MVAr injection at "to" bus
|
55
|
+
('LOSS0', 15), # constant term of linear loss function (MW)
|
56
|
+
('LOSS1', 16), # linear term of linear loss function (MW)
|
57
|
+
('MU_PMIN', 17), # Kuhn-Tucker multiplier on lower flow limit at "from" bus (u/MW)
|
58
|
+
('MU_PMAX', 18), # Kuhn-Tucker multiplier on upper flow limit at "from" bus (u/MW)
|
59
|
+
('MU_QMINF', 19), # Kuhn-Tucker multiplier on lower Q limit at "from" bus (u/MVAr)
|
60
|
+
('MU_QMAXF', 20), # Kuhn-Tucker multiplier on upper Q limit at "from" bus (u/MVAr)
|
61
|
+
('MU_QMINT', 21), # Kuhn-Tucker multiplier on lower Q limit at "to" bus (u/MVAr)
|
62
|
+
('MU_QMAXT', 22), # Kuhn-Tucker multiplier on upper Q limit at "to" bus (u/MVAr)
|
63
|
+
])
|
64
|
+
|
65
|
+
cost_src = OrderedDict([
|
66
|
+
('PW_LINEAR', 1), # cost model, 1 - piecewise linear, 2 - polynomial
|
67
|
+
('POLYNOMIAL', 2), # cost model, 1 - piecewise linear, 2 - polynomial
|
68
|
+
('MODEL', 0), # cost model, 1 - piecewise linear, 2 - polynomial
|
69
|
+
('STARTUP', 1), # startup cost in US dollars
|
70
|
+
('SHUTDOWN', 2), # shutdown cost in US dollars
|
71
|
+
('NCOST', 3), # number of cost coefficients to follow
|
72
|
+
('COST', 4), # cost coefficients, see below
|
73
|
+
])
|
74
|
+
|
75
|
+
bus_src = OrderedDict([
|
76
|
+
# --- bus types ---
|
77
|
+
('PQ', 1), # PQ bus
|
78
|
+
('PV', 2), # PV bus
|
79
|
+
('REF', 3), # reference bus
|
80
|
+
('NONE', 4), # isolated bus
|
81
|
+
# --- indices ---
|
82
|
+
('BUS_I', 0), # bus number (1 to 29997)
|
83
|
+
('BUS_TYPE', 1), # bus type
|
84
|
+
('PD', 2), # Pd, real power demand (MW)
|
85
|
+
('QD', 3), # Qd, reactive power demand (MVAr)
|
86
|
+
('GS', 4), # Gs, shunt conductance (MW at V = 1.0 p.u.)
|
87
|
+
('BS', 5), # Bs, shunt susceptance (MVAr at V = 1.0 p.u.)
|
88
|
+
('BUS_AREA', 6), # area number, 1-100
|
89
|
+
('VM', 7), # Vm, voltage magnitude (p.u.)
|
90
|
+
('VA', 8), # Va, voltage angle (degrees)
|
91
|
+
('BASE_KV', 9), # baseKV, base voltage (kV)
|
92
|
+
('ZONE', 10), # zone, loss zone (1-999)
|
93
|
+
('VMAX', 11), # maxVm, maximum voltage magnitude (p.u.)
|
94
|
+
('VMIN', 12), # minVm, minimum voltage magnitude (p.u.)
|
95
|
+
# NOTE: included in opf solution, not necessarily in input
|
96
|
+
# NOTE: assume objective function has units, u
|
97
|
+
('LAM_P', 13), # Lagrange multiplier on real power mismatch (u/MW)
|
98
|
+
('LAM_Q', 14), # Lagrange multiplier on reactive power mismatch (u/MVAr)
|
99
|
+
('MU_VMAX', 15), # Kuhn-Tucker multiplier on upper voltage limit (u/p.u.)
|
100
|
+
('MU_VMIN', 16), # Kuhn-Tucker multiplier on lower voltage limit (u/p.u.)
|
101
|
+
])
|
102
|
+
|
103
|
+
branch_src = OrderedDict([
|
104
|
+
('F_BUS', 0), # f, from bus number
|
105
|
+
('T_BUS', 1), # t, to bus number
|
106
|
+
('BR_R', 2), # r, resistance (p.u.)
|
107
|
+
('BR_X', 3), # x, reactance (p.u.)
|
108
|
+
('BR_B', 4), # b, total line charging susceptance (p.u.)
|
109
|
+
('RATE_A', 5), # rateA, MVA rating A (long term rating)
|
110
|
+
('RATE_B', 6), # rateB, MVA rating B (short term rating)
|
111
|
+
('RATE_C', 7), # rateC, MVA rating C (emergency rating)
|
112
|
+
('TAP', 8), # ratio, transformer off nominal turns ratio
|
113
|
+
('SHIFT', 9), # angle, transformer phase shift angle (degrees)
|
114
|
+
('BR_STATUS', 10), # initial branch status, 1 - in service, 0 - out of service
|
115
|
+
('ANGMIN', 11), # minimum angle difference, angle(Vf) - angle(Vt) (degrees)
|
116
|
+
('ANGMAX', 12), # maximum angle difference, angle(Vf) - angle(Vt) (degrees)
|
117
|
+
# NOTE: included in opf solution, not necessarily in input
|
118
|
+
('PF', 13), # real power injected at "from" bus (MW)
|
119
|
+
('QF', 14), # reactive power injected at "from" bus (MVAr)
|
120
|
+
('PT', 15), # real power injected at "to" bus (MW)
|
121
|
+
('QT', 16), # reactive power injected at "to" bus (MVAr)
|
122
|
+
# NOTE: included in opf solution, not necessarily in input
|
123
|
+
# NOTE: assume objective function has units, u
|
124
|
+
('MU_SF', 17), # Kuhn-Tucker multiplier on MVA limit at "from" bus (u/MVA)
|
125
|
+
('MU_ST', 18), # Kuhn-Tucker multiplier on MVA limit at "to" bus (u/MVA)
|
126
|
+
('MU_ANGMIN', 19), # Kuhn-Tucker multiplier on lower angle difference limit (u/degree)
|
127
|
+
('MU_ANGMAX', 20), # Kuhn-Tucker multiplier on upper angle difference limit (u/degree)
|
128
|
+
])
|
129
|
+
|
130
|
+
area_src = OrderedDict([
|
131
|
+
('AREA_I', 0), # area number
|
132
|
+
('PRICE_REF_BUS', 1), # price reference bus for this area
|
133
|
+
])
|
134
|
+
|
135
|
+
|
136
|
+
class Consts:
|
137
|
+
"""
|
138
|
+
Base class for constants collection.
|
139
|
+
"""
|
140
|
+
|
141
|
+
def __init__(self, source):
|
142
|
+
"""
|
143
|
+
Parameters
|
144
|
+
----------
|
145
|
+
source : OrderedDict
|
146
|
+
Dictionary of constants.
|
147
|
+
"""
|
148
|
+
self.init(source)
|
149
|
+
|
150
|
+
def init(self, source):
|
151
|
+
for key, value in source.items():
|
152
|
+
setattr(self, key, value)
|
153
|
+
|
154
|
+
|
155
|
+
class IDXClass:
|
156
|
+
"""
|
157
|
+
Column indices for named columns.
|
158
|
+
"""
|
159
|
+
|
160
|
+
def __init__(self):
|
161
|
+
"""
|
162
|
+
Parameters
|
163
|
+
----------
|
164
|
+
source : OrderedDict
|
165
|
+
Dictionary of column indices.
|
166
|
+
"""
|
167
|
+
self.gen = Consts(gen_src)
|
168
|
+
self.dcline = Consts(dcline_src)
|
169
|
+
self.cost = Consts(cost_src)
|
170
|
+
self.bus = Consts(bus_src)
|
171
|
+
self.branch = Consts(branch_src)
|
172
|
+
self.area = Consts(area_src)
|
173
|
+
|
174
|
+
IDX = IDXClass()
|