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 in pandapower backend when the generator representing the slack bus is moved #89

Closed
BDonnot opened this issue May 15, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@BDonnot
Copy link
Collaborator

BDonnot commented May 15, 2020

When the generator representing the slack bus in pandapower backend is changed of location (with change_bus) it sometimes lead to issue with negative generation and in most cases the kirchoff's law, as "seen" by grid2op is not verified and the total generation is not enough to sustain the total demand.

The script to reproduce the bug is:

with warnings.catch_warnings():
    warnings.filterwarnings("ignore")
    env = grid2op.make("rte_case14_realistic", test=True)
action = env.action_space({"set_bus": {"generators_id": [(-1, 2)], "lines_or_id": [(0, 2)]}})
obs, reward, done, info = env.step(action)
assert not done
assert np.all(obs.prod_p >= 0.)
assert np.sum(obs.prod_p) >= np.sum(obs.load_p)
p_subs, q_subs, p_bus, q_bus = env.backend.check_kirchoff()
assert np.all(np.abs(p_subs) <= self.tol_one)
assert np.all(np.abs(p_bus) <= self.tol_one)

Correct behavior: this script run without issue.

Current behavior:

assert np.all(np.abs(p_subs) <= self.tol_one)
AssertionError

This problem does not arise with lightsim2grid backend (https://github.com/BDonnot/lightsim2grid). It is likely due to a "ghost" generator being still modeled in pandapower where the slack bus used to be.

@BDonnot BDonnot added the bug Something isn't working label May 15, 2020
BDonnot referenced this issue in BDonnot/Grid2Op May 15, 2020
BDonnot referenced this issue in BDonnot/Grid2Op May 15, 2020
@BDonnot
Copy link
Collaborator Author

BDonnot commented May 19, 2020

Fixed in version 0.9.0.

@BDonnot BDonnot closed this as completed May 19, 2020
BDonnot added a commit that referenced this issue Jul 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant