Problem with Previous Value Element

Answered

Comments

9 comments

  • Avatar
    Jason

    It will help to see more of this model. Can you provide some screen captures of the elements (Submodel and Previous Value elements and how they are connected). Can you take a screen capture and describe the expressions used to connect them?

    Thanks!

    0
    Comment actions Permalink
  • Avatar
    Asarkar

    Hello Jason,

    Thank you for your response. The model is kind of complicated. I will try to explain in a simpler way. The interface for the optimization is:

    It shows new_wells as the optimization output variable. There are many variables in the input interface but I have only included Net Revenue in the actual optimization problem. (Just in case you need info on the other input variables: Qt is the amount of natural gas that is available in the basin and total_production is the total production from both old and new wells).

    The screenshot below shows the optimization properties:

    new_wells is the element that is being calculated through optimization, and NetRevenue is being maximized. NetRevenue is a product of no. of new wells, the quantity of natural gas produced by them and the price of gas minus the costs of production (it also has old wells and their production, but it is not necessary for this question). The number of new wells is calculated and connected to another module where the production of natural gas is being calculated as shown below:

    The element new_wells is connected to the optimization sub-model:

    the element new_wells exists twice in the model, one inside the optimization module and two, outside of it. they are interconnected.  To avoid recursive loop, I have used previous value element (called new_wells2) to find out the total production from the new wells in the next period (and further, the revenue is calculated):

    this is the gist of the model pertaining to the question.

    Does this provide enough info? Please let me know if you need more details.

    Thank you,

    Aditi 

    0
    Comment actions Permalink
  • Avatar
    Jason

    Hi Aditi,

    Did this get resolved yet? I'm looking up at the information in your last post and I'm not fully understanding it. I can't remember if you had sent us the model in an email separately or not. Is it possible you could share the model or just part of the model that shows basically what you are trying to do? Here are some resources that might provide some guidance as well:

    Thanks,

    Jason

    0
    Comment actions Permalink
  • Avatar
    Asarkar

    Hello Jason,

    Yes, the problem has been resolved. I had to change the simulation settings. Thank you for checking up on this post!

    I have another question, though. It is a general modeling question: how do I model the multiplication of a variable's simulated values over the entire time horizon? For example, suppose the value for a variable, x,  is simulated in each time step. I want Goldsim to keep on multiplying each of the values together in each time step. For example, x holds the value 2 in time step 1, 4 in time step 2, 3 in time step 3, and so on and so forth. I want GoldSim to keep on multiplying the values together in each time period. So, in time step 1, the value is going to be 2, in time step 2, the value goes up to 2*4, which is 8. In the 3rd time step, the value will be 8*3 which is 24. 

    The mathematical representation of what I want to do, looks like this:

    The sign is capital pi (which means the product notation), t is the time step and x is the variable whose values are being simulated. How do I create a function that enables me to do this in Goldsim?

    It would be great if you could get back to me on this question. I appreciate your help.

    Thank you,

    Aditi 

     

     

    0
    Comment actions Permalink
  • Avatar
    Jason

    Aditi,

    It looks like you want to use the Previous Value element, right?

    -Jason

    0
    Comment actions Permalink
  • Avatar
    Asarkar

    Yes. Do you know how to do it?

     

    Aditi

    0
    Comment actions Permalink
  • Avatar
    Jason

    How about this:

     

    Where the Time Series is:

    The Expression "X" is:

    And the Previous Value is: 

    You can learn more about the Previous Value element here: 

    Referencing an Output's Previous Value (goldsim.com)

    Let me know if this helps!

    0
    Comment actions Permalink
  • Avatar
    Asarkar

    Yes, it does! I can modify it from here to make it work in my model. Thank you so much!!

    1
    Comment actions Permalink
  • Avatar
    Jason

    I'm glad this was helpful. Good luck with your model.

    -Jason

    0
    Comment actions Permalink

Please sign in to leave a comment.