Numerical Method Sol of Eqns

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 30

Numerical Methods in Civil engineering

Gauss Elimination Method: In this method, the unknowns are eliminated


successively and the system is reduced to an upper triangular system from which
the unknowns are found by back substitution. The method is quite general and is
well-adapted for computer operations. Here we shall explain it by considering a
system of three equations for sake of clarity.
Consider the equations

++=

++=

++= ……..(1)
Step I. To eliminate x from second and third equations.
Assuming ≠ 0, we eliminate x from the second equation by subtracting (/)
times the first equation from the second equation. Similarly we eliminate x from
the third equation by eliminating (/) times the first equation from the third
equation. We thus, get the new system.

++=

+=

+=
……(2)
Here the first equation is called the pivotal equation and is called the first pivot.
Step II. To eliminate y from third equation in (2).
Assuming ≠ 0, we eliminate y from the third equation of (2), by subtracting ()
times the second equation from the third equation. We thus, get the new system.

++=

+=

=
…….(3)
Here the second equation is the pivotal equation and is the new pivot.
Step III. To evaluate the unknowns.
The values of z are found from the reduced system (3) by back substitution.
Example1. Apply gauss elimination method to solve the equations
x + 4y z = 5; x + y 6z = 12; 3x y z = 4.

Sol. We have x + 4y z = 5 ……(i)


x + y 6z = 12 ...…(ii)
3x y z = 4 …...(iii)

Step I. To eliminate x, operate (ii) – (i) and (iii) – 3(i):

3y 5z = 7 ……(iv)
13y + 2z = 19 ...…..(v)
Step II. To eliminate y, operate (v) (iv):

z= …….(vi)
Step III. By back-substitution, we get
From (vi): z = = 2.0845

From (iv): y = = = 1.1408


From (i): x = 5 4 + = = 1.6479
Hence, x = 1.6479, y = 1.1408, z = 2.0845.
Note. A useful check is provided by noting the sum of the coefficients and terms
on the right, operating on those numbers as on the equations and checking that
the derived equations have the correct sum.
Otherwise: We have =

Operate and 3 =

Operate =
Thus, we have z = 148/71 = 2.0845,
3y = 7 – 5z = 7 – 10.4225 = 3.4225 i.e., y = 1.1408
and x = 5 – 4 y + z = 5 + 4 (1.1408) + 2.0845 = 1.6479
Hence x = 1.6479, y = 1.1408, z = 2.0845.
Problem 1. Solve 10x – 7y + 3z + 5u = 6, -6x + 8y – z – 4u = 5, 3x + y + 4z +11u
=2, 5x – 9y – 2z + 4u = 7 by Gauss elimination method.

Problem 2. Using Gauss elimination method, solve the equation : x + 2y + 3z – u =


10, 2x + 3y – 3z – u = 1, 2x – y + 2z + 3u = 7, 3x + 2y – 4z + 3u = 2.
Gauss-Jordan Method.:
• This is a modification of the gauss elimination method.

• In this method, elimination of unknowns is performed not in the equation


below but in the equation above also, ultimately reducing the system to a
diagonal matrix form i.e. each equation involving only one unknown. From
these equation, the unknowns x, y, z can be obtained readily.

• Thus, in this method, the labour of back-substitution for finding the unknowns
is saved at the cost of additional calculation.
Example1. Apply gauss-Jordan method to solve the equations x + y + z = 9;
2x – 3y + 4z = 13; 3x + 4y + 5z = 40.
Sol. We have x+y+z=9 …..(i)
2x – 3y + 4z = 13 ….(ii)
3x + 4y + 5z = 40 ….(iii)

Step I. To eliminate x from (ii) and (iii), operate (ii) – 2(i) and (iii) – 3(i):
x+y+z=9 …..(iv)
– 5y + 2z = -5 …..(v)
y + 2z = 13 …..(vi)
Step II. To eliminate y from (iv) and (vi), operate (iv) + (v) and (vi) + (v):
x+ z=8 …..(vii)
– 5y + 2z = – 5 …..(viii)
z = 12 …..(ix)
Step III. To eliminate z from (vii) and (viii), operate (vii) - (ix) and (viii) - (ix):
x=1
– 5y = – 15
z = 12
Hence the solution is x = 1, y = 3, z = 5.
Otherwise: Rewriting the equations as =

Operate – – =

Operate + =
Operate 5 =

Operate + , =

Operate =

Operate - - =

Hence x = 1, y = 3, z = 5.
Obs. Here the process of elimination of variables amounts to reducing the given
coefficient metric to a diagonal matrix by elementary row transformations
only.

Problem 1. Solve the equation 10x – 7y + 3z + 5u = 6; – 6x + 8y – z – 4u = 5;


