Showing posts with label Computer Oriented Numerical Methods. Show all posts
Showing posts with label Computer Oriented Numerical Methods. Show all posts

Tuesday, 13 August 2013

BC0043 Computer Oriented Numerical Methods

BC0043 Computer Oriented Numerical Methods


Question 1. Verify Rolle’s theorem for the function f(x) = |x| in (–1, 1).

f(x) = -x for  -1 < x < 0.
      
       = 0 for x = 0

       = x for 0 < x < 1

f(-1)= 1 f(1) -1 

f(-1)= f(1)
f1(x) = -1 for -1 < x < 0
f1 (x) = 1 for 0 < x < 1

Therefore f1  (x) does not exist at x =0 and hence f(x) is not differentiable in (-1,1) Rolle’s theorem is not applicable to the function f(x) = ǀxǀ in (-1,1)



Question 2. Find the multiplicity root of the equation x3 – x2 – x + 1 = 0 near x0 = 0.9


F(x) = x3 – x2 –x + 1
F’(x) = 3x2 -2x -1 and f’’ (x) =6x – 2
Let x0 =0.9 (taken randomly) be the initial approximated value.
X0 – m f(x0)  =  x0 – (m -1) f’(x0)                   
           F’(x0)                        f’(x0)       

M=2, x0 = 0.9, f(x0) = f(x0)  = f(0.9) = 0.019, f’ (x0) = f’(0.9) = -0.37 and f’’ (x0) = f’’ (0.9) = 3.4

Therefore

X02 f (x0) = x0f’(x0)
        F’(x0)              f’’(x0)
We have x02f(x0)   =0.9 - 2×0.019 = 1.003, and    
                       F’(x0)              -0.37
X0f’(x0) = 0.9 – (-0.37) =  1.009
        F’’(x0)            3.4
The closeness of these values indicates that there is a double root near x =1.

For the next approximation we choose x1 = 1.01
We get  x12f(x1) = 1.01 - 2×0.0002 = 1.0001
                     F’(x1)               0.0403
and x1f’(x1) = 1.01 – 0.0403  =  1.0001
              f’’(x1)                4.06
The show that there is a root at x =1.0001 which is quite near the actual root x =1.
Observation : for f(x) = x3-x2-x+1=(x-1)2 (x+1). Therefore x=1 is a double root with multiplicity m= 2.


Question 3. Use Bisection method to solve x3+3x-5 defined in the interval [1,2]

F(x)   = X3+ 3x-5
F(1)   = 1+3×1-5
         = 4 – 5 = -1
F(2)  = 23 + 3×2-5
        =  8+6-5
         = 9

F (1) is negative  &  f(2)  is  positive

 

X1  =  1+2  =  3   
            2        2
      =  1.5

F(x)  =  F(1.5)3 + 3×1.5 – 5

        =  3.375 + 4.5-5
        =  2.875   > 0
Hence the root ties between  1& 1.5.  Since f(1.5) > 0 & f(1) < 0


Question 4. Find AB and BA, when = A =  and  B =

Given A is a 2×3 matrix and B is a 3×2  matrix. So AB is a 2×2 matrix.

AB=  = 


Question 5. Find the solution of the following system of equations.
   
       
      x-  y- z =
        x+ y-  w =
        -  x+z -  w =
        -  y -   z+w =  

       
    
 using Gauss-Seidel method and perform the first five iterations.

The given system of equations can be rewritten as          ........(1)

Taking the initial approximation as y =z =0 on the right side of the equation (1) we get x(1) =0.5.
Taking  z=0 and w=0 and  the current value of x, we get
Y(1) =0.5 + (0.25)(0.5) + 0 = 0.625 from the second equation of (1).

Now taking w = 0 and the current value of x, we get
Z(3) = 0.25 + (0.25) (0.5) + 0 = 0.375 from the third equation of (1).
Lastly, using the current values of y and z, the fourth equation of (1) gives
W(1) = 0.25 + (0.25) (0.625) + (0.25)( 0.375) = 0.5 .
The Gauss-Seidal iterations for the given set of equations can be written as
     ........(1)


Now by Gauss – Seidel procedure ,  the second and the subsequent approximations can be obtained and the sequence of the first five approximations is tabulated below.

Iteration
Number (r)
                                         Variables
      x
            y
          z
         w
1
0.5
0.625
0.375
0.5
2
0.75
0.8125
0.5625
0.59375
3
0.84375
0.85938
0.60938
0.61719
4
0.86719
0.87110
0.62110
0.62305
5
0.87305
0.87402
0.62402
0.62451




Question 6. Fit parabola of second degree y = a + bx +  for the data


X
0
1
2
3
4
y
1
1.8
1.3
2.5
2.3

The normal equations for y=a +bx+c are
 
      =na + b + c
    Xy = a + b    +c
         y = a  + b+c

Here n = 5.
The relevant table is given below:
x
y
X2
X3
X4
xy
X2y
0
1
0
0
0
0
0
1
1.8
1
1
1
1.8
1.8
2
1.3
4
8
16
2.6
5.2
3
2.5
9
27
81
7.5
22.5
4
2.3
16
64
256
9.2
36.8
= 10
 8.9
 2 = 30
3 = 100
 354
 21.1
y = 66.3

The normal equations becomes
5a + 10 b + 30 c = 8.9
10 a +30 b +100 c =21.1
30 a +100 b +354 c = 66.3
Solving these simultaneous equations, we get
a = 1.078
b = 0.414
c = -0.021
Hence the required parabola is
Y = 1.078 + 0. 414 x – 0.021 x2