• 137 views | 3 messages Discussion: LEAP
    Topic: Inheritance and interpSubscribe | Previous | Next
  • Johannes Eckstein 2/19/2021

    Hi all,

    I am struggling with inheritance and timeseries implementation. Maybe there is a simple solution and I just don't know the function.

    In a nutshell, I have two scenarios for non-energy emissions. One acts on a key account variable which is linked to emissions. The second scenario inherits from this first scenario and I want to change emissions directly, but at a later year.

    Eg like this:
    emissions = factor*activity

    Scenario 1 changes the factor by interpfsy(2020;X;2024;Y)
    Scenario inherits and should change emissions starting in 2022, setting them to 0 in 2030.

    So it could be something like emissions=interp(take what is there until 2022; 2030;0). I could enter the data manually, but then I would have to this again if factor or activity changes. Is there something like interp(2019;self;20221;self;2022;self;2030;0) or similar?

    The model start in 2019.

    Many thanks in advance!

    Johannes

    Edit: I found the set of functions that are required and provide the functionalities. Check functions like Value, ScenarioValue, and those linked there. Thanks for implementing this in such an easy LEAP-ish way!

  • Charlie Heaps 2/28/2021
      Best Response

    Bear in mind that the expressions are used to enter data expressions for the activity levels, energy intensities and emission factors, so you cannot simply specify the total emissions: they are calculated. Not sure if that was already clear.

    You could make use of the If and ScenarioValue functions to write an expression that makes values depend on those in another scenario (e.g. one named Baseline). Something like this:

    If(year< 2022,
    ScenarioValue(Baseline),
    Interp(2022, ScenarioValue(Baseline), EndYear, 0)
    )

    Hope this helps!

    Charlie

  • Johannes Eckstein 3/5/2021
      Best Response

    Thanks Charlie, this was useful. I've been using the if-year construct since.