Professional Documents
Culture Documents
Infinite Squre Well Potential
Infinite Squre Well Potential
import numpy as np
def f(U,X,E):
y,z=U
f1,f2=z,(V-E)*y
return[f1,f2]
def shoot(E):
sol=odeint(f,U,X,args =(E,))
return sol[:,0][-1]
V=0
energies=np.arange(0,200,0.2)
X=np.linspace(0,1,100)
U=[0,0.001]
plt.plot(energies,hits)
plt.axhline(linestyle="--")
plt.show()
sol=odeint(f,U,X,args=(En,))
psi=sol[:,0]
N=1/np.sqrt(simps(psi*psi,X))
psi_normal=N*psi
plt.plot(X,psi_normal)
plt.show()
def psi_normal(En):
sol=odeint(f,U,X,args=(En,))
psi=sol[:,0]
N=1/np.sqrt(simps(psi*psi,X))
return N*psi
En=newton(shoot,9*n**2)#newton method
plt.plot(X,psi_normal(En))
plt.axhline(linestyle="--")
plt.xlim(0,1)
plt.ylim(-1.5,1.5)
plt.show()