阅读背景:

IndexError:列表索引超出范围,拍摄方法

来源:互联网 
x1=np.linspace(xmin, xmax, Nsteps)
y1=np.linspace(0., 0., Nsteps)
h=x1[1]-x1[0]
V1=-V0*np.exp(-alpha*(x1)**2)
E=-1
k=math.sqrt(-2*E)
y1[0]=1
y1[1]=np.exp(k*h)
f=2*[V1-E]

def a():
   for i in range (1,Nsteps):
    denom = np.sum(2+10*h**2*f[i]/12)
    numer = np.sum(1-h**2*f[i+1]/12)   
    return denom/numer


def b():
  for i in range(1, Nsteps):
    denom = np.sum(1-h**2*f[i-1]/12)
    numer = np.sum(1-h**2*f[i+1]/12)
    return denom/numer

def y2():
    a[i]*y1[i] + b[i]*y1[i-1]

for i in range (1, Nsteps):
    print(y2)

plt.plot(x1, y2)
plt.show()
x1=np.linspace(xmin, xmax, Nsteps)
y1=np.linspa



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: