Choosing a start system for homotopy continuation is an art for itself. We give some basic rules for start systems. They can roughly be subdivided into three classes:
The first one is suitable for system, which are dense. The second one is suitable for systems, which are sparse. Here is how it works:
using HomotopyContinuation @polyvar x y; f = [x^2 + 2y, y^2 - 2] solve(f; start_system = :total_degree) # using totaldegree solve(f; start_system = :polyhedral) # using polyhedral
In this case, one should first compute an intermediate solution with random complex coefficients. Why complex? The reason is that tracking over the complex numbers one can easily avoid the locus where homotopy continuation fails (and this is not possible tracking only over the real numbers!).
Here is an example with parameters
using HomotopyContinuation, DynamicPolynomials @polyvar x y z p[1:3] F = [ x + 3 + 2y + 2y^2 - p^2, (x - 2 + 5y)*z + 4 - p * z, (x + 2 + 4y)*z + 5 - p * z ]
Suppose we want to solve the system for
p₁ = [1,1,2]. Then, we first solve it for random complex coefficients:
# Generate generic parameters by sampling complex numbers from the normal distribution p₀ = randn(ComplexF64, 3) # Substitute p₀ for p F_p₀ = subs(F, p => p₀) # Compute all solutions for F_p₀ result_p₀ = solve(F_p₀)
Now, we track
p₁ using a parameter homotopy.
p₁ = [1, 1, 2] result_p₁ = solve(F, solutions(result_p₀); parameters=p, start_parameters=p₀, target_parameters=p₁)
This approach is particularly useful when one has to solve this system for many different sets of parameters, as we explain in this guide.
In this case, one should use the monodromy method.