-
Notifications
You must be signed in to change notification settings - Fork 249
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
Endogenous transport #960
base: master
Are you sure you want to change the base?
Endogenous transport #960
Conversation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
…-eur into endogenous-transport
…o endogenous-transport
I was experimenting a little bit with this branch since it would be a nice addition to a project I'm working on right now. First of all, thanks a bunch for this work! I sometimes ran into feasibility issues, which after having a look at an irreducible set of constraints I tracked down to fixed profiles of the transport links in this PR. Have a look at the IIS:
The problem seems to be that, due to numerical inaccuracy, the existing EV capacity which has to run due to the fixed p_min_pu/p_max_pu profile is ever so slightly larger than the set load, leading to infeasibility. I had turned off the penalty generation or and negative load generators for this; that would probably solve the problem too. A fix that also worked for me is allowing old vehicles to be phased out: @@ -81,6 +81,18 @@ def add_brownfield(n, n_p, year):
c.df[f"{attr}_nom"] = c.df[f"{attr}_nom_opt"]
c.df[f"{attr}_nom_extendable"] = False
+ # Allow the model to phase out vehicles early if needed to avoid infeasibility
+ transport_carriers = [
+ "land transport oil",
+ "land transport fuel cell",
+ "land transport EV",
+ "BEV charger",
+ "V2G",
+ ]
+ vehicle_i = c.df.index[c.df.carrier.isin(transport_carriers)]
+ c.df.loc[vehicle_i, f"{attr}_nom_max"] = c.df.loc[vehicle_i, f"{attr}_nom"]
+ c.df.loc[vehicle_i, f"{attr}_nom_extendable"] = True
+
n.import_components_from_dataframe(c.df, c.name)
Maybe this a reasonable approach for making the transport sector more obviously feasible / solvable from an optimisation perspective? On the other hand, if you think dummy generators are more elegant, I'm sure that solves more problems too. |
@koen-vg I am not sure what the best way is. I am currently having an additional load shedding generator and extended the clipping in the config to avoid numerical problems. Allowing earlier phase outs is an option as well, my suspicion is that one get's a too quick transition of the car fleet if you allow for an earlier phase-out. One could also think about only fixing the profiles of EVs and H2 fuel cell cars and letting the internal combustion cars without a profile. |
@lisazeyen |
I can see what I get in terms of phase-outs and if this is a real problem. If I understand it correctly, the model could actually gain money by "selling off" (i.e. phasing out) vehicles, and so one thing that would surely be needed would be to set the capital cost of vehicles that can be phased out to zero or even something negative so that it's costly to phase vehicles out directly. However, this would result in some annoyance when analysing the network afterwards since this cost data will technically be wrong. Maybe one could even reset the capital cost again afterwards / before analysis. In principle, if it turns out that it's cost effective to switch very quickly to EVs even though there's significant capital cost (and sunk cost in terms of ICE vehicles) tied to that, that's an interesting result in its own right? |
(By the way, feel free to have a look at and use my fork of this branch where I merged the latest master branch, including multiyear support. I haven't been able to test it in much detail but it more or less seems to work: https://github.com/koen-vg/pypsa-eur/tree/endogenous-transport) |
Hi! I think this is a great feature, and was wondering what might be needed to get this merged? I was just having a quick look at the merge conflicts and it seems that the master branch is diverging more and more from this PR. There is still the issue that this PR works with transportation demand in distance driven (which makes sense for comparing different types of cars, but creates "downstream" problems with plotting, summaries, etc. which assume energy units), whereas the master branch uses an energy demand. It looks like the handling of IDEES and Eurostat data on transportation has also been updated in the master branch while this PR is a bit different. I'd be happy to have a go at pushing this PR to completion if there's a clear idea of where to go with it :) We might then consider if it makes sense to try to merge master into this branch, or just start with a clean slate and extract the relevant parts. |
Changes proposed in this Pull Request
endogenise land transport
TODO
Checklist
envs/environment.yaml
.config.default.yaml
.doc/configtables/*.csv
.doc/release_notes.rst
is added.