generate a solution to Schrodinger's eqn for a potential V=(2m/hbar**2)(V-E) using the Numerov method. Always integrate in from forbidden region to center of potential from both ends, and solve to match boundary conditions. The initial conditions will fail if started in an allowed (V-E < 0) region Definition at line 21 of file numerov_solve.py. 00021 : 00022 """generate a solution to Schrodinger's eqn for a potential V=(2m/hbar**2)(V-E) using the Numerov method. 00023 Always integrate in from forbidden region to center of potential from both ends, and solve to match boundary conditions. The initial conditions will fail if started in an allowed (V-E < 0) region""" 00024 npoints=len(V) 00025 Y=Numeric.zeros(npoints,Numeric.Float) 00026 dx2=dx*dx 00027 ypsifact=1.0/(1.0-(dx2/12.0)*V) 00028 coef=2.0+dx2*V*ypsifact 00029 00030 Y[0]=1.0/ypsifact[0] 00031 Y[1]=math.exp(math.sqrt(V[0])*dx)/ypsifact[1] 00032 00033 numerov_iter(Y,coef) 00034 00035 return Y*ypsifact 00036 00037 def zbrent(func, x1, x2, tol, itmax=100, trace=0):
|