![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/172672/image.png)
How to plot Efficiency maps
131 次查看(过去 30 天)
显示 更早的评论
I am trying to plot the efficiency map using a contour function for the torque speed curve shown below. the problem is, the contour function, plots for the whole surface of the matrix. But i only want the contour plot to be under the torque speed curve so that the part above the torque speed curve is white.
the link below is a link of the torque speed curve. any help would be much appreciated
0 个评论
回答(3 个)
Junfei Tang
2016-2-4
编辑:Junfei Tang
2016-2-4
Hi,
Before creating the efficiency map, I think you already have a set of coordinates (x,y) and the corresponding values (z), i.e. the efficiencies. Then you need to put all the x-axis values together, all the y-axis values together and all the z-axis values together to form matrices:
X = [ X(1,1), X(1,2), X(1,3), ..., X(1,n);
X(2,1), X(2,2), X(2,3), ..., X(2,n);
...................................;
X(n,1), X(n,2), X(n,3), ..., X(n,n) ];
Y = [ Y(1,1), Y(1,2), Y(1,3), ..., Y(1,n);
Y(2,1), Y(2,2), Y(2,3), ..., Y(2,n);
...................................;
Y(n,1), Y(n,2), Y(n,3), ..., Y(n,n) ];
Z = [ Z(1,1), Z(1,2), Z(1,3), ..., Z(1,n);
Z(2,1), Z(2,2), Z(2,3), ..., Z(2,n);
...................................;
Z(n,1), Z(n,2), Z(n,3), ..., Z(n,n) ];
where X(x,y), Y(x,y) and Z(x,y) correspond to each other: x and y are the indices, X is the matrix containing the x-axis values, Y is the matrix containing the y-axis values and Z is the matrix containing the z-axis values, e.g. the efficiencies.
MATLAB will put the points on the map like this: MATLAB assigns Z(1,1) to be the z-axis value of point (X(1,1), Y(1,1)); then assigns Z(2,1) to be the z-axis value of point (X(2,1), Y(2,1)); ... until assigns Z(n,n) to be the z-axis value of point (X(n,n), Y(n,n)).
This is what I have done, since to form matrices is easier for me to check the values in a table format afterwards. However, I think if you create an array for each of X, Y and Z instead of creating a matrix for each of them, it should also work.
After the assignment of the values, start to create the figure:
figure
n = 100; % number of contour levels
efficiency_map = contourf(X,Y,Z);
colorbar;
xlabel('{\it\Omega}_r [rev/min]')
ylabel('{\itT}_e [N*m]')
legend
Then the efficiency map comes out:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/172672/image.png)
0 个评论
Walter Roberson
2012-7-25
The points that you do not want plotted, set the Z value to NaN before doing the contour plot.
2 个评论
Can
2023-5-26
for example my efficiency value at Tork = 10nM^2 and rpm = 400 rev/min is 83,04 how will i assign these values to the X, Y and Z axis can you show me at one example with the values i give.
Ashu
2023-6-28
torque developed by the motor and efficiency against silip on the same graph, use left axis for torque and right for the efficiency. please how can i plot it
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Lighting, Transparency, and Shading 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!