필터 지우기
필터 지우기

How to plot Efficiency maps

조회 수: 173 (최근 30일)
Anthony
Anthony 2012년 7월 25일
답변: Ashu 2023년 6월 28일
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

답변 (3개)

Junfei Tang
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:

Walter Roberson
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
Anthony
Anthony 2012년 7월 26일
Thanks alot Walter. How do I go about setting the Z value in the contour to NAN? I only have a matrix of values, covering the surface shown in the image above
Can
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
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

카테고리

Help CenterFile Exchange에서 Lighting, Transparency, and Shading에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by