Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在根解决后获得结果。
a = Eq(x**3 + x**2 - 3*x + 1,0) b = solve(a) print(b)
结果:
[1, -1 + sqrt(2), -sqrt(2) - 1]
使用evalf:
evalf
In [4]: [s.evalf() for s in b] Out[4]: [1.0, 0.414213562373095, -2.41421356237309]