Skip to content

Commit

Permalink
add dummy generator for glpk
Browse files Browse the repository at this point in the history
  • Loading branch information
lisazeyen committed Mar 7, 2024
1 parent 573cad1 commit 709fd98
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions scripts/prepare_sector_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -1752,6 +1752,19 @@ def adjust_endogenous_transport(n):
"land transport fuel cell": cost_FCE,
"land transport oil": cost_ICE,
}

# add dummy generator only needed for solving with glpk with higher solver tolerance
n.add("Carrier", "dummy transport", color="#dd2e23", nice_name="Dummy transport")
buses_i = n.buses[n.buses.carrier=="land transport demand"].index
n.madd(
"Generator",
buses_i,
" load",
bus=buses_i,
carrier="load",
marginal_cost=1e5,
p_nom=1e9,
)

This comment has been minimized.

Copy link
@FabianHofmann

FabianHofmann Mar 7, 2024

Contributor

can't this be covered by the already implemented load shedding instead?

This comment has been minimized.

Copy link
@lisazeyen

lisazeyen Mar 7, 2024

Author Contributor

Could be, but the costs would need to be adjusted and it should be only applied to land transport nodes, since we want to make sure in the test that everything else is working.

It would be nice to reduce the solver tolerance with glpk to 1e-6 but that does not seem to be possible from the terminal. The thing is that with the endogenous transport we fix the profiles following the transport demand with p_max_pu and p_min_pu which seems to be numeric challenging if there is not an expensive dummy generator


for car_type, cost in costs_car_type.items():
car_i = n.links[n.links.carrier == car_type].index
Expand Down

0 comments on commit 709fd98

Please sign in to comment.