-
Notifications
You must be signed in to change notification settings - Fork 119
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
Using a generator as the slack bus in Grid2Op Environment's PandaPower BackEnd #617
Comments
Hello, Thanks for reporting this bug. I'll try to fix it asap. You seems to be correct, there appears to be an error in the way pandapower backend handles slack. |
Hello again, So after lots of investigation:
I'll try to see if there is something elegant to avoid this issue that is an issue (thermal limit are set AFTER the env is created in the make function, so grid2op does not know, when the powerflow is being run, that the thermal limit should not be used yet)... Anyway... Thanks for noticing these bugs :-) A fix will be available in the next release and hopefully by the tomorrow evening if you install from source from the |
Hi again :) This should be solved if you install the development grid2op version:
Hopefully i'll be able to release the 1.10.3 version this week. Most likely the next one (i still have some things I want to include in this release) |
Thank you for fixing this! |
Environment
1.10.2
windows
3.11.9
Bug description
When creating a custom environment (without chronics) using the PandaPower backend will throw an index error if one of the generators has
slack=True
. The work-around right now is to use an ext_grid element as the slack.This happens because in Lines 354-439 of pandaPowerBackend.py we have:
Hence if no slack gen is present, we use self._iref_slack to index the slack bus. (note: iref is None is always True if we reach that line, since it is defined as i_ref = None a few lines earlier (line 353).
However if a slack gen is present, then self.slack_id is used instead. This causes problems inside the powerflow (runpf(...)), line 1161:
Since in this scenario (where there is a gen with slack = True) _iref_slack is still None and will throw an index error.
How to reproduce
Current output
Expected output
No output expected (environment successfully initializes).
Suggest Fix
Change Line 1161 in pandaPowerBackend.py to:
Note: in the above minimal example this fix does not seem to work (power flow does not converge due to an 'isolated bus'). I am unsure why, since there is no issue running it inside PandaPower directly:
However using an external grid element instead of a generator with slack=True seems to work so will use that as a workaround for now. One of the built-in environments 'rte_case14_realistic' does have a slack=True gen and does work, hence there is likely more to this issue.
The text was updated successfully, but these errors were encountered: