且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在python中使用for循环求解非线性方程?

更新时间:2022-06-16 19:11:39

根据 本文档solve 的输出就是解决方案.x 没有赋值,它仍然只是符号.

According to this documentation, the output of solve is the solution. Nothing is assigned to x, that's still just the symbol.

x = symbols('x')
for N in range(0,2500,5):
    result = solve(a2*x**2+a1*N*x+a0*N**2-s2*x**2-s1*x-s0-0)
    answer.append(result)