How to extract desired time series data from an element?

Answered

Comments

5 comments

  • Avatar
    Jason

    Hafiz,

    Thank you for posting in our Forum! This is a good question and possibly one that others will benefit from. I would suggest that you consider using a submodel. But before we go into specifics, do you mind explaining a bit more about your modeling requirements? I see that you are running the first calendar year deterministic. Do you need to start the next year knowing the final value results of the first year or will you need time history output available for the next year. Also, you mentioned the second year is an optimization run. Are you running the second year probabilistically? Also, is the optimization for the final values of the 2nd year (occurring at the end of the run)? Or are you trying to optimize values on a daily basis? Thanks for your clarification and patience.

    Jason 

    0
    Comment actions Permalink
  • Avatar
    Hafiz Faizan Ahmed

    Hi Jason, 

    Thank you for your response. My concern using a sub-model is that I don't want to run the model for a different timestep, I just want to save the results for a shorter time period in a new element. I am not 100% sure how sub-model works though. 

    Yes, the second year run will be based on the output of first year. In fact, every next day simulations are based on the output of previous day. You can tale changes in soil moisture as an example. The second year will still be run by deterministic modelling approach. I am trying to optimize the parameters based on daily values. 

    Let me know if you have any other questions or need any clarification. 

    Hafiz

    0
    Comment actions Permalink
  • Avatar
    Jason

    Hafiz,

    I would consider finding the expression in your model that represents the objective function (i.e. Revenue, Risk, Water_Supply, etc.). Refer to this in a Selector element. Add a condition to your Selector such as:

    IF:

    datetime >= "01/01/2018" --> THEN --> {refer to the objective function here}

    ELSE: 0.0

     

    Something like this might work just fine. It will ignore anything that happens prior to 01 Jan 2018 but include everything thereafter. Might that work for you?

    -Jason

    0
    Comment actions Permalink
  • Avatar
    Hafiz Faizan Ahmed

    No, this wont work, I have tried it. The objective function involves in taking the mean of the time series as well as (Observations-Simulations)^2. Assigning a zero value by using an if-else script negatively influences the objective function. Ideally, if I could assign a NaN (not a number) or just empty cell, that might have worked but GoldSIm does not allow it. 

    0
    Comment actions Permalink
  • Avatar
    Jason

    Hafiz,

    Oh okay I see now what you mean. Can you point me to some documentation of your function or the model itself so I can provide you with a possible workaround using some logic a model I can share with you? If you are using a model like this one for the objective function, then you should be able to work around the problem of the first year not being counted by cutting the NumOfValues in half (for just 1 of the 2 years). But I would like to see more about your objection function. There is a chance you might need to reset an Integrator with a discrete change. To share the model, please make a support request and I'll send it to you.

    -Jason

    0
    Comment actions Permalink

Please sign in to leave a comment.