Equivalent function needed in Vensim

Use this forum to post Vensim related questions.
Post Reply
kamath.vasanth
Junior Member
Posts: 2
Joined: Tue Apr 14, 2020 4:53 pm
Vensim version: PLE

Equivalent function needed in Vensim

Post 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.
tomfid
Administrator
Posts: 3806
Joined: Wed May 24, 2006 4:54 am

Re: Equivalent function needed in Vensim

Post by tomfid »

Is this basically a lookup table?
Administrator
Super Administrator
Posts: 4573
Joined: Wed Mar 05, 2003 3:10 am

Re: Equivalent function needed in Vensim

Post 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.
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
tomfid
Administrator
Posts: 3806
Joined: Wed May 24, 2006 4:54 am

Re: Equivalent function needed in Vensim

Post 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.
kamath.vasanth
Junior Member
Posts: 2
Joined: Tue Apr 14, 2020 4:53 pm
Vensim version: PLE

Re: Equivalent function needed in Vensim

Post by kamath.vasanth »

Thank you Gentlemen !! Thanks for your support and guidance.
Post Reply