Two dimensional lookup

Use this forum to post Vensim related questions.
Post Reply
Steve
Junior Member
Posts: 4
Joined: Fri Mar 26, 2004 7:52 pm

Two dimensional lookup

Post by Steve »

Hi,

I would like to be able to make a lookup with two variables. On the basis of an oil price difference and a hedging time period, a premium should be calculated (with interpolation for other months between 3 and 9). Rather than using different (consecutive) lookups, is there a good way to implement this?

The attached table gives the basic information.

Thanks,
Attachments
doublelookup.xls
(14.5 KiB) Downloaded 562 times
LAUJJL
Senior Member
Posts: 1477
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

two dimensiional lookup

Post by LAUJJL »

HI

One way to manage a two dimensional lookup, whatever the kind of dimension (it looks like Time in your case), I have the same case but with price elasticities of different type of products, varying eventually with time which would make it a three dimensional lookup.
One way is to simulate the lookup with common equations, eventually using soft if then else to ease optimization, or to adjust your lookup with a function using constants.
The advantage of both solutions, is that you can or calibrate the lookup or use optimization, using the constants of the simulated lookups or the constants of the adjusting function.
Or you can just, import the lookups at different time from a spreadsheet, as imported data, storing them or not in an subscripted array but no calibration or optimization as I think. But some people with more knowledge then me must certainly, I hope, know better.
J.J. Laublé
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

It is often true that in multiple dimensions it is easier to formulate some sort of algebraic expression. - but 2d lookups can be done.

The attached model solves the problem by specifying a series of 1 dimensional lookups that are slices through the 2d surface and then interpolating between the solution points of adjacent slices. If you muck around with it I think you will see how it works. It may be easier to setup the numbers in Excel and use the GET XLS LOOKUPS function to bring them into Vensim.
Attachments
2dlookup.mdl
(3.47 KiB) Downloaded 632 times
Post Reply