# 一维薛定谔方程的数值解法

1. 物理想法

\displaystyle \begin{aligned} \frac{\mathrm{d} \phi}{\mathrm{d} x^2} + k^2(x) \phi(x) = 0; \\ \psi(x_{min}) = \psi(x_{max})=0, \end{aligned} \ \ \ \ \ (1)

$\displaystyle k^2(x)= \frac{2m}{\hbar^2} [E - V(x)].$

$\displaystyle \frac{\mathrm{d}\psi_<}{\mathrm{d}x}\Bigg\vert_{x_m}- \frac{\mathrm{d}\psi_>}{\mathrm{d}x}\Bigg\vert_{x_m} = 0. \ \ \ \ \ (2)$

$\displaystyle f \equiv \frac{1}{\psi} [\psi_<(x_m - h) - \psi_> (x_m - h)] = 0, \ \ \ \ \ (3)$

2. 算法分析

$\displaystyle \Bigg(1+\frac{\hbar^2}{12} k^2_{n+1} \Bigg) \psi_{n+1} - 2\Bigg( 1 - \frac{5\hbar^2}{12} k^2_n \Bigg) \psi_n + \Bigg( 1 + \frac{\hbar^2}{12} \Bigg) \psi_{n-1} = O(h^6). \ \ \ \ \ (4)$

$\displaystyle \Bigg[ - \frac{1}{\gamma^2} \frac{\mathrm{d}^2}{\mathrm{d} x^2} + v(x) - \epsilon \Bigg] \psi(x) = 0, \ \ \ \ \ (5)$

$\displaystyle \gamma^2 = \frac{ 2m a^2 V_0}{\hbar^2}$

clear; m0=9.108E-31; ml=0.916*m0; h1=1.055e-34; N=500; M=500; tol=1e-6; a=3e-9; V0=1.602e-20; l=35e-9; dx=l/N; L=l/a; Dx=dx/a; X=0:Dx:L; x=X*a; ga=sqrt(2*ml*V0*a^2/h1^2); Vm=1; V=-Vm:Vm/N:0; V=V*1.602e-19; v=V/V0; eold=v(1)+abs(v(1))/M; for k=1:N/2 U(k,2*k-1:2*k+1)=[1,4,1]; end for k=1:1000 e1=eold+abs(v(1))/M; err=2*tol; v1=-(v-eold); s=find(v1tol & abs(err)<10000 & e1<0 & M<10^10 v1=-(v-e1); s=find(v1<=0);

if length(s)==1 e=e(find(e~=0)); E=e*V0; P=Psi(find(e~=0),:); return end K=-ga^2*(v-e1); psi(N+1)=0; psi(N)=Dx*0.5; for n=N+1:-1:s(1)+1 psi(n-2)=(2*(1-K(n-1)*5*Dx^2/12)*psi(n-1)-(1+K(n)*Dx^2/12)… *psi(n))/(1+K(n-2)*Dx^2/12); end psi1(1)=0; psi1(2)=Dx*0.5; for n=1:s(1)-1 psi1(n+2)=(2*(1-K(n+1)*5*Dx^2/12)*psi1(n+1)-(1+K(n)*Dx^2/12)… *psi1(n))/(1+K(n+2)*Dx^2/12); end psi=psi/psi(s(1)); psi1=psi1/psi1(s(1)); err=psi1(s(1)+1)-psi(s(1)+1); eold=e1; e1=e1+abs(v(1))/M; if err*errold<0 eold=e1-3*abs(v(1))/M; M=M*10; e1=eold+abs(v(1))/M; end end if abs(err)<0.0001 e(k)=eold; end Psi(k,1:s(1))=psi1(1:s(1)); Psi(k,s(1)+1:N+1)=psi(s(1)+1:N+1); Psi(k,:)=Psi(k,:)/sqrt(Dx*sum(U*Psi(k,:).^2')/3); psi=0; psi1=0; M=500; eold=eold+2*abs(v(1))/M; end