Look-up table with changing table

1 view (last 30 days)
SIMONE PARENTELA
SIMONE PARENTELA on 6 Jan 2021
Answered: Jayant Gangwar on 3 Oct 2022
I have two vectors with one row and 200 columns. The Torque vector is organised in an increasing way, while the velocity vector is not. This allows me to have the graph represented by the red line.
need to create a lookup table in simulink. I can't use the one in the library because I have to have the velocity vector organised in an increasing way. So I thought of creating this model in simulink. I sort the w_OOL data and use the sorted indexes to sort the T_OOL data. So with monotonically ordered vectors I can use the Lookup Table Dynamic block. The vector w_OOL is a vector of rpm ranging in an unordered fashion from 750 to 2479, whereas the vector T_OOL is ordered.
I don't understand why I get this error.
It is as if the sort block does not work. But if I replace the data with a vector xxx=rand(1,200) it works correctly. I don't understand how to get out of this problem. I repeat, I think the problem is between the w_OOL vector and the sort block, but I don't understand what the problem is.

Answers (1)

Jayant Gangwar
Jayant Gangwar on 3 Oct 2022
Hi Simone,
As the error specifies "xdat vector is the breakpoint, which must be strictly monotonically increasing.", which means that the w_OOL data should be increasing as well as should not have any repeating data for it to be classified as "strictly monotonically increasing".
From the graph you shared it is visible that w_OOL data which has the velocity vector has multiple data with same velocity values because of which this error is arising.
To overcome this error you can either create a look-up table with Torque vector as the "xdat" or find a way to eliminate the repeating values in the velocity vector.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!