1 Star 0 Fork 0

ACertainUser/我的赛博大物实验

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
schrodinger1D_ODE.m 1.32 KB
一键复制 编辑 原始数据 按行查看 历史
% 薛定谔我找到你了!一维 抛物线势阱 定态薛定谔方程 的 有限差分 求解
% 使用打靶法猜测本征能量
% 这种方法精度与效率比较低,且结果没有归一化。
% 由于本人学艺不精,可能存在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
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Matlab
1
https://gitee.com/acertainuser/my---matlab-script.git
git@gitee.com:acertainuser/my---matlab-script.git
acertainuser
my---matlab-script
我的赛博大物实验
master

搜索帮助