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 (
FALSEneedsnsteps).- 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"forArcLengthContinuation()).- tracking_maxiters
Iteration cap of the interior correctors (
NULLfor 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.
Details
SimpleHomotopySweep()follows the solution from the start oflambdaspanto its end in adaptive steps (natural parameter continuation), with a secant predictor whose trust is monitored, the correctorinner(defaultSimpleNewtonRaphson()) capped attracking_maxitersiterations at interior points, step growth afterexpand_thresholdcheap 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 bygamma * (g(theta_bar) / g(Theta))^(1 / p),g(x) = sqrt(1 + 4x) - 1, from the first contraction ratioThetaof the corrector (theta_minwhen it is not measured), clamped to[qmin, qmax]. Withstricta corrector contracting worse thantheta_rejectis rejected. The contraction is measured forinner = NewtonRaphson(); other inner algorithms usetheta_min.ArcLengthContinuation()is pseudo arclength continuation: the unknowns andlambdaare corrected together on the augmented systemH(u, lambda) = 0,<tau, x - x_k>_theta = ds(the theta weighted inner product), so it can pass folds wherelambdaturns back. The predictor is the secant (or the tangent of the bordered system withpredictor = "tangent"); steps turning more thanmax_angleare rejected. When a step crosses the end of the span the end point is solved at fixedlambda.HomotopyPolyAlgorithm(algs)tries the stages in turn; withwarm_handoffa 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()isHomotopySweep()thenArcLengthContinuation(), andFastShortcutHomotopyPolyalg()usesFastShortcutNonlinearPolyalg()as corrector. Inside a polyalgorithmHomotopySweep()runs the controller of NonlinearSolve (secant trust, corrector effort bands and thetracking_maxiterscap) 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"