Products & Services Solutions Academia Support User Community Company

Learn more about Simscape   

PS Lookup Table (1D) - Approximate one-dimensional function using specified lookup method

Library

Physical Signals/Lookup Tables

Description

The PS Lookup Table (1D) block computes an approximation to some function y=f(x) given data vectors x and y. Both the input and the output are physical signals.

The length of the x and y data vectors provided to this block must match. Also, the x data vector must be strictly monotonically increasing (i.e., the value of the next element in the vector is greater than the value of the preceding element).

You define the lookup table by specifying the Vector of input values parameter as a 1-by-n vector and the Vector of output values parameter as a 1-by-n vector. The block generates output based on the input values using the selected interpolation and extrapolation methods. You have a choice of three interpolation methods and two extrapolation methods.

Dialog Box and Parameters

Vector of input values

Specify the vector of input values as a tabulated 1-by-n array. The input values vector must be strictly monotonically increasing. The values can be non-uniformly spaced.

Vector of output values

Specify the vector of output values as a tabulated 1-by-n array. The output values vector must be the same size as the input values vector.

Interpolation method

Select one of the following interpolation methods for approximating the output value when the input value is between two consecutive grid points:

  • Linear — Uses a linear function.

  • Cubic — Uses the Piecewise Cubic Hermite Interpolation Polinomial (PCHIP). For more information, see [1] and the pchip MATLAB® function.

  • Spline — Uses the cubic spline interpolation algorithm described in [2].

Extrapolation method

Select one of the following extrapolation methods for determining the output value when the input value is outside the range specified in the argument list:

  • From last 2 points — Extrapolates using the linear method (regardless of the interpolation method specified), based on the last two output values at the appropriate end of the range. That is, the block uses the first and second specified output values if the input value is below the specified range, and the two last specified output values if the input value is above the specified range.

  • From last point — Uses the last specified output value at the appropriate end of the range. That is, the block uses the last specified output value for all input values greater than the last specified input argument, and the first specified output value for all input values less than the first specified input argument.

 Restricted Parameters

Ports

The block has one physical signal input port and one physical signal output port.

References

[1] D. Kahaner, Cleve Moler, Stephen Nash, Numerical Methods and Software, Prentice Hall, 1988

[2] W.H. Press, B.P. Flannery, S.A. Teulkolsky, W.T. Wetterling, Numerical Recipes in C: The Art of Scientific Computing, Cambridge University Press, 1992

See Also

PS Lookup Table (2D)

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS