[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    RE: Need help for KSpread Maths
From:       Don Sanders <dsanders () cch ! com ! au>
Date:       1999-11-17 22:20:31
[Download RAW message or body]

David won't your solution (which is the most well though out answer given I
think) possibly fail on even a function as simple as a third order polynomial
with a relative minima? Think about the relative minima.

I am assuming that Excel can handle third order polynomials, cubics, right?

I think people are completely missing the point of Torben's post. This
is a classical problem in numerical analysis and it seems obvious from Torben's
post that he is aware of classical methods such as the Newton one.

The problem as Torben stated very cleary is that these methods require a and b
satisfying the criteria he has given. How do we guess the initial a and b?

Torben, I guess you are looking for a trick to pick a and b, a trick that works
a lot of the time especially for the types of functions users enter into excel
spread sheets, right?

Unfortunately I suspect the average numerical analysis text book will shy away
from this problem restricting its attention to less ugly problems.

BFN,
Don.

On Thu, 18 Nov 1999, David Faure wrote:
> > Hi,
> > 
> > Excel has this "Goal Seek". Nice thing. You point it to a formular
> > and to the cell that is used as input and Excel finds the
> > input value that makes the formula result in a user specified value.
> > 
> > In fact that is the problem of finding x in f(x) = 0.
> > 
> > There are many algorithms which help you here, but they want
> > a) a range [a,b] to search in which can be very big with 
> > double values.
> > b) two points a and b, so that f(a)*f(b) < 0.
> > 
> > Can anyone tell me what to do here. Excel is getting quick and good
> > results, so there must be a way.
> 
> I've checked how it works in Excel : there are two things you know :
> the function, but also a starting point (Excel looks for the closest
> solution
> to the starting point, not _all_ solutions).
> 
> The solution is to use the Newton method : (credits to my father for
> thinking of it !)
> 
> 1. Start from x0 => f(x0)
> 2. Now with x0 + delta, delta being arbitrary but "small" => f(x0 + delta),
> 3. The line (D) going from those two points cuts the horizontal axe at
> x1 = x0 - delta*f(x0) /{f(xo+delta) - f(xo)}
> and of course x1 is either smaller or bigger than x0 depending on the sign
> of f(x0)
> (let's say delta is positive once and for all)
> 4. Start again with x1 => x2, then x3 ....
> 5. A problem can happen if we are close to a max or min of f(x) because then
> (D) is almost 
> horizontal, which throws xi very far...

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic