uniroot_all function

Finds many (all) roots of one equation within an interval

Finds many (all) roots of one equation within an interval

The function uniroot_all searches the interval from lower to upper for several roots of a function f with respect to its first argument.

uniroot_all( f, interval, lower = min(interval), upper = max(interval), tol = .Machine$double.eps^0.2, maxiter = 1000, trace = 0, n = 100, ... )

Arguments

  • f: the function for which the root is sought. This function needs to accept a vector of input values.
  • interval: a vector containing the end-points of the interval to be searched for the root.
  • lower: the lower end point of the interval to be searched.
  • upper: the upper end poitn of the interval to be searched.
  • tol: the desired accuracy (convergence tolerance). Passed to function uniroot.
  • trace: integer numberl if positive, tracing information is produced. Higher values giving more details. Passed to function uniroot.
  • n: number of subintervals in which the root is sought.
  • ...: additional named or unnamed arguments to be passed to f (but beware of parital matching to other arguments).

Returns

a vector with the roots found in the interval.

Details

this is a copy taken from the package rootSolve but imported here to avoid dependency

See Also

uniroot

Author(s)

Karline Soetaert karline.soetaert@nioz.nl - original . Copied by Simon Bond.

  • Maintainer: Simon Bond
  • License: GPL-2
  • Last published: 2024-03-12

Useful links