Git Product home page Git Product logo

andes's People

Contributors

aaliqureshi avatar buaaqq avatar cuihantao avatar jinningwang avatar josepfanals avatar lacknc avatar pyup-bot avatar qzhang41 avatar rwl avatar saimaalamosu avatar sanurielf avatar seedpower avatar treymingee avatar weigao-123 avatar willjschmitt avatar yasirroni avatar zaidmahmood avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

andes's Issues

andes failing with numpy versions containing 'rc'

Andes is falling when detecting NumPy versions because it may contain literals like "rc" at the end.

To Reproduce

pip install numpy==1.20.0rc2
pip install andes
andes prep

Expected behavior

The following output appears:

Saved generated pycode to "/Users/urielsandoval/.andes/pycode"
Loaded generated Python code in "/Users/urielsandoval/.andes/pycode".
Traceback (most recent call last):
File "/usr/local/bin/andes", line 33, in
sys.exit(load_entry_point('andes', 'console_scripts', 'andes')())
File "/Users/urielsandoval/Nextcloud/dev/andes/andes/cli.py", line 211, in main
return func(cli=True, **vars(args))
File "/Users/urielsandoval/Nextcloud/dev/andes/andes/main.py", line 728, in prepare
system.prepare(quick=quick, incremental=incremental, models=models,
File "/Users/urielsandoval/Nextcloud/dev/andes/andes/system.py", line 316, in prepare
self.dill()
File "/Users/urielsandoval/Nextcloud/dev/andes/andes/system.py", line 1351, in dill
np_ver = tuple([int(i) for i in np_ver])
File "/Users/urielsandoval/Nextcloud/dev/andes/andes/system.py", line 1351, in
np_ver = tuple([int(i) for i in np_ver])
ValueError: invalid literal for int() with base 10: '0rc2'

Bug in GENCLS when ra != 0

Describe the bug

Dynamic initialization fails when ra !=0 for classical generator. Need to check if the bug also affects GENROU.

Initialization of multiple generators on buses with multiple PV

During the initialization of synchronous generators, all power generation from static gens is summed up per generator per bus. If two generators are connected to the same bus, they must specify gammap and gammaq for proper initialization.

If two PVs are connected to bus 1 and only 1 synchronous generator is connected, then one PV will not be properly removed (turned off by PowerSystem.rmgen().

Many buses in PV and PQ are repeated in npcc case

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Run '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. Windows]
  • ANDES version (please paste the preamble from andes)

**pip packages (please paste the output from pip list)

Additional context
Add any other context about the problem here.

Initial Update

The bot created this issue to inform you that pyup.io has been set up on this repo.
Once you have closed it, the bot will open pull requests for updates as soon as they are available.

Specifying `input_path` does not impact `addfile`

Describe the bug
When input_path is specified, it impacts the base case file case but not the additional file addfile.

To Reproduce

ss = andes.run(fnamein, addfile=fnamedyr, input_path=dirin, output_path=dirout) # fails
ss = andes.run(fnamein, addfile=os.path.join(dirin,fnamedyr), input_path=dirin, output_path=dirout) # works

To Fix
ANDES should detect if input_path is specified and whether case and addfile are relative paths.

  • If input_path not specified, look up files using the original case and addfile
  • If input_path is specified and both case and addfile are relative, prepend input_path to both.
  • If input_path is specified and either case of addfile is absolute, error out.

Parsing issue in dyr for HYGOV

It seems that parsing dyr files with HYGOV is failing

The raw file I'm using is this one:

0,   100.00, 33, 0, 0, 60.00     / PSS(R)E 33 RAW created by rawd33  SUN, JAN 30 2022  20:47


     1,'BUS 1',  20,2,   1,   1,   1,1.03000,  27.0698,1.10000,0.90000,1.10000,0.90000
     2,'BUS 2',  20,2,   1,   1,   1,1.01000,  17.3055,1.10000,0.90000,1.10000,0.90000
     3,'BUS 3',  20,3,   2,   1,   1,1.03000,   0.0000,1.10000,0.90000,1.10000,0.90000
     4,'BUS 4',  20,2,   2,   1,   1,1.01000, -10.1917,1.10000,0.90000,1.10000,0.90000
     5,'BUS 5', 230,1,   1,   1,   1,1.00646,  20.6078,1.10000,0.90000,1.10000,0.90000
     6,'BUS 6', 230,1,   1,   1,   1,0.97813,  10.5233,1.10000,0.90000,1.10000,0.90000
     7,'BUS 7', 230,1,   1,   1,   1,0.96102,   2.1143,1.10000,0.90000,1.10000,0.90000
     8,'BUS 8', 230,1,   3,   1,   1,0.94862, -11.7551,1.10000,0.90000,1.10000,0.90000
     9,'BUS 9', 230,1,   2,   1,   1,0.97138, -25.3519,1.10000,0.90000,1.10000,0.90000
    10,'BUS 10', 230,1,   2,   1,   1,0.98347, -16.9369,1.10000,0.90000,1.10000,0.90000
    11,'BUS 11', 230,1,   2,   1,   1,1.00826,  -6.6270,1.10000,0.90000,1.10000,0.90000
0 / END OF BUS DATA, BEGIN LOAD DATA
     7,'1 ',1,   1,   1,   967.000,   100.000,     0.000,     0.000,     0.000,     0.000,   1,1,0
     9,'1 ',1,   2,   1,  1767.000,   100.000,     0.000,     0.000,     0.000,     0.000,   1,1,0
0 / END OF LOAD DATA, BEGIN FIXED SHUNT DATA
     7,'1 ',1,     0.000,   200.000
     9,'1 ',1,     0.000,   350.000
0 / END OF FIXED SHUNT DATA, BEGIN GENERATOR DATA
     1,'1 ',   700.000,   185.002,  9999.000, -9999.000,1.03000,     0,   900.000, 2.50000E-3, 2.50000E-1, 0.00000E+0, 0.00000E+0,1.00000,1,  100.0,  9999.000, -9999.000,   1,1.0000
     2,'1 ',   700.000,   234.578,  9999.000, -9999.000,1.01000,     0,   900.000, 2.50000E-3, 2.50000E-1, 0.00000E+0, 0.00000E+0,1.00000,1,  100.0,  9999.000, -9999.000,   1,1.0000
     3,'1 ',   719.083,   175.993,  9999.000, -9999.000,1.03000,     0,   900.000, 2.50000E-3, 2.50000E-1, 0.00000E+0, 0.00000E+0,1.00000,1,  100.0,  9999.000, -9999.000,   1,1.0000
     4,'1 ',   700.000,   202.038,  9999.000, -9999.000,1.01000,     0,   900.000, 2.50000E-3, 2.50000E-1, 0.00000E+0, 0.00000E+0,1.00000,1,  100.0,  9999.000, -9999.000,   1,1.0000
0 / END OF GENERATOR DATA, BEGIN BRANCH DATA
     5,     6,'1 ', 2.50000E-3, 2.50000E-2,   0.04375,    0.00,    0.00,    0.00,  0.00000,  0.00000,  0.00000,  0.00000,1,1,  25.00,   1,1.0000
     6,     7,'1 ', 1.00000E-3, 1.00000E-2,   0.01750,    0.00,    0.00,    0.00,  0.00000,  0.00000,  0.00000,  0.00000,1,1,  10.00,   1,1.0000
     7,     8,'1 ', 1.10000E-2, 1.10000E-1,   0.19250,    0.00,    0.00,    0.00,  0.00000,  0.00000,  0.00000,  0.00000,1,1, 110.00,   1,1.0000
     7,     8,'2 ', 1.10000E-2, 1.10000E-1,   0.19250,    0.00,    0.00,    0.00,  0.00000,  0.00000,  0.00000,  0.00000,1,1, 110.00,   1,1.0000
     8,     9,'1 ', 1.10000E-2, 1.10000E-1,   0.19250,    0.00,    0.00,    0.00,  0.00000,  0.00000,  0.00000,  0.00000,1,1, 110.00,   1,1.0000
     8,     9,'2 ', 1.10000E-2, 1.10000E-1,   0.19250,    0.00,    0.00,    0.00,  0.00000,  0.00000,  0.00000,  0.00000,1,1, 110.00,   1,1.0000
     9,    10,'1 ', 1.00000E-3, 1.00000E-2,   0.01750,    0.00,    0.00,    0.00,  0.00000,  0.00000,  0.00000,  0.00000,1,1,  10.00,   1,1.0000
    10,    11,'1 ', 2.50000E-3, 2.50000E-2,   0.04375,    0.00,    0.00,    0.00,  0.00000,  0.00000,  0.00000,  0.00000,1,1,  25.00,   1,1.0000
0 / END OF BRANCH DATA, BEGIN TRANSFORMER DATA
     1,     5,     0,'1 ',1,1,1, 0.00000E+0, 0.00000E+0,2,'TRFO1-5',1,   1,1.0000,   0,1.0000,   0,1.0000,   0,1.0000,'            '
 0.00000E+0, 1.66670E-2,   100.00
1.00000,   0.000,   0.000,   900.00,     0.00,     0.00, 0,      0, 1.10000, 0.90000, 1.10000, 0.90000,  33, 0, 0.00000, 0.00000,  0.000
1.00000,   0.000
     2,     6,     0,'1 ',1,1,1, 0.00000E+0, 0.00000E+0,2,'TRFO2-6',1,   1,1.0000,   0,1.0000,   0,1.0000,   0,1.0000,'            '
 0.00000E+0, 1.66670E-2,   100.00
1.00000,   0.000,   0.000,   900.00,     0.00,     0.00, 0,      0, 1.10000, 0.90000, 1.10000, 0.90000,  33, 0, 0.00000, 0.00000,  0.000
1.00000,   0.000
     3,    11,     0,'1 ',1,1,1, 0.00000E+0, 0.00000E+0,2,'TRFO3-11',1,   1,1.0000,   0,1.0000,   0,1.0000,   0,1.0000,'            '
 0.00000E+0, 1.66670E-2,   100.00
1.00000,   0.000,   0.000,   900.00,     0.00,     0.00, 0,      0, 1.10000, 0.90000, 1.10000, 0.90000,  33, 0, 0.00000, 0.00000,  0.000
1.00000,   0.000
     4,    10,     0,'1 ',1,1,1, 0.00000E+0, 0.00000E+0,2,'TRFO4-10',1,   1,1.0000,   0,1.0000,   0,1.0000,   0,1.0000,'            '
 0.00000E+0, 1.66670E-2,   100.00
1.00000,   0.000,   0.000,   900.00,     0.00,     0.00, 0,      0, 1.10000, 0.90000, 1.10000, 0.90000,  33, 0, 0.00000, 0.00000,  0.000
1.00000,   0.000
0 / END OF TRANSFORMER DATA, BEGIN AREA DATA
0 / END OF AREA DATA, BEGIN TWO-TERMINAL DC DATA
0 / END OF TWO-TERMINAL DC DATA, BEGIN VSC DC LINE DATA
0 / END OF VSC DC LINE DATA, BEGIN IMPEDANCE CORRECTION DATA
0 / END OF IMPEDANCE CORRECTION DATA, BEGIN MULTI-TERMINAL DC DATA
0 / END OF MULTI-TERMINAL DC DATA, BEGIN MULTI-SECTION LINE DATA
0 / END OF MULTI-SECTION LINE DATA, BEGIN ZONE DATA
0 / END OF ZONE DATA, BEGIN INTER-AREA TRANSFER DATA
0 / END OF INTER-AREA TRANSFER DATA, BEGIN OWNER DATA
0 / END OF OWNER DATA, BEGIN FACTS DEVICE DATA
0 / END OF FACTS DEVICE DATA, BEGIN SWITCHED SHUNT DATA
0 / END OF SWITCHED SHUNT DATA, BEGIN GNE DATA
0 / END OF GNE DATA, BEGIN INDUCTION MACHINE DATA
0 / END OF INDUCTION MACHINE DATA
Q

and dyr:

  1     'GENROU' 1    8    0.03   0.4  0.05  6.5  0  1.8  1.7   0.30  0.55  0.25    0.2  0.0      0.0 /   
  2     'GENROU' 1    8    0.03   0.4  0.05  6.5  0  1.8  1.7   0.30  0.55  0.25    0.2  0.0      0.0 /  
  3     'GENROU' 1    8    0.03   0.4  0.05  6.175  0  1.8  1.7   0.30  0.55  0.25    0.2  0.0      0.0 /   
  4     'GENROU' 1    8    0.03   0.4  0.05  6.175  0  1.8  1.7   0.30  0.55  0.25    0.2  0.0      0.0 /  
  1     'SEXS'  1    0.10000     10.000       100.00      0.10000   0.0000  5.0000  /
  2     'SEXS'  1    0.10000     10.000       100.00      0.10000   0.0000  5.0000  /
  3     'SEXS'  1    0.10000     10.000       100.00      0.10000   0.0000  5.0000  /
  4     'SEXS'  1    0.10000     10.000       100.00      0.10000   0.0000  5.0000  /
  1    'HYGOV'  1    0.04  0.5       1.0      0.05   0.20   0.10  1.0   0.00   1  1.0  0.0   0.0 / 
  2    'HYGOV'  1    0.04  0.5       1.0      0.05   0.20   0.10  1.0   0.00   1  1.0  0.0   0.0 / 
  3    'HYGOV'  1    0.04  0.5       1.0      0.05   0.20   0.10  1.0   0.00   1  1.0  0.0   0.0 / 
  4    'HYGOV'  1    0.04  0.5       1.0      0.05   0.20   0.10  1.0   0.00   1  1.0  0.0   0.0 / 

The error when doing:
ss.run(raw_path, addfile = dyr_path, routine = 'eig')
is the following:

line 221, in set_axis
    f"Length mismatch: Expected axis has {old_len} elements, new "
ValueError: Length mismatch: Expected axis has 14 elements, new values have 13 elements

Removing the HYGOV entries in the dyr fixes the problem.

play in signal to a network

Does andes have a function as a playback function in PSSE or powerworld? I want to create a model which includes a generator, pss, governor, and an exciter. I want to insert the voltage and frequency into the network and get the real and reactive power as output. Is that possible with andes? thanks

Counted in user's response time when timing format conversion

When running andes run --convert and the output file exists, the user will be prompted to confirm overwriting. The user's response time is mistakenly counted in the total conversion time.

The timer code is in andes.io.dump(), but the confirmation is called in each converter. We will need to refactor the code and let andes.io.dump() invoke the confirmation.

LCC-MMC HVDC/MTDC system

If I need to use ANDES to implement LCC-MMC three-terminal or multi-terminal HVDC transmission system, is it possible? What models and parameters do I need to add?
To simulate the switching in MMC, i need an electromagnetic simulation tool ,like PSCAD?
Is there a model of LCC or MMC in ANDES?I need to program LCC and MMC models, right?
Thank you for your guidance!

Create a PyIodide package for Andes

Andes has a complex set of dependencies that potential users might not be willing to install locally. PyIoidide is an exciting new project that could allow Andes to be run within the browser using WebAssembly. Many of the packages that Andes requires have already been ported to PyIodide. If CVXOPT and SymPy were ported it might be possible to create an Andes package:

https://pyodide.readthedocs.io/en/latest/new_packages.html

This would allow users to create and share notebooks online. Andes running in WebAssembly would open the possibility to create a custom GUI such as that made with MATPOWER:

https://matpower.app/

This could, potentially, also be built into an Electron-based desktop application and made available to download by users wishing to work offline or on air-gaped machines.

Instantiate `ExtendedEvent` Error

Describe the bug
When instantiating an ExtendedEvent, the t_ext should not be a number. It should come from a param or service, or there will be an error when running TDS.

To Reproduce

  1. Instantiate an ExtendedEvent in the model and set t_ext=0.02.
  2. Run the TDS.

Expected behavior
Run TDS without error.

Screenshots
image

Desktop (please complete the following information):

  • OS: [Mac OS 11.5.2]
  • ANDES version [1.3.12.post51.dev0+g42ae457d]

**pip packages (please paste the output from pip list)
Package Version Location


andes 1.3.3.post154.dev0+ga723634 /home/jwang175/andes
appdirs 1.4.4
argon2-cffi 20.1.0
astroid 2.6.2
async-generator 1.10
attrs 21.2.0
backcall 0.2.0
backports.functools-lru-cache 1.6.4
black 21.7b0
bleach 3.3.0
certifi 2021.5.30
cffi 1.14.5
chardet 4.0.0
click 8.0.1
colorama 0.4.4
coloredlogs 15.0.1
cvxopt 1.2.6
cycler 0.10.0
decorator 5.0.9
defusedxml 0.7.1
dill 0.3.4
dime 0.0.1
dnspython 1.16.0
docopt 0.6.2
docutils 0.17.1
entrypoints 0.3
et-xmlfile 1.1.0
fett 0.3.2
flake8 3.9.2
humanfriendly 9.2
idna 2.10
importlib-metadata 4.5.0
ipykernel 5.5.5
ipython 7.24.1
ipython-genutils 0.2.0
ipywidgets 7.6.3
isort 5.9.2
jedi 0.18.0
Jinja2 3.0.1
jsonschema 3.2.0
jupyter 1.0.0
jupyter-client 6.1.12
jupyter-console 6.4.0
jupyter-core 4.7.1
jupyterlab-pygments 0.1.2
jupyterlab-widgets 1.0.0
kiwisolver 1.3.1
kvxopt 1.2.6.0
lazy-object-proxy 1.6.0
MarkupSafe 2.0.1
matplotlib 3.4.2
matplotlib-inline 0.1.2
mccabe 0.6.1
mistune 0.8.4
mpmath 1.2.1
multiprocess 0.70.12.2
mypy-extensions 0.4.3
nbclient 0.5.3
nbconvert 6.1.0
nbformat 5.1.3
nest-asyncio 1.5.1
networkx 2.5.1
notebook 6.4.0
numpy 1.20.3
openpyxl 3.0.7
packaging 20.9
pandas 1.2.4
pandocfilters 1.4.2
parso 0.8.2
pathos 0.2.8
pathspec 0.8.1
pexpect 4.8.0
pickleshare 0.7.5
Pillow 8.2.0
pip 21.1.2
pox 0.3.0
ppft 1.6.6.4
prometheus-client 0.11.0
prompt-toolkit 3.0.19
ptyprocess 0.7.0
pycodestyle 2.7.0
pycparser 2.20
pyflakes 2.3.1
Pygments 2.9.0
pylint 2.9.3
pymongo 3.11.4
pyparsing 2.4.7
PyQt5 5.12.3
PyQt5-sip 4.19.18
PyQtChart 5.12
PyQtWebEngine 5.12.1
pyrsistent 0.17.3
python-dateutil 2.8.1
python-jsonrpc-server 0.3.4
pytz 2021.1
PyYAML 5.4.1
pyzmq 22.1.0
qtconsole 5.1.0
QtPy 1.9.0
regex 2021.7.6
requests 2.25.1
scipy 1.6.3
Send2Trash 1.7.1
setuptools 49.6.0.post20210108
six 1.16.0
snooty-lextudio 1.9.2.dev0
sympy 1.8
terminado 0.10.1
testpath 0.5.0
toml 0.10.2
tomli 1.0.4
tomlkit 0.7.2
tornado 6.1
tqdm 4.61.1
traitlets 5.0.5
typed-ast 1.4.3
typing-extensions 3.7.4.3
ujson 1.35
urllib3 1.26.5
watchdog 1.0.2
wcwidth 0.2.5
webencodings 0.5.1
wheel 0.36.2
widgetsnbextension 3.5.1
wrapt 1.12.1
XlsxWriter 1.4.3
zipp 3.4.1

Additional context
No big deal, just a kind reminder that we can clarify that such definition is inappropriate in ANDES.

Use PyFMI to support dynamic models made with other tools

Power companies often have custom dynamic models that they are accustomed to using in their simulations. The symbolic modeling features of Andes make it convenient to add new models, but users may wish to reuse existing models and would not be comfortable re-implementing them.

I noticed that GridDyn has support for the Functional Mock-up Interface (FMI) standard. The FMI library is implemented in C and there is a Python interface available:

https://pypi.org/project/PyFMI/

Perhaps it could be used with Andes to allow the integration of models written with other tools. There are some existing libraries that could be used for experimentation:

https://github.com/OpenIPSL/OpenIPSL
https://github.com/dynawo/dynawo/tree/master/dynawo/sources/Models/Modelica/Dynawo

variable wt in 'wtdta1.py' is not set up as the type <y>

Describe the bug
A clear and concise description of what the bug is.
run TDS for the case 'ieee14_wt3n.xlsx' and find the error

TypeError: ExtVar <WTPTA1.wt> is of type , but source Vars <RenGovernor.wt> may not.

After checking the source code, it looks like the variable wt in 'wtdta1.py' is not set up as the type . I tried to fix this issue but have not debugged through it in developer mode. Hopefully this issue might be easier to fix on your side. Thank you very much for your efforts in developing the code!

To Reproduce
Steps to reproduce the behavior:

  1. Go to '1.2 demo_DGPRCTExt. ipynb'
  2. substitute the case to be 'ieee14/ieee14_wt3n.xlsx
  3. ss.TDS.run()
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.
image

Desktop (please complete the following information):

  • OS: Windows
  • ANDES version (please paste the preamble from andes)

**pip packages (please paste the output from pip list)

Additional context
Add any other context about the problem here.

Make io functions accept file like objects

Is your feature request related to a problem? Please describe.
Currently, if I have data in memory that I wish to parse into a System it has to be written out to a temporary file and the path passed to a read function from an io module.

Describe the solution you'd like
It would be good if the io modules had read_file functions that would accept file-like objects (e.g. StringIO). These could be called from the existing read functions that would still take paths and handle opening/closing files.

Describe alternatives you've considered
The xlsx module already supports this as the Pandas ExcelFile constructor accepts file-like objects. The json module is simple enough to just copy, but the matpower and psse modules call open.

Time domain simulation of fault failed for system with renewables

For andes systems with wind or PV, time domain simulation fails at the time of fault: "Time step reduced to zero. Convergence is not likely."

Steps to reproduce the behavior:

  1. Find the ieee14_wt3.xlsx or ieee14_solar.xlsx attached with andes package
  2. Add fault to the system at bus 8: tf = 1, tc = 1.3, xf = 0.0001, rf = 0
  3. run time domain simulation
  4. See error

Update README.md before v1.0.0 release

Needs to update README and use the NPCC simulation results.

Mention the verifications and provide links to the folder in both README and the docs landing page.

Eigenvalue analysis with zeroed out time constants

For a differential equation T \dot{x} = f, when T is zero, it becomes an algebraic equation and should be eliminated through gy^{-1} when calculating the state matrix.

ANDES currently removes the rows and columns corresponding to differential equations (and the corresponding state) that have zero time constants. I doubt the approach is correct.

Kundur under-damped modes

the document says:

The Kundur's two-area system has under-damped modes and two coherent groups of generators. It is
suitable for oscillation study and transient stability studies.

how to do that? how to set the under-damped mode?

Running PFlow after TDS.run()

Disclaimer: This might just as well be about me being dumb or using andes in a wrong way, but could also be a bug ;)

Describe the bug
I use the ieee14 benchmark system. I can run powerflow (with PFlow.run()) and then run TDS for an arbitrary number seconds, even with interruptions and mid-simulation setup-changes (like loadjumps via Ppf and Qpf). But I cannot run PFlow at a later point (e.g. at the very end of the TDS). In short: Once TDS was started, I cannot run PFlow without getting the Slack generator is not defined/enabled for 1 island(s). Jacobian matrix is singular. error, eventhough everything in the system is fine (even according to the TDS)

Expected behavior
Provide PFlow-results based on the system configuration at the end of a TDS

Actual bevhior
Slack generator is not defined/enabled for 1 island(s). Jacobian matrix is singular. Suspect diagonal elements: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 144, 145, 146, 147, 148] Jacobian matrix is singular. Suspect diagonal elements: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 144, 145, 146, 147, 148] Jacobian matrix is singular. Suspect diagonal elements: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 144, 145, 146, 147, 148] Jacobian matrix is singular. Suspect diagonal elements: [49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 144, 145, 146, 147, 148] NaN found in solution. Convergence is not likely Simulation terminated at t=20.0000 s. NaN found in solution. Convergence is not likely Simulation terminated at t=20.0000 s.

