Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Plot function of 3 space variables plus time

  1. Jul 26, 2017 #1
    Hi there. I am willing to plot a function of three space variables plus time, lets say ##\phi(x,y,z,t)##. The idea is to plot the 3D function for each time, i.e. evolving in time. As I have three independent variables, corresponding to the three Cartesian coordinates, the function is actually a four dimensional object. So, the idea I had in mind was to plot the mangitude of the function with colours and transparencies, in such a way that I can see through the 3D space. As ##\phi## represents some diffusing concentration, I would like to see it in the whole 3D domain. If possible, I would like to do this with gnu plot. I have already plotted functions of two space variables evolving in time with gnuplot, but that is much easier.

    However, if somebody knows of other alternatives to do this, I dispose of the data in columns, in a text file, x,y,z,##\phi##,t. If there is some software to do this in an easy way, I would welcome it (preferably in linux, but if it is for windows, I can arrange my self to do that).
  2. jcsd
  3. Jul 28, 2017 #2


    User Avatar
    Homework Helper
    Gold Member

    To try to "see" the whole 3d domain, represented by transparent colors, would be difficult enough if you actually built a 3D object, which somebody could walk around and look at. But you want to project this onto a 2d screen. I don't think it will be represented well. There is no easy way. I think this is why you are having a hard time finding something, and not getting much response here.
  4. Jul 28, 2017 #3
    But, for example (and excuse me for this illustration, but this is how the idea came to me) when you pee in the toilet, you are seeing the concentration of pee diffusing in the water, and this concentration is a function of three space variables and time, why can't I resemble this?
  5. Aug 7, 2017 #4
    Hi. I could plot the isosurfaces for each time t: ##\phi(x,y,z)=C##, where C is a constant. I could generate a file with columns ##(x,y,z)## for which ##\phi(x,y,z)=C##, is it possible to plot it that way?
  6. Aug 9, 2017 #5


    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    You can plot a sequence of surfaces. Here's a simple example done in Maple, where you have a sphere with perhaps a varying density indicated by a change in color. But you can't see it all at once. Not sure if it's the kind of thing you want or whether an animated gif will work here. Here goes:
    Well, I guess it works.
    Here's another example where instead of animation I use wireframe so you can see through it somewhat. It's the same example:
    Last edited: Aug 9, 2017
  7. Aug 10, 2017 #6
    Yes, that is ok. Your function is something like ##\rho(x,y,z,t)=x^2+y^2+z^2+\phi(t)##? I think it would be ok just to plot ##\rho(x,y,z,t)=1## at all times, in this case I think it would be just a fixed sphere, but in general it would be some evolving isosurface.
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted