How to plot this wave function into 2D or 3D polar coordinate?
显示 更早的评论
Hi ! I have wave function for pz orbital
psi=1/sqrt(32*pi)*a0^(-5/2)*r*exp(-r/2*a0)*cos(theta)
for px orbital
psi=1/sqrt(32*pi)*a0^(-5/2)*r*exp(-r/2*a0)*sin(theta)*cos(phi)
there are many examples for plotting wave functions, but I want to use this wave function directly. help me please!!!
2 个评论
Star Strider
2018-5-26
What do you want to plot?
I assume ‘psi’ is your dependent variable. What is or are your independent variables?
Are any values constants? Are they vector constants or scalar constants?
chanyoung choi
2018-5-26
回答(2 个)
Star Strider
2018-5-26
I have no idea what you are doing.
This runs, although having the correct values for the constants will likely produce better results than I got:
psi = 0.5; % Use The Correct Value
phi = 0.5; % Use The Correct Value
a0 = 42; % Use The Correct Value
pzfcn = @(theta,r) psi - (1/sqrt(32*pi)*a0^(-5/2)*r.*exp(-r/2*a0).*cos(theta));
pxfcn = @(theta,r) psi - (1/sqrt(32*pi)*a0^(-5/2)*r*exp(-r/2*a0)*sin(theta)*cos(phi))
thta = linspace(0, 2*pi);
for k1 = 1:numel(thta)
rz(k1) = fzero(@(r) pzfcn(thta(k1),r), 0.001);
rx(k1) = fzero(@(r) pxfcn(thta(k1),r), 0.001);
end
figure(1)
polarplot(thta, rz)
hold on
polarplot(thta, rx)
hold off
The code is relatively straightforward, so I will not document it further.
Experiment to get the result you want.
Veena Kumari
2019-11-10
0 个投票
psi = 0.5; % Use The Correct Value
phi = 0.5; % Use The Correct Value
a0 = 42; % Use The Correct Value
pzfcn = @(theta,r) psi - (1/sqrt(32*pi)*a0^(-5/2)*r.*exp(-r/2*a0).*cos(theta));
pxfcn = @(theta,r) psi - (1/sqrt(32*pi)*a0^(-5/2)*r*exp(-r/2*a0)*sin(theta)*cos(phi))
thta = linspace(0, 2*pi);
for k1 = 1:numel(thta)
rz(k1) = fzero(@(r) pzfcn(thta(k1),r), 0.001);
rx(k1) = fzero(@(r) pxfcn(thta(k1),r), 0.001);
end
figure(1)
polarplot(thta, rz)
hold on
polarplot(thta, rx)
hold off
类别
在 帮助中心 和 File Exchange 中查找有关 Physical and Time Unit Conversions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!