Desktop (please complete the following information):

  • OS: Windows - PyCharm
  • ANDES 1.7.6

Documentation: Change TDS timeframe in interactive usage

While changing the simulation timeframe is very straightforward and simple for CLI-usage (as it is part of the cheatsheet :) ) I had a somewhat unnecessarily hard time to find out how to change the simulation time in interactive usage:

ss = andes.run('./cases/5bus/pjm5bus.xlsx', tf=50)

The solution is stunningly simple, but somehow I had to figure this out with trial and error as the documentation did not mention this setting anywhere else but in the configuration params (while not telling how to apply config-changes). I'm not very savvy, thus this request might be fairly stupid, but maybe other users struggled with this, too :)

Great work, very user-friendly otherwise!

Data file likely contains references to unsupported models.

(base) C:\ProgramData\Anaconda3\Lib\site-packages\andes\cases\ieee39>andes run IEEE39bus.raw --addfile IEEE39bus.dyr -c

    _           _         | Version 1.8.2
   /_\  _ _  __| |___ ___ | Python 3.9.12 on Windows, 11/10/2022 09:24:27 AM
  / _ \| ' \/ _` / -_|_-< |
 /_/ \_\_||_\__,_\___/__/ | This program comes with ABSOLUTELY NO WARRANTY.

