• 377 views | 8 messages Discussion: LEAP
    Topic: Link WEAP and LEAP: a conflict on data time sliceSubscribe | Previous | Next
  • Jiefeng Kang 4/12/2016

    276 Views

    Hi all,
    I am trying to link LEAP with WEAP. The time slice set in the models are both "month", then WEAP can read data from LEAP, and LEAP can get data from LEAP. However, I found that when LEAP get data from WEAP, it can only get and show the first month data of WEAP, and leave the data of othere month alone...

    For example, the year 2015 data output from WEAP is:
    Jan: 1.00
    Feb: 2.21
    ...
    Dec: 5.32

    Because the result shown in LEAP is yearly data, so what I want is that LEAP should read the WEAP output and sum up the data of all month.

    However actually, WEAP only get the data of January.

    Of course I can aggregate the monthly data and set the time slice by year instead of month. But I would lose a lot of information in that way.
    How can I solve the problem?

    P.S. My e-mail box if necessary: kangjf1943@163.com or kangjf1943@outlook.com
    Thanks anyone with kind help :D
  • Taylor Binnington 4/15/2016
      Best Response

    275 Views

    Hi Jie-feng,

    Are you attempting to write a variable reference to WEAP's monthly value into a time-sliced variable in LEAP? If the variable in LEAP in which you create the reference is not time sliced, then LEAP will interpret the first number in the time series as the value for the whole year.

    Currently there is no automatic way to aggregate time-sliced variables from WEAP into non-time-sliced LEAP variables. I would suggest that you first create an auxiliary variable in WEAP which performs the aggregation, and reference this sum using LEAP.

    Sorry for any inconvenience. We hope to improve upon this feature in the coming months.

    Taylor

  • Jiefeng Kang 4/18/2016
      Best Response

    255 Views

    Hi Mr. Taylor Binnington,
    Thank you for your reply, it seems to be helpful! But I am a little confused about the operation, you mean I can build a variable (let's call it "A") in WEAP, then aggregate the value of time-sliced-variable "B" (let's say B value is divided in months), is it right?
    If so, to my knowledge, the "A" is also time sliced, because I can only set the "time slice" for the whole WEAP model, but not for the individual variable (is it right?), how can I set "A" as the sum of "B"?

    Thanks! :)

    KANG
  • Jiefeng Kang 4/18/2016
      Best Response

    254 Views

    More information:

    And the variable I set in LEAP is also time sliced.
    Both the time slice of LEAP and WEAP model are set as 12 months, so that they can be linked.
  • Taylor Binnington 4/19/2016
      Best Response

    253 Views

    Hi Jie-Feng,

    Yes - your summary is correct. But it isn't necessary to use a time-sliced variable "A" in WEAP - instead, you would use one which holds a single value for each year. For additional help on how to do this in WEAP, please use the WEAP forums:

    http://www.weap21.org/forum

    In LEAP, you would then use an expressions like this, to get the appropriately aggregated value:

    WEAPValue(path\to\WEAP\variable:A)

    I'm not quite sure what you mean in your second posting: that your LEAP variable is also time-sliced. Aren't you attempting to write in an annual value to LEAP, not a group of sub-annual values?

    Taylor




  • Jiefeng Kang 4/20/2016
      Best Response

    207 Views

    Hi Taylor,
    I have also tried that before: to set the time slice of each year in WEAP into "1" which means I use the annual variable instead of sub-annual variable in WEAP. However, when I try to link LEAP with WEAP, the time slice of one model doesn't match with each other (you know, to link the two model, you need to match the years/area/ scenarios/time slice).
    Is it possible that it is due to computer system/model version (I am using the latest version of WEAP and LEAP)?
    Thank you for your help!
  • Taylor Binnington 4/28/2016
      Best Response

    205 Views

    Hi Kang,

    I'm afraid I might have confused you. You should not be redefining the time slices in your WEAP model. You are correct that the time slices used in LEAP and in WEAP must be the same in order for the two pieces of software to speak to one another.

    In your WEAP model, you should simply calculate the appropriate annual sum using the values in each time slice from another variable. The result will be a variable "A" in WEAP which contains a single number (not a set of different numbers for each time slice). If you need to refer to this variable from LEAP, you would then write an expression in LEAP similar to the example that I included in my post above.

    You can use WEAP to calculate a sum across time slice values for a particular variable using the PrevTSValue() function, which you can read about on p. 160 of the user guide:

    http://www.weap21.org/downloads/WEAP_User_Guide.pdf

    For additional help with this function, please use the WEAP forums.

    Hope this helps,

    Taylor
  • Jiefeng Kang 7/6/2016
      Best Response

    48 Views

    Hi Taylor,
    sorry for the late reply. Thank you very much for your answer, I am now trying to get some detailed data so that I can match the structure of the two model. Thanks!��šD