Skip to contents

The algorithms NonlinearSolve takes from other Julia packages, implemented natively after those packages:

Usage

CMINPACK(method = "auto", autodiff = NULL)

NLsolveJL(
  method = "trust_region",
  autodiff = NULL,
  linesearch = NULL,
  beta = 1,
  factor = 1,
  autoscale = TRUE,
  m = 10L
)

LeastSquaresOptimJL(alg = "lm", linsolve = NULL, autodiff = "central")

FastLevenbergMarquardtJL(
  linsolve = "cholesky",
  factor = 1e-06,
  factoraccept = 13,
  factorreject = 3,
  factorupdate = "marquardt",
  minscale = 1e-12,
  maxscale = 1e+16,
  minfactor = 1e-28,
  maxfactor = 1e+32,
  autodiff = NULL
)

NLSolversJL(method = "LineSearch", autodiff = NULL)

SpeedMappingJL(
  sigma_min = 0,
  stabilize = FALSE,
  check_obj = FALSE,
  orders = c(3L, 3L, 2L)
)

FixedPointAccelerationJL(
  algorithm = "Anderson",
  m = NULL,
  condition_number_threshold = NULL,
  extrapolation_period = NULL,
  replace_invalids = "NoAction",
  dampening = 1
)

SIAMFANLEquationsJL(
  method = "newton",
  delta = 0.001,
  linsolve = NULL,
  m = 0L,
  beta = 1,
  autodiff = NULL
)

PETScSNES(petsclib = NULL, mpi_comm = NULL, autodiff = NULL, ...)

Arguments

method, alg, algorithm, linsolve

The method of the wrapped package.

autodiff

The Jacobian choice (an ADType, a string, or NULL; finite differences are used when the problem has no Jacobian).

linesearch

The NLsolve line search, "Static" or "BackTracking".

beta

Relaxation (NLsolve, SIAMFANLEquations Anderson).

factor, autoscale, m

Settings of NLsolve.

factoraccept, factorreject, factorupdate, minscale, maxscale, minfactor, maxfactor

Settings of FastLevenbergMarquardt.

sigma_min, stabilize, check_obj, orders

Settings of SpeedMapping.

extrapolation_period, replace_invalids, dampening, condition_number_threshold

Settings of FixedPointAcceleration.

delta

Initial pseudo time step of "pseudotransient".

petsclib, mpi_comm, ...

Kept for compatibility (... holds SNES options such as snes_stol, snes_max_funcs, snes_linesearch_order).

Value

An algorithm object for solve.NonlinearProblem().

Details

  • CMINPACK(method): MINPACK. "hybr" is Powell's hybrid method (hybrj with a Jacobian, hybrd1 with forward differences), "lm" the Levenberg Marquardt method of More (lmder, lmdif1); "auto" picks "lm" for least squares problems. As in MINPACK.jl the call counts are recorded only with store_trace = TRUE.

  • NLsolveJL(method): NLsolve with "trust_region" (dogleg with autoscaling), "newton" (with linesearch = "Static" or "BackTracking"), "anderson" and "broyden".

  • LeastSquaresOptimJL(alg): the "lm" and "dogleg" methods of LeastSquaresOptim with a pivoted QR ("qr") or Cholesky solver.

  • FastLevenbergMarquardtJL(linsolve): FastLevenbergMarquardt. As in the extension, the residual of the solution is the sum of squares. factorupdate = "nielson" (the spelling NonlinearSolve accepts) and "nielsen" (the spelling of FastLevenbergMarquardt) both select Nielsen's damping update.

  • NLSolversJL(method): NLSolvers; method = "LineSearch" is Newton's method with the static unit step (LineSearch(Newton(), Static(1))).

  • SpeedMappingJL(): the alternating cyclic extrapolation of SpeedMapping applied to the map u + f(u).

  • FixedPointAccelerationJL(algorithm): FixedPointAcceleration on the map u + f(u) with "Anderson", "MPE", "RRE", "VEA", "SEA", "Simple", "Aitken" or "Newton".

  • SIAMFANLEquationsJL(method): SIAMFANLEquations with "newton", "pseudotransient", "secant" (scalar problems) or "anderson" (m = 0 is Picard iteration on u + f(u)).

  • PETScSNES(): the default PETSc SNES, Newton with the cubic backtracking line search and the snes_atol, snes_rtol and snes_stol tests.

Examples

f <- function(u, p) c(u[1]^2 + u[2]^2 - 4, u[1] * u[2] - 1)
prob <- NonlinearProblem(f, c(2, 0.5))
solve(prob, CMINPACK())$u
#> [1] 1.9318517 0.5176381
solve(prob, NLsolveJL())$u
#> [1] 1.9318517 0.5176381
solve(prob, SIAMFANLEquationsJL())$u
#> [1] 1.9318517 0.5176381
solve(prob, PETScSNES())$u
#> [1] 1.9318517 0.5176381