简体   繁体   English

导数对象没有属性derived_count

[英]Derivative object has no attribute derivative_count

I am trying to solve a very simple ODE using the dsolve sympy function: 我正在尝试使用dsolve sympy函数解决一个非常简单的ODE:

from sympy import*
init_printing()
t = symbols('t', real = True)
A = symbols('A', complex = True)
f = Function('rho')(t)
dsolve(Derivative(f, t)+A*f, f)

But, then I get: 但是,我得到:

 Traceback (most recent call last):
  File "<ipython-input-9-3d1f21a5ef22>", line 1, in <module>
    dsolve(Derivative(f, t)+A*f, f)
  File "/home/ted/anaconda3/lib/python3.6/site-packages/sympy/solvers/ode.py", line 566, in dsolve
    hints = _desolve(eq, func=func, hint=hint, simplify=True, xi=xi, eta=eta, type='ode', ics=ics, x0=x0, n=n, **kwargs)
  File "/home/ted/anaconda3/lib/python3.6/site-packages/sympy/solvers/deutils.py", line 205, in _desolve
    n=terms, x0=x0, prep=prep)
  File "/home/ted/anaconda3/lib/python3.6/site-packages/sympy/solvers/ode.py", line 1251, in classify_ode
    r = _nth_linear_match(reduced_eq, func, order)
  File "/home/ted/anaconda3/lib/python3.6/site-packages/sympy/solvers/ode.py", line 3723, in _nth_linear_match
    terms[f.derivative_count] += c
AttributeError: 'Derivative' object has no attribute 'derivative_count'

The sympy version is 1.1.1, the python version is 3.6.4 and the ipython version is 6.2.1. sympy版本是1.1.1,python版本是3.6.4,ipython版本是6.2.1。

My bad! 我的错! I tried to use one of the files (ode.py) from the current development version without updating the rest. 我尝试使用当前开发版本中的一个文件(ode.py),而不更新其余文件。 Now I have it working. 现在,我可以使用了。 Thanks! 谢谢!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM