Hello,
This is probably a quite trivial question. However, I could not find an answer yet.
I am trying to setup optimization in Vensim so that it tells me for which value of a parameter a given value of a variable is reached in the shortest time. So I am trying to find the value of a parameter which minimizes the time it takes until a variable reaches a certain value. How can I do this using the Optimization Setup of Vensim?
I already tried setting up the payoff definition in the following way: Type = "Policy", Variable = variable which is supposed to reach a given value in the shortest time possible, and Weight = "Time". However, this setup does not always result in the optimal value of the chosen parameter.
Thank you very much for your help!
Optimizing over time
-
- Super Administrator
- Posts: 4838
- Joined: Wed Mar 05, 2003 3:10 am
Re: Optimizing over time
Create a variable called "time value reached".
Make the equation for it
time value reached = SAMPLE IF TRUE ( value to reach >= target to reach :and: time value reached = 99999 , time , 99999 )
This should be 99999 until "value to reach" gets to "target to reach". Once it reaches it, time value reached will = time.
Now optimize and set the payoff to minimize the value of "time value reached"
Make the equation for it
time value reached = SAMPLE IF TRUE ( value to reach >= target to reach :and: time value reached = 99999 , time , 99999 )
This should be 99999 until "value to reach" gets to "target to reach". Once it reaches it, time value reached will = time.
Now optimize and set the payoff to minimize the value of "time value reached"
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559
Re: Optimizing over time
Hi Agroe
Here is joined a simple model that works. You have just to minimize the 'time when goal is reached' value by putting 'payoff elm' into the payoff elements variable with a weight of -1.
Of course you have to build yourself the equations for the 'variable that must reach the goal' that will depend on the parameter's values tha will minimize the time when goal is reached.
While I was making the model, the administrator proposed another solution. It is roughly the same, it just does not use the sample if true function. Of course the sample if true takes less equations as it does not need to use the value of a level at the end of the period. In fact both models do the same thing.
Regards.
JJ
Here is joined a simple model that works. You have just to minimize the 'time when goal is reached' value by putting 'payoff elm' into the payoff elements variable with a weight of -1.
Of course you have to build yourself the equations for the 'variable that must reach the goal' that will depend on the parameter's values tha will minimize the time when goal is reached.
While I was making the model, the administrator proposed another solution. It is roughly the same, it just does not use the sample if true function. Of course the sample if true takes less equations as it does not need to use the value of a level at the end of the period. In fact both models do the same thing.
Regards.
JJ
- Attachments
-
- optimizing goal.mdl
- (3.82 KiB) Downloaded 275 times
Re: Optimizing over time
Thank you very much for your suggestions. It works fine now 
