|
Systems of Polynomial Equations
例如$\cases{xy - 2y=0\\2y^2 - x^2=0}$
from sympy import solve_poly_system
from sympy.abc import x, y
solve_poly_system([x*y - 2*y, 2*y**2 - x**2], x, y)
[(0, 0), (2, -sqrt(2)), (2, sqrt(2))]
得方程组的解$\cases{x=0\\y=0}\cases{x=2\\y=-\sqrt2}\cases{x=2\\y=\sqrt2}$
使用Gianni-Kalkbrenner算法
The algorithm proceeds by computing one Groebner basis in the ground domain and then by iteratively computing polynomial factorizations in appropriately constructed algebraic extensions of the ground domain.
该算法在基域中计算 Groebner 基,然后在基域的适当的代数扩张中逐次分解多项式。
例如$\cases{x^2 + y + z - 1=0\\ x + y^2 + z - 1=0\\ x + y + z^2 - 1=0}$
from sympy import solve_triangulated
from sympy.abc import x, y, z
F = [x**2 + y + z - 1, x + y**2 + z - 1, x + y + z**2 - 1]
solve_triangulated(F, x, y, z)
[(0, 0, 1), (0, 1, 0), (1, 0, 0)]
得方程组的解$\cases{x=0\\y=0\\z=1}\cases{x=0\\y=1\\z=0}\cases{x=1\\y=0\\z=0}$ |
|