susantoj / pypower-dynamics Goto Github PK
View Code? Open in Web Editor NEWPython-based transient stability simulation program
License: BSD 3-Clause "New" or "Revised" License
Python-based transient stability simulation program
License: BSD 3-Clause "New" or "Revised" License
There is a ) bracket missing from the equation for Vfd0 of the Sauer-Pai model at the bottom of the Machine Models page of the wiki:
Recorder object only works for signals and states (not network variables)
Currently when the program fails, it just crashes and doesn't give any meaningful guidance on what was done incorrectly.
Currently, interfacing of controllers only works for signals in machine models or other controllers. Augment to allow interfacing with network variables (e.g. voltages, currents, etc)
An __init__.py
file is required in the pydyn directory to make Python treat it as a package.
Generator current injections do not appear to be correct when generator parameters exhibit saliency.
Faults are modelled as high shunt admittances / conductances and use the shunt columns (Gs, Bs) in the PYPOWER case file. This is okay if there are no actual shunts on the bus, but where a shunt exists, then the fault and fault clearing events overwrite the existing shunt values.
Need to fix this.
As of version 5.1, MATPOWER is available under the terms of a 3-clause BSD license and no longer uses the GPLv3. PYPOWER has been updated and released under the same BSD license.
PYPOWER-Dynamics might also be updated to use the BSD license. This would bring it in line with the latest MATPOWER version and with its derived projects.
The switch would allow those unable to work with the GPL license to use PYPOWER-Dynamics and not turn to the older and less capable PyDyn project:
With the exception of PSAT, I am not currently aware of any open source library capable of Small Signal Stability Analysis (SSSA).
Section 7 of "Power System Modelling and Scripting" by Federico Milano includes some useful information and snippets of code.
The eigs function from SciPy provides a convenient interface to ARPACK that would do the hard work.
Does anyone know how to find the eigenvalues for a PYPOWER-Dynamics model?
Add saturation to rotor field current.
In order to get controllers to work with Python 2.7 I had to wrap the replace
operation with a unicode
call in the neg_token
function. I suspect this is a Python 2 only issue and has no effect when using Python 3.
if unicode(x.replace('.','0')).isnumeric() == True:
PYPOWER-Dynamics/pydyn/controller.py
Line 197 in bb90844
Add tests for core functions
In this branch I have been experimenting with a more flexible structure for case data:
https://github.com/rwl/PYPOWER-Dynamics/tree/pypf
I didn't want to have to update all of the OPF functions in PYPOWER so I moved the necessary PF functions into a new pypf package. There is still a dependency on PYPOWER for the remaining functions.
The new case data classes should make it straightforward to add columns for new attributes. By way of demonstration, I committed the 3 phase fault analysis function by @susantoj and added faultMVA
, Rgen
and Xdpp
attributes.
I took the liberty of doing away with the BUS_I
column. The former GEN_BUS
, F_BUS
and T_BUS
columns are now assumed to be the zero-based bus index. This removes the need for ext2int
and int2ext
conversions, but may have some as yet unforeseen downsides. A convert_ppc
function allows PYPOWER case data dicts to be reused and performs the necessary conversions.
The variable yi
is not defined here:
PYPOWER-Dynamics/pydyn/controller.py
Line 126 in 350f779
The fix looks straightforward. I'll send a PR soon.
Hi I have been trying to use pypower dynamics in python3.
So far I have found the following error:
IndexError: only integers, slices (
:), ellipsis (
...), numpy.newaxis (
None) and integer or boolean arrays are valid indices
This happens becase the indices are floats instead of integers. The affected function (there might be more) is
def mod_Ybus(Ybus, elements, bus, gen, baseMVA):
# Add equivalent generator and grid admittances to Ybus matrix
for element in elements.values():
Ye = 0
# 4th/6th order machines and converters
if element.__module__ in ['pydyn.sym_order4', 'pydyn.sym_order6a', 'pydyn.sym_order6b', 'pydyn.vsc_average']:
i = gen[element.gen_no,0]
Ye = element.Yg
# External grid
if element.__module__ == 'pydyn.ext_grid':
i = gen[element.gen_no,0]
Ye = 1 / (1j * element.params['Xdp'])
if Ye != 0:
Ybus[i,i] = Ybus[i,i] + Ye
# Add equivalent load admittance to Ybus matrix
Pl, Ql = bus[:, PD], bus[:, QD]
for i in range(len(Pl)):
S_load = (Pl[i] - 1j * Ql[i]) / baseMVA
y_load = S_load / (bus[i, VM] ** 2)
Ybus[i,i] = Ybus[i,i] + y_load
return Ybus
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.