Working directory: "C:\ProgramData\Anaconda3\Lib\site-packages\andes\cases\ieee39"
> Loaded config from file "C:\Users\Administrator\.andes\andes.rc"
> Loaded generated Python code in "C:\Users\Administrator\.andes\pycode".
Parsing input file "IEEE39bus.raw"...
  NEW ENGLAND TEST SYSTEM, 39 BUSES, 9 GENERATORS
  Created by Pablo Ledesma [email protected]
Input file parsed in 0.0090 seconds.
Parsing additional file "IEEE39bus.dyr"...
Data file likely contains references to unsupported models.
['syn'] = ['GENROU_1'] not found in Exciter
Error parsing addfile "IEEE39bus.dyr" with psse parser.
-> Single process exit with an error in 0.7368 seconds.

upload file appendix:ieee39.zip

FLoad error

Error

ANDES version: 1.5.1.post2+ge8465ce0, case: ieee14_fload.json

The error occurred in method ModelCache.refresh in model.py. The error was caused by the bus value being none by ss.FLoad.as_dict(vin=True). Output results are shown below:

ss.FLoad.as_dict(vin=False)

{'uid': array([0]),
...
 'bus': [2]}

ss.FLoad.as_dict(vin=True)

{'uid': array([0]),
...
 'bus': array([], dtype=float64)}

