Sympy dsolve无法解决简单的ODE系统,产生NotImplementedEorr

时间:2019-10-17 11:41:26

标签: sympy

当我尝试求解极其简单的ODE系统时,Sympy dsolve会产生NotImplemented错误。如果我使用dsolve求解Eq2,然后将结果插入Eq1,则dsolve返回正确的结果。但是,如果我尝试以ODE系统解决,则会收到未实现的错误:

import sympy
sympy.init_printing()


t = sympy.Symbol('t',real=True)
x = sympy.Function('x')(t)
v = sympy.Function('v')(t)
w = sympy.Symbol('omega',real=True,positive=True,nonzero=True)

eq1 = sympy.Eq(x.diff(),v)
eq2 = sympy.Eq(v.diff(),sympy.cos(w*t))
eqs = [eq1,eq2]

sympy.dsolve(eqs,[x,v])

错误:

---------------------------------------------------------------------------
NotImplementedError                       Traceback (most recent call last)
<ipython-input-12-51065819702a> in <module>
----> 1 sympy.dsolve(eqs,[x,v])

/usr/local/lib/python3.6/dist-packages/sympy/solvers/ode.py in dsolve(eq, func, hint, simplify, ics, xi, eta, x0, n, **kwargs)
    607             "number of functions being equal to number of equations")
    608         if match['type_of_equation'] is None:
--> 609             raise NotImplementedError
    610         else:
    611             if match['is_linear'] == True:

NotImplementedError: 

这与ODE系统获得的过程一样简单,所以我很惊讶地收到此错误。 github(https://github.com/sympy/sympy/issues/16635)上列出了一个问题,但是它已经休眠了几个月。

0 个答案:

没有答案