Hi there,
I would like to know how I can writte an equation which include IF function and Lookup togather, I mean how can express the case (IF X =0 then Y=0, otherwise y= Graph(x1,y1), (x2,y2)...etc.)
It is simmply you can say add the value (0,0) to the graph, but, actually, this is not accceptable in my case.
Kind regards
Rajaa
Lookup function
-
- Super Administrator
- Posts: 4590
- Joined: Wed Mar 05, 2003 3:10 am
Re: Lookup function
Something like
Code: Select all
y = IF THEN ELSE ( x =0 , 0, lookup graph(x))
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: Lookup function
See also:
http://www.vensim.com/documentation/usr08.htm
http://www.vensim.com/documentation/fn_if_then_else.htm
http://www.vensim.com/documentation/usr08.htm
http://www.vensim.com/documentation/fn_if_then_else.htm
/*
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
*/
Re: Lookup function
Hi,
Thanks for your response.
Actually, what I need to know how to write this equation in the equation editor. Because If I wrote in the current case (IF THEN ELSE ( x =0 , 0, lookup graph(x))), Vensim would ask to identify the "lookup graph" as a variable!!
Regards
Rajaa
Thanks for your response.
Actually, what I need to know how to write this equation in the equation editor. Because If I wrote in the current case (IF THEN ELSE ( x =0 , 0, lookup graph(x))), Vensim would ask to identify the "lookup graph" as a variable!!
Regards
Rajaa
-
- Super Administrator
- Posts: 4590
- Joined: Wed Mar 05, 2003 3:10 am
Re: Lookup function
If you read through
http://www.vensim.com/documentation/ind ... ?usr08.htm
It will show you how to create a lookup (and how to use it).
http://www.vensim.com/documentation/ind ... ?usr08.htm
It will show you how to create a lookup (and how to use it).
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: Lookup function
Hi,
Many thanks for your response.
I've already create the lookup graph. I have no problem in that. My problem is in how to include the lookup graph in the IF function.
For example,
effect of competition on fee= if then else (number of competitors=0, 1, Lookup graph(number of competitors))
where, effect of competition on fee= graph(2,1.33), (3, 1.2) .... (6,1)
I insert the values to get the lookup function as usual and I get the grap, but I do not know how to build IF function including this lookup function.
When I insert the equation in the equation editor as oyu told me above (y=if then else (x=0,0, lookup graph (x)), it considered "lookup graph" statemnet an indicator for an absent variable that I need to add it to my SD daigram as I recieved this message (do you want to add "lookup graph" to the model) instead of considering the "lookup graph" as a part of the IF fucntion.
I hope that I made myself clear
Many thanks for being patient
Kind regards
Rajaa
Many thanks for your response.
I've already create the lookup graph. I have no problem in that. My problem is in how to include the lookup graph in the IF function.
For example,
effect of competition on fee= if then else (number of competitors=0, 1, Lookup graph(number of competitors))
where, effect of competition on fee= graph(2,1.33), (3, 1.2) .... (6,1)
I insert the values to get the lookup function as usual and I get the grap, but I do not know how to build IF function including this lookup function.
When I insert the equation in the equation editor as oyu told me above (y=if then else (x=0,0, lookup graph (x)), it considered "lookup graph" statemnet an indicator for an absent variable that I need to add it to my SD daigram as I recieved this message (do you want to add "lookup graph" to the model) instead of considering the "lookup graph" as a part of the IF fucntion.
I hope that I made myself clear
Many thanks for being patient
Kind regards
Rajaa
-
- Super Administrator
- Posts: 4590
- Joined: Wed Mar 05, 2003 3:10 am
Re: Lookup function
Are you using PLE? If yes, just draw an arrow from your lookup to the variable where you need to use it.
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: Lookup function
Hi,
I am using DSS. I already drew this link and I wrot the equation in the way you told me but it does not work
Please find attached a graph ilustrating the link and equation
Regards
Rajaa
I am using DSS. I already drew this link and I wrot the equation in the way you told me but it does not work
Please find attached a graph ilustrating the link and equation
Regards
Rajaa
Re: Lookup function
You're missing parentheses around the lookup argument. In other words, you have
IF THEN ELSE( a=b, x, lookup"y" )
and you need
IF THEN ELSE( a=b, x, lookup("y"))
IF THEN ELSE( a=b, x, lookup"y" )
and you need
IF THEN ELSE( a=b, x, lookup("y"))
/*
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
*/