quintel / etsource

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

Adding change in number of vehicles with change of demand in the model #2970

Closed kaskranenburgQ closed 2 months ago

kaskranenburgQ commented 10 months ago

Fixing the issues as explained in issue #2967 .

mabijkerk commented 8 months ago

Seems to work great, nice work @kaskranenburgQ! I have slightly editing the formatting in the inputs, for consistency. Additionally, I have two questions:

kaskranenburgQ commented 8 months ago

@mabijkerk Thanks for the changes! Regarding your questions:

  1. I will follow your call on this matter, at the moment I don't have enough experience with the AREA attributes to form an opinion about this. I'm not quite sure how and when these attributes are used and I therefore find it difficult to get to a conclusion. Would like to discuss this some time.
  2. I agree with you. I think the efficiency should affect the tkm.
github-actions[bot] commented 6 months ago

This pull request 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 5 months ago

I've tried to implement updating the AREA attribute number_of_xxx when changing the share of certain transport technologies in passenger demand and freight demand, as well as updating this attribute when changing expected yearly change in passenger km or freight kms. The latter is not that straightforward, since transport_useful_demand_passenger_kms and transport_useful_demand_freight_tonne_kms have update_type = %y. Therefore, the following gives very strange results in the updated AREA attribute:

EACH(
      UPDATE(V(transport_useful_demand_passenger_kms), preset_demand, USER_INPUT()),
      UPDATE(V(transport_useful_demand_cars), number_of_units, USER_INPUT()),
      UPDATE(V(transport_useful_demand_busses), number_of_units, USER_INPUT()),
      UPDATE(
        AREA(),
        number_of_cars, 
        V(transport_useful_demand_cars, number_of_units)
      ),
      UPDATE(
        AREA(),
        number_of_busses, 
        V(transport_useful_demand_busses, number_of_units)
      )
    )

AREA(number_of_cars) --> 1.4e242 AREA(number_of_busses) --> 8.7e147

Some questions / solutions:

Already discussed with @kaskranenburgQ. @mabijkerk what do you think is the best way?

mabijkerk commented 5 months ago

Some thoughts:

Other possibility is to change the input type of change in passenger km or freight km to not indicate the expected change per year, but the overall change between start and future year... And then change this query accordingly.

We have recently implemented this change for industry efficiency inputs. The upside of % per year is that it is an assumptions that can be maintained across scenarios. 2% per year is the same for a scenario with end year 2030 as it is for 2050. The downside is that the absolute change is a bit harder to the determine. Switching to % absolute change requires a migration for all relevant inputs, which is why it is not my preferred solution.

kndehaan commented 5 months ago

I've restructured the inputs of % annual change of demand passenger kms and demand freight tonne kms, as well as the inputs for share cars and busses in total passenger km fleet and share trucks and busses in total freight tonne km fleet.

With these changes, the effect of either or both % annual change and modal split are updated once. In order to calculate the result of annual % change, two new GQL functions are added to ETEngine.

@mabijkerk @kaskranenburgQ can you both have a look at these changes and see if it works as desired?

Goes with:

Next step (when PR is approved):

kndehaan commented 2 months ago

I will rewrite to issue since the implementation of the fix is larger than initially expected.

kndehaan commented 2 months ago

More effort is required to solve this issue, therefore this PR will be closed and proposed next steps are described in this issue https://github.com/quintel/etsource/issues/2967