1. Trang chủ
  2. » Công Nghệ Thông Tin

A textbook of Computer Based Numerical and Statiscal Techniques part 40 pptx

10 663 2

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 10
Dung lượng 100,61 KB

Nội dung

In general, the rearrangement of equation is done even if pivot element is non-zero to improve the accuracy of solution by reducing the round off errors involved in elimination process,

Trang 1

largest coefficient of y We continue this process till last equation This procedure is known as

partial pivoting In general, the rearrangement of equation is done even if pivot element is non-zero to improve the accuracy of solution by reducing the round off errors involved in elimination process, by getting a larger determinant, which is done by finding a largest element

of the row as the pivotal element

Complete Pivoting: If the order of elimination of x1 , x2, x3, is not important, then we may choose at each stage the largest coefficient of the whole matrix of coefficients We may search the largest value, not only in rows but also in columns After searching largest value, we bring at the diagonal position This method of elimination is known as complete pivoting The superiority of this method is that it gives the solution of a system, provided its determinant does not vanish in finite number of steps

A system of equations A X = B is said to be ill-conditioned or unstable if it is highly sensitive

to small changes in A and B i.e., small change in A or B causes a large change in the solution

of the system On the other hand if small changes in A and B give small changes in the solution, the system is said to be stable, or, well conditioned Thus in a ill-conditioned system, even the small round off errors effect the solutions very badly Unfortunately it is quite difficult to recognize an ill-conditioned system

For example, consider the following two almost identical systems

x1−x2=1 x1−x2=1

1 1.00001

xx2 =0 and x1−0.99999 x2 =0

Respective solutions are:

(100001, 100000) and (–99999, –100000) obviously the two solutions differ very widely Therefore the system is ill conditioned

Example 3 Show that the following system of linear equations is ill-conditioned.

7x 10y = 1

5x + 7y = 0.7 Sol On solving the given equations we get x= 0 and y= 0.1.

Now, we make slight changes in the given system of equations The new system becomes

7x+ 10y= 1.01

5x+7y=0.69

Here we get x= − 0.17 and y= 0.22.

Hence the given system is ill-conditioned

ELIMINATION METHOD

The solution of system of equations will have some rounding error, we will discuss a technique called as ‘iterative refinement’ which leads to reduced rounding errors and often a reasonable solution for some ill-conditioned problems is obtained

Trang 2

Consider the system of equations:

a x b y c z d

a x b y c z d

a x b y c z d

Let x, y, z′ be an approximate solution, Substituting these values on the left-hand sides, we

get new values of d1, d2, d3 as d′1, d′2, d′3, so their new system becomes;

a x b y c z d

a x b y c z d

a x b y c z d

′+ ′+ ′= ′

′+ ′+ ′= ′

Subtracting each equation in ( )2 from the corresponding equations in ( )1 , we get

a x b y c z k

a x b y c z k

a x b y c z k

where, x e = −x x y, e = −y y z′, e = −z z′ and k i= −d i d i

We now solve the system ( )3 for x y z e, e, e giving z= +xx e, y= +yy e, z= +zz e which will be better approximations for x y z, , We can repeat the process for improving the accuracy

Example 4 An approximate solution of the system 2x + 2y – z = 6, x – y + 2z = 8; – x + 3y + 2z = 4 is given by x = 2.8, y = 1, z = 1.8 Using the iterative method improve this solution Sol Substituting the approximate value x = 2.8, y = 1, z′ = 1.8 in the given equations,

We get

( ) ( )

2 2.8 +2 1 −1.8 5.8=

( )

( ) ( )

−2.8 3 1+ +2 1.8 =3.8

Subtracting each equation in ( )1 from the corresponding given equations, we get

2x e+2y e− =z e 0.2

2 0.6

where x e = x – 2.8, y e = y –1, z e = z –1.8

Solving the equations (2), we get x e = 0.2, y e = 0, z e = 0.2

This gives the better solution x=3, y=1, z=2, which incidentally is the exact solution

Ans.

LINEAR EQUATION

All the previous methods seen in solving the system of simultaneous algebraic linear equations are direct methods Now we will see some indirect methods or iterative methods





Trang 3

