I have written a code where i am trying to simulate n numbers of bubbles but my problem is that i have to hard code my function as you can see that i am using fx, fy, fz
then fx1, fy1, fz1
and fx2, fy2, fz2
.
Instead of that i want to create my functions using a loop and also want to plot them using a loop.Is there any way to do that.
Here is the code :
w=1.0
set isosample 50
set parametric
set urange [0:2*pi]
set vrange [-pi/2:pi/2]
do for [w=1:50] {
fx(v,u,w) = w*cos(v)*cos(u)
fy(v,u,w) = w*cos(v)*sin(u)
fz(v,w) = w*sin(v)
fx1(v,u,w) = 20+w*cos(v)*cos(u)
fy1(v,u,w) = 30+w*cos(v)*sin(u)
fz1(v,w) = 30+w*sin(v)
fx2(v,u,w) = 40+w*cos(v)*cos(u)
fy2(v,u,w) = 60+w*cos(v)*sin(u)
fz2(v,w) = 60+w*sin(v)
splot fx(v,u,w), fy(v,u,w), fz(v,w), fx1(v,u,w), fy1(v,u,w), fz1(v,w), fx2(v,u,w), fy2(v,u,w), fz2(v,w) with pm3d
}