quintel / etsource

Data source for the Energy Transition Model
https://energytransitionmodel.com/
MIT License
13 stars 8 forks source link

Number of vehicles does not change with modal split #2967

Open mabijkerk opened 11 months ago

mabijkerk commented 11 months ago

Background For a cars, buses, vans and trucks we calculate the number of units. This is mainly done to determine the available storage volume for the electric variants. For example, for cars it works like this, the transport_useful_demand_cars node gets the number_of_units assigned in the start year:

~ number_of_units = AREA(number_of_cars)

The transport_car_using_electricity the determines its number of units using the inheritable number of units group, which simply takes the share of electric cars and multiplies it with the number of units for all cars.

- groups = [inheritable_nou, ...]

If the share of electric cars in the mix of cars is changed, automatically the number of electric cars will change as well, through the interitable_nou group. You can query this:

EACH(
  V(transport_car_using_electricity,number_of_units),
  V(transport_useful_demand_cars,number_of_units),
  INPUT_VALUE(transport_car_using_electricity_share)
)

[
  4,265,500.0,
  8,531,000.0,
  50.0,
]

Problem The problem is that if the modal split of cars in the total passenger transport is changed, the total number of cars does not change. This means that if I change transport_cars_share or if I change the total passenger demand transport_useful_demand_passenger_kms, the number of cars will stay at 8,531,000.0.

Goal For cars and buses their number of units need to scale with the change in passenger transport demand and with their share in the modal split for passenger transport. For vans and trucks their number of units need to scale with the change in freight transport demand and with their share in the modal split for freight transport. This means that we need to adjust the following inputs to also update the relevant number of units:

github-actions[bot] commented 9 months ago

This issue has had no activity for 60 days and will be closed in 7 days. Removing the "Stale" label or posting a comment will prevent it from being closed automatically. You can also add the "Pinned" label to ensure it isn't marked as stale in the future.

kndehaan commented 4 months ago

Some effort and discussion has been put into solving this issue (see https://github.com/quintel/etsource/pull/2970), however more effort is required than initially expected. The solutions consist of the following steps:

  1. Update inputs as specified by Mathijs so that number_of_units of cars, busses, trucks and vans are updated, minding to check / set priority correctly
  2. The area attribute number_of_xxx should be updated with the newly calculated number_of_units

Part 1 is relatively easy, however implementing part 2 in the useful demand inputs specifically is more complicated due to its update_type = %y. This results in strange numbers of updating the area attribute.

Proposed solution: we can write new GQL that works similar as the update_type = %y functionality and use the new GQL to get rid of the update_type functionality. An effort to create this GQL has been done here, however when writing new GQL there are other things to consider as well (new spec should be written, testing, other relevant actions(?), documentation).