Forgot password
 Register account
View 148|Reply 0

[SymPy] solve a system of polynomial equations

[Copy link]

3208

Threads

7846

Posts

51

Reputation

Show all posts

hbghlyj posted 2022-12-24 10:09 |Read mode
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}$

Quick Reply

Advanced Mode
B Color Image Link Quote Code Smilies
You have to log in before you can reply Login | Register account

$\LaTeX$ formula tutorial

Mobile version

2025-7-12 15:23 GMT+8

Powered by Discuz!

Processed in 0.012592 seconds, 26 queries