This is the mail archive of the gsl-discuss@sources.redhat.com mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Root function


Ok,

I have understood the problem: this morning I have solved my problem in this way.

The user has to insert an interval (and the function): I split my interval in
small pieces and valuate the value of the function, with libmatheval, in each
piece (only the extreme points of each sub interval).
I register the intervals (and then the points) in which user function changes
sign: at the end I apply the brent solver in each interval registered (infact I
know that if the interval is [a,b], sign(f(a)) is different from sign(f(b))).

This method is more accurate more pieces is diveded user interval.

This method is not suitable for infinite intervals, but for my case I think it
is ok.


What do you think?

Cheers

--Laura


---------- Initial Header -----------

>From      : "Karsten Howes" karsten@videotron.ca
To          : "lauradiara@libero.it" lauradiara@libero.it
Cc          :
Date      : Wed, 03 Dec 2003 14:36:16 -0500
Subject : Re: Root function

> Laura,
>
> There is not much you can do in general.  Any root finder, no matter how
> clever, can be stumped by some choice of function.  Its not a problem
> with gsl.  It's just an issue of how general the set of functions
> specified by the user can be.  (Just try finding the roots of f(a) == 0
> , f(x) == 1 for x!=a).  Even smooth (analytical) functions can cause 
> arbitrarily difficult problems especially in the vicinity of an
> essential singularity.  Your problem is only well posed in the context 
> some particular restricted set of functions.
>
> Karsten
>
> lauradiara@libero.it wrote:
>
> >Hi,
> >
> >I'd like to write a function which finds all the roots of a funcion y=f(x)
> >provided by the user.
> >
> >I have read the chapter one dimensional root finding: I have some questions.
> >
> >The concept expressed is that you use root bracketing or root polishing: with
> >the first you have to provide an initial intervalwitha root inside, while with
> >the second you have to provide a guess root.
> >
> >The first question is: both metods find only a root: if the function has more
> >roots what happen?
> >
> >The second question is that the initial condition (guess or interval with a
> >root) is not simple, it's difficult to provide a good value.
> >
> >All the examples are quite simple with a function provided athe start and not
> >inserted by the user: so the guess or the interval is simple. But in the real
> >applications, what can you do?
> >
> >I think there is a solution, otherwise the functions in gsl_roots,h are not
> >usable in real situations.
> >
> >
> >Can you give me some advice?
> >
> >
> >Thanks
> >
> >
> >--Laura
> >
> >
> >
> >
> >
> Karsten Howes
> National Bank of Canada
>
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]