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

Plotting atomic orbitals on matlab

  1. Jan 18, 2014 #1
    Hi guys

    I've been having some trouble plotting the p(x) and d(xy) atomic orbitals on Matlab.

    I have been given that p(x) = x*e^-(x^2 + y^2 + z^2)^0.5

    and d(xy) = x*y*e^-(x^2 + y^2 x^2)^0.5

    Now I want to plot these orbitals on matlab using mesh or the surf command and then plot the corresponding contour plots with the contour command. Now the first stage is to just plot them on the xy plane setting z=0 (as a function of x and y) f(x,y).

    Can anyone offer some advice on this?

    Thanks
     
  2. jcsd
  3. Jan 19, 2014 #2

    kreil

    User Avatar
    Gold Member

    Here is a jumping off point. I plotted p(x,y,0) and d(x,y) using surfc(), which is a surf plot with contours. The images are attached below.

    Let me know if you have questions!

    Code (Text):

    px = @(x,y,z) x.*exp(-sqrt(x.^2+y.^2+z.^2));
    dxy = @(x,y) x.*y.*exp(-sqrt(x.^2+y.^2.*x.^2));

    [X,Y] = meshgrid(-4:0.2:4,-4:0.2:4);
    Z = px(X,Y,0);
    Z1 = dxy(X,Y);

    figure;
    surfc(X,Y,Z)
    title('p(x,y,0)')

    figure;
    surfc(X,Y,Z1)
    title('d(x,y)')
     
     

    Attached Files:

    • dxy.png
      dxy.png
      File size:
      10.3 KB
      Views:
      408
    • pxy0.png
      pxy0.png
      File size:
      10.7 KB
      Views:
      492
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Plotting atomic orbitals on matlab
  1. MATLAB plots (Replies: 1)

  2. Matlab Plot (Replies: 2)

  3. Plotting in MATLAB (Replies: 8)

  4. Plotting with MATLAB (Replies: 1)

Loading...