How do I create a 2D lookup table from efficiency map?

Hi,
I have created a efficiency plot using [speed,torque] points (see figure). Efficiency inside the red curve is 96% and between the red and the green line, the efficiency is 94%. How do I create a 2D lookup table that gives out efficiency value for a given torque and speed?
Regards,
Bidhan

답변 (1개)

Chunru
Chunru 2021년 12월 4일
% Combine all the points for red and green curves to form the three vectors
% speed, torque, efficiency. Then use the scatteredUbterpolant
F = scatteredInterpolant(speed, torque, efficiency)
% now you can look up
e = F(speed0, torque0)
% doc scatteredInterpolant

댓글 수: 2

bidhan pandey
bidhan pandey 2021년 12월 7일
편집: bidhan pandey 2021년 12월 7일
Thanks for the answer. I did use your answer in a Matlab funtion block in Simulink to get back an efficiency value. But that made my model too slow. Actually I want to create a 2D lookup table (in the 2-D Lookup Table block) that I can use inside Simulink. Any help on that?
If you want to improve the speed, one way is to interpolate the data into a 2-D regular grid, for example
[x, y] = meshgrid(0:.1:1, 0:.1:1);
z = F(x, y);
Once these are evaluated offline, you can use a 2D-lookup table in simulink with x, y, z the lookup table.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Nonlinearity에 대해 자세히 알아보기

태그

질문:

2021년 12월 4일

댓글:

2021년 12월 9일

Community Treasure Hunt

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

Start Hunting!

Translated by