Description Usage Arguments Details Value References See Also Examples
Find a single root of a function of one variable within a specified interval. Brent's method.
1 2 |
fn |
A real function of a single variable for which a root is desired. |
gr |
A real function of a single variable giving the gradient (derivative) of |
ri |
A vector of two real numbers defining the ends of the interval in which to search. |
method |
A character string giving the name of the rootfinding method to be used. Must be
one of the methods |
ftrace |
If TRUE, provided diagnostic output of the process of rootfinding. |
... |
Extra data needed to compute the function |
This routine is a wrapper to allow a consistent calling sequence for a number of different rootfiners.
The output is a list consisting of
root The estimate, b, of the position of the root.
froot The value of the function at this point, f(b).
rtol The width of the interval in which the root exists.
iter The number of iteration cycles used.
Nash, John C. (1979) Compact numerical methods: linear algebra and function minimisation. Bristol UK: Adam Hilger.
1 2 3 4 5 6 7 8 9 10 | # Dekker example
# require(rootoned)
# phi <- 6
dek <- function(x, phi=0){ 1/(x-3) - phi }
# r1 <- rootwrap(dek, ri=c(3.0000001, 6), ftrace=TRUE, method="uniroot", phi=6)
r1 <- rwx(dek, ri=c(3.0000001, 6), ftrace=TRUE, method="uniroot", phi=6)
r1
# r2 <- rootwrap(dek, ri=c(3.0000001, 6), ftrace=TRUE, method="root1d", phi=6)
r2 <- rwx(dek, ri=c(3.0000001, 6), ftrace=TRUE, method="root1d", phi=6)
r2
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.