3x + y + 4z + 11u = 2; 5x – 9y – 2z + 4u = 7 by Gauss-Jordan method.
Factorization method:
This method is based on the fact that every square matrix [A] can be expressed as
the product of a lower triangular matrix and an upper triangular matrix, provided
all the principal minors of [A] are non-singular, i.e. if A = then
≠ 0, ≠[0], ≠ [0], etc.
Also such a factorisation if it exists, is unique.
Now consider the equations
+ + =
+ + =
+ + =
Which can be written as [A]{X} = {B}
where A = X = and B = ……(1)
Let A = LU,
where L = and U = …….(2)

Then (1) becomes LUX = B ……..(3)


Writing UX = V, ……(4),

(3) becomes LV = B
which is equivalent to the equations , + = , ++ = .
Solving these for we know V. Then, (4) becomes
++= , += , = ,
from which , , and can be found by back-substitution.
To compute the matrices L and U, we write (2) as

Multiplying the matrices on the left and equating corresponding elements from
both sides, we obtain

(i) = , =, =

(ii) = or = /; =

or = /
(iii) + = or = = or,
=
+ = or =

(iv) = or

(v) = which gives

Thus we compute the elements of L and U in


the following set of order:
(i) First row of U, (ii) First column of L, (iii) Second row of U,
(iv) Second column of L, (v) Third row of U.
Example 1.: Apply factorization method to solve the equation :
3x + 2y + 7z = 4 ; 2x + 3y + z = 5 ; 3x + 4y + z = 7.
Let = (i.e. A),
So that
(i) of U : = 3, = 2, = 7.
(ii) of L : = 2, = 2/3,
= 3, = 1.
(iii) of U : = 3, = 5/3,
= 1, = 11/3.
(iv) of L : = 6/5.
(v) of U : = 8/5.
Thus L= , U =
Writing UX = V, the given system becomes
=
Solving this system, we have
or ,
Hence the original system becomes
i.e.
3x + 2y + 7z = 4,
By back-substitution, we have
z = 1/8, y = 9/8 and x = 7/8.

Problem 1.: Solve the equation 10x 7y + 3z + 5u = 6; 6x + 8y z 4u = 5;


3x + y + 4z + 11u = 2; 5x 9y 2z + 4u = 7 by Factorization method.
Jacobi’s iteration method.: Consider the equations

……(1)
If are large as compared to other coefficients, solve for x, y, z respectively. Then the
system can be written as

…….(2)
Let us start with the initial approximations for the values of x, y, z respectively.
Substituting these on the right sides of (2), the first approximations are given by
Substituting the values on the right sides of (2), the second approximations are
given by

This process is repeated till the difference between two consecutive


approximations is negligible.
Problem 1.: Solve, by Jacobi’s iteration method, the equations 20x + y 2z = 17;
3x + 20y z = 18; 2x 3y + 20z = 25, correct to two decimal places.

Problem 2: Solve by Jacobi’s iteration method, the equations 10x + y z = 11.19,


x + 10y + z = 28.08, x + y + 10z = 35.61, correct to two decimal places.
Gauss-Seidal iteration method.: This is a modification of Jacobi’s method. As
before the system of equation :
……(1)
is written as
……..(2)
Here also we start with the initial approximations for x, y, z respectively which
may each be taken as zero. Substituting y = , z = in the first of the equations (2),
we get
Then putting x = , z = in the second of the equations (2), we have

Next substituting x = , y = in the third of the equation (2), we obtain

and so on i.e. as soon as a new approximation for an unknown is found, it is


immediately used in the next step.
This process of iteration is repeated till the values of x, y, z are obtained to
desired degree of accuracy.
Example 1.: Apply Gauss-Seidal iteration method to solve the equations

20x + y 2z = 17; 3x + 20y z = 18; 2x 3y + 20z = 25.

Sol. We write the given equations in form

x= ………..(i)

y= ………..(ii)

z= ………..(iii)
First iteration
Putting y = , z = in (i), we get
Putting x = , z = in (ii), we have
Putting x = , y = in (iii), we obtain
Second iteration
Putting y = , z = in (i), we get
Putting x = , z = in (ii), we obtain
Putting x = , y = in (iii), we get
Third iteration, we get

The values in the 2nd and 3rd iteration being practically the same, we can stop.

Hence the solution is x = 1, y = 1, z = 1.

Problem 1.: Solve the equations 27x + 6y z = 85, x + y + 54z = 110; 6x + 15y + 2z = 72
by Gauss-Jacobi method and Gauss-Seidel method.

Problem 2.: Apply Gauss-Seidel iteration method to solve the equations : 10

You might also like