Skip to content

Issue with reading PSSE transformers #337

Open
@jahanbani

Description

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions