Fixed Point Iteration

What is Fixed Point Iteration?
http://en.wikipedia.org/wiki/Fixed_point_iteration

Algorithm
To find a solution to p = g(p) given an initial approximation p0.

INPUT: Initial approximation p0; tolerance TOL; maximum number of iterations N0. OUTPUT: approximate solution p or message of failure.

Step 1: Set i =1

Step 2: While $$i \leq No$$ Steps 3 - 6

Step 3: Set p = g(p0)

Step 4: If $$|p - po| \leq TOL$$ then OUTPUT (p); (The procedure was successful). STOP.

Step 5: Set i = i + 1

Step 6: Set p0 = p. (Update p0)

Step 7: OUTPUT ('The method failed after N0 iterations'). STOP.

Examples
1. Find square root of 2 accurate till third decimal (10-3). The initial point is 2.

Answer.


 * We know that,


 * x0 = 2


 * xn+1 = 0.5 * ( x0 + (2/ x0))


 * x1 = 0.5 * (2 + (2/2)) = 1.5


 * x2 = 0.5 * (1.5 + (2/1.5)) = 1.416


 * x3 = 0.5 * (1.416 + (2/1.416)) = 1.4142


 * We found out the square root of 2 accurate till 4th decimal in 3 steps.

As implemented in python
The following python code implements the functionality of this section.

The two statements under "# Original estimate of square root (initial approximation.)" provide a pretty good estimate of initial approximation of $$p_0.$$ Unfortunately they are computationally intensive and add significant time to completion of function

The code within the  loop is both very simple and very fast. $$$$ $$$$$$$$$$$$

Tolerance  is determined by the desired precision of the set by the code that invokes this function. The following optional code is valid in debugging mode. It provides information about what happens during the  loop and verifies that the calculated square root is in fact within tolerance. Compared with python's method  this code is slow for small values of precision. However, for numbers containing 550 decimal digits or more, this code (without debugging) is a little faster than python's method.

sqrt(2) with 1,000 places of decimals
Result was produced with only 12 passes through loop.

2. Consider the iteration pn+1 = g(p0) when the function g(x) = 1 + x - x2/4 is used. The fixed points can be found by solving equations x = g(x). The two solutions (fixed points of g) are x = -2 and x = 2. The derivative of the function is g'(x) = 1 - x/2, and there are only two cases to consider


 * Case 1 (P = -2):
 * Start with P0 = -2.05
 * We get
 * P1 = -2.100625
 * P2 = -2.20378135
 * ..... $$\infty$$
 * Therefore, if |g'(x)| > 1 then sequence will not converge to P = -2


 * Case 2 (P = 2):
 * Start with P0 = 1.6
 * We get
 * P1 = 1.96
 * P2 = 1.9996
 * ..... 2
 * Therefore, if |g'(x)| < 1 then sequence will converge to P = 2

Applications
Two methods in which Fixed point technique is used:

1. Newton Raphson Method


 * Formula
 * $$x_{n+1}=x_n-\frac{f(x_n)}{f'(x_n)}$$


 * where,
 * xn - initial point
 * f(xn) is the value of the function at that point
 * f'(xn) is the value of the differentiated function at that point.


 * Plug all these values into the above equation to get xn+1. It becomes the next initial point. Repeat until you get a point within an acceptable degree of error

2. Secant Method


 * Used to avoid differentiated form in Newton Raphson's method. Only problem is you need two initial points for this method (xn and xn-1)


 * Formula
 * $$x_n=x_{n-1}-f(x_{n-1})\frac{x_{n-1}-x_{n-2}}{f(x_{n-1})-f(x_{n-2})}$$


 * Similar to Newton Raphson's method plug in all values to generate next approximation.

Exercises
If 'f' is continuous and 'x' is a fixed point on 'f' then what is 'f(x)'? Solution: f(x) = x

Find the square root of 0.5 using fixed point iteration? Initial point 0.1 and tolerance 10-3

Calculating x1 i.e. 1st Iteration Solution: x1 = 2.55

Calculating x2 i.e. 2nd Iteration Solution: x2 = 1.373

Calculating x3 i.e. 3rd Iteration Solution: x3 = 0.8685

Calculating x4 i.e. 4th Iteration Solution: x4 = 0.722

Calculating x5 i.e. 5th Iteration Solution: x5 = 0.707

In above problem, how many iterations or steps are needed to achieve an accuracy of 10-8 Solution: Iteration: 6

Quizzes
{Is there any possibility that the fixed point isn't unique -Yes +No
 * type=""}

{ Assuming g ε C[a,b], If the range of the mapping y = g(x) satisfies y ε [a,b], then} +g has a fixed point in [a,b] -g has no fixed point in [a,b] -Depends on some other condition

{ If |g'(x)| > 1, then the iteration xn+1 = g (x) produces a sequence } +that diverges away from P -that converges towards P -Depends

{The fixed point iteration will diverge unless x0 = 0. +True -False
 * type=""}

{Consider the following fixed point iteration; $$f(x)=\frac 12\left(\frac ax + x\right)$$. Rate (order) of convergence of this iteration is +Quadratic -Linear -Cubic
 * type=""}