How do I create a 2D lookup table from efficiency map?
10 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
回答(1 个)
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 个评论
Chunru
2021-12-9
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.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Nonlinearity 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!