Skip to contents

Algorithms for HomotopyProblem(), as in NonlinearSolve:

Usage

SimpleHomotopySweep(
  inner = SimpleNewtonRaphson(),
  nsteps = NULL,
  adaptive = TRUE,
  initial_step_factor = 0.1,
  min_dlambda = NULL,
  max_step_factor = 1,
  expand_factor = 2,
  expand_threshold = 2L,
  expand_quality = 0.25,
  predictor = c("secant", "constant"),
  tracking_maxiters = 10L,
  tracking_abstol = NULL,
  maxsteps = 10000L
)

KantorovichHomotopy(
  inner = NULL,
  nsteps = NULL,
  initial_step_factor = 0.1,
  min_dlambda = NULL,
  max_step_factor = 1,
  qmin = 1/5,
  qmax = 5,
  theta_min = 1/8,
  theta_reject = 0.95,
  theta_bar = 0.5,
  gamma = 0.95,
  strict = TRUE,
  predictor = c("constant", "secant"),
  predictor_order = NULL,
  expand_quality = 0.25,
  tracking_maxiters = 10L,
  tracking_abstol = NULL,
  maxsteps = 10000L,
  store_original = FALSE
)

ArcLengthContinuation(
  inner = NULL,
  initial_step_factor = 0.1,
  adaptive = TRUE,
  min_ds = NULL,
  max_step_factor = 1,
  expand_factor = 2,
  expand_threshold = 2L,
  max_angle = pi/6,
  predictor = c("secant", "tangent"),
  autodiff = NULL,
  linsolve = NULL,
  tracking_maxiters = 10L,
  maxsteps = 10000L,
  theta = 0.5,
  store_original = FALSE
)

HomotopyPolyAlgorithm(
  algs = NULL,
  inner = NULL,
  warm_handoff = TRUE,
  store_original = FALSE
)

FastShortcutHomotopyPolyalg(
  autodiff = NULL,
  concrete_jac = NULL,
  linsolve = NULL,
  vjp_autodiff = NULL,
  jvp_autodiff = NULL,
  warm_handoff = TRUE,
  store_original = FALSE
)

Arguments

inner

The corrector algorithm (NULL: the default polyalgorithm).

nsteps

Optional number of equal divisions setting the first step.

adaptive

Adapt the step size (FALSE needs nsteps).

initial_step_factor

First increment as a fraction of the span.

min_dlambda, min_ds

Smallest increment (default sqrt(eps)).

max_step_factor

Largest increment as a fraction of the span.

expand_factor, expand_threshold, expand_quality

Step growth: factor, accepted steps in a row, largest relative prediction error allowing it.

predictor

"secant" or "constant" ("secant" or "tangent" for ArcLengthContinuation()).

tracking_maxiters

Iteration cap of the interior correctors (NULL for none).

tracking_abstol

Optional loose tolerance of the interior correctors.

maxsteps

Largest number of continuation attempts.

qmin, qmax, theta_min, theta_reject, theta_bar, gamma, strict, predictor_order

Settings of the Kantorovich controller.

store_original

Kept for compatibility.

max_angle

Largest turn of the path in one step.

autodiff, linsolve, concrete_jac, vjp_autodiff, jvp_autodiff

Options of the correctors.

theta

Weight of the unknowns in the arclength inner product.

algs

A list of continuation algorithms.

warm_handoff

Start later stages where the sweep stopped.

Value

An algorithm object.

Details

  • SimpleHomotopySweep() follows the solution from the start of lambdaspan to its end in adaptive steps (natural parameter continuation), with a secant predictor whose trust is monitored, the corrector inner (default SimpleNewtonRaphson()) capped at tracking_maxiters iterations at interior points, step growth after expand_threshold cheap or well predicted steps and bisection after a failure.

  • KantorovichHomotopy() is the same continuation with the step size of the Newton Kantorovich controller of Deuflhard: the next increment is scaled by gamma * (g(theta_bar) / g(Theta))^(1 / p), g(x) = sqrt(1 + 4x) - 1, from the first contraction ratio Theta of the corrector (theta_min when it is not measured), clamped to [qmin, qmax]. With strict a corrector contracting worse than theta_reject is rejected. The contraction is measured for inner = NewtonRaphson(); other inner algorithms use theta_min.

  • ArcLengthContinuation() is pseudo arclength continuation: the unknowns and lambda are corrected together on the augmented system H(u, lambda) = 0, <tau, x - x_k>_theta = ds (the theta weighted inner product), so it can pass folds where lambda turns back. The predictor is the secant (or the tangent of the bordered system with predictor = "tangent"); steps turning more than max_angle are rejected. When a step crosses the end of the span the end point is solved at fixed lambda.

  • HomotopyPolyAlgorithm(algs) tries the stages in turn; with warm_handoff a later stage starts from the last point a sweep reached (backed off by a twentieth of the span), with its step caps rescaled to the shorter span. HomotopyPolyAlgorithm() is HomotopySweep() then ArcLengthContinuation(), and FastShortcutHomotopyPolyalg() uses FastShortcutNonlinearPolyalg() as corrector. Inside a polyalgorithm HomotopySweep() runs the controller of NonlinearSolve (secant trust, corrector effort bands and the tracking_maxiters cap) with the settings it has.

Examples

y <- Variable("y")
sys <- complete(System(list(0 ~ homotopy(atan(y - 3), y)), name = "h"))
prob <- HomotopyProblem(sys, list(y ~ 12))
solve(prob, SimpleHomotopySweep())$u
#> y 
#> 3 
solve(prob, KantorovichHomotopy(inner = NewtonRaphson()))$u
#> y 
#> 3 
solve(prob, ArcLengthContinuation())$u
#> y 
#> 3 
solve(prob, HomotopyPolyAlgorithm())$retcode
#> [1] "Success"