1 2 3 BCA 3rd Semester 4 BC0043 01 Computer Oriented Numerical Methods
Q1. Find a real root of the equation x3 2x 5 = 0 by the method of regula-falsi position, correct to three decimal places.
Let f (x) = x3 2x 5 Then f (1) = 1 2 5 = 6 < 0 f (2) = 8 4 5 = 1 < 0 f (3) = 27 6 5 = 16 > 0 Hence a root lies between 2 and 3. Take x1 = 2, x2 = 3, f (x1) = 1, f (x2) = 16, in the method of false position, we get
x3 = x1
=2
==2+
= 2.0588
Now f(x3) = f(2.0588) = (2.0588)3 2 2.0588 5 = 0.3908 < 0. Since f(2.0588) < 0 we have that root lies between 2.0588 and 3.0. Replace x1 by x3, and generate the next approximation using the formula,
x4 = x3
= 2.0588
= 2.0813.
Repeating this process, the successive approximations are x 5 = 2.0862, x6 = 2.0915, x7 = 2.0934, x8 = 2.0941, x9 = 2.0943 etc. 1
Hence the root x = 2.094 correct to three decimal places. Observation: The regula-falsi method is intended to produce faster convergence to the solution. However, it does not always do so. Sometimes, the values of x new do not improve quickly. One reason for the slow convergence can be the departure from the basic premises on which the false position method is built.
Q2. Find a real root of the transcendental equation cosx 3x + 1 = 0, correct to four decimal places using the method of iteration.
Let f(x) = cos x 3x + 1.
Now f(0) = cos 0 0 + 1 = 2 > 0 and f between 0 and . Rewriting the given equation cos x 3x + 1 = 0 as
+ 1 < 0. Therefore a root lies
x = (1 + cos x) = (x) (i) (x) = (1 + cos x) (say) Differentiate with respect to x on both the sides,
(x) = Since 1, we have
and
< 1.
Therefore | (x) | < 1 for all x in
Hence the iteration method can be applied to the equation (i) and we start with x 0 = 0 choice of x in the interval
or any
x1 = (x0) =
(1+ cos 0) = 0.6667
x2 = (x1) =
(1+ cos 0.6667) = 0.5953
x3 = (x2) =
(1+ cos 0.5953) = 0.6093
x4 = (x3) =
(1+ cos 0.6093) = 0.6067
x5 = (x4) =
(1+ cos 0.6067) = 0.6072
x6 = (x5) =
(1+ cos 0.6072) = 0.6071
x7 = (x6) =
(1+ cos 0.6071) = 0.6071
Hence we take the solution as x = 0.6071 correct to 4 decimal place.
Q3. Find the transformation.
rank
of
using
elementary
row
The rank of A min {3, 4} = 3.
A= [Firstly we use the leading entry in the first row 1 to make the leading entries in second and third rows to zero].
Perform,
Perform,
Perform, The above matrix is in the echelon form having two non-zero rows. Hence the rank of A is 2.
Q4. Apply Gauss-Seidel iteration method to solve the equations
3 x1 + 20 x 2 x3 = 18 2 x1 3 x 2 + 20 x3 = 25 20 x1 + x 2 2 x3 = 17
Solution: We write the equation in the form ( after partial pivoting),
20 x1 + x 2 2 x3 = 17
3 x1 20 x 2 + x3 = 18 20 x1 + x 2 2 x3 = 17
And
C 1B x1 = fffffffff 17 @ x 2 + 2 x 3 (i) 20 C 1B x 2 = fffffffff @18 @3 x1 + x 3 (ii) 20 C 1B x 3 = fffffffff 25 @2 x1 + 3 x 2 (iii) 20
Initial approximation: x1 = x1 = 0, x 2 = x 2 = 0, x3 = x 3 = 0 A First Iteration: Taking x 2 = x 2 = 0, x 3 = 0 in i , we get x1 = 0.85 Taking x1 = x11 = 0.85, x30 = 0 in ii ,
` a 1 @ A we have x 21 = fffffffff @18 @3 B 0.85 + 0 = @1.0275 20 ` a ` a ` a ` a
` a
` a
` a
` a
`a
` a
Taking x1 = x1 = 0.85 , x 2 = x 2 = @1.0275 in iii ,
C ` a 1B ` a 1 we obtain x 3 = fffffffff 25 @2 B 0.85 + 3 B @1.0275 = 1.0109 A 20
` a
` a
b c
Second Iteration
C ` a 1B ` a 2 x1 = fffffffff 17 @3 @1.0275 + 2 B 1.0109 = 1.0025 20
C ` a 1B ` a 2 x 2 = fffffffff @18 @3 B @1.0025 + 1.0109 = @0.9998 20 C ` a 1B ` a x 32 = fffffffff 25 @2 B 1.0025 + 3 B @0.9998 = 0.9998 20
Similarly in third iteration, we get x1 = 1.0000, x 2 = @1.0000 x 3 = 1.0000 The values in the 2nd and 3rd iterations being practically the same, we can stop the x1 = 1, x 2 = @1, x 3 = 1 iterations. Hence the solution is
` a
` a
` a
Q5. Use the method of group averages and find a curve of the form y = mxn, that fits the following data:
X 10 20 30 40 50 60 70 80 Y 1.06 1.33 1.52 1.68 1.81 1.91 2.01 2.11 Solution: The required curve is of the form y = mxn Taking logarithm on both sides, we get log10y = log10 m + n log10x Let log10y = Y, log10m = c and log10x = X, then the equation becomes Y = nX +c. Now e take logarithms of the given pairs of data and divide them into two groups, such that the first group contains the first four values and the remaining constitutes the second group, as follows. 6
Group-I x 1 0 2 0 3 0 4 0 y 1.06 1.33 1.52 1.68 Y = log10 y X = log10x 0.0253 0.1239 0.1818 0.2253 1.0000 1.3010 1.4771 1.6021
SY = 0.5563 SX = 5.3802 Group-II x 5 0 6 0 7 0 8 0 y 1.81 1.91 2.01 2.11 Y = log10 y X = log10x 0.2577 0.2810 0.3032 0.3243 1.6990 1.7782 1.8451 1.9031
SY = 1.1662 SX = 7.2254 Using the method of group averages, we determine the constants n and c from (5) and (6) as follows.
Substituting the values from the above tables, we get
and 4c + 5.3802n 0.5563 = 0 and 4c + 7.2254n- 1.1662 = 0. 7
Solving we get c = -0.3055 and n = 0.3305. Therefore m = antilog c = 0.4949. Hence the required curve is y = (0.4949)x0.3305.
Q6. Given that x 1.0 1.1 1.2 1.3 1.4 1.5 1.6 y 7.989 8.403 8.781 9.129 9.451 9.750 10.031 Find and at (a) x = 1.1 (b) x = 1.6 using Newtons forward difference formulae.
The difference table is, x 1.0 y 7.989 D 0.414 1.1 8.8403 0.378 1.2 1.3 1.4 1.5 8.781 0.348 9.129 0.322 9.451 0.299 9.750 0.281 1.6 10.031 -0.018 -0.023 0.005 -0.026 0.003 0.002 -0.030 0.004 -.0001 -0.036 0.006 -0.002 0.001 0.002 0.003 D2 D3 D4 D5 D6
To find
and
at x = 1.1, we use Newton's Forward differentiation formula, we have
Here h = 0.1, x0 = 1.0, x1 = 1.1. The above formula can be rewritten as
(i)
(ii) Substituting Dy1 = 0.378, D2y1 = 0.030, D3y1 = 0.004, D4y1 = 0.001, D5y1 = 0.003 in (i) and (ii), we get
= 3.947
Therefore
Therefore
To find that is,
at x = 1.6, we have to use Newton's backward differentiation formula,
(iii) and
(iv) We use the instead of D. above difference table and backward difference operator
Here h = 0.1, xn = x6 = 1.6 and y6 = 0.281, 2y6 = 0.018, 3y6 = 0.005, 4y6 = 0.002, 5y6 = 0.003, 6y6 = 0.002. Putting these values in (iii) and (iv), by taking n = 6, we get,
Therefore and
10