sogno-platform / pyvolt Goto Github PK
View Code? Open in Web Editor NEWState-estimation and powerflow in Python
License: Apache License 2.0
State-estimation and powerflow in Python
License: Apache License 2.0
At the end of this quickstart example script, the calculated voltage values are compared with precalculated references.
However, doing an assertion of complex floats is not a good idea and usually fails because of numerical tolerances.
So I'd suggest to do the following:
voltages_ref = [(1-7.970485900477431e-27j), (0.9521818868802214-0.11692768153747995j),
(0.9642955926931457-0.09862127081290231j), (0.8796973782245792-0.15318580971335868j),
(0.8758799767843979-0.1554670528853566j), (0.8774339089327876-0.1545390713879984j),
(0.8704521134131005-0.1574589214738466j), (0.8719578342107204-0.15661905676450852j),
(0.8731024990161087-0.1561497673751958j), (0.8727417602545003-0.15623359013901236j),
(0.8740410220986286-0.1565630049874985j), (0.9563016474701451-0.09917826765833906j),
(0.9592141716734833-0.09896267637101246j), (0.8702137462858025-0.15760036065945185j),
(0.9239489705253996-0.13105032262255972j)]
epsilon = 1e-4
assert ([val-epsilon for val in voltages] <= voltages_ref <= [val+epsilon for val in voltages]), \
"Results do not match reference results."
Please let me know if I should push that change.
Currently, almost all quickstart and validation examples are broken, because they depend on different (old) versions of the cimpy package.
This should be fixed.
As a reference, the most recent master branch version of the cimpy package should be used:
https://github.com/cim-iec/cimpy
When a branch of type PowerTransformer is created, there is a bug in the function _get_primary_connection. This function shoud not return the PowerTransformerEnd with the higheist nominal voltage but also the PowerTransformerEnd with r>0 and x>0. Independently of the nominal voltage of the PowerTransformerEnd, the parameters x, r can be equal to zero, which results in a singular admittance matrix.
If the underlying CIM data is reloaded ( using function network.System.load_cim_data(...) ), the power flow algorithm fails because the network model is not created properly in this case.
Describe the bug
Installing the Pyvolt package in an up-to-date environment and executing one of the example scripts leads to an error.
This is caused by changes in Numpy that has removed support for numpy internal datatypes (np.int, np.complex etc.) and replaced them with Python default datatypes.
To avoid this problem in the future Versions should be pinned.
While at it the project could/should be transitioned to the currents standard of PEP621 for project metadata (see e. g. Setuptools explaination
To Reproduce
Steps to reproduce the behavior:
If a node inside the network typology is an instance of BusType.PV, the powerflow algorithm either produces abstruse results or does not converge at all.
According to file network.py, a node is declared as "PV" type if at least one synchronous machine is connected to it:
Lines 324 to 331 in e42d566
I am aware of the ToDo remark, so please don't get me wrong...
So, I checked the code in nv_powerflow.py and I am wondering about the following (unfortunately, I don't know the working principle of the algorithm in detail):
Lines 6 to 83 in e42d566
And by the way, if I set a node containing a synchronous machine to type "PQ" instead of "PV", the algorithm seems to work properly.
But this is most certainly not the way to go, I guess...
Best regards,
Sebastian
Problem description
While using the algorithm of the state estimation our developement team noticed something unusual in the behaviour of the function.
Two behaviours occured with our input:
To Reproduce
Build an example like this one but instead of the Voltage magnitude and phase input provide in input Voltae magnitude(MeasType.V_mag), active and reactive power.
Expected behavior
Return a state of all the input grid with relevant values trough the Result class included in the pyvolt.result module, where all nodes and branches informations after estimation are contained.
Additional context
The issue has already been discussed with Jan Dinkelbach, member of the community, who gave to the team support and noticed that this behaviour is not normal and could be fixed.
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.