Page 1 of 1

Equivalent function needed in Vensim

Posted: Tue Apr 14, 2020 5:34 pm
by kamath.vasanth
Hello everyone,
I want an equivalent formula in Vensim for this function used in Powersim.

Market_Share = 0.1 + 0.03 ∗ GRAPH(Reuse_Ratio, 0, 0.1, [−1.0,−0.615,−0.335,−0.165,−0.05, 0, 0.05, 0.165, 0.335, 0.615, 1.0“ Min:−1.0; Max: 1.0; Zoom” ])

Could you please help.

Re: Equivalent function needed in Vensim

Posted: Tue Apr 14, 2020 5:45 pm
by tomfid
Is this basically a lookup table?

Re: Equivalent function needed in Vensim

Posted: Tue Apr 14, 2020 5:46 pm
by Administrator
I'm guessing as I don't have Powersim and I cannot find the help for it online.

Vensim uses lookup tables, these are x/y pairs. But the "−1.0,−0.615,−0.335,−0.165,−0.05, 0, 0.05, 0.165, 0.335, 0.615, 1.0" are not pairs as there are 11 values. So maybe it's from 0 in 0.1 increments which fits?

Market share reuse lookup ((0,−1.0),(0.1,−0.615),(0.2,−0.335),(0.3,−0.165)),(0.4,−0.05),(0.5, 0), (0.6,0.05),( 0.7,0.165), (0.8,0.335),(0.9, 0.615), (1,1))

Now to get the value,
market share reuse = Market share reuse lookup (reuse ratio)

And then
market share = 0.1 + 0.03 ∗ market share reuse

It's very bad practice to have things like "0.1" and "0.03" embedded in equations. What are they? Are they there just to make the output correct (in that case, clearly the model would be wrong).

Hope this helps.

Re: Equivalent function needed in Vensim

Posted: Tue Apr 14, 2020 7:44 pm
by tomfid
Right. That could make the syntax of the GRAPH function:
GRAPH( inputVar, xmin, xmax, [vector of points] ).
I think the Min/Max/Zoom items may be just for display. The big question is probably whether the 3rd argument should be xincrement or xmax.

I agree that embedding constants in equations is bad practice.

Re: Equivalent function needed in Vensim

Posted: Sat Apr 25, 2020 1:50 am
by kamath.vasanth
Thank you Gentlemen !! Thanks for your support and guidance.