pypsa-eur icon indicating copy to clipboard operation
pypsa-eur copied to clipboard

Review endogenous transport

Open lisazeyen opened this issue 1 year ago • 6 comments

Closes # (if applicable). This PR is a review of PR #734

Changes proposed in this Pull Request

Checklist

  • [ ] I tested my contribution locally and it seems to work fine.
  • [ ] Code and workflow changes are sufficiently documented.
  • [ ] Changed dependencies are added to envs/environment.yaml.
  • [ ] Changes in configuration options are added in all of config.default.yaml.
  • [ ] Changes in configuration options are also documented in doc/configtables/*.csv.
  • [ ] A release note doc/release_notes.rst is added.

lisazeyen avatar Nov 16 '23 15:11 lisazeyen

@martavp @s8au I was wondering if it makes more sense to modify the script build_transport_demand.py to take the demand from the energy totals and not convert it already for EVs. I guess, that would make the script more understandable because the efficiencies are more intuitive. Also, when building the transport demand there are already correction factors e.g. for efficiency gains and heating of EVs, which you don't want to assume for internal combustion cars. Have you thought about doing this or was there a reason not to do it?

lisazeyen avatar Nov 17 '23 14:11 lisazeyen

My initial idea was to maintain the exogenous option as it is now (before this PR). Then, the land transport demand is always in units of MWh_electricity that are needed and the efficiencies take into account the type of vehicle (e.g. if it is an ICE you need to consume additional MWh_oil due to the low efficiency of the ICE). This would compensate for the efficiency_gain but I overlooked the temperature dependence correction

My summary of how I see it now.

(A) LAND TRANSPORT DEMAND EXPRESS IN MWh_elec [+] Exogenous code does not change, i.e. same calculation in build_transport_demand.py for exogenous and endogenous [-] Efficiency for VE=1 but Efficiency for ICE and Fuel cell can be counterintuitive

(B) LAND TRANSPORT DEMAND EXPRESS IN MWh_oil [+] Efficiency for VE=efficiency_gain, efficiency_for_ICE=1, efficiency_for_H2=efficiency_gain_for_H2 (to be calculated) [- ] Different calculation in build_transport_demand.py for exogenous and endogenous. In the first case, it will be expressed in MWh_elec while in the second in MWh_oil

At this point, after having realised that efficiency definitions are indeed counterintuitive and that the build_transport_demand needs to be modified anyway because the temperature dependence only applies to the EVs, I think option (b) is better.

What do you think @s8au ?

martavp avatar Nov 20 '23 08:11 martavp

My initial idea was to maintain the exogenous option as it is now (before this PR). Then, the land transport demand is always in units of MWh_electricity that are needed and the efficiencies take into account the type of vehicle (e.g. if it is an ICE you need to consume additional MWh_oil due to the low efficiency of the ICE). This would compensate for the efficiency_gain but I overlooked the temperature dependence correction

My summary of how I see it now.

(A) LAND TRANSPORT DEMAND EXPRESS IN MWh_elec [+] Exogenous code does not change, i.e. same calculation in build_transport_demand.py for exogenous and endogenous [-] Efficiency for VE=1 but Efficiency for ICE and Fuel cell can be counterintuitive

(B) LAND TRANSPORT DEMAND EXPRESS IN MWh_oil [+] Efficiency for VE=efficiency_gain, efficiency_for_ICE=1, efficiency_for_H2=efficiency_gain_for_H2 (to be calculated) [- ] Different calculation in build_transport_demand.py for exogenous and endogenous. In the first case, it will be expressed in MWh_elec while in the second in MWh_oil

At this point, after having realised that efficiency definitions are indeed counterintuitive and that the build_transport_demand needs to be modified anyway because the temperature dependence only applies to the EVs, I think option (b) is better.

What do you think @s8au ?

@martavp @s8au I agree option B is better. But I was rather thinking getting the actual energy demand by dividing the JRC-IDEES by the average fuel efficiency in the build_transport_demand script and calculating out the temperature correction (see last commit). This should be done for the exogenous and the endogenous case. The way it is done currently is simply wrong also for the exogenous case with the temperature correction if we have a share of combustion cars.

Then, in the prepare_sector_network take efficiencies of the corresponding car type (so ICE would be average fuel efficiency), assume correction for heating and cooling depending on the car type (I guess for fuel cells I would assume the same as for internal combustion cars, since the efficiency losses for heating are probably also smaller than for EVs since they also combust the fuel).

lisazeyen avatar Nov 20 '23 08:11 lisazeyen

But I was rather thinking getting the actual energy demand by dividing the JRC-IDEES by the average fuel efficiency in the build_transport_demand script and calculating out the temperature correction (see last commit). This should be done for the exogenous and the endogenous case.

I agree. Then, the land_transport_demand is always in MWh of propulsion or mechanical energy, both for the endogenous and the exogenous

The way it is done currently is simply wrong also for the exogenous case with the temperature correction if we have a share of combustion cars.

Yes, you are right.

martavp avatar Nov 20 '23 09:11 martavp

(B) LAND TRANSPORT DEMAND EXPRESS IN MWh_oil [+] Efficiency for VE=efficiency_gain, efficiency_for_ICE=1, efficiency_for_H2=efficiency_gain_for_H2 (to be calculated) [- ] Different calculation in build_transport_demand.py for exogenous and endogenous. In the first case, it will be expressed in MWh_elec while in the second in MWh_oil At this point, after having realised that efficiency definitions are indeed counterintuitive and that the build_transport_demand needs to be modified anyway because the temperature dependence only applies to the EVs, I think option (b) is better. What do you think @s8au ?

@martavp @s8au I agree option B is better. But I was rather thinking getting the actual energy demand by dividing the JRC-IDEES by the average fuel efficiency in the build_transport_demand script and calculating out the temperature correction (see last commit). This should be done for the exogenous and the endogenous case. The way it is done currently is simply wrong also for the exogenous case with the temperature correction if we have a share of combustion cars.

Then, in the prepare_sector_network take efficiencies of the corresponding car type (so ICE would be average fuel efficiency), assume correction for heating and cooling depending on the car type (I guess for fuel cells I would assume the same as for internal combustion cars, since the efficiency losses for heating are probably also smaller than for EVs since they also combust the fuel).

I agree, we need to take the temperature dependence of the different vehicle types into account. Regarding the implementation, I think it may be clearer to calculate the correction factors in the build_transport_demand because. From what I can see, it requires a few variables that are calculated with the functions there, so that way we do not do the calculation for cooling/heating dependencies two times in different scripts. Although we probably would have to save two files for the transport_demand then. What do you think @lisazeyen?

s8au avatar Nov 20 '23 15:11 s8au

I would just import the functions to calculate the temperature correction from the build_transport_demand script to prepare_sector_network and do the corrections there. Then it should be just one line getting the correction. You basically can adjust the efficiencies of the links depending on the temperature correction

lisazeyen avatar Nov 20 '23 16:11 lisazeyen