need help for plotting of data

8 views (last 30 days)
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

Accepted Answer

KALYAN ACHARJYA
KALYAN ACHARJYA on 13 Jan 2021
Edited: KALYAN ACHARJYA on 13 Jan 2021
>> 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 Comment
shantanu lanke
shantanu lanke on 15 Jan 2021
thank you so much sir this really helped me a lot.
Regards
shantanu lanke

Sign in to comment.

More Answers (1)

Deniz Savas
Deniz Savas on 13 Jan 2021
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 Comments
Deniz Savas
Deniz Savas on 13 Jan 2021
Is this the sort of visualization you are looking for ?
There is also an option to animate these graphs
shantanu lanke
shantanu lanke on 15 Jan 2021
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

Sign in to comment.

Categories

Find more on Creating, Deleting, and Querying Graphics Objects in Help Center and File Exchange

Products


Release

R2020b

Community Treasure Hunt

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

Start Hunting!