LOOKUP

Use this forum to post Vensim related questions.
Post Reply
Cathy
Junior Member
Posts: 2
Joined: Fri Oct 06, 2006 11:01 pm

LOOKUP

Post by Cathy »

Hi,

I have a question, please if anybody has any answer, would be great, thank you! I try to explain it:
In my model I have subscripts (S1, S2, S3).
I want to implement a new variable (NW) in the model, where all the subscripts would have a lookup function. That means that I have all the values for the subscripts from the past years, so the "Input" in the lookup are the years and the "Output" I can fill in manually. It would be easy to do, because in this new variable (NW) I can choose the "Type" as lookup, and I can choose each subscript elements, and write the data given.
BUT!
In case of S2, the value of this variable is NOT a constant given for the past years, BUT it is coming from the model itself, it is an OUTPUT variable. That means that I would need to connect a variable containing the needed S2 info to the NW, and the "output" in the lookup should be another model variable.
Is it possible to do this?
To build a lookup, where the output is another variable?
Or I will have to change the strucutre?

Thank you very much,
all my best,
Cathy
LAUJJL
Senior Member
Posts: 1427
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

variable lookup

Post by LAUJJL »

Hi Cathy

A lookup is a function that is not supposed to change during the course of a simulation, as far as I know.

The only solution that I know to have a changing lookup is to
define the function by yourself.
For instance, if you have a very simple lookup where Y is the output and X the input where Y = A*X if x is between 1 and 2 and Y = B*X if x is between 2 and 3, which is a lookup made of two linear functions, you will write a function that looks like Y = if then else (X <= 1 :AND: X >=2,A * X,B*A).
and you can make the parameters A and B variables depending from the model.
If the number of parameters is increasing, it is better to use intermediary variables for the A * X value, to avoid having a too complex formulation.
I have in my own models, very often the necessity to have variable lookups that change in the course of time.
In fact the supposition that the influence between a variable
A and B is staying the same during the time, may sometimes be simplistic, and I think that Vensim should ease the representation of this reality.
But before using variable lookups, you must see too if your problem is not ill exposed, and that by changing the structure of your model, it is not possible to stay with stable lookups.
In short the fact that the influence is varying may be coming from something missing and not taken into consideration in your model, and it is this missing that makes the lookup change necessary.
Regards.
JJ
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

Hi Cathy,

Currently there is no way to do this, though we do plan to add in a facility that will allow this type of thing. Basically this will require passing a vector of subscriped values as the Y coordinates - details to be determined.

You can create this type of thing manually using subcripts - an example is attached - it is actually for a 2d lookup but you should get the idea.

That said, this type of construct is very easy to get in trouble with. Lookups are intended as functional relationships and changing them element by element can lead to nonsense shaped functions. It is often better to use a fomulation such as

output output effect= normalized lookup function around 1(normalized input val)^sensitivity

and adjust sensitivty- depending on the input and outputs you can make other types of sensitivity adjustments.

Bob Eberlein

[Edited on 7-10-2006 by Administrator]
Attachments
2dlookup.mdl
(3.72 KiB) Downloaded 267 times
Cathy
Junior Member
Posts: 2
Joined: Fri Oct 06, 2006 11:01 pm

Post by Cathy »

Thank you a lot for your answers.

Finally, it was a better solution to change the structure of the model, however I might use this again.

greetings,
Cathy
Post Reply