First bad commit

After inspection, the issue first occurred in commit e8465ce, and I am working on this.

Procedures to identify the known bad commit

Using git bisect to locate the first known issue commit

Start the git bisect by git bisect

Mark first known good commit 9c2a5c8 using git bisect good 9c2a5c84

Make first know bad commit f417cf2 using git bisect bad f417cf2e

Then do the bisection by

git checkout <commit>
pip install -e .
andes prep
andes st
andes run /Users/jinningwang/Documents/work/andes/andes/cases/ieee14/ieee14_fload.json -r tds

After test run, mark it as good or bad

Originally posted by @jinningwang in #442 (comment)

test system format

Dr. Cui,
I notice that the test system data are contained in *.raw and *.dyr files. It seems that InterPSS also uses those two extensions to define the test system. I wonder what's the original software that defined these two extensions. Where can I find the documentation of the two extensions? I'd like to convert my own system in order to use ANDES or InterPSS. Thanks.

Initialization Test

Is your feature request related to a problem? Please describe.
It will be more convenient to have an initialization test when developing a new model. Users will have a quicker way to know the model quality.

Describe the solution you'd like
Add a partial test like andes inittest, so users can run that command to verify their model during development.
Especially if we can have an andes inittest <model_name> to test the new model initialization, it will be really convenient.

