Controlling Interpolation and Extrapolation for a Lookup Table

By default, the interpolation carried out by GoldSim to determine the value of the Dependent Variable for a given value of the Independent Variable (i.e., the argument) is done linearly with respect to both variables.  However, you can change the interpolation to be used for any or all of the variables.  This is done via the Interpolation drop-lists for the independent variables and the Result Interpolation drop-list for the dependent variable:

For the independent variables, GoldSim provides the following interpolation options:

Linear: This is the default, and if selected, GoldSim will linearly interpolate between table values to determine the appropriate value.

Next lower: This option results in a “stair-step” function, with no interpolation at all.  If this option is selected, given an input argument for the table, GoldSim uses the largest independent variable entry in the table that is less than or equal to the input argument.  For example, if your independent variable entries were 10, 20 and 30, and the input argument was 17, GoldSim would assume an independent variable value of 10.

Exact only: If this option is selected, the Lookup table will only accept arguments that exactly match independent variable entries in the table.  If there is not an exact match, rather than interpolating between points, GoldSim issues a fatal error.

The only options available for Result Interpolation are Linear and Log.

The general guidance below can be used to determine when to use Linear or Log interpolation for the Result variable:

   If you plot the Results against an independent variable, and it becomes approximately a straight line, select Linear for both the Result and the Independent Variable.

   If you plot the logarithm of the Results against an independent variable, and it becomes approximately a straight line, select Log for Result and Linear for the Independent Variable.

   Note: If an independent variable appears to vary logarithmically, enter the logs of the independent variable when defining points in the Lookup Table (and use the log of the independent variable as an argument when referencing the table).

When you define a Lookup Table, you must also specify how GoldSim is to handle references to the table that are outside the bounds of the table.  For example, if your Row Variable varied between 1 and 10, and you used the Lookup Table to evaluate a value for the Row Variable equal to 15, how should GoldSim handle this?

The Handling of Data Outside Bounds field specifies how GoldSim is to handle such an instance.  GoldSim provides three options for 1-D Tables, and two options for 2-D and 3-D Tables:

Fatal Error: This is the default.  If you try to reference a point outside the bounds of the table, GoldSim will display a Fatal Error message when you try to run the simulation.

Do Not Extrapolate: If you try to reference a point outside the bounds of the table, GoldSim will not extrapolate.  Instead, it will compute the value for the dependent variable based on the values for the independent variables at the nearest portion of the defined region.  That is, it assigns a value from the nearest “edge” of the table.

Extrapolate: This option is only available for 1-D Tables.  GoldSim extrapolates beyond the range of the specified data by using the two closest data pairs.

An example model which illustrates various interpolation and extrapolation options (TableInterpolation.gsm) can be found in the General Examples/LookupTable folder in your GoldSim directory (accessed by selecting File | Open Example... from the main menu).

Related Topics…