| 网站首页 | 业界新闻 | 小组 | 交易 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
 买学问 - 大牛一对一辅导，有问必答 买学问 - 专业的付费知识问答平台

问题点数：0  回复次数：2
Python解微分方程出现TypeError: splu() got an unexpected keyword argument 'drop_tol'错误提示

import fipy as fp
nx = 20
ny = 20
dx = 1.
dy = dx
L = dx*nx
mesh = fp.Grid2D(dx=dx,dy=dy,nx=nx,ny=ny)
phi = fp.CellVariable(name='solution variable', mesh=mesh, value=0.)
D = 1
eq = fp.TransientTerm() == fp.DiffusionTerm(coeff=D)
T1 = 100
T2 = 0
phi.constrain(T2, mesh.facesRight)
phi.constrain(T2, mesh.facesLeft)
phi.constrain(T2, mesh.facesBottom)
phi.constrain(T1, mesh.facesTop)

viewer = fp.Viewer(vars = phi, datamin=0., datamax = 1.)
viewer.plot()

timeStepDuration = 10*0.9*dx**2/(2*D)
steps =10
for step in range(steps):
eq.solve(var=phi, dt=timeStepDuration)
viewer.plot()
print fp.numerix.allclose(phi(((L,),(0,))),T1,atol = 1e-2)
raw_input('press <return> to exit')

File "C:\Users\Yang\Desktop\pf-test\bdwk.py", line 24, in <module>
eq.solve(var=phi, dt=timeStepDuration)
File "C:\Python27\lib\site-packages\fipy\terms\term.py", line 213, in solve
solver._solve()
File "C:\Python27\lib\site-packages\fipy\solvers\scipy\scipySolver.py", line 61, in _solve
self.var[:] = numerix.reshape(self._solve_(self.matrix, self.var.ravel(), numerix.array(self.RHSvector)), self.var.shape)
File "C:\Python27\lib\site-packages\fipy\solvers\scipy\linearLUSolver.py", line 64, in _solve_
permc_spec=3)
TypeError: splu() got an unexpected keyword argument 'drop_tol'

得分:0

得分:0

• 3
• 1/1页
• 1