small_step_root: Find root of a function using small_step method

View source: R/numeric.R

small_step_rootR Documentation

Find root of a function using small_step method

Description

This function returns roots of a focal function by checking the sign change in each step.

Usage

small_step_root(func, step, ...)

Arguments

func

the function for which the root is sought.

step

a vector containing the step values

...

optional arguments to be passed to "func"

Value

data.frame with two col, "lower" and "upper" which are the range of the solutions. root

Examples

f = function(x,y){return(x*x-y*x)}
ans = small_step_root(f, seq(-2,2,length=41),y=1.333)
# ans == data.frame("lower"=c(0.0,1.3),"upper"=c(0.0,1.4))

hmito/hmRLib documentation built on March 13, 2024, 9:41 p.m.