Skip to contents

HomotopyContinuationProblem(sys, op) builds a problem for a nonlinear system whose equations are polynomials (or rational functions) in the unknowns. solve(prob, HomotopyContinuationJL()) tracks solution paths from the roots of the total degree start system x_i^d_i = 1 to the roots of the system, in complex arithmetic, with the homotopy (1 - s) * gamma * G(x) + s * F(x). The solution holds the real root closest to the initial values in sol$u; all roots found are in sol$original (real_solutions, solutions, and the number of tracked and failed paths). Roots at which a denominator vanishes are discarded.

Usage

HomotopyContinuationProblem(sys, op = list(), ...)

HomotopyContinuationJL(
  gamma = complex(modulus = 1, argument = 0.6180339887 * pi),
  max_paths = 4096L
)

Arguments

sys

A complete time independent System with polynomial equations.

op

Operating point: values of unknowns (used to choose the reported root) and parameters.

...

Solver options stored with the problem.

gamma

The complex constant of the homotopy; a fixed generic value by default so results are reproducible.

max_paths

The largest number of paths to track.

Value

A HomotopyContinuationProblem, or the algorithm object.

Details

The number of paths is the product of the degrees of the equations, so this is meant for small systems. Paths that diverge or end at a singular root may be lost; sol$original$n_failed counts them, so the list of roots is not guaranteed to be complete. ModelingToolkit delegates the tracking to HomotopyContinuation.jl; the tracker here is native R.

Examples

x <- Variable("x"); y <- Variable("y")
sys <- complete(System(list(0 ~ x^2 + y^2 - 5, 0 ~ x * y - 2), name = "poly"))
prob <- HomotopyContinuationProblem(sys, list(x ~ 1, y ~ 1))
sol <- solve(prob)
sol$u
#> x y 
#> 1 2 
nrow(sol$original$real_solutions)
#> [1] 4