Modified on
12 May 2023 07:57 pm
Skill-Lync
A lookup table is an array of data that maps input values to output values, resembling a mathematical function. A lookup operation retrieves the corresponding output values from the table if there are a given set of input values. In other words, a lookup table computes an approximation to some mathematical function y=f(x), given data vectors x and y. We can define the lookup table by specifying a vector of output values parameter as a 1-by-n vector. The lookup table block in Simulink generates an output based on the input values using one of the methods selected from the Look-up method parameter list. If the lookup table does not define the input values, the block estimates the output values based on a nearby table.
The methods listed are
If we go to Simulink and type a lookup table, this is how it appears. You can go to the library browser
There are several lookup tables available in the Lookup table block Library with different functions.
The following table summarizes the purpose of each block in the library.
The following example illustrates a one-dimensional lookup table that approximates the function y = x^3
The lookup table defines its output (y) data discretely over the input (x) range [-2, 2].
The lookup table defines its output (y) data discretely over the input (x) range [-2, 2].
The above figure shows the breakpoints of the function when plotted in the XY axis
Interpolation-Extrapolation- -This is the default method used to plot the breakpoints. it performs linear interpolation and extrapolation of the inputs.
When the lookup table block encounters an input that does not match any of the table's x values, it can interpolate or extrapolate the answer. For instance, the lookup table does not define an input value of -1.5; however, the block can linearly interpolate the nearest adjacent data points. For example, given these two points:
Similarly, although the lookup table does not include data for x values beyond the range of [-2, 2], the block can extrapolate values using a pair of data points at either end of the table.
If an input falls between breakpoint values or outside the range of a breakpoint data set and you do not specify interpolation or extrapolation, the block rounds the value to an adjacent breakpoint and returns the corresponding output value. If you explore the Lookup Table Dynamic block, it lets you select any of the rounding methods
Click on the drop-down for rounding options
How to use a lookup table in Simulink
Here is an example for the rounding method in Simulink
This example shows how to use the Lookup Table Dynamic block to approximate the sinh function. The breakpoint data is given by the vector [-5:5], and the table data is given by the vector sinh([-5:5]). The Constant block provides the input x with a vector 1.4
The simulation time was given as 10s. Three constant blocks were used for giving the input values, and a lookup table dynamic block was used to map the output. The rounding method option for the Nearest input value was given. So the lookup table uses the value for sinh (1.0), which is near to 1.4.value given in input. You can analyze the results by changing the option in Lookup dynamic block and giving different input values.
Here is a simple example of a 1D Lookup table in Simulink.
The input is taken as a Repeating stair sequence, and the values given are 6 2.5 4 with a sample time of 1. The lookup table is configured as shown below.
Parameter estimation
Table and Breakpoints
Breakpoints: Feed the x values of the function
Breakpoint Specification: Specify whether to enter data as explicit breakpoints or as parameters that generate evenly spaced breakpoints.
Table data: Enter the table of output values (Here, Feed the Y values of the function)
Data specification: Specify the table data and breakpoints
Number of table dimensions: Enter the number of dimensions of the lookup table ( Here it is 1 (because we use a 1D lookup table))
The values given here are such that the output will give twice the value of the input .; y=2x
The algorithm was set to Linear point-slope for the Interpolation method, and by default, the option for Linear will be set for the Extrapolation method.
Data types were kept as default
Results
The simulation is carried out for 3 s because we have given only 3 values at the input side (repeating sequence stair)We have defined a mathematical function y=2x using a lookup table in this article
The scope shows that the Lookup table plot gives values double the input values from repeating sequence stairs. Likewise, you can define a mathematical function with one variable. You can use a 2D lookup table to define two variables.
Author
Navin Baskar
Author
Skill-Lync
Subscribe to Our Free Newsletter
Continue Reading
Related Blogs
The average vehicle body gives any vehicle its structural integrity, while the electric motor is concerned with the generation of torque or force. The electric motor can be a permanent magnet synchronous motor, brushless dc motor etc.
25 Aug 2022
In industrial control applications, a PID controller is a device that regulates temperature, flow, pressure, speed, and other process variables. PID (proportional integral derivative) controllers, which use a control loop feedback mechanism to control process variables, are the most accurate and trustworthy controllers.
27 Aug 2022
A lithium-ion (Li-ion) battery is a complicated battery technology that uses lithium ions as a key component of its electrochemistry. During a discharge cycle, lithium atoms within the anode are ionized and separated from their electrons.
29 Aug 2022
Dash in your car is your source of information. It basically functions as a control panel that sits in front of the driver and shows numerous controls and instrumentation required for your car to function.
01 Sep 2022
A hybrid vehicle has two power sources for motion within the same vehicle. Basically the hybrid vehicle is split into two types supported the source for propulsion - combustion engine type and Hydrogen power cell.
07 Sep 2022
Author
Skill-Lync
Subscribe to Our Free Newsletter
Continue Reading
Related Blogs
The average vehicle body gives any vehicle its structural integrity, while the electric motor is concerned with the generation of torque or force. The electric motor can be a permanent magnet synchronous motor, brushless dc motor etc.
25 Aug 2022
In industrial control applications, a PID controller is a device that regulates temperature, flow, pressure, speed, and other process variables. PID (proportional integral derivative) controllers, which use a control loop feedback mechanism to control process variables, are the most accurate and trustworthy controllers.
27 Aug 2022
A lithium-ion (Li-ion) battery is a complicated battery technology that uses lithium ions as a key component of its electrochemistry. During a discharge cycle, lithium atoms within the anode are ionized and separated from their electrons.
29 Aug 2022
Dash in your car is your source of information. It basically functions as a control panel that sits in front of the driver and shows numerous controls and instrumentation required for your car to function.
01 Sep 2022
A hybrid vehicle has two power sources for motion within the same vehicle. Basically the hybrid vehicle is split into two types supported the source for propulsion - combustion engine type and Hydrogen power cell.
07 Sep 2022
Related Courses