PYTHON 符号不可调用
PYTHON Symbol is not callable
我开始学习 Python 微分方程和差分方程,这是来自 SymPy 教程,但我仍然收到此错误:'Symbol' object is not callable.
我该如何解决这个问题?
t = symbols('t',real=True)
x, y = symbols('x, y', function=True)
eq = (Eq(Derivative(x(t),t), 12*t*x(t) + 8*y(t)), Eq(Derivative(y(t),t), 21*x(t) + 7*t*y(t)))
如果我对 docs 的解释正确,你的例子应该定义如下:
from sympy import Function
t = symbols('t',real=True)
x = Function('x')(t)
y = Function('y')(t)
eq = (Eq(Derivative(x,t), 12*t*x + 8*y),
Eq(Derivative(y,t), 21*x + 7*t*y))
我开始学习 Python 微分方程和差分方程,这是来自 SymPy 教程,但我仍然收到此错误:'Symbol' object is not callable.
我该如何解决这个问题?
t = symbols('t',real=True)
x, y = symbols('x, y', function=True)
eq = (Eq(Derivative(x(t),t), 12*t*x(t) + 8*y(t)), Eq(Derivative(y(t),t), 21*x(t) + 7*t*y(t)))
如果我对 docs 的解释正确,你的例子应该定义如下:
from sympy import Function
t = symbols('t',real=True)
x = Function('x')(t)
y = Function('y')(t)
eq = (Eq(Derivative(x,t), 12*t*x + 8*y),
Eq(Derivative(y,t), 21*x + 7*t*y))