Re: [R] Finding Zeros of a Function

2010-10-08 Thread Hans W Borchers
Hans W Borchers wrote: > > Let's see how many zeroes are there of the function sin(1/x) in the > interval > [0.1, 1.0]. Can you find out by plotting? > > In the 1-dimensional case the simplest approach is to split into > subintervals > small enough to contain at most one zero and search each o

Re: [R] Finding Zeros of a Function

2010-10-08 Thread Hans W Borchers
Lorenzo Isella wrote: > > Hello, > And sorry for the late reply. > You see, my problem is that it is not known a priori whether I have one > or two zeros of my function in the interval where I am considering it; > on top of that, does BBsolve allow me to select an interval of variation > of x

Re: [R] Finding Zeros of a Function

2010-10-08 Thread Berend Hasselman
Lorenzo Isella wrote: > > Hello, > And sorry for the late reply. > You see, my problem is that it is not known a priori whether I have one > or two zeros of my function in the interval where I am considering it; > on top of that, does BBsolve allow me to select an interval of variation > of x

Re: [R] Finding Zeros of a Function

2010-10-08 Thread Lorenzo Isella
Hello, And sorry for the late reply. You see, my problem is that it is not known a priori whether I have one or two zeros of my function in the interval where I am considering it; on top of that, does BBsolve allow me to select an interval of variation of x? Many thanks Lorenzo On 09/26/20

Re: [R] Finding Zeros of a Function

2010-09-25 Thread Berend Hasselman
You may also try package nleqslv, which uses Newton or Broyden to solve a system of nonlinear equations. It is an alternative to BB. Without further information from your side, no additional information can be provided. /Berend -- View this message in context: http://r.789695.n4.nabble.com/Fi

Re: [R] Finding Zeros of a Function

2010-09-25 Thread Jorge Ivan Velez
Dear Lorenzo, You could try the BB package: # function we need the roots for fn1 <- function(x, a) - x^2 + x + a # plot curve(fn1(x, a = 5), -4, 4) abline(h=0, col = 2) # searching the roots in (-4, 4) # install.packages('BB') require(BB) BBsolve(par = c(-1, 1), fn = fn1, a = 5) valu

[R] Finding Zeros of a Function

2010-09-25 Thread Lorenzo Isella
Dear All, I need to find the (possible multiple) zeros of a function f within an interval. I gave uniroot a try, but it just returns one zero and I need to provide it with an interval [a,b] such that f(a)f(b)<0. Is there any function to find the multiple zeros of f in (a,b) without constraints