ltbams 1.0.8__py3-none-any.whl → 1.0.10__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 +0 -1
- ams/_version.py +3 -3
- ams/cases/5bus/pjm5bus_demo.json +1324 -0
- ams/core/__init__.py +1 -0
- ams/core/common.py +30 -0
- ams/core/model.py +1 -1
- ams/core/symprocessor.py +1 -1
- ams/extension/eva.py +1 -1
- ams/interface.py +40 -24
- ams/io/matpower.py +192 -26
- ams/io/psse.py +278 -1
- ams/io/pypower.py +14 -0
- ams/main.py +2 -2
- ams/models/group.py +2 -70
- ams/models/static/pq.py +7 -3
- ams/opt/param.py +1 -2
- ams/report.py +3 -4
- ams/routines/__init__.py +2 -3
- ams/routines/acopf.py +5 -108
- ams/routines/dcopf.py +8 -0
- ams/routines/dcpf.py +1 -1
- ams/routines/ed.py +4 -2
- ams/routines/grbopt.py +150 -0
- ams/routines/pflow.py +2 -2
- ams/routines/pypower.py +631 -0
- ams/routines/routine.py +4 -10
- ams/routines/uc.py +2 -2
- ams/shared.py +30 -44
- ams/system.py +118 -2
- docs/source/api.rst +2 -0
- docs/source/getting_started/formats/matpower.rst +135 -0
- docs/source/getting_started/formats/pypower.rst +1 -2
- docs/source/getting_started/install.rst +9 -6
- docs/source/images/dcopf_time.png +0 -0
- docs/source/images/educ_pie.png +0 -0
- docs/source/release-notes.rst +29 -47
- {ltbams-1.0.8.dist-info → ltbams-1.0.10.dist-info}/METADATA +87 -47
- {ltbams-1.0.8.dist-info → ltbams-1.0.10.dist-info}/RECORD +58 -75
- {ltbams-1.0.8.dist-info → ltbams-1.0.10.dist-info}/WHEEL +1 -1
- tests/test_1st_system.py +1 -1
- tests/test_case.py +14 -14
- tests/test_export_csv.py +1 -1
- tests/test_interface.py +24 -2
- tests/test_io.py +125 -1
- tests/test_omodel.py +1 -1
- tests/test_report.py +6 -6
- tests/test_routine.py +2 -2
- tests/test_rtn_acopf.py +75 -0
- tests/test_rtn_dcopf.py +1 -1
- tests/test_rtn_dcopf2.py +1 -1
- tests/test_rtn_ed.py +9 -9
- tests/test_rtn_opf.py +142 -0
- tests/test_rtn_pflow.py +0 -72
- tests/test_rtn_pypower.py +315 -0
- tests/test_rtn_rted.py +8 -8
- tests/test_rtn_uc.py +18 -18
- ams/pypower/__init__.py +0 -8
- ams/pypower/_compat.py +0 -9
- ams/pypower/core/__init__.py +0 -8
- ams/pypower/core/pips.py +0 -894
- ams/pypower/core/ppoption.py +0 -244
- ams/pypower/core/ppver.py +0 -18
- ams/pypower/core/solver.py +0 -2451
- ams/pypower/eps.py +0 -6
- ams/pypower/idx.py +0 -174
- ams/pypower/io.py +0 -604
- ams/pypower/make/__init__.py +0 -11
- ams/pypower/make/matrices.py +0 -665
- ams/pypower/make/pdv.py +0 -506
- ams/pypower/routines/__init__.py +0 -7
- ams/pypower/routines/cpf.py +0 -513
- ams/pypower/routines/cpf_callbacks.py +0 -114
- ams/pypower/routines/opf.py +0 -1803
- ams/pypower/routines/opffcns.py +0 -1946
- ams/pypower/routines/pflow.py +0 -852
- ams/pypower/toggle.py +0 -1098
- ams/pypower/utils.py +0 -293
- ams/routines/cpf.py +0 -65
- ams/routines/dcpf0.py +0 -196
- ams/routines/pflow0.py +0 -113
- tests/test_rtn_dcpf.py +0 -77
- {ltbams-1.0.8.dist-info → ltbams-1.0.10.dist-info}/entry_points.txt +0 -0
- {ltbams-1.0.8.dist-info → ltbams-1.0.10.dist-info}/top_level.txt +0 -0
ams/shared.py
CHANGED
@@ -6,7 +6,7 @@ This module is supplementary to the ``andes.shared`` module.
|
|
6
6
|
import logging
|
7
7
|
import unittest
|
8
8
|
from functools import wraps
|
9
|
-
from
|
9
|
+
from time import strftime
|
10
10
|
|
11
11
|
import cvxpy as cp
|
12
12
|
|
@@ -20,10 +20,16 @@ logger = logging.getLogger(__name__)
|
|
20
20
|
sps = LazyImport('import scipy.sparse as sps')
|
21
21
|
np = LazyImport('import numpy as np')
|
22
22
|
pd = LazyImport('import pandas as pd')
|
23
|
+
ppoption = LazyImport('from pypower.ppoption import ppoption')
|
24
|
+
runpf = LazyImport('from pypower.runpf import runpf')
|
25
|
+
runopf = LazyImport('from pypower.runopf import runopf')
|
26
|
+
opf = LazyImport('from gurobi_optimods import opf')
|
23
27
|
|
24
28
|
# --- an empty ANDES system ---
|
25
29
|
empty_adsys = adSystem(autogen_stale=False)
|
26
30
|
ad_models = list(empty_adsys.models.keys())
|
31
|
+
ad_pf_models = [mname for mname, model in empty_adsys.models.items() if model.flags.pflow]
|
32
|
+
ad_dyn_models = [mname for mname, model in empty_adsys.models.items() if model.flags.tds and not model.flags.pflow]
|
27
33
|
|
28
34
|
# --- NumPy constants ---
|
29
35
|
# NOTE: In NumPy 2.0, np.Inf and np.NaN are deprecated.
|
@@ -35,7 +41,9 @@ _prefix = r" - --------------> | " # NOQA
|
|
35
41
|
_max_length = 80 # NOQA
|
36
42
|
|
37
43
|
# NOTE: copyright
|
38
|
-
copyright_msg =
|
44
|
+
copyright_msg = "Copyright (C) 2023-2025 Jinning Wang"
|
45
|
+
nowarranty_msg = "AMS comes with ABSOLUTELY NO WARRANTY"
|
46
|
+
report_time = strftime("%m/%d/%Y %I:%M:%S %p")
|
39
47
|
|
40
48
|
# NOTE: copied from CVXPY documentation, last checked on 2024/10/30, v1.5
|
41
49
|
mip_solvers = ['CBC', 'COPT', 'GLPK_MI', 'CPLEX', 'GUROBI',
|
@@ -102,49 +110,27 @@ def skip_unittest_without_MISOCP(f):
|
|
102
110
|
return wrapper
|
103
111
|
|
104
112
|
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
(
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
'apf', 'mu_pmax', 'mu_pmin', 'mu_qmax', 'mu_qmin']),
|
117
|
-
('gencost', ['model', 'startup', 'shutdown', 'n', 'c2', 'c1', 'c0']),
|
118
|
-
])
|
113
|
+
def skip_unittest_without_PYPOWER(f):
|
114
|
+
"""
|
115
|
+
Decorator for skipping tests that require PYPOWER.
|
116
|
+
"""
|
117
|
+
def wrapper(*args, **kwargs):
|
118
|
+
try:
|
119
|
+
import pypower # NOQA
|
120
|
+
except ImportError:
|
121
|
+
raise unittest.SkipTest("PYPOWER is not installed.")
|
122
|
+
return f(*args, **kwargs)
|
123
|
+
return wrapper
|
119
124
|
|
120
125
|
|
121
|
-
def
|
126
|
+
def skip_unittest_without_gurobi_optimods(f):
|
122
127
|
"""
|
123
|
-
|
124
|
-
|
125
|
-
Parameters
|
126
|
-
----------
|
127
|
-
ppc : dict
|
128
|
-
PYPOWER case dict.
|
129
|
-
model : str
|
130
|
-
Model name.
|
131
|
-
ppc_cols : dict
|
132
|
-
Column names.
|
133
|
-
|
134
|
-
Returns
|
135
|
-
-------
|
136
|
-
pandas.DataFrame
|
137
|
-
DataFrame.
|
138
|
-
|
139
|
-
Examples
|
140
|
-
--------
|
141
|
-
>>> import ams
|
142
|
-
>>> sp = ams.system.example()
|
143
|
-
>>> ppc = ams.io.pypower.system2ppc(sp)
|
144
|
-
>>> ppc_bus = ams.shared.ppc2df(ppc, 'bus')
|
128
|
+
Decorator for skipping tests that require gurobi_optimods.
|
145
129
|
"""
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
130
|
+
def wrapper(*args, **kwargs):
|
131
|
+
try:
|
132
|
+
import gurobi_optimods # NOQA
|
133
|
+
except ImportError:
|
134
|
+
raise unittest.SkipTest("Gurobi is not installed.")
|
135
|
+
return f(*args, **kwargs)
|
136
|
+
return wrapper
|
ams/system.py
CHANGED
@@ -9,7 +9,6 @@ from typing import Dict, Optional
|
|
9
9
|
|
10
10
|
import numpy as np
|
11
11
|
|
12
|
-
from andes.core import Config
|
13
12
|
from andes.system import System as andes_System
|
14
13
|
from andes.system import (_config_numpy, load_config_rc)
|
15
14
|
from andes.variables import FileMan
|
@@ -23,9 +22,17 @@ from ams.routines.type import TypeBase
|
|
23
22
|
from ams.models import file_classes
|
24
23
|
from ams.routines import all_routines
|
25
24
|
from ams.utils.paths import get_config_path
|
25
|
+
from ams.core import Config
|
26
26
|
from ams.core.matprocessor import MatProcessor
|
27
27
|
from ams.interface import to_andes
|
28
28
|
from ams.report import Report
|
29
|
+
from ams.shared import ad_dyn_models
|
30
|
+
|
31
|
+
from ams.io.matpower import system2mpc
|
32
|
+
from ams.io.matpower import write as wrtite_m
|
33
|
+
from ams.io.xlsx import write as write_xlsx
|
34
|
+
from ams.io.json import write as write_json
|
35
|
+
from ams.io.psse import write_raw
|
29
36
|
|
30
37
|
logger = logging.getLogger(__name__)
|
31
38
|
|
@@ -389,6 +396,43 @@ class System(andes_System):
|
|
389
396
|
self.is_setup = False
|
390
397
|
self.setup()
|
391
398
|
|
399
|
+
def add(self, model, param_dict=None, **kwargs):
|
400
|
+
"""
|
401
|
+
Add a device instance for an existing model.
|
402
|
+
|
403
|
+
Revised from ``andes.system.System.add()``.
|
404
|
+
"""
|
405
|
+
if model not in self.models and (model not in self.model_aliases):
|
406
|
+
if model in ad_dyn_models:
|
407
|
+
logger.debug("ANDES dynamic model <%s> is skipped.", model)
|
408
|
+
else:
|
409
|
+
logger.warning("<%s> is not an existing model.", model)
|
410
|
+
return
|
411
|
+
|
412
|
+
if self.is_setup:
|
413
|
+
raise NotImplementedError("Adding devices are not allowed after setup.")
|
414
|
+
|
415
|
+
group_name = self.__dict__[model].group
|
416
|
+
group = self.groups[group_name]
|
417
|
+
|
418
|
+
if param_dict is None:
|
419
|
+
param_dict = {}
|
420
|
+
if kwargs is not None:
|
421
|
+
param_dict.update(kwargs)
|
422
|
+
|
423
|
+
# remove `uid` field
|
424
|
+
param_dict.pop('uid', None)
|
425
|
+
|
426
|
+
idx = param_dict.pop('idx', None)
|
427
|
+
if idx is not None and (not isinstance(idx, str) and np.isnan(idx)):
|
428
|
+
idx = None
|
429
|
+
|
430
|
+
idx = group.get_next_idx(idx=idx, model_name=model)
|
431
|
+
self.__dict__[model].add(idx=idx, **param_dict)
|
432
|
+
group.add(idx=idx, model=self.__dict__[model])
|
433
|
+
|
434
|
+
return idx
|
435
|
+
|
392
436
|
def setup(self):
|
393
437
|
"""
|
394
438
|
Set up system for studies.
|
@@ -421,7 +465,16 @@ class System(andes_System):
|
|
421
465
|
adjusted_params_str = ', '.join(adjusted_params)
|
422
466
|
msg = f"Zero Line parameters detected, adjusted to default values: {adjusted_params_str}."
|
423
467
|
logger.info(msg)
|
424
|
-
|
468
|
+
# --- bus type correction ---
|
469
|
+
pq_bus = self.PQ.bus.v
|
470
|
+
pv_bus = self.PV.bus.v
|
471
|
+
slack_bus = self.Slack.bus.v
|
472
|
+
# TODO: how to include islanded buses?
|
473
|
+
if self.Bus.n > 0 and np.all(self.Bus.type.v == 1):
|
474
|
+
self.Bus.alter(src='type', idx=pq_bus, value=1)
|
475
|
+
self.Bus.alter(src='type', idx=pv_bus, value=2)
|
476
|
+
self.Bus.alter(src='type', idx=slack_bus, value=3)
|
477
|
+
logger.info("All bus type are PQ, adjusted given load and generator connection status.")
|
425
478
|
# === no device addition or removal after this point ===
|
426
479
|
self.calc_pu_coeff() # calculate parameters in system per units
|
427
480
|
|
@@ -662,10 +715,73 @@ class System(andes_System):
|
|
662
715
|
|
663
716
|
return False
|
664
717
|
|
718
|
+
def to_mpc(self):
|
719
|
+
"""
|
720
|
+
Export an AMS system to a MATPOWER dict.
|
721
|
+
|
722
|
+
Returns
|
723
|
+
-------
|
724
|
+
dict
|
725
|
+
A dictionary representing the MATPOWER case.
|
726
|
+
"""
|
727
|
+
return system2mpc(self)
|
728
|
+
|
729
|
+
def to_m(self, outfile: str, overwrite: bool = None):
|
730
|
+
"""
|
731
|
+
Export an AMS system to a MATPOWER M-file.
|
732
|
+
|
733
|
+
Parameters
|
734
|
+
----------
|
735
|
+
outfile : str
|
736
|
+
The output file name.
|
737
|
+
overwrite : bool, optional
|
738
|
+
If True, overwrite the existing file. Default is None.
|
739
|
+
"""
|
740
|
+
return wrtite_m(self, outfile=outfile, overwrite=overwrite)
|
741
|
+
|
742
|
+
def to_xlsx(self, outfile: str, overwrite: bool = None):
|
743
|
+
"""
|
744
|
+
Export an AMS system to an Excel file.
|
745
|
+
|
746
|
+
Parameters
|
747
|
+
----------
|
748
|
+
outfile : str
|
749
|
+
The output file name.
|
750
|
+
overwrite : bool, optional
|
751
|
+
If True, overwrite the existing file. Default is None.
|
752
|
+
"""
|
753
|
+
return write_xlsx(self, outfile=outfile, overwrite=overwrite)
|
754
|
+
|
755
|
+
def to_json(self, outfile: str, overwrite: bool = None):
|
756
|
+
"""
|
757
|
+
Export an AMS system to a JSON file.
|
758
|
+
|
759
|
+
Parameters
|
760
|
+
----------
|
761
|
+
outfile : str
|
762
|
+
The output file name.
|
763
|
+
overwrite : bool, optional
|
764
|
+
If True, overwrite the existing file. Default is None.
|
765
|
+
"""
|
766
|
+
return write_json(self, outfile=outfile, overwrite=overwrite)
|
767
|
+
|
768
|
+
def to_raw(self, outfile: str, overwrite: bool = None):
|
769
|
+
"""
|
770
|
+
Export an AMS system to a v33 PSS/E RAW file.
|
771
|
+
|
772
|
+
Parameters
|
773
|
+
----------
|
774
|
+
outfile : str
|
775
|
+
The output file name.
|
776
|
+
overwrite : bool, optional
|
777
|
+
If True, overwrite the existing file. Default is None.
|
778
|
+
"""
|
779
|
+
return write_raw(self, outfile=outfile, overwrite=overwrite)
|
665
780
|
|
666
781
|
# --------------- Helper Functions ---------------
|
667
782
|
# NOTE: _config_numpy, load_config_rc are imported from andes.system
|
668
783
|
|
784
|
+
|
669
785
|
def example(setup=True, no_output=True, **kwargs):
|
670
786
|
"""
|
671
787
|
Return an :py:class:`ams.system.System` object for the
|
docs/source/api.rst
CHANGED
@@ -181,3 +181,138 @@ Generator Cost Data
|
|
181
181
|
|
182
182
|
#. Not currently used by any Matpower functions.
|
183
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}`.
|
184
|
+
|
185
|
+
|
186
|
+
Generator Types
|
187
|
+
~~~~~~~~~~~~~~~~~~~~
|
188
|
+
+------+---------------------------------------------------------------+
|
189
|
+
| code | description |
|
190
|
+
+------+---------------------------------------------------------------+
|
191
|
+
| BA | Energy Storage, Battery |
|
192
|
+
+------+---------------------------------------------------------------+
|
193
|
+
| CE | Energy Storage, Compressed Air |
|
194
|
+
+------+---------------------------------------------------------------+
|
195
|
+
| CP | Energy Storage, Concentrated Solar Power |
|
196
|
+
+------+---------------------------------------------------------------+
|
197
|
+
| FW | Energy Storage, Flywheel |
|
198
|
+
+------+---------------------------------------------------------------+
|
199
|
+
| PS | Hydraulic Turbine, Reversible (pumped storage) |
|
200
|
+
+------+---------------------------------------------------------------+
|
201
|
+
| ES | Energy Storage, Other |
|
202
|
+
+------+---------------------------------------------------------------+
|
203
|
+
| ST | Steam Turbine (includes nuclear, geothermal, and solar steam) |
|
204
|
+
+------+---------------------------------------------------------------+
|
205
|
+
| GT | Combustion (Gas) Turbine |
|
206
|
+
+------+---------------------------------------------------------------+
|
207
|
+
| IC | Internal Combustion Engine (diesel, piston, reciprocating) |
|
208
|
+
+------+---------------------------------------------------------------+
|
209
|
+
| CA | Combined Cycle Steam Part |
|
210
|
+
+------+---------------------------------------------------------------+
|
211
|
+
| CT | Combined Cycle Combustion Turbine Part |
|
212
|
+
+------+---------------------------------------------------------------+
|
213
|
+
| CS | Combined Cycle Single Shaft |
|
214
|
+
+------+---------------------------------------------------------------+
|
215
|
+
| CC | Combined Cycle Total Unit |
|
216
|
+
+------+---------------------------------------------------------------+
|
217
|
+
| HA | Hydrokinetic, Axial Flow Turbine |
|
218
|
+
+------+---------------------------------------------------------------+
|
219
|
+
| HB | Hydrokinetic, Wave Buoy |
|
220
|
+
+------+---------------------------------------------------------------+
|
221
|
+
| HK | Hydrokinetic, Other |
|
222
|
+
+------+---------------------------------------------------------------+
|
223
|
+
| HY | Hydroelectric Turbine |
|
224
|
+
+------+---------------------------------------------------------------+
|
225
|
+
| BT | Turbines Used in a Binary Cycle |
|
226
|
+
+------+---------------------------------------------------------------+
|
227
|
+
| PV | Photovoltaic |
|
228
|
+
+------+---------------------------------------------------------------+
|
229
|
+
| WT | Wind Turbine, Onshore |
|
230
|
+
+------+---------------------------------------------------------------+
|
231
|
+
| WS | Wind Turbine, Offshore |
|
232
|
+
+------+---------------------------------------------------------------+
|
233
|
+
| FC | Fuel Cell |
|
234
|
+
+------+---------------------------------------------------------------+
|
235
|
+
| OT | Other |
|
236
|
+
+------+---------------------------------------------------------------+
|
237
|
+
| UN | Unknown |
|
238
|
+
+------+---------------------------------------------------------------+
|
239
|
+
| JE | Jet Engine |
|
240
|
+
+------+---------------------------------------------------------------+
|
241
|
+
| NB | ST - Boiling Water Nuclear Reactor |
|
242
|
+
+------+---------------------------------------------------------------+
|
243
|
+
| NG | ST - Graphite Nuclear Reactor |
|
244
|
+
+------+---------------------------------------------------------------+
|
245
|
+
| NH | ST - High Temperature Gas Nuclear Reactor |
|
246
|
+
+------+---------------------------------------------------------------+
|
247
|
+
| NP | ST - Pressurized Water Nuclear Reactor |
|
248
|
+
+------+---------------------------------------------------------------+
|
249
|
+
| IT | Internal Combustion Turbo Charged |
|
250
|
+
+------+---------------------------------------------------------------+
|
251
|
+
| SC | Synchronous Condenser |
|
252
|
+
+------+---------------------------------------------------------------+
|
253
|
+
| DC | DC ties |
|
254
|
+
+------+---------------------------------------------------------------+
|
255
|
+
| MP | Motor/Pump |
|
256
|
+
+------+---------------------------------------------------------------+
|
257
|
+
| W1 | Wind Turbine, Type 1 |
|
258
|
+
+------+---------------------------------------------------------------+
|
259
|
+
| W2 | Wind Turbine, Type 2 |
|
260
|
+
+------+---------------------------------------------------------------+
|
261
|
+
| W3 | Wind Turbine, Type 3 |
|
262
|
+
+------+---------------------------------------------------------------+
|
263
|
+
| W4 | Wind Turbine, Type 4 |
|
264
|
+
+------+---------------------------------------------------------------+
|
265
|
+
| SV | Static Var Compensator |
|
266
|
+
+------+---------------------------------------------------------------+
|
267
|
+
| DL | Dispatchable Load |
|
268
|
+
+------+---------------------------------------------------------------+
|
269
|
+
|
270
|
+
Fuel Types
|
271
|
+
~~~~~~~~~~~~~~~~
|
272
|
+
+-------------+---------------------------------------+
|
273
|
+
| code | description |
|
274
|
+
+-------------+---------------------------------------+
|
275
|
+
| biomass | Biomass |
|
276
|
+
+-------------+---------------------------------------+
|
277
|
+
| coal | Coal |
|
278
|
+
+-------------+---------------------------------------+
|
279
|
+
| dfo | Distillate Fuel Oil |
|
280
|
+
+-------------+---------------------------------------+
|
281
|
+
| geothermal | Geothermal |
|
282
|
+
+-------------+---------------------------------------+
|
283
|
+
| hydro | Hydro |
|
284
|
+
+-------------+---------------------------------------+
|
285
|
+
| hydrops | Hydro Pumped Storage |
|
286
|
+
+-------------+---------------------------------------+
|
287
|
+
| jetfuel | Jet Fuel |
|
288
|
+
+-------------+---------------------------------------+
|
289
|
+
| lng | Liquefied Natural Gas |
|
290
|
+
+-------------+---------------------------------------+
|
291
|
+
| ng | Natural Gas |
|
292
|
+
+-------------+---------------------------------------+
|
293
|
+
| nuclear | Nuclear |
|
294
|
+
+-------------+---------------------------------------+
|
295
|
+
| oil | Unspecified Oil |
|
296
|
+
+-------------+---------------------------------------+
|
297
|
+
| refuse | Refuse, Municipal Solid Waste |
|
298
|
+
+-------------+---------------------------------------+
|
299
|
+
| rfo | Residual Fuel Oil |
|
300
|
+
+-------------+---------------------------------------+
|
301
|
+
| solar | Solar |
|
302
|
+
+-------------+---------------------------------------+
|
303
|
+
| syncgen | Synchronous Condenser |
|
304
|
+
+-------------+---------------------------------------+
|
305
|
+
| wasteheat | Waste Heat |
|
306
|
+
+-------------+---------------------------------------+
|
307
|
+
| wind | Wind |
|
308
|
+
+-------------+---------------------------------------+
|
309
|
+
| wood | Wood or Wood Waste |
|
310
|
+
+-------------+---------------------------------------+
|
311
|
+
| other | Other |
|
312
|
+
+-------------+---------------------------------------+
|
313
|
+
| unknown | Unknown |
|
314
|
+
+-------------+---------------------------------------+
|
315
|
+
| dl | Dispatchable Load |
|
316
|
+
+-------------+---------------------------------------+
|
317
|
+
| ess | Energy Storage System |
|
318
|
+
+-------------+---------------------------------------+
|
@@ -3,8 +3,7 @@
|
|
3
3
|
PYPOWER
|
4
4
|
--------
|
5
5
|
|
6
|
-
AMS
|
7
|
-
in version 2 for scheduling modeling and analysis. PYPOWER cases follow the same format as MATPOWER.
|
6
|
+
AMS supports PYPOWER PY case file. PYPOWER cases follow a similar format as MATPOWER.
|
8
7
|
|
9
8
|
The PYPOWER case is defined as a Python dictionary that includes ``bus``, ``gen``, ``branch``,
|
10
9
|
``areas``, and ``gencost``.
|
@@ -43,7 +43,7 @@ Create an environment for AMS (recommended)
|
|
43
43
|
|
44
44
|
.. code:: bash
|
45
45
|
|
46
|
-
mamba create --name ams python=3.
|
46
|
+
mamba create --name ams python=3.10
|
47
47
|
|
48
48
|
Activate the new environment with
|
49
49
|
|
@@ -83,10 +83,7 @@ To install packages in the ``dev`` when installing AMS, do:
|
|
83
83
|
|
84
84
|
.. code:: bash
|
85
85
|
|
86
|
-
pip install
|
87
|
-
|
88
|
-
One can also inspect the ``requirements-dev.txt`` to identify the packages
|
89
|
-
for manual installation.
|
86
|
+
pip install .[dev]
|
90
87
|
|
91
88
|
.. _Develop Install:
|
92
89
|
|
@@ -131,6 +128,7 @@ Install dependencies with
|
|
131
128
|
mamba install --file requirements.txt
|
132
129
|
mamba install --file requirements-dev.txt
|
133
130
|
mamba install --file requirements-doc.txt
|
131
|
+
mamba install --file requirements-nlp.txt
|
134
132
|
|
135
133
|
Alternatively, you can install them with ``pip``:
|
136
134
|
|
@@ -139,12 +137,17 @@ Alternatively, you can install them with ``pip``:
|
|
139
137
|
pip install -r requirements.txt
|
140
138
|
pip install -r requirements-dev.txt
|
141
139
|
pip install -r requirements-doc.txt
|
140
|
+
pip install -r requirements-nlp.txt
|
141
|
+
|
142
|
+
Alternatively, if you have a modern version of pip (>=23.1), you can install all dependencies specified in ``pyproject.toml`` with:
|
143
|
+
|
144
|
+
pip install .[dev,doc,nlp]
|
142
145
|
|
143
146
|
Step 3: Install AMS in the development mode using
|
144
147
|
|
145
148
|
.. code:: bash
|
146
149
|
|
147
|
-
|
150
|
+
python3 -m pip install -e .
|
148
151
|
|
149
152
|
Note the dot at the end. Pip will take care of the rest.
|
150
153
|
|
Binary file
|
Binary file
|
docs/source/release-notes.rst
CHANGED
@@ -9,6 +9,35 @@ 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.10 (2024-xx-xx)
|
13
|
+
--------------------
|
14
|
+
|
15
|
+
- Add bus type correction in ``system.System.setup()``
|
16
|
+
- Revise ``ams.io.psse.read`` to complete model Zone when necessary
|
17
|
+
- Use numerical Area and Zone idx in MATPOWER and PSSE RAW file conversion
|
18
|
+
- Support JSON format addfile when converting to ANDES case
|
19
|
+
- Add PSS/E v33 RAW file writer
|
20
|
+
- In class ``System``, add wrapper methods ``to_mpc``, ``to_m``, ``to_xlsx``,
|
21
|
+
``to_json``, and ``to_raw`` for easier case file export
|
22
|
+
- Add wrapper routines for PYPOWER: ``DCPF1``, ``PFlow1``, ``DCOPF1``, and ``ACOPF1``
|
23
|
+
- In routine ``DCOPF`` and its derivatives, add ExpressionCalc ``mu1`` ``mu2`` to
|
24
|
+
calculate Lagrange multipliers of line flow limits constraints
|
25
|
+
- Add wrapper routine ``OPF`` for gurobi_optimods
|
26
|
+
- Add a demo to show newly added wrapper routines, see
|
27
|
+
``examples/demonstration/demo_wrapper_routines.ipynb``
|
28
|
+
- Revise ``andes.common.config.Config.update`` to ensure configuration parameters
|
29
|
+
are consistently updated in both the object and its internal ``_dict``
|
30
|
+
- Remove legacy revised PYPOWER module
|
31
|
+
- Remove function ``ams.shared.ppc2df``
|
32
|
+
|
33
|
+
v1.0.9 (2024-04-23)
|
34
|
+
--------------------
|
35
|
+
|
36
|
+
Improve MATPOWER file converter:
|
37
|
+
|
38
|
+
- Add a M file case writer
|
39
|
+
- Include Area and Zone in both MATPOWER read and write
|
40
|
+
|
12
41
|
v1.0.8 (2024-04-20)
|
13
42
|
--------------------
|
14
43
|
|
@@ -400,50 +429,3 @@ v0.4 (2023-01)
|
|
400
429
|
-------------------
|
401
430
|
|
402
431
|
This release outlines the package.
|
403
|
-
|
404
|
-
Known Limitations
|
405
|
-
=================
|
406
|
-
|
407
|
-
- For builit-in PYPOWER-based ACOPF, the known largest solvable case is "pglib_opf_case1354_pegase.m"
|
408
|
-
- Batch processing is not supported yet
|
409
|
-
- Routine ``DCOPF`` has been extensively benchmarked with pandapower and MATPOWER.
|
410
|
-
- Routines besides above mentioned are not fully benchmarked yet.
|
411
|
-
|
412
|
-
Roadmap
|
413
|
-
=======
|
414
|
-
|
415
|
-
This section lists out some potential features that may be added in the future.
|
416
|
-
Note that the proposed features are not guaranteed to be implemented and subject to change.
|
417
|
-
|
418
|
-
Electric Vehicle for Grid Service
|
419
|
-
------------------------------------------
|
420
|
-
|
421
|
-
A charging-time-constrained EV aggregation based on the state-space model
|
422
|
-
|
423
|
-
References:
|
424
|
-
|
425
|
-
[1] J. Wang et al., "Electric Vehicles Charging Time Constrained Deliverable Provision of Secondary
|
426
|
-
Frequency Regulation," in IEEE Transactions on Smart Grid, doi: 10.1109/TSG.2024.3356948.
|
427
|
-
|
428
|
-
[2] M. Wang et al., "State Space Model of Aggregated Electric Vehicles for Frequency Regulation," in
|
429
|
-
IEEE Transactions on Smart Grid, vol. 11, no. 2, pp. 981-994, March 2020, doi: 10.1109/TSG.2019.2929052.
|
430
|
-
|
431
|
-
Distribution OPF
|
432
|
-
--------------------------
|
433
|
-
|
434
|
-
- Distribution networks OPF and its LMP
|
435
|
-
- DG siting and sizing considering energy equity
|
436
|
-
|
437
|
-
References:
|
438
|
-
|
439
|
-
[1] H. Yuan, F. Li, Y. Wei and J. Zhu, "Novel Linearized Power Flow and Linearized OPF Models for
|
440
|
-
Active Distribution Networks With Application in Distribution LMP," in IEEE Transactions on Smart Grid,
|
441
|
-
vol. 9, no. 1, pp. 438-448, Jan. 2018, doi: 10.1109/TSG.2016.2594814.
|
442
|
-
|
443
|
-
[2] C. Li, F. Li, S. Jiang, X. Wang and J. Wang, "Siting and Sizing of DG Units Considering Energy
|
444
|
-
Equity: Model, Solution, and Guidelines," in IEEE Transactions on Smart Grid, doi: 10.1109/TSG.2024.3350914.
|
445
|
-
|
446
|
-
Planning
|
447
|
-
--------------------------
|
448
|
-
|
449
|
-
- Transmission expansion planning
|