torsdag 29 oktober 2009

Proffessor M.Steffensen

Kom hem från Göteborg efter en vistelse hos släkt och på universeum, ja, hmmm....jo imorn ska jag på kalas hos några vänner till familjen å sen blir det en sväng till fritidsgården, som vanligt!

Ha det!

P.S. Kolla vad jag hitta, Steffensen's teori!

Simple description

The simplest form of the formula for Steffensen's method occurs when it is used to find the zeros, or roots, of a function f, that is, to find the input value x_\star that satisfies f(x_\star)=0. Near the solution x_\star, the function f is supposed to approximately satisfy -1 < f'(x_\star) < 0, which makes it adequate as a correction function for finding its own solution, although it is not required to be efficient. For some functions, Steffensen's method can work even if this condition is not met, but in such a case, the starting value x0 must be very close to the actual solution x_\star, and convergence to the solution may be slow.

Given an adequate starting value x_0\ , a sequence of values x_0,\ x_1,\ x_2,\dots,\ x_n,\dots can be generated. When it works, each value in the sequence is much closer to the solution x_\star than the prior value. The value x_n\ from the current step generates the value x_{n+1}\ for the next step, via this formula[1]:

x_{n+1} = x_n - \frac{f(x_n)}{g(x_n)}

for n = 0, 1, 2, 3, ... , where the slope function g(xn) is a composite of the original function f given by the following formula:

g(x_n) = \frac{f(x_n + f(x_n)) - f(x_n)}{f(x_n)}

The function g is the average slope of the function ƒ between the last sequence point (x,y)=( x_n,\ f(x_n) ) and the auxiliary point (x,y)=( x_n + h,\ f(x_n + h) ), with the step h=f(x_n)\ . It is only for the purpose of finding this auxiliary point that the value of the function f must be an adequate correction to get closer to its own solution. For all other parts of the calculation, Steffensen's method only requires the function f to be continuous, and to actually have a nearby solution. Several modest modifications of the step h in the slope calculation g exist to accommodate functions f that do not quite meet this requirement.

The main advantage of Steffensen's method is that it can find the roots of an equation f just as "quickly" as Newton's method but the formula does not require a separate function for the derivative, so it can be programmed for any generic function. In this case quickly means that the number of correct digits in the answer doubles with each step. The cost for the quick convergence is the double function evaluation: both f(xn) and f(xn + f(xn)) must be calculated, which might be time-consuming if f is a complicated function. For comparison, the secant method needs only one function evaluation per step, so allowing for two function evaluations the secant method can do two steps and two steps of the secant method increase the number of correct digits by a factor 2.6 while one step of Steffensen's (or Newton's) method increases it by a factor 2.

Similar to Newton's method and most other quadratically convergent methods, the crucial weakness with Steffensen's method is the choice of the starting value x0 . If the value of x0 is not "close enough" to the actual solution, the method may fail and the sequence of values x_0, x_1, x_2, x_3,\dots may either flip flop between two extremes, or diverge to infinity (possibly both!).
[edit] Derivation using Aitken's delta-squared process

The version of Steffensen's method implemented in the MATLAB code shown below can be found using the Aitken's delta-squared process for accelerating convergence of a sequence. To compare the following formulas to the formulas in the section above, notice that x_n = p\ -\ p_n . This method assumes starting with a linearly convergent sequence and increases the rate of convergence of that sequence. If the signs of p_n,\ p_{n+1},\ p_{n+2} agree and p_n\ is sufficiently close to the desired limit of the sequence p\ , we can assume the following:

\frac{p_{n+1}-p}{p_n-p}\approx\frac{p_{n+2}-p}{p_{n+1}-p}

then

(p_{n+1}-p)^2\approx(p_{n+2}-p)(p_n-p)

so

p_{n+1}^2-2p_{n+1}p+p^2\approx p_{n+2}p_n-(p_n+p_{n+2})p+p^2

and hence

(p_{n+2}-2p_{n+1}+p_n)p\approx p_{n+2}p_n-p_{n+1}^2 .


Solving for the desired limit of the sequence p gives:

p\approx \frac{p_{n+2}p_n-p_{n+1}^2}{p_{n+2}-2p_{n+1}+p_n}


=\frac{p_{n}^2+p_{n}p_{n+2}+2p_{n}p_{n+1}-2p_{n}p_{n+1}-p_{n}^2-p_{n+1}^2}{p_{n+2}-2p_{n+1}+p_n}


=\frac{(p_{n}^2+p_{n}p_{n+2}-2p_{n}p_{n+1})-(p_{n}^2-2p_{n}p_{n+1}+p_{n+1}^2)}{p_{n+2}-2p_{n+1}+p_n}


=p_n-\frac{(p_{n+1}-p_n)^2}{p_{n+2}-2p_{n+1}+p_n}


Which results in the more rapidly convergent sequence:

p\approx p_{n+3}=p_n-\frac{(p_{n+2}p_n-p_{n+1})^2}{p_{n+2}-2p_{n+1}+p_n}

Inga kommentarer:

Skicka en kommentar