代码拉取完成,页面将自动刷新
% 薛定谔我找到你了!一维 抛物线势阱 定态薛定谔方程 的 有限差分 求解
% 使用打靶法猜测本征能量
% 这种方法精度与效率比较低,且结果没有归一化。
% 由于本人学艺不精,可能存在bug,仅供娱乐!
% 参考:https://chem.libretexts.org/Bookshelves/Physical_and_Theoretical_Chemistry_Textbook_Maps/Quantum_Tutorials_(Rioux)/09%3A_Numerical_Solutions_for_Schrodinger's_Equation/9.09%3A_Numerical_Solutions_for_the_Harmonic_Oscillator
% Gitee Repo
% 定态薛定谔方程 的形式是
% \Psi=\Psi(x), -\frac{\hbar^2}{2m} \pdv[2]{\Psi(x)}{x} + V(x) \Psi(x) = E\Psi(x)
% 该方程的本征解有多个,一种解对于一个E(这个问题刚好是非简并的)
clc
clear
L = 10;
dx = 0.1;
E = 0;%能量,是需要猜测的
C = 0.2 %(C=2m/hbar^2)
x = (-L:dx:L)';
n = size(x, 1);
Psi = zeros(n,1); %波函数
V = zeros(n,1); %势能
Psi(1) = 0;
Psi(2) = 0.1*dx;
V(:) = 1/2*0.1*x.^2;
figure()
for E=0:0.005:5
E
for i = 3:n
Psi(i) = 2*Psi(i-1) - Psi(i-2) + (E-V(i-1)).*Psi(i-1)*dx^2*(-C);
end
clf
hold on
% axis equal
xlim([-L L])
plot(x,Psi.^2);
drawnow
if abs(Psi(n).^2)<0.1
printf('a possible solution near E=%0.2f\n', E)
break;
end
pause(0.1)
end
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。