Errors with WITH LOOK UP function
Errors with WITH LOOK UP function
Could you tell me if there is any error related to missed parens in the following equation? I tried but could not fix it.
Thank you.
Cost of waste recycling = Transportation cost+WITH LOOKUP(maturation of waste recycling market, ((0.15,40),(0.2,35),(0.3,30),(0.4,27),(0.5,23),(0.6,18),(0.7,16),(0.8,14)))
The Vensim notified about an error with Lookup function: look for missing parens
Thank you.
Cost of waste recycling = Transportation cost+WITH LOOKUP(maturation of waste recycling market, ((0.15,40),(0.2,35),(0.3,30),(0.4,27),(0.5,23),(0.6,18),(0.7,16),(0.8,14)))
The Vensim notified about an error with Lookup function: look for missing parens
Re: Errors with WITH LOOK UP function
I think the error message may be misleading. WITH LOOKUP has to be the first & only thing on the right side of the equation - that's probably the issue here.
/*
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: Errors with WITH LOOK UP function
Thank you so much, I understood the issue here.
What other function can I use in case I want to calculate the total cost as equal to transportation cost plus recycling cost (for example) which in turn depends on the maturation of the market? I mean a combined functions like the inital idea.
-
- Super Administrator
- Posts: 4667
- Joined: Wed Mar 05, 2003 3:10 am
Re: Errors with WITH LOOK UP function
It's probably best if you start a new topic and provide more details.
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: Errors with WITH LOOK UP function
Just create a separate variable.
z = x + y
y = WITH LOOKUP(...)
z = x + y
y = WITH LOOKUP(...)
/*
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: Errors with WITH LOOK UP function
Or use an ordinary lookup variable instead of WITH LOOKUP:
z = x + y( input )
y = (0,1),(1,2),(3,4), ...
z = x + y( input )
y = (0,1),(1,2),(3,4), ...
/*
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: Errors with WITH LOOK UP function
Thank you. I am trying to re-establish the model found from a published paper to understand the methodology. The authors explained a formula in which x = a + WITH LOOKUP (y). Then I tried doing similar things but now I know WITH LOOKUP can not be used in such a combination like this.
-
- Super Administrator
- Posts: 4667
- Joined: Wed Mar 05, 2003 3:10 am
Re: Errors with WITH LOOK UP function
I always discourage the use of WITH LOOKUP, I'm not sure why anyone uses it. It much better to define the lookup as a separate variable.
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: Errors with WITH LOOK UP function
I don't discourage it, but I tend to use regular lookups in my own work. WITH LOOKUP is fine if you'll only use the curve shape once.
I'm puzzled that the authors describe x = a + WITH LOOKUP (y) - that hasn't ever worked, and the function is more or less unique to Vensim. Perhaps it was simply a shorthand.
I'm puzzled that the authors describe x = a + WITH LOOKUP (y) - that hasn't ever worked, and the function is more or less unique to Vensim. Perhaps it was simply a shorthand.
/*
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
*/
-
- Newbie
- Posts: 1
- Joined: Wed Jun 26, 2024 10:15 am
- Vensim version: PLE
Re: Errors with WITH LOOK UP function
Hi, i am also have issues with creating LOOKUP functions in Venism PLE. I am trying to create a look up function for the impact of a policy throughout time (2024-2050) so that i can use it to show that the policy will have a non-linear impact on other variables in my model depending on the year. However, when I create an auxillary variable and use the =WITHLOOKUP (ImpactLSP([(2024, 0)-(2050, 1)],(2024, 0.3),(2025,0.35),(2026,0.4)
(2027, 0.2), (2028,0.19),(2029, 0.1)). I am getting the error "expecting an operator". Do you know why this might be. Any help would be really appreciated.
(2027, 0.2), (2028,0.19),(2029, 0.1)). I am getting the error "expecting an operator". Do you know why this might be. Any help would be really appreciated.