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

add lines as s_nom_min not s_nom #956

Open
2 tasks done
pz-max opened this issue Jan 11, 2024 · 2 comments · May be fixed by #961
Open
2 tasks done

add lines as s_nom_min not s_nom #956

pz-max opened this issue Jan 11, 2024 · 2 comments · May be fixed by #961
Labels
bug Something isn't working

Comments

@pz-max
Copy link
Member

pz-max commented Jan 11, 2024

Checklist

  • I am using the current main branch or the latest release. Please indicate.
  • I am running on an up-to-date pypsa-earth environment. Update via conda env update -f envs/environment.yaml.

Describe the Bug

Lines are currently added as s_nom. If lines are oversized in a network and can reduce for the optimal case s_nom_opt. 1) deconstructing lines makes no sense (yet) and 2) this can lead to negative objective values.

def _set_lines_s_nom_from_linetypes(n):
# Info: n.line_types is a lineregister from pypsa/pandapowers
n.lines["s_nom"] = (
np.sqrt(3)
* n.lines["type"].map(n.line_types.i_nom)
* n.lines.eval("v_nom * num_parallel")
)

We should probably add lines as s_nom_min

@pz-max pz-max added the bug Something isn't working label Jan 11, 2024
@pz-max
Copy link
Member Author

pz-max commented Jan 11, 2024

@GbotemiB discovered the bug and @davide-f found out about the potential reason

@GbotemiB GbotemiB linked a pull request Jan 18, 2024 that will close this issue
8 tasks
@davide-f
Copy link
Member

As a revision, in the mentioned code, it is ok to define it as s_nom, but it is better to specify s_nom_min in prepare_network.
Actually, we have a section of code that should be doing that but it seems not to be working for some reason.

The code is in the set_transmission_limit function here:

def set_transmission_limit(n, ll_type, factor, costs, Nyears=1):

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

Successfully merging a pull request may close this issue.

2 participants