using the lookup slope function

Use this forum to post Vensim related questions.
Post Reply
LAUJJL
Senior Member
Posts: 1477
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

using the lookup slope function

Post by LAUJJL »

Hi

I use the lookup slope function (an example is joined in a simplistic model) to force the result of a function lookup (extrapolate or not) to be equal to zero outside of the boundaries of the lookup. It seems to work all right (see the model joined). But I use it in a model with subscripts where I optimize, and where I want the results outside of the boundaries to be equal to zero. The optimization does not work correctly with the formulation with the slope lookup , but if I replace the function with a standard lookup, it works. Seeing the model joined, is the formulation of the equation correct?
Or is the optimizer not able to find its way, because outside of the boundaries, the results are staying equal to zero?
Regards.
JJ
Attachments
lookup.mdl
(1.94 KiB) Downloaded 380 times
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

Hi JJ,

I don't see anything wrong with the formulation, though simply changing the lookup to take on values such as

(-100,0),(0.5,0),(0.5,0.3),(1,0.5),(1.5,0.8),(1.5,0),(100,0)

would give you the same results.

If there is a problem with the optimizer my guess is that it is simply because the flat lookup output is propogating to give a payoff that does not change with changes to the inputs. Also, in general, any discontinuity in a model is likely to make optimization more problematic.
LAUJJL
Senior Member
Posts: 1477
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

using the lookup slope

Post by LAUJJL »

Hi Bob

Thank you for your reply.
I know the formulation that you propose, but it is easier to use mine if you want to switch
between a lookup extrapolate and a flat 0 lookup.
I have a model with a double subscripted lookup table with 45 elements, and it is simpler
to change the formula than to modify 45 lookups.
I have found out where is the problem.
It does not lie in the lookup, although the formulation proposed as in the lookup slope is
discontinuous, but from one of the payoff to optimize.
That payoff exists to avoid a value, the capacity used or utilization to exceed 80%.
When it exceeds that value I calculate a penalty to jump to 1000000 with the
equation : if then else (utilization > 0.8,1e+006,0) and put the penalty as one of the payoff.
This formulation is discontinuous.
If I optimize with that formulation, after 30 minutes and more than 10000000 simulations
the optimum is still not right, only near the real optimum.
I then transformed the equation into : max (0,(utilization - 0.8)*1e+006)
that is continuous. It still took approximately the same time.
Then I transformed the formulation into :
if then else (utilization <= 0.8,0,1000000 *(utilization * ((utilization / 2) - 0.8) + 0.32))
which is continuous and that has its derivative function continuous too and equal to zero
when the utilization is equal to 0.8.
It then worked perfectly in a matter of seconds.
All these peculiarities can be dangerous as one may think that the optimum is reached after
20 seconds, and in fact you should wait 30 minutes at least or change some equations some
where so that it behaves more smoothly, mainly in the pay off functions I suppose.
Regards.
JJ
Post Reply