Plotting atomic orbitals on matlab

Click For Summary
SUMMARY

This discussion focuses on plotting atomic orbitals p(x) and d(xy) using MATLAB. The mathematical definitions provided are 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). Users successfully utilized the surfc() function to create surface and contour plots for these orbitals, specifically on the xy plane with z set to 0. The discussion includes MATLAB code snippets for generating these plots.

PREREQUISITES
  • Familiarity with MATLAB programming
  • Understanding of atomic orbital equations
  • Knowledge of meshgrid function in MATLAB
  • Experience with plotting functions such as surf and contour
NEXT STEPS
  • Explore advanced MATLAB plotting techniques using the plot3 function
  • Learn about visualizing 3D atomic orbitals in MATLAB
  • Research the mathematical properties of atomic orbitals
  • Investigate optimization techniques for rendering complex plots in MATLAB
USEFUL FOR

This discussion is beneficial for physicists, chemists, and MATLAB users interested in visualizing atomic orbitals and enhancing their plotting skills in scientific computing.

Scientist94
Messages
10
Reaction score
0
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
 
Physics news on Phys.org
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:
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)')
 

Attachments

  • dxy.png
    dxy.png
    12.3 KB · Views: 1,213
  • pxy0.png
    pxy0.png
    12.8 KB · Views: 1,532

Similar threads

  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 11 ·
Replies
11
Views
5K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 14 ·
Replies
14
Views
4K