MATLAB - 3D contour plot (hydrogen orbitals 2p)

I have the following code that works to build an xy slice of the Hydrogen 2pz orbit:

%probability densities pd_psi_210 = @(r,theta,phi) exp(-r).*(r.^2).*(cos(theta).^2)/(32*pi); %configuring the range [xyz] = meshgrid(-10:.1:10,-10:.1:10,-2:.1:2); [THETA,PHI,R] = cart2sph(x,y,z); %create array of probability density magnitudes psi_210_vals = pd_psi_210(R,THETA,PHI); %plotting imagesc(psi_210_vals(:,:,1)); %xy plane 

I would like to plot a three-dimensional contour of the orbit. I tried this (and it seems I don't like it):

 isosurface(psi_210_vals(:,:,:)); %3D contour 

How can I make this work?

+4
source share
1 answer

You just need to specify the base grid and the desired level. For instance:

 >> isosurface(-10:.1:10, -10:.1:10, -2:.1:2, psi_210_vals, 0.001); >> axis equal 

enter image description here

+6
source

Source: https://habr.com/ru/post/1380034/


All Articles