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

gridcal2rec.py - with GridCode >4. e.g. 5.1.8 #2

Open
jodoka23 opened this issue May 20, 2024 · 0 comments
Open

gridcal2rec.py - with GridCode >4. e.g. 5.1.8 #2

jodoka23 opened this issue May 20, 2024 · 0 comments

Comments

@jodoka23
Copy link

Hi Guy's
Thank you for your great work! I work a lot in modeling, validation mainly with commercial tools like PowerFactory.
As a hobbyist, I was always looking for open source alternatives.
This is my first GIT feedback. If I made something wrong please let me know :)

I found some Issues regarding pf2rec/gridcal2rec.py together with the newest GridCal Version 5.1.8.

#1 Transformer Type Line 187

         if str(branch.branch_type) == 'transformer':

should be

        if str(branch.type_name) == 'transformer':

#2 add values to buses
change:

    if re.search(r"3.\d.\d", __VERSION) or __VERSION == '4.0.0':
        pf_S_bus_results["P [MW]"] = np.real(pf.results.Sbus * grid.Sbase)
        # Adding reactive power to the buses
        pf_S_bus_results["Q [MVAR]"] = np.imag(pf.results.Sbus * grid.Sbase)
    elif re.search(r"4.\d(.\d)*", __VERSION):
        # For version 4 of GridCal, power is already given in MW and MVar
        pf_S_bus_results["P [MW]"] = np.real(pf.results.Sbus)
        pf_S_bus_results["Q [MVAR]"] = np.imag(pf.results.Sbus)

to

  # For version >4 of GridCal, power is already given in MW and MVar
  pf_S_bus_results["P [MW]"] = np.real(pf.results.Sbus)
  pf_S_bus_results["Q [MVAR]"] = np.imag(pf.results.Sbus)

#3 bus names line 453

df_bus = pd.DataFrame(index = grid.bus_names, columns = headers)

should be

  df_bus = pd.DataFrame(index = grid.get_bus_names(), columns = headers)

There maybe also other problems. If I find more solutions I will let you know.

best Regards

Johannes

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

1 participant