Skip to contents

IntervalNonlinearProblem(sys, uspan, parammap) builds the problem of finding the root of a single equation in a single unknown inside the bracketing interval uspan. It is solved by the bracketing methods ITP(), Bisection(), Brent() and Falsi(). IntervalNonlinearFunction(sys) builds the scalar residual f(u, p).

Usage

IntervalNonlinearFunction(sys, ...)

IntervalNonlinearProblem(sys, uspan, parammap = list(), ..., p = NULL)

Arguments

sys

A complete System with one equation and one unknown, or an R function f(u, p).

...

Solver options stored with the problem.

uspan

The interval c(left, right); the residual must change sign over it.

parammap

Parameter values.

p

Parameters for raw problems.

Value

An IntervalNonlinearFunction or IntervalNonlinearProblem.

Examples

x <- Variable("x"); a <- Parameter("a")
sys <- complete(System(list(0 ~ x^2 - a), name = "sq"))
prob <- IntervalNonlinearProblem(sys, c(0, 3), list(a ~ 2))
solve(prob)$u
#>        x 
#> 1.414214 
solve(prob, Brent())$u
#>        x 
#> 1.414214