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.
Equivalent function needed in Vensim
-
- Junior Member
- Posts: 2
- Joined: Tue Apr 14, 2020 4:53 pm
- Vensim version: PLE
Re: Equivalent function needed in Vensim
Is this basically a lookup table?
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
-
- Super Administrator
- Posts: 4573
- Joined: Wed Mar 05, 2003 3:10 am
Re: Equivalent function needed in Vensim
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.
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
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559
Re: Equivalent function needed in Vensim
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.
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.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
-
- Junior Member
- Posts: 2
- Joined: Tue Apr 14, 2020 4:53 pm
- Vensim version: PLE
Re: Equivalent function needed in Vensim
Thank you Gentlemen !! Thanks for your support and guidance.