This iterative methods is not always successful to all systems of equations If this method

is to succeed, each equation of the system must possess one large coefficient and the large coefficient must be attached to a different unknown in that equation This condition will be satisfied if the large coefficients are along the leading diagonal of the coefficient matrix When this condition is satisfied, the system will be solvable by the iterative method The system,

a11 1x +a x12 2+a x13 3 =b1

a21 1x +a x32 2+a x23 3 =b2

a31 1x +a x32 2+a x33 3=b3

will be solvable by this method if

a11 > a12 + a13

a22 > a21 + a23

a33 > a31 + a32

In other words, the solution will exist (iterating will converge) if the absolute values of the leading diagonal elements of the coefficient matrix A of the system AX = B are greater than the sum of absolute values of the other coefficients of that row The condition is sufficient but not necessary

Under the category of iterative method, we shall describe the following two methods:

(i) Jacobi’s method (ii) Gauss-Seidel method.

8.6.1 Jacobi’s Method or Gauss-Jacobi Method

Let us consider the system of simultaneous equations

a1x b y c z+ 1 + 1 =d1

a3x b y c z+ 3 + 3 =d3

such that a1, ,b2 and c3 are the largest coefficients of x,y,z, respectively So that convergence is

assured Rearranging the above system of equations and rewriting in terms of x y z, , , as:

( 1 1 1 )

1

1

x d b y c z a

( 2 2 2 )

2

1

y d a x c z b

( 3 3 3 )

3

1

z d a x b y c

let x0, y0, z0 be the initial approximations of the unknowns x, y and z Then, the first approximation

are given by

1 ( 1 1 0 1 0)

1

1

x d b y c z a

1 ( 2 2 0 2 0)

2

1

b





Trang 4

1 ( 3 3 0 3 0)

3

1

c

Similarly, the second approximations are given by

2 ( 1 1 1 1 1)

1

1

x d b y c z a

2 ( 2 2 1 2 1)

2

1

y d a x c z b

2 ( 3 3 1 3 1)

3

1

z d a x b y c

Proceeding in the same way, if x n,y z n, n are the nth iterates then

1 ( 1 1 1 )

1

1

x d b y c z a

1 2 2 2

2

1

y d a x c z b

1 3 3 3

3

1

z d a x b y c

The process is continued till convergency is secured

Note: In the absence of any better estimates, the initial approximations are taken as x0 =0, y0=0,

z = .

Example 5 Solve the following system of equation using Jacobi’s method

5x y + z = 10

2x + 4y = 12

x + y + 5z = 1

Start with the solution (2, 3, 0).

Sol Given system of equation can be written in the folliwng form, if we assume, x0 , y0,

z0 as initial approximation:

1=1{10+ 0+ 0}

5

1 =1{12 2− 0}

4

1= 1{− −1 0− 0}

5

Now if x0 =2, y0 =3, z0 =0, then

First approximation: 1=1{10 3 0+ − =} 2.6

5

x

Trang 5

1= 1{12 4− }=2.0

4

y

1=1{− − −1 2 3}= −1.2

5

z

Second approximation: 2 = 1{10 2 1.2+ + }=2.64

5

x

2 { }

1

12 5.2 1.70 4

2 { }

1

1 2.6 2 1.12 5

z = − − − = −

Third approximation: 3 = 1{10 1.7 1.12+ + }=2.564

5

x

3 1{ }

12 5.28 1.680 4

3 = 1{− −1 2.64 1.7− }= −1.068

5

z

Fourth approximation: 4 = 1{10 1.68 1.068+ + }=2.5496

5

x

4 =1{12 5.128} 1.7180− =

4

y

5

Fifth approximation: x5 = 1

5{10 + 1.718 + 1.0428} = 2.553

y4 = 1

4{12 – 5.0992} = 1.725,

z5 = 1

5{–1 – 2.5496 – 1.718} = – 1.054

Hence, approximating solution after having some other approximations is (up to 3 decimal places)

x = 2.556

y = 1.725

z = –1.055 Ans.

Example 6 Solve the following system of equations by Jacobi iteration method.

