Ploting 3D flow data (4D plot)
8 views (last 30 days)
Show older comments
Hi,
I will be doing CFD calculations with MATLAB in 3D. I have x,y,z coordinates and Temperature in each point. Assume I have 100 points in each direction I have 100*100*100 temperature points. I want to plot temperature (also make a movie) using color as the temperature intensity. Is there an easy way of doing it? I am not sure if scatter3 will work for me or not. ( I want to know if I need to invest time to learn paraview)
Thank you.
1 Comment
Walter Roberson
on 5 Apr 2013
What is your display resolution? Although in theory 100*100*100 has the same number of pixels as a 1000 x 1000 display, in practice the projection angle is going to require a lot of those voxels to be visually on top of one another.
How far "into" the cube needs to be visible from the outside?
Answers (2)
Ahmed A. Selman
on 5 Apr 2013
Logically, no 4-D plot can be made sensible to us (unfortunately, we are stuck to see and understand 3-D world, only). So even if you could plot it somehow, understanding it will be quite tricky. Yet, fortunately this time, we can imagine n-D world theoretically (with n = 0 to inf).
Now, suppose your data set is something like D(x,y,z,T). At each point of (x,y,z) space, there is a (T) value that changes the behavior. So you want to visualize the (x,y,z) space at a given (T). Thus, the answer is (fix one coordinate, and change the other 3). The rest is how to do it.
When I needed it, I used to fix z-coordinate and plot (x,y) horizontally, with (T) in the vertical axis, as in the example below:
clc
clear
close all
for x=1:20;
for y=1:20;
for z=1:20
for T=1:20
D(x,y,z,T)=sin((T.*x.*z)*0.1); % creating 4-D array
end
end
end
end
[nio, njo, nko, nTo]=size(D);
surfl(D(:,:,1)); % Initial snapshot
for k=1:nTo; % fixing the z-coordinates
surfl(D(:,:,k))
xlabel(' X - Axis');
ylabel(' Y - Axis');
zlabel(' T - Axis');
title({' Z is fixed at: ' k })
pause (0.1);
CF(k)=getframe;
end
figure;
movie(CF); % This is the movie of the frames just displayed.
Please modify it to your own convenience, this is NOT the code you exactly need, but the method is, I think.
0 Comments
Omid Adljuy
on 5 Apr 2013
Edited: Omid Adljuy
on 5 Apr 2013
Probably the isosurface command is what you're looking for.
See MATLAB Help for more details and examples.
0 Comments
See Also
Categories
Find more on Surface and Mesh Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!