HomotopyContinuation.jl

NonlinearSolve wraps the homotopy continuation algorithm implemented in HomotopyContinuation.jl. This solver is not included by default and needs to be installed separately:

import Pkg
Pkg.add("NonlinearSolveHomotopyContinuation")
import NonlinearSolveHomotopyContinuation
import NonlinearSolve as NLS

Solver API

NonlinearSolveHomotopyContinuation.HomotopyContinuationJL — Type
HomotopyContinuationJL{AllRoots}(; autodiff = true, kwargs...)
HomotopyContinuationJL(; kwargs...) = HomotopyContinuationJL{false}(; kwargs...)

This algorithm is an interface to HomotopyContinuation.jl. It is only valid for fully determined polynomial systems. The AllRoots type parameter can be true or false and controls whether the solver will find all roots of the polynomial or a single root close to the initial guess provided to the NonlinearProblem. The polynomial function must allow complex numbers to be provided as the state.

If AllRoots is true, the initial guess in the NonlinearProblem is ignored. The function must be traceable using HomotopyContinuation.jl's symbolic variables. Note that higher degree polynomials and systems with multiple unknowns can increase solve time significantly.

If AllRoots is false, a single path is traced during the homotopy. The traced path depends on the initial guess provided to the NonlinearProblem being solved. This method does not require that the polynomial function is traceable via HomotopyContinuation.jl's symbolic variables.

HomotopyContinuation.jl requires the jacobian of the system. In case a jacobian function is provided, it will be used. Otherwise, the autodiff keyword argument controls the autodiff method used to compute the jacobian. A value of true refers to AutoForwardDiff and false refers to AutoFiniteDiff. Alternate algorithms can be specified using ADTypes.jl.

HomotopyContinuation.jl requires the taylor series of the polynomial system for the single root method. This is automatically computed using TaylorSeries.jl.

source
NonlinearSolveHomotopyContinuation.TaylorHomotopyContinuationJL — Type
TaylorHomotopyContinuationJL{AllRoots}(; degree = 3, autodiff = true, kwargs...)
TaylorHomotopyContinuationJL(; kwargs...) = TaylorHomotopyContinuationJL{false}(; kwargs...)

A solver for general (non-polynomial) nonlinear systems built on top of HomotopyContinuation.jl. The system is approximated by its multivariate Taylor polynomial of total degree degree around the initial guess, all roots of the polynomial surrogate are found via homotopy continuation, and every (near-)real root is used as an initial guess for a Newton iteration on the original system. Newton iterates that converge are reported as roots.

Unlike HomotopyContinuationJL this does not require the system to be polynomial. The system function must accept TaylorSeries.jl jet types as state (the same operator-overloading requirement as ForwardDiff.jl duals). If the system is polynomial of total degree at most degree, the surrogate is exact and all roots of the system are found.

The AllRoots type parameter can be true or false. If true, an EnsembleSolution of all distinct roots found is returned and the initial guess only serves as the expansion point. If false, the single converged root closest to the initial guess is returned.

The number of homotopy paths grows like degree^n where n is the number of unknowns, which restricts this method to small-to-medium systems (roughly n ≤ 12 at degree = 2, n ≤ 8 at degree = 3).

Keyword arguments

  • degree: the total degree of the Taylor approximation. Higher degrees give more faithful surrogates (and find more roots of transcendental systems) at the cost of degree^n path growth.
  • autodiff: the autodiff algorithm used for the Newton polish. true maps to AutoForwardDiff(), false to AutoFiniteDiff(); any ADTypes.jl algorithm is accepted. If the NonlinearFunction provides a jacobian it is used directly.

All other keyword arguments are forwarded to HomotopyContinuation.solve.

source

The HomotopyNonlinearFunction type is defined and documented by SciMLBase.