Skip to content

multi_investment_periods causes sector study to crash #583

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

Closed
2 tasks done
trevorb1 opened this issue Mar 27, 2025 · 0 comments
Closed
2 tasks done

multi_investment_periods causes sector study to crash #583

trevorb1 opened this issue Mar 27, 2025 · 0 comments
Labels
bug Something isn't working Sector Sector Coupling Issue

Comments

@trevorb1
Copy link
Collaborator

Checklist

  • I am using the current master branch
  • I am running on an up-to-date pypsa-usa environment. Update via conda env update -f envs/environment.yaml

The Issue

In solve_network there is an option that sets...

kwargs["multi_investment_periods"] = config["foresight"] == "perfect"

This is needed (as elaborated in PR #581), however, running sector studies with this causes it to crash with the error below. I believe the origin of the issue has to due with the non-road transport LPG buses (ie. air, boat, and train). But I havent managed to track down the exact cause.

Relates to issue #428

Steps To Reproduce

No response

Expected Behavior

No response

Error Message

Traceback (most recent call last):
  File "/home/trevor/master/pypsa-usa/workflow/.snakemake/scripts/tmp7j1x2iw6.solve_network.py", line 1748, in <module>
    n = solve_network(
        ^^^^^^^^^^^^^^
  File "/home/trevor/master/pypsa-usa/workflow/.snakemake/scripts/tmp7j1x2iw6.solve_network.py", line 1685, in solve_network
    status, condition = n.optimize(**kwargs)
                        ^^^^^^^^^^^^^^^^^^^^
  File "/home/trevor/miniforge3/envs/pypsa-usa/lib/python3.11/site-packages/pypsa/optimization/optimize.py", line 615, in __call__
    return optimize(self._parent, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/trevor/miniforge3/envs/pypsa-usa/lib/python3.11/site-packages/pypsa/optimization/optimize.py", line 578, in optimize
    m = create_model(
        ^^^^^^^^^^^^^
  File "/home/trevor/miniforge3/envs/pypsa-usa/lib/python3.11/site-packages/pypsa/optimization/optimize.py", line 284, in create_model
    define_nodal_balance_constraints(
  File "/home/trevor/miniforge3/envs/pypsa-usa/lib/python3.11/site-packages/pypsa/optimization/constraints.py", line 605, in define_nodal_balance_constraints
    raise ValueError("Empty LHS with non-zero RHS in nodal balance constraint.")
ValueError: Empty LHS with non-zero RHS in nodal balance constraint.

Anything else?

No response

@trevorb1 trevorb1 added bug Something isn't working Sector Sector Coupling Issue labels Mar 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Sector Sector Coupling Issue
Projects
None yet
Development

No branches or pull requests

1 participant