我正在尝试在 python 中解决 3 个三角方程。我使用了 Sympy 库,但出现错误,例如“TypeError: can't convert expression to float”
这是我的 Python 源代码:
from sympy import Symbol, solve, Eq
from math import*
# Robot Arm length
L1 = 0
L2 = 97.9
L3 = 120
L4 = 120
L5 = 184
# location
x = L1+L2+L3+L4+L5
y = 0
z = 0
x1 = Symbol('x1',real = True)
x2 = Symbol('x2',real = True)
x3 = Symbol('x3',real = True)
#trigonometric equations
e1= Eq(L1 - (5*sin(x1))/2 - L4*(cos(x1)*sin(x2)*sin(x3) - cos(x1)*cos(x2)*cos(x3)) - …Run Code Online (Sandbox Code Playgroud)