Skip to contents

Root finders for IntervalNonlinearProblem(), as in BracketingNonlinearSolve.jl. ITP() (interpolate, truncate and project) is the default; Bisection(), Brent() and Falsi() (regula falsi) are the classical methods. The residual must have opposite signs at the ends of the interval, otherwise the return code is "InitialFailure".

Usage

ITP(scaled_k1 = 0.2, k2 = 2, n0 = 10L)

Bisection(exact_left = FALSE, exact_right = FALSE)

Brent()

Falsi()

Arguments

scaled_k1, k2, n0

Tuning parameters of ITP.

exact_left, exact_right

Return the left or right end of the final bracket instead of its midpoint.

Value

An algorithm object.

Examples

prob <- IntervalNonlinearProblem(function(u, p) u^3 - p, c(0, 3), p = 8)
solve(prob, ITP())$u
#> [1] 2
solve(prob, Bisection())$u
#> [1] 2
solve(prob, Falsi())$u
#> [1] 2