need help for plotting of data
1 回表示 (過去 30 日間)
古いコメントを表示
Below is 3d heat conduction equation code. The data is visible in excel format but i want to plot for better visualization and understanding.
can someone please help me with this any suggestions will do!
xlength = 0.173; % Width (m)
ylength = 0.125; % High (m)
zlength = 0.045;
nx = 10; % Number of nodes on the x axis
ny = 10; % Number of nodes on the y axis
nz = 10;
sx = nx-1; % Number of segments on the x axis
sy = ny-1; % Number of segments on the y axis
sz = nz-1;
deltax = xlength/sx; % uniform nodal spacing on the x-axis
deltay = ylength/sy;
deltaz = zlength/sz;
c=nx/2; % centre cell x-axis
v=ny/2; % centre cell y-axis
b=nz/2;
xspan = linspace(0,xlength,nx);
yspan = linspace(0,ylength,ny);
zspan = linspace(0,zlength,nz);
T = zeros(nx);
T(1,1:nx,1:nz) = 28; % Temperature at top surface
T(ny,1:nx,1:nz) = 28; % Temperature at bottom surface
T(1:ny,1,1:nz) = 26; %Temperature at left surface
T(1:ny,nx,1:nz) = 26;
T(1:ny,1:nx,1) = 26; % Temperature at right surface
T(1:ny,1:nx,nz) = 26;
cond = 0.2; % Thermal conductivity
qdot_gen = 7043; % heat flux generation
qdot_node = qdot_gen; % uniform heat flux generation
p=10000; % No of itteration
for h=1:1:p
for i = 2:nx-1
for j = 2:ny-1
for k = 2:nz-1
T(i,j,k) = 1/6*(T(i,j+1,k) + T(i+1,j,k) + T(i,j-1,k) + T(i-1,j,k) + T(i,j,k-1) + T(i,j,k+1));
for x=c
for y=v
for z=b
T(x,y) = 1/6*(T(x,y+1,z) + T(x+1,y,z) + T(x,y-1,z) + T(x-1,y,z) + T(x,y,z+1) + T(x,y,z-1) + qdot_node*deltax^2/cond);
end
end
end
end
end
end
end
2 件のコメント
採用された回答
KALYAN ACHARJYA
2021 年 1 月 13 日
編集済み: KALYAN ACHARJYA
2021 年 1 月 13 日
>> whos T
Name Size Bytes Class Attributes
T 10x10x10 8000 double
Here, if you try to fit all those planes in the same plot, it maynot be seen from Top due to overlap each others (Visualizations point of view), better to separate each other.
tiledlayout(2,5)
for i=1:10
nexttile,surf(T(:,:,i));
title(['Plane No: ',num2str(i)]);
colormap summer;
end
Please do modify as per requirements.
その他の回答 (1 件)
Deniz Savas
2021 年 1 月 13 日
Dear Shantanu,
I think I might have just the right tool for you.
After I study your code I shall provide you with further information.
Deniz
4 件のコメント
Deniz Savas
2021 年 1 月 13 日
Is this the sort of visualization you are looking for ?
There is also an option to animate these graphs
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!