小编hyo*_*kai的帖子

如何使用python简化三角表达式?

我有一个这样的表达式,由 Sympy 计算:

-1.0*pi*(-1.0*sin(1.0*t) - 0.025*cos(1.0*t) + 4.0*cos(2.0*t))
Run Code Online (Sandbox Code Playgroud)

然后我尝试了很多为简化表达而提供的选项,但它们并没有太大作用。

当我使用时expand_trig(),它返回:

pi*(1.0*sin(1.0*t) + 0.025*cos(1.0*t) - 4.0*cos(2.0*t))
Run Code Online (Sandbox Code Playgroud)

但是当我使用 Mathematica 时,它返回:

-25.0542 Cos t + 3.14159 Sin t
Run Code Online (Sandbox Code Playgroud)

如何使用 Python 获得像 Mathematica 这样的结果?如果我想进一步简化 Mathematica 给出的表达式,我该怎么办?

python wolfram-mathematica sympy

1
推荐指数
1
解决办法
428
查看次数

标签 统计

python ×1

sympy ×1

wolfram-mathematica ×1