8000 Issue with reading PSSE transformers · Issue #337 · SanPen/GridCal · GitHub
[go: up one dir, main page]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with reading PSSE transformers #337

Open
jahanbani opened this issue Feb 17, 2025 · 1 comment
Open

Issue with reading PSSE transformers #337

jahanbani opened this issue Feb 17, 2025 · 1 comment
Assignees

Comments

@jahanbani
Copy link
Contributor
jahanbani commented Feb 17, 2025

This issue is more of a resiliency of the code issue rather than a bug. I am working with real network data and there are situations that the following happens:

Image

The code throws an error on line 421 of raw_to_gridcal.py
elif psse_elm.VMA2 != 0:
In reality, this line of code should have not been compiled. However, since there is a data entry issue (highlighted yellow in the picture), the code eaches line 421 and throws TypeError: '>' not supported between instances of 'NoneType' and 'int'

This is more of a code resiliency which would help in adoption of the code by industry.

Potential Fix:
Maybe a try, except and then if except, we check which winding has NPT>0?

Another issue that may arise with the data of two-winding transformer is as follows:

Image

This will throw the following error:
GridCal\src\GridCalEngine\IO\raw\devices\transformer.py:1255, in RawTransformer.get_2w_pu_impedances(self, Sbase, v_bus_i, v_bus_j)
1252 I0 = I0 * Sn / Sbase # try?
1253 zm = 1.0 / (I0 / 100.0)
-> 1255 inside_sqrt = (-zm ** 2 * rm ** 2) / (zm ** 2 - rm ** 2)
1256 if inside_sqrt > 0:
1257 xm = np.sqrt(inside_sqrt)

ZeroDivisionError: float division by zero

This condition happens when the transformer's magnetizing parameters (its no‐load losses and no‐load current, as given by MAG1 and MAG2) are such that the computed shunt resistance and reactance are equal in magnitude. When that happens, the denominator becomes zero and the division fails.

@SanPen
Copy link
Owner
SanPen commented Feb 18, 2025

Hi,

It would be super helpful if you could attach a simple .raw file just with the transformers that cause trouble. This way I can create testing for those.

@SanPen SanPen self-assigned this Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0