contour plot with a circular boundary

I have the following code which gives me rectangular contour, I would like to chaneg it to be circular contour (boundaries), Can anyone help me please?
L = [-0.875 -0.75 -0.625 -0.5 -0.375 -0.25 -0.125 0 0.125 0.25 0.375 0.5 0.625 0.75 0.875];
r = [-0.875 -0.75 -0.625 -0.5 -0.375 -0.25 -0.125 0 0.125 0.25 0.375 0.5 0.625 0.75 0.875];
[X,Y]=meshgrid(L,r)
T=xlsread('Tempvalues (horizontal 70 psi)try.xlsx');
Z = [T(:,1),T(:,2),T(:,3),T(:,4),T(:,5),T(:,6),T(:,7),T(:,8),T(:,9),T(:,10),T(:,11),T(:,12),T(:,13),T(:,14),T(:,15)];
contourf(X,Y,Z)
pbaspect([1,1,1])
xlabel('Dimensionless axial position (z/L)')
ylabel('Dimensionless radial position (r/R)')
title('Axial velocity distribution along heated channel')

回答 (1 件)

Torsten
Torsten 2023 年 10 月 5 日
編集済み: Torsten 2023 年 10 月 5 日

0 投票

If you want to plot it within a circular contour, you have a 3d-plot. For a 3d-plot, you can only plot cuts in length direction with temperature as the contours.
So in short: Plotting all your data with a circular boundary is not possible - only the radial temperature distribution at a fixed length.
And I don't know what negative radial positions mean.

4 件のコメント

Zeyad Zeitoun
Zeyad Zeitoun 2023 年 10 月 6 日
I have a cylinder (Diameter 16 mm) and at a definite position there is a thermocouple moving radially from the channel wall to the corresponding wall with 1 mm increment. So i am collecting 15 reading at this position and I want to draw a circular contour representing the change in temperature radially at this location.
The negative radial position meaning that the thermocouple didn't reach the centerline and once it passes the centerline, the values are positive. can we have the contour with circualr boudnaries in my case ? Thanks for your help. Much appreciated.
Torsten
Torsten 2023 年 10 月 6 日
編集済み: Torsten 2023 年 10 月 6 日
I have a cylinder (Diameter 16 mm) and at a definite position there is a thermocouple moving radially from the channel wall to the corresponding wall with 1 mm increment. So i am collecting 15 reading at this position and I want to draw a circular contour representing the change in temperature radially at this location.
But how do you want to plot a radial profile if the temperatures along the radial measurement line on the one side of the center of the cylinder differ from the temperatures on the other side of the center of the cylinder at the same radius ? You will also get an angular profile this way.
Anyhow: This might help.
r = linspace(0,8,100);
theta = linspace(0,2*pi,30);
[R,THETA] = meshgrid(r,theta);
X = R.*cos(THETA);
Y = R.*sin(THETA);
TEMP = X.^2+Y.^2;
contourf(X,Y,TEMP)
colorbar
Zeyad Zeitoun
Zeyad Zeitoun 2023 年 10 月 6 日
The temeprature is different radially because the gas is flowing inside the cylinder by natural convection heat transfer, so there is a radial temperature gradient where the hot gas layers are above the cold layers thats why I want to draw it by contour map much better than normal plotting.
I tried your code but it doesn't represent the temperature gradient in the channel. Thanks

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeContour Plots についてさらに検索

質問済み:

2023 年 10 月 5 日

コメント済み:

2023 年 10 月 6 日

Community Treasure Hunt

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

Start Hunting!

Translated by