简体   繁体   中英

Find solutions for a set of quadratic equations

I have a set of quadratic equations, like

x² + x + y = 7
x + 3y = -3
y² + x² + z = 11

All coefficients are integers. The set of equations could either have no solution, one solution of a whole set of solutions.

Does anybody know a method to find out whether these equations have a solution?

My first idea was to solve these equations one by one in double and use the results to solve the other equations. The problems are the rounding errors: If, in theory, I have two equations

x + y = 5
x = 5 - y

there would be plenty of solutions. But if my method results in

x + y = 4.999999
x = 5 - y

the system suddenly has no solution. In the next step, I could add epsilons to compensate for rounding errors, but I am not sure how large they should be. Any ideas or better approaches?

PS: The background is to find intersection points of a complicated set of circles and lines in the plane.

Since you have exact input with integers you could use exact algorithms. You could, for instance, compute a Groebner basis of the polynomials corresponding to your equations, eg

x² + x + y - 7
x + 3y + 3
y² + x² + z - 11

With lexicographic ordering of the terms you will get a Groebner basis in a kind of "triangular" form, where the first polynomial contains as few variables as possible, eg

81z² - 176z + 92
2y + 9z - 8
2x - 27z + 30

This gives you two real roots for z and unique values for y and x once z is fixed. If the first polynomial of the computed basis does not contain a variable, then your set of equations does not have any solutions. If the first polynomial in the computed bases contains two variables, then you have an infinite number of solutions (possibly complex).

You can experiment with Groebner bases online with Wolfram Alpha (eg compute the basis for your example ). A Groebner basis can be computed using the Buchberger algorithm , for which a few implementations are available in Java.

Note: the worst case complexity of the Buchberger algorithm is double exponential in the maximal total degree of the input, but in your application this might not matter.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM