Popular Posts

Showing posts with label Numerical Analysis. Show all posts
Showing posts with label Numerical Analysis. Show all posts

Solution of equation in one variable, Lecture 2, Numerical analysis

Tuesday, March 1, 2011

Date: 28.02.2011
Problem: By using bisecting method to find a real root of  f(x)= ex-3x2correct two decimal points.


FIXED POINT  ITERATION  METHOD/ ITERATION METHOD

This method is used to find the numerical solution to  polynomial  and other  equations such as

                                    f(x)=0......................................(1)

we start an initial approximation xo to the solution of   f(x)=0 and apply it to a procedure which gives a new approximation is normally a better one. Use this approximation to find a new one. This procedure is known as iteration method.

METHOD IN DETAILS:
Rewrite the given equation   f(x)=0 in the form

                              x=Φ(x).....................(2)

 let xo be the initial approximation to the desired root. Substitute  it on the right hand side of  (1).
we get the next approximation
x1=Φ(xo)
x2=Φ(x1)
x3=Φ(x2)
x4=Φ(x3)
.
.
.
xn=Φ(xn-1)    


stop when │xn-xn-1│< tolerance

Condition : This iteration method or fixed point iteration method is applicable when
│ϕ’(x)│< 1

Example: Use iteration method find a real root of  f(x)= x3+x2-1 correct to 3 decimal places.

Solution:  Let us have the eqution f(x)= x3+x2-1.    if   f(x)= 0   then      
                                                                    x3+x2-1 =0
                                                                   
We get if x=0 then f(x)= -ve and  x=1 then f(x)= +ve  then by bisection method, there must be solution of  f(x) in between 0 and 1 that is on the interval (0,1).
Let the solution xo=0.75 ( changeable, u can take different value between 0 and 1 )

x1=Φ(xo) =Φ(0.75)=0.7559

x2=Φ(x1)=Φ(0.7559)=0.7546

x3=Φ(x2)= Φ(0.7546)=0.7549

...........................................................
..........................................................


we get │x3-x2│=0.7549 - 0.7546
                              =0.0003

the result 0.0003 says that 0.7549 or 0.755 is the desired result.

Therefore the desired root is 0.755

Example 2: Use iteration method find a real root of  f(x)= 2x-cos x -3  correct to 3 decimal places.

Let us have the equation  f(x)= 2x-cos x -3=0
                                            
                                                   

To find the solution by iteration method we need to show that the given function satisfy the condition of iteration method. That is  



 │ϕ’(x)= -(sin x)/2│<1 . For any value of x this condition is satisfied.


Now let the solution be xo= 1.5 , Because for the value of x in radian unit the value of  f(x) becomes negative when x=1 and positive when x=2.

x1=Φ(xo) =Φ(1.5)=1.535368601

x2=Φ(x1)=Φ(1.535368601)=1.517710158

x3=Φ(x2)= Φ(1.517710158)=1.526530619

...........................................................

we get │x3-x2│=1.526530619 - 1.517710158
                              =0.008820461
the result 0.008820461 says that 1.526530619 or simply 1.527 is the desired result.

Therefore the desired root is1.527

(To be continued) 


Solution of equation in one variable, Lecture 1. Numerical analysis

Friday, February 18, 2011

Date:14/02/2011
Monday
Numerical Analysis
3 credits
course conducted by Mr. Babul Hasan(BH)


Numerical Analysis
Definition: Numerical Analysis involves the study of methods of computing numeric data. It produces a sequences of approximations to many problems. So it is the questions of rate of accuracy.

We seek results in numerical form. To provide efficient numerical methods for obtaining numerical results to the mathematical problems we proceed as follows:
Step 1: We first start with an initial approximation
Step 2: Compute
Step 3: After some iterations we get the desired results. Since the data used are only approximate, being correct to some desired decimal places, the computation result always have errors.

By using it we will solve –
1.    1.   Non Linear equations
2.    2.   Interpolation/ Extrapolation
3.   3.    Numerical Differentiation/ Integration
4.    4.   System  of  linear equations
5.   5.    Differential equations


1.      Non Linear Equation
To find the root of f(x) =0------------------------------------------------------- (1)
If f(x) is a polynomial of degree 2 or 3 then we can solve it easily by exact methods, But f(x) is a polynomial of higher degree or it contains transcendental functions (e.g. 1+cos x, cos x+ tan x, ex+cos x etc) recourse must be taken to find the root of f(x)=0 by approximation methods.
The methods are :

i.       i) Bisection method
ii.    ii)  Iteration method
iii.    iii) False position method
iv.   iv) Newton-Raphson’s method
v.    v)   Secant method and any others


i) Bisection Method:

If f(x) is differentiable and continuous on (a,b) and has opposite sign at a & b then there must be at least one point c for which f(c)=0
Suppose f(a) is positive & f(b) is negetive. Let the initial approximation be xo
Xo=(a+b)/2
Then there may be three cases:
Case one:  f(xo)=0 , Then stop and xo  is the desired  root. [xo=c]
Case two:  f(xo)>0 ,  Then replace ‘a’ by xo and find the new approximation  x1=( xo+b)/2
Case three:  f(xo)<0,  Then  replace ‘b’ by xo and find new approximation    x1=( xo+a)/2
Then repeat the process until the desired root is obtained .

Problem: Find the real root of  x3-x-1=0 by Bisection method. Correct to 2 decimal places.
Solution:  f(1)= -ve
                 f(2)= +ve
so root lies between 1 and 2.
Let, xo= (1+2)/2,   then   xo=1.5
f(xo)= f(1.5) = (1.5)3-1.5-1
            =0.875
A root lies between 1 and 1.5
Let  x1 = (1.5+1)/2 = 1.25,  then  x1=1.25
f(x1)= f(1.25) =-0.29
 So a root  lies between 1.25 and 1.5
Let,  x2=(1.25+1.5)/2 =  1.375,  then  x2=1.375
f(x2)= f(1.375) = 0.22