I have three functions in spherical coordinates that I want to plot. They are functions of r,theta,phi and I want to view them in the x-y,y-z,x-z planes. I’ve tried accomplishing this for literally 8 hours. Every method I’ve tried has been unsuccessful.
How can I accomplish this phenomenally simple task?
F1 = (r.^2).*abs((1/(8*sqrt(pi))).*r.*exp(-r/2).*sin(theta).*cos(phi)).^2;
F2 = (r.^2).*abs((1/(8*sqrt(pi))).*r.*exp(-r/2).*sin(theta).*sin(phi)).^2;
F3 = (r.^2).*abs((1/(4*sqrt(2*pi))).*r.*exp(-r/2).*cos(theta)).^2;
As you can see, all three of the functions are F(r,theta,phi). That means that there are four dimensions: F,r,theta,phi.
If your functions cannot be expressed as r=f(theta,phi), maybe you can compute the value of f(theta,phi,r) over a grid and then plot an isosurface where your volume data equals your value twoPx.
I tried this small example from which you can expand but I do not know if the shape is correct because I do not know what to expect:
A little explanation of what this snippet does:
ndgrid)sph2cart)patchandisosurface)Finally you may want to use the Matlab function
viewto specify which plane you want to look from.