need help for plotting of data

조회 수: 7 (최근 30일)
shantanu lanke
shantanu lanke 2021년 1월 13일
댓글: shantanu lanke 2021년 1월 15일
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
KSSV
KSSV 2021년 1월 13일
REad about pcolor and Surf.
shantanu lanke
shantanu lanke 2021년 1월 15일
ok

댓글을 달려면 로그인하십시오.

채택된 답변

KALYAN ACHARJYA
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
shantanu lanke
shantanu lanke 2021년 1월 15일
thank you so much sir this really helped me a lot.
Regards
shantanu lanke

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Deniz Savas
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
Deniz Savas 2021년 1월 13일
Is this the sort of visualization you are looking for ?
There is also an option to animate these graphs
shantanu lanke
shantanu lanke 2021년 1월 15일
Hi @Deniz Savas thanks a lot for your reply can you please share how you plotted this graphs and are they customizable like the axis data and all?
Thank you so much once again for helping
Regards
Shantanu Lanke

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by