from sympy import *
t6,a,b,c = symbols ('t6,a,b,c')
result=solve([(a*cos(t6))+(b*sin(t6))+c],[t6])
cs=[(a,-26.468147779101194),(b,4.395890741437306),(c,19.920476269921963)]
t6 = result[t6].subs(cs)
试图解一个方程我想这是因为它有两个结果因为它适用于更简单的方程
在solve()
中不需要list
(即[]
)
t6,a,b,c = symbols('t6,a,b,c')
result=solve((a*cos(t6))+(b*sin(t6))+c, t6)
cs=[(a,-26.468147779101194),(b,4.395890741437306),(c,19.920476269921963)]
# solve for t6
for i in range(len(result)):
t6 = result[i].subs(cs)
print(t6)
输出:
0.569494943945226
-0.898655036471938