Describe alternatives you've considered
For now, I can only verify the initialization when I run a TDS, which is kind of low efficiency.

Additional context
I think this is a low cost and worth feature, although it is not that necessary and urgent.
It should be noticed that:

  1. There should be a 'base system' that can be easily assembled for the new model.
    IEEE 14-bus system should be a good candidate.
    We can tell ANDES which system can be used for the initialization test, and which part can hold the new model.
  2. Some mandatory parameters without default values should be given, from users or ANDES.

Problems in the simulation of generator frequency

I encountered problems in the simulation of generator frequency. I used the file
” ss = andes.load(andes.get_case("ieee14/ieee14_full.xlsx"), setup=False, default_config=True)”.
I increased the active power of the GENROU3 by 0.2p.u. at 7s. It can be seen from the figure that the frequency of the GENROU3 increased.
I am expecting to see that the frequency of five generators will be consistent. But it is strange that the frequency of GENROU3 will not be reduced to be consistent with the other four generators. Can you help me find out what is the reason for this?

WINDOWS
ANDES Version 1.8.7

image

Unify tutorial test cases

This will improve the documentations.

In the tutorial chapter, use the same folder for all examples to avoid confusion. For example, use andes/cases/kundur for all examples.

In the multiprocessing example, one will need to have the MATPOWER data to find case5 and case57.

