How to solve a system of polynomial equations

For this guide, we're going to walk through an illustrative example


If you have not yet installed HomotopyContinuation.jl, please consider the installation guide.

Solve your first system of equations

Consider the following simple system of two polynomials in two variables.

$$ f=\begin{bmatrix}x^2+2y \\ y^2-2 \end{bmatrix} $$

Solving the equation $f=0$ can be accomplished as follows

using HomotopyContinuation # load the package into the current Julia session
@polyvar x y; # declare the variables x and y
f = [x^2 + 2y, y^2 - 2]
result = solve(f) # solve f

After the computation has finished, you should see the following output.

Result with 4 solutions
• 4 non-singular solutions (2 real)
• 0 singular solutions (0 real)
• 4 paths tracked
• random seed: 902575

We see that $f$ has two real zeros. They are

julia> realsolutions(result)
2-element Array{Array{Float64,1},1}:
 [1.68179, -1.41421]
 [-1.68179, -1.41421]

It is possible to interrupt the computations using control+c. All solutions that have been computed before the interruption will be returned.

Understanding the output of your computation

A detailed explanation of the output of solve(f) is described in the next guide.

Solving many systems of equations

solve(f) works nicely for single systems. If you have to solve many systems in a loop, you should read this guide.

What else should I know?

HomotopyContinuation.jl provides many more features. Check our detailed Guides for learning more about the full power of homotopy continuation.

You should also consult our API Docs, where all options of solve(f) are listed.