UGM-EPSLab / matpowercaseframes

Parse MATPOWER case into pandas DataFrame.
Other
5 stars 2 forks source link

some cases have different units and are not correctly read by CaseFrames #3

Closed salvapineda closed 4 months ago

salvapineda commented 7 months ago

Hi, Some cases like case16am.m (https://github.com/MATPOWER/matpower/blob/master/data/case16am.m) have the impedance un ohm instead of p.u. If you read this case with matpower, there is no problem, because the final lines in the file case16am.m changes the units. However, if you read the file using CaseFrames these last lines are not read, and you will operate with the impedances in omhs instead of p.u. Not sure if there is an easy fix for that. In any case, thanks a lot beforehand. Salva.

yasirroni commented 4 months ago

Hi @salvapineda. Sorry, please mention me to make me notice about any problems. I will try to look at it later.

yasirroni commented 4 months ago

Solution, use matpower-pip for the data and utilize loadcase as it is the most intended way of loading matpower case. Maybe, I will make a PR to use this as the default behavior:

from matpower import start_instance
from matpowercaseframes import CaseFrames

m = start_instance()

CASE_NAME = f"case16am.m"
mpc = m.loadcase(CASE_NAME)  # this will run ohm to p.u. convertion
cf_16am = CaseFrames(mpc)
cf_16am.branch
yasirroni commented 4 months ago

Added feature to use loadcase in https://github.com/UGM-EPSLab/matpowercaseframes/pull/7.