Provide an example to add Toggler.

Documentation not being updated after repository transfer

Discussed in #421

Originally posted by jinningwang March 12, 2023
Hello Hantao,

Just a kind reminder that I found that the ANDES documentation has not been updated to v1.8.7.
Maybe you need to update the git source in ReadTheDocs and the link in the documentation?

Regards,
Jinning

PSS/e interactive load

I am trying to load pss/e data in interactive Jupyter as follows

andes.config_logger(stream_level=10)
ss = andes.System()
andes.io.psse.read(ss, '../andes/cases/psid_files/ThreeBusMulti.raw')
andes.io.psse.read_add(ss, '../andes/cases/psid_files/ThreeBus_GENROE.dyr')
ss.PFlow.run()

and I get this error

Loaded config from file "/Users/jdlara/.andes/andes.rc"
Non-zero parameter GENCLS.M corrected to 6

-> Power flow calculation
Sparse Solver: UMFPACK
Method: NR method
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
 in ()
      3 andes.io.psse.read(ss, '../andes/cases/psid_files/ThreeBusMulti.raw')
      4 andes.io.psse.read_add(ss, '../andes/cases/psid_files/ThreeBus_GENROE.dyr')
----> 5 ss.PFlow.run()

~/cache/andes/andes/routines/pflow.py in run(self, **kwargs)
    129         system = self.system
    130         self.summary()
