TypeError:列表索引必须是整数或切片,不能是Symbol


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

相关内容

  • 没有找到相关文章

最新更新