Contents - Index


INTERPOLATE2D

 

The INTERPOLATE2D function returns an interpolated or extrapolated value as a function of two independent variables from tabular data using either a bi-quadratic or radial basis function method.  The default method is a bi-quadratic method.  Note that the INTERPOLATED2DM also provides two-dimensional interpolation of data in a Lookup table or Lookup file.  The difference between the INTERPOLATE2D and INTERPOLATE2DM functions is that the INTERPOLATE2D function operates on data within 3 columns in the Lookup table whereas the INTERPOLATE2DM requires the data to be provided in a 2D matrix form.  The INTERPOLATE2DM uses linear interpolations while INTERPOLATE2D uses non-linear methods that do not require the data to be provided at equal increments of the independent variables.   

 

Because of the need to grid the data and handle non-linear functions, the INTERPOLATE2D function requires a large data set (e.g., 128 points or larger) to function properly.  These data can be in a Lookup table in the  Lookup Table Window or a Lookup file (stored on disk).   This function extends the capability of the Interpolate function which returns a value as a function of one independent variable.  The format of this function is 

 

INTERPOLATE2D('Table Name', X, Y, Z, X=value1, Y=Value1 )  {­default - use bi-quadratic interpolation with the 16 nearest data points}

or 

INTERPOLATE2D('Table Name', X, Y, Z, X=value1, Y=Value1 ,N)  {­specify the interpolation algorithm and number of data points to use in interpolation}

 

'Table Name' is a string constant or string variable  that provides the name of the Lookup table in the Lookup Window or the name of an existing Lookup file stored on disk. The string constant must be enclosed within single quote marks.  Lookup table names appear on the tabs at the top of the Lookup Table Window.   If the name of a disk file is supplied, it must be the name of an existing Lookup file having either the binary (.LKT) or ASCII (.TXT, .CSV, .DAT) Lookup file Formats.  

 

X, Y,  and Z are the names of three different columns in the specified table.  These arguments can be string constants or string variables.  Since there is no ambiguity, the single quotes that are normally required for string constants are optional and they have been left off in the example above.

 

The next two parameters identify the two independent variables and set their values.  The format is ColumnName=Value where the text to the left of the equal sign must be one of the three column names specified in the second, third and fourth parameters.  Note that if a string variable was provided for the column name, then the same string variable must be used for this parameter.  Value is a numerical value or expression.   

 

The last parameter, N, is optional.  It serves two purposes.  First, it indicates which of two different interpolation algorithms are used.   If N < 0, then a bi-quadratic method is used in the interpolation.  If N > 0 then a multi-quadric radial basis function interpolation method is used.  The absolute value of N is the maximum number of data points used in the interpolation process.  The two-dimensional interpolation algorithm is computationally intensive for large values of N.   If the data table contains more than N points, EES will use the N points in the table that are nearest to the point for which the interpolate is requested in normalized coordinates.  If the data table contains fewer than N points, N is set to the number of points in the table.  If N is set to be less than 8, EES will reset it to 8 and issue a warning message.  If N is not provided, a value of -16 is assumed so that the default case is a bi-quadratic method with 16 points.

 

Values for two of the three specified columns in the data table are specified in the calling parameters.  EES will return the interpolated value from the data as a function of these independent variables using interpolation or extrapolation, as required.

 

(Note:  use a semicolon instead of a comma as the list separator when using the European numerical format).

 

See also: Interpolate, Interpolate1, Interpolate2

Interpolate2DM

Mathematical Functions