--> 131         self.init()
    132         if system.dae.m == 0:
    133             logger.error("Loaded case contains no power flow element.")

~/cache/andes/andes/routines/pflow.py in init(self)
     58         self.mis = []
     59 
---> 60         self.system.init(self.models)
     61         logger.info('Power flow initialized.')
     62         return self.system.dae.xy

~/cache/andes/andes/system.py in init(self, models)
    505 
    506             # initialize variables second
--> 507             mdl.init()
    508 
    509             self.vars_to_dae(mdl)

~/cache/andes/andes/core/model.py in init(self)
   1108         """
   1109         # update service values
-> 1110         self.s_update()
   1111 
   1112         for name, instance in self.vars_decl_order.items():

~/cache/andes/andes/core/model.py in s_update(self)
    935             self.s_numeric(**kwargs)
    936 
--> 937         self.get_inputs(refresh=True)
    938 
    939     def s_update_var(self):

~/cache/andes/andes/core/model.py in get_inputs(self, refresh)
    816         if len(self._input) == 0 or refresh:
    817             self.refresh_inputs()
--> 818             self.refresh_inputs_arg()
    819 
    820         return self._input

~/cache/andes/andes/core/model.py in refresh_inputs_arg(self)
    866         Refresh inputs for each function with individual argument list.
    867         """
--> 868         self.f_args = [self._input[arg] for arg in self.calls.f_args]
    869         self.g_args = [self._input[arg] for arg in self.calls.g_args]
    870 

TypeError: 'NoneType' object is not iterable

Run-time error

The following error was reported after running this command
ss=andes.run('kundur_vsc.xlsx')

Working directory: "C:\Users\Administrator\ANDES\ACDC"
Loaded config from file "C:\Users\Administrator.andes\andes.rc"
Using generated Python code.
Parsing input file "kundur_vsc.xlsx"...
Input file parsed in 0.1026 seconds.
System internal structure set up in 0.0249 seconds.
-> System connectivity check results:
No islanded bus detected.
A total of 1 island(s) detected.
Each island has a slack bus correctly defined and enabled.

-> Power flow calculation
Sparse solver: KLU
Solution method: NR method
Sparse addition: Fast in-place (kvxopt)
Power flow initialized.
g_update failed. Have you run andes prepare -i after updating?

UFuncTypeError Traceback (most recent call last)
in
----> 1 ss=andes.run('kundur_vsc.xlsx')

~\Anaconda3\envs\andes\lib\site-packages\andes\main.py in run(filename, input_path, verbose, mp_verbose, ncpu, pool, cli, codegen, shell, **kwargs)
578 t0, _ = elapsed()
579 if len(cases) == 1:
--> 580 system = run_case(cases[0], codegen=codegen, **kwargs)
581 elif len(cases) > 1:
582

~\Anaconda3\envs\andes\lib\site-packages\andes\main.py in run_case(case, routine, profile, convert, convert_all, add_book, codegen, remove_pycapsule, **kwargs)
389
390 if system.is_setup:
--> 391 system.PFlow.run(**kwargs)
392 for r in routine:
393 system.dict[routine_cli[r.lower()]].run(**kwargs)

~\Anaconda3\envs\andes\lib\site-packages\andes\routines\pflow.py in run(self, **kwargs)
196 self.niter = 0
197 while True:
--> 198 mis = self.nr_step()
199 logger.info('%d: |F(x)| = %.10g', self.niter, mis)
200

~\Anaconda3\envs\andes\lib\site-packages\andes\routines\pflow.py in nr_step(self)
100 system.s_update_var(self.models)
101 system.f_update(self.models)
--> 102 system.g_update(self.models)
103 system.l_update_eq(self.models)
104 system.fg_to_dae()

~\Anaconda3\envs\andes\lib\site-packages\andes\system.py in g_update(self, models)
890 except TypeError as e:
891 logger.error("g_update failed. Have you run andes prepare -i after updating?")
--> 892 raise e
893
894 def g_islands(self):

