Please enable JavaScript to view this site.

Vensim Help

Navigation: Reference Guide > Functions > Lookups

LOOKUP INVERT(lookup,y) INVERT the LOOKUP and return input

Scroll Prev Top Next More

Finds the input that, when used in the Lookup lookup would return y.  That is, if x = LOOKUP INVERT (lookup,y) then lookup(x) would return y.

LOOKUP INVERT will find the first value that satisfies this inverse relationship.  If the lookup is not monotone (always increasing or always decreasing) there may actually be more than one value that would work as an inverse.  Vensim will return the smallest such value.  If y is outside the range of lookup (bigger than the biggest y value or smaller than the smallest y value in lookup) the function will return :NA:.  In general it is wise to test to see if this has happened.

Units: LOOKUP INVERT(units1,units1) --> dmnl

Example

LOOK((0,0),(1,1),(3,2))

LOOKUP INVERT(LOOK,-1) is equal to :NA:

LOOKUP INVERT(LOOK,0.5) is equal to 0.5

LOOKUP INVERT(LOOK,1.5) is equal to 2.0

Availability: Not PLE or PLE Plus.

See also: VECTOR LOOKUP, Lookups

Sample model: LOOKUP functions.mdl in FunctionExamples