3x + 4y + 15z = 54.8, x + 12y + 3z = 39.66 and 10x + y – 2z = 7.74 Sol The coefficient matrix of the given system is not diagonally dominant Hence we rearrange

the equations, as follows, such that the elements in the coefficient matrix are diagonally dominant

10x + y – 2z = 7.74

x + 12y + 3z = 39.66 3x + 4y + 15z = 54.8

Trang 6

Now, we write the equations in the form

1 7.74 2 10

1 39.66 3 12

1 54.8 3 4 15

(1)

We start from an approximation = x0 = y0 = z0 = 0

Substituting these on RHS of (1), we get

First approximation:

x1= 1

10[7.74 – 0 + 2(0)] = 0.774

y1= 1

12[39.66 – 0 – 3(0)] = 1.1383333

z1= 1

15[54.8 – 3(0) – 4(0)] = 3.6533333

Second approximation:

x2= 1

10[7.74 – 1.1383333 + 2(3.6533333)] = 1.3908333

y2= 1

12[39.66 – 0.744 – 3(3.6533333)] = 2.3271667

z2= 1

15[54.8 – 3(0.744) – 4(1.1383333)] = 3.1949778

Third approximation:

x3= 1

10[7.74 – 2.3271667 + 2(3.1949778)] = 1.1802789

y3= 1

12[39.66 – 1.3908333 – 3(3.1949778)] = 2.3903528

z3= 1

15[54.8 – 3(1.3908333) – 4(2.3271667)] = 2.7545889

Fourth approximation:

x4= 1

10[7.74 – 2.3903528 + 2(2.7545889)] = 1.0858825

y4= 1

12[39.66 – 1.1802789 – 3(2.7545889)] = 2.5179962

z4= 1

15[54.8 – 3(1.1802789) – 4(2.3903528)] = 2.7798501

Fifth approximation:

x5= 1 7.74 2.5179962 2 2.7798501( ) 1.0781704

y5= 1 39.66 1.0858825 3 2.7798501( ) 2.5195473

z5= 1 54.8 3 1.0858825( ) (4 2.5179962) 2.7646912

Trang 7

Sixth approximation:

6 1 7.74 2.5195473 2 2.7646912( ) 1.0749835

10

x =  − + =

1 39.66 1.0781704 3 2.7646912 2.5239797 12

y =  − − =

6 ( ) ( )

1 54.8 3 1.0781704 4 2.5195473 2.76582 15

z =  − − =

Seventh approximation:

7 1 7.74 2.5239797 2 2.76582( ) 1.074766

10

7 =  − − ( )=

1 39.66 1.0749835 3 2.76582 2.523963 12

y

7 ( ) ( )

1 54.8 3 1.0749835 4 2.5239797 2.7652754 15

z =  − − = From the sixth and seventh approximations:

x=1.075, y=2.524and z=2.765 correct to three decimals Ans

8.6.2 Guass-Seidel Method

This is a modification of Gauss-Jacobi method As before, the system of the linear equations

a x b y c z+ + =d

a x b y c z+ + =d

a x b y c z+ + =d

is written as

( 1 1 1 )

1

1

x d b y c z a

( 2 2 2 )

2

1

y d a x c z b

( 3 3 3 )

3

1

z d a x b y c

and we start with the intial approximation x0, y0, z0 Substituting y0 and z0 in Eqn ( )1 , we get

1 ( 1 1 0 1 0)

1

1

x d b y c z a

Now substituting x=x z1, =z0 in Eqn ( )2 , we get

1 ( 2 2 1 2 0)

2

1

y d a x c z b

Substituting x=x1, y=y1 in Eqn ( )3 , we get

1 ( 3 3 1 3 1)

3

1

z d a x b y c

Trang 8

This process is continued till the value of x y z, , , are obtained to the desired degree of

accuracy In general, kth iteration can be written as

1 ( 1 1 1 )

1

1

x d b y c z a

1 ( 2 2 1 2 )

2

1

y d a x c z b

1 ( 3 3 1 3 1)

3

1

z d a x b y c

The rate of convergence of Gauss-Seidel method is roughly twice that of Gauss-Jacobi method

Example 7 Solve by Gauss-Seidel iteration method the system of equations