~\Anaconda3\envs\andes\lib\site-packages\andes\system.py in g_update(self, models)
887 """
888 try:
--> 889 self.call_models('g_update', models)
890 except TypeError as e:
891 logger.error("g_update failed. Have you run andes prepare -i after updating?")

~\Anaconda3\envs\andes\lib\site-packages\andes\system.py in call_models(self, method, models, *args, **kwargs)
1516 ret = OrderedDict()
1517 for name, mdl in models.items():
-> 1518 ret[name] = getattr(mdl, method)(*args, **kwargs)
1519
1520 return ret

~\Anaconda3\envs\andes\lib\site-packages\andes\core\model.py in g_update(self)
1232 for i, var in enumerate(self.cache.algebs_and_ext.values()):
1233 if var.e_inplace:
-> 1234 var.e += g_ret[i]
1235 else:
1236 var.e[:] = g_ret[i]

UFuncTypeError: Cannot cast ufunc 'add' output from dtype('complex128') to dtype('float64') with casting rule 'same_kind'

andes/andes/case/npcc/npcc.xlsx In "PQ" and "PV" sheets, why one bus is repeated twice in the column named "bus".?

There are two issues confusing me:

  1. andes/andes/case/npcc/npcc.xlsx
    In "PQ" and "PV" sheets, why one bus is repeated twice in the column named "bus".
    For example, the 23rd and 24th rows in "PQ" sheet; the 53rd and 54th rows in "PQ" sheet; the 55th and 56th rows in "PQ" sheet; the 4th and 5th rows in "PV" sheet.

  2. The NPCC case has 140 buses, why the total number of the PQ, the PV, and the SW buses is not equal to 140?

Thank you for your response. I will be appreciative if you could share the original NPCC 140-bus system data.

`config_option` fails when the value is a floating number

By @aaliqureshi

When we access the config settings of the PQ model using 'ss.PQ.config', the values of conversion parameters such as pq2z,p2p etc. appear as floats (0.0,1.0 etc.).

However, when I tried to update the default values by providing a float value (1.0 instead of 1), the command did not run and an error was produced saying invalid config_option option. If I make a on-the-fly change in the config setting using either rway, it works fine.

Andes speed calculation

I am currently using master in this simulation to test for a generation trip of generator No 5 at Bus 102, here is the set-up the raw and dyr files are in the attached zip file

import andes
ss = andes.run("FourBusMulti.raw",
            addfile="ThreeBus_multigen.dyr",
               setup=False)

ss.add("Toggler", dict(model='SynGen', dev="GENROU_6", t=1.0))
ss.setup()

ss.PQ.config.p2p = 0
ss.PQ.config.q2q = 0
ss.PQ.config.p2z = 1
ss.PQ.config.q2z = 1
ss.PQ.pq2z = 0
ss.PFlow.run()

ss.TDS.config.tf = 20
ss.TDS.config.criteria = 0
ss.TDS.run()
ss.TDS.load_plotter()
ss.TDS.plt.export_csv()

ss.TDS.plt.plot(ss.GENROU.omega,
                a=(0, 2, 3, 4),
                ytimes=60,
                )

However, the resulting frequency is this increasing line.

image

I am expecting to see something more like this which matches PowerSimulationsDynamics and PSS/e

image

Archive.zip

TGOV1N setpoint for reactive power (qref0) does not seem to be implemented in contrast to documentation

Regarding the govenor-type TGOV1N and its documentation I was able to set pref0 successfully, but for qref0 this is not working. qref0 also seems to not even appear in the rest of the TGOV1N documentation except in the introduction text where it says Scheduling changes should write to the v fields of pref0 and qref0 in place.

It appears that qref0 is not yet implemented or the documentation is more advanced than the code (OR I am - again - doing something wrong, I'm sorry in that case! :D)

Output format to PSSE/Matpower

I would like to compare some of the results from Andes with PSSE (or Matpower). However, it seems that Andes does not provide a raw format output. Is it possible to add such feature (or does it exist and I have missed it)?

Thank you

Power flow calculation of AC/DC system

Respected Professor Hantao Cui:
I am a postgraduate student from Kunming University of Science and Technology, Yunnan Province, China. I would like to use your Andes software to realize the function of ac/DC power flow calculation.
I would be grateful if you could give me some valuable advice on whether this is possible.
Thank you very much

Power flow calculation of AC/DC system

Professor Cui Hantao:
Sorry for replying your email so late. Thank you for your suggestions and guidance.

I would like to ask you whether you have the system connection diagram of the kundur_vsc.xlsx transformed with the kundur four gernerator and two areas, or I need to draw the wiring diagram according to the table data.

I hope to add LCC and MMC models, it would be better if we can realize multi-terminal mixed DC and MMC-HVDC, and realize power flow calculation of AC-DC system

Thank you again

Originally posted by @YaeSakura1 in https://github.com/cuihantao/andes/issues/102#issuecomment-744133712

TDS Convergence is not likely.

Based on kundur_full.xlsx, I set the fault start from 1.0s to 1.1s at bus 1, and when I run the tds, it shows the information as follow:

Time step reduced to zero. Convergence is not likely.
Simulation terminated at t=1.1000 s.

I wonder why this would happen, how I get the result under the above situation (Based on kundur_full.xlsx, I set the fault start from 1.0s to 1.1s at bus 1).

Format converter for .raw and .dyr files

I'd like to convert .raw and .dyr files into a single .xlsx file. It works to convert the .raw file into .xlsx, while running the command "andes run xxx.dyr --convert xlsx" throwed a error "Unable to determine case format." So how to realize this conversion?
Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.