multrfind: multrfind: Find a single root of a function of one variable...

Description Usage Arguments Details Value References See Also Examples

Description

Find a single root of a function of one variable within a specified interval. Brent's method.

Usage

1
   multrfind(fn, gr=NULL, ri, ftrace=FALSE, meths="uniroot",...) 

Arguments

fn

A real function of a single variable.

gr

A real function of a single variable to evaluate the gradient of fn.

ri

A vector of two real numbers defining the ends of the interval in which to search.

ftrace

TRUE if the progress of the methods is to be displayed

meths

A vector of character (quoted) names of methods to apply to find real roots of fn.

...

Dot arguments – extra information that is needed to compute the function and gradient.

Details

This routine calls the rootfinder wrapper rootwrap for each of the named solvers.

Value

The output is a data frame consisting of one row for each of the methods. The columns of the data frame are "root", "froot", "rtol", "iter", "fncount", and "method".

References

Nash, John C. (1979) Compact numerical methods: linear algebra and function minimisation. Bristol UK: Adam Hilger.

See Also

optimize

Examples

1
2
3
4
5
6
7
8
# Dekker example
require(rootoned)
phi <- 6
dek <- function(x, phi=6){ 1/(x-3) - phi }
mymeth <- c("uniroot", "root1d", "zeroin")
# r1 <- multrfind(dek, ri=c(3.0000001, 6), meths=mymeth, ftrace=TRUE, phi = 6)
r1 <- multrfind(dek, ri=c(3.0000001, 6), meths=mymeth, ftrace=TRUE)
r1

rootoned documentation built on May 2, 2019, 6:48 p.m.