8x – 3y + 2z = 20; 6x + 3y + 12z = 35 and 4x + 11y – z = 33.

Sol From the given equations, we have

1( )

20 3 2 8

1(33 4 )

11

1 ( )

35 6 3 12

Putting y=0, z=0 in RHS of ( )1 , we get 20 2.5

8

x= = Putting x=2.5, z=0 in RHS of ( )2 , we get

1 33 4 2.5( ) 2.0909091

11

y=  − = Putting x=2.5, y=2.0909091 in RHS of ( )3 , we get

1 ( ) ( )

1

35 6 2.5 3 2.0909091 1.1439394 12

z =  − − = For the second approximation:

2 ( 1 1)

1

20 3 2 8

x = + yz

1 20 3 2.0909091( ) (2 1.1439394) 2.9981061

8

2 [ 2 1]

1

33 4 11

y = − x +z

1 33 4 2.9981061( ) 1.1439394 2.0137741

11

2 [ 2 2]

1

35 6 3 12

z = − xy

1 35 6 2.9981061( ) (3 2.0137741) 0.9141701

12

Trang 9

Third approximation:

3

1

20 3 2.0137741 2 0.9141701 3.0266228 8

x =  + − =

3

1

33 4 3.0266228 0.9141701 1.9825163 11

y =  − + =

3

1

35 6 3.0266228 3 1.9825163 0.9077262 12

z =  − − =

Fourth approximation:

4

1

8

4

1

33 4 3.0165121 0.90777262 1.9856071 11

y =  − + =

4

1

35 6 3.0165121 3 1.9856071 0.9120088 12

z =  − − =

Fifth approximation:

5

1

8

5

1

33 4 3.0166005 0.9120088 1.9859643 11

y =  − + =

5

1

35 6 3.0166005 3 1.9859643 0.9118753 12

z =  − − =

Sixth approximation:

6

1

20 3 1.9859643 2 0.9118753 3.0167568 8

x =  + − =

6

1

33 4 3.0167568 0.9118753 1.9858913 11

y =  − + =

6

1

35 6 3.0167568 3(1.9858913 0.9118099 12

z =  − − =

Seventh approximation:

x7 = 1

18[20 + 3(1.9858913) –2(0.9118099)] = 3.0167568

y7 = 1

11[33 – 4(3.0167568) + 0.9118099] = 1.9858894

z7 = 1

12[35 – 6(3.0167568) –3(1.9858894)] = 0.9118159

Since at the sixth and seventh approximations, the values of x y z, , , are the same, correct

to four decimal places, we can stop the iteration process

x=3.0167, y=1.9858, z=0.9118

We find that 12 iteration are necessary in Gauss-Jacobi Method to get the same accuracy

as achieved by 7 iterations in Gauss-Seidel method

Trang 10

Example 8 Solve the following system of equations using Gauss-Seidel method:

10x + y + 2z = 44

2x +10y + z = 51

x + 2y + 10z = 61 Sol Given system of equations can be written as:

1( )

10

x= − −y z

1 (51 2 )

10

y= − x z

1 ( )

10

z= − −x y

If we start by assuming y0 = =0 z0 then, we obtain

1 ( )

1

44 0 0 4.4 10

Now we susbtitute x=4.4 and z0 =0 for y1 and we obtain

1 1 (51 8.8 0) 4.22

10

y = − − = Similarly, we obtain 1 1 (61 4.4 2 4.22) 4.816

10

Now for second approximation, we obtain

x2 =4.0154

y2 =3.0148

z2 =5.0955

Third approximation is given by

x3 =3.0794

y3 =3.9746

z3=4.9971

Similarly, if we proceed up to eighth approximation, then, we obtain

x8 =3.00

y8 =4.00

z8=5.00

PROBLEM SET 8.1

1

1 Apply Gauss-Elimination method to solve the system of equations

x+ y z− = −

3x y z− − =4 [Ans 117,

71

x= 81,

71

y=− 148

71

z= ]

Ngày đăng: 04/07/2014, 15:20

TỪ KHÓA LIÊN QUAN

TÀI LIỆU CÙNG NGƯỜI DÙNG

TÀI LIỆU LIÊN QUAN

w