Examples of linear and bilinear interpolation in table lookup data references
- Last UpdatedJan 11, 2023
- 1 minute read
- PI System
- PI Server 2024 R2
- PI Server
Linear interpolation example
In a tank strapping table that contains a column and a column, the following configuration string interpolates the volume based on the level reading:
SELECT Volume FROM MyTable WHERE INTERPOLATE(Level, @MyLevelReading)
Assume the sample table has the following rows:
|
Level |
Volume |
|
1 |
0.0 |
|
2 |
20.0 |
|
3 |
30.0 |
|
4 |
40.0 |
|
5 |
60.0 |
|
6 |
70.0 |
-
A reading of 2.2 results in a returned of 22.0.
-
A reading of 2.7 results in a returned of 20.0 when Stepped is selected (true).
-
Extrapolation: A reading of 6.5 results in a returned of 75.0 when Stepped is cleared (false).
-
Extrapolation: A reading of 6.5 results in a returned or 70.0 when Stepped is selected (true).
Bilinear interpolation example
In an air velocity table that contains an column, a column, and a column, the following configuration string interpolates the velocity based on the X horizontal and Y vertical positions.
SELECT Velocity FROM Table1 WHERE INTERPOLATE([X Horizontal Position], @X) AND INTERPOLATE([Y Vertical Position], @Y)
Assume the sample table has the following rows:
|
X Horizontal Position |
Y Vertical Position |
Velocity |
|
180 |
140 |
4.6 |
|
220 |
140 |
4.1 |
|
260 |
140 |
2.7 |
|
180 |
180 |
4.8 |
|
220 |
180 |
4.4 |
|
260 |
180 |
2.5 |
|
180 |
220 |
4.5 |
|
220 |
220 |
4.4 |
|
260 |
220 |
2.5 |
An of 245 and a of 165 results in a returned of 3.2171875.