How to plot this wave function into 2D or 3D polar coordinate?
Show older comments
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 Comments
Star Strider
on 26 May 2018
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
on 26 May 2018
Answers (2)
Star Strider
on 26 May 2018
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
on 10 Nov 2019
0 votes
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
Categories
Find more on Physical and Time Unit Conversions in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!