% input arguments
n = 4;
l = 3;
m = 1;
% setups
a = 1; % natural unit of length
N = 20000*n; % sampling points
rs = 20*n*rand(1,N);
% radial wave function
xi = 2*rs / ( n*a );
syms x r
Xnl = ( exp(-x/2) .* x.^l .* hypergeom(-n+l+1, 2*l+2, x) ).^2.*r.^2;
Xnl = matlabFunction(Xnl);
Xnl = Xnl(rs,xi);
M = max(Xnl);
rs2 = M*rand(1,N);
r = rs(rs2<Xnl);
nr = length(r);
% phi =2*pi*rand(1,n);
% angular wave function
ts = pi*rand(1,nr);
Ylm = legendre(l, cos(ts));
Ylm = Ylm(abs(m)+1,:);
Ylm2 = Ylm.*Ylm.*sin(ts);
My = max(Ylm2);
ts2 = My*rand(1,nr);
t = ts(ts2<Ylm2);
nn = length(t);
phi = 2*pi*rand(1,nn);
% display results
figure( 'Position', [200 50 1000 700],'Color','w')
[X,Y,Z] = sph2cart(phi,t-pi/2,r(1:nn));
subplot(2,2,1);hold on;view(3)
plot3(X,Y,Z,'.r','MarkerSize',1)
title('3D view')
axis equal
[X1,Y1] = pol2cart(phi,r(1:nn));
subplot(2,2,2);hold on
title('xy plane section')
plot(X1,Y1,'.r','MarkerSize',1)
axis equal
subplot(2,2,3);hold on
title('xy plane projection')
plot(X,Y,'.r','MarkerSize',1)
axis equal
subplot(2,2,4);hold on
title('xz plane projection')
plot(X,Z,'.r','MarkerSize',1)
axis equal
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
matlab绘制氢原子的电子云.zip (2个子文件)
matlab绘制氢原子的电子云
dianziyun.m 1KB
fig (1).png 835KB
共 2 条
- 1
木子奇奇~
- 粉丝: 470
- 资源: 26
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页