我想用渐近法建立一个方程。但是指数的使用似乎是一个错误:
import sympy
from sympy import init_printing
init_printing(use_unicode=True)
E0, V0, B0, dB0, V = sympy.symbols('E0 V0 B0 dB0 V')
E0 + 9*V0*B0/16 * (
[(V0/V)^2/3 - 1 ]^3 * dB0 + \
[(V0/V)^2/3 - 1 ]^2 * [6-4*(V0/V)^(2/3)] \
)返回错误:
TypeError: unsupported operand type(s) for ^: 'Mul' and 'int'发布于 2018-05-10 10:01:12
在python中,指数运算符不是^,而是**。在scypy中也是(如本例中关于docs:http://docs.sympy.org/0.7.1/tutorial.html#series-expansion中的系列的例子所示)
https://stackoverflow.com/questions/50270182
复制相似问题