26
MTH-366(A): Applied Numerical Methods Unit 1: Simultaneous Linear equations Periods - 15, Marks – 10 1.1 Method of factorization or triangularization. 1.2 Crout’s method 1.3 Inverse of a matrix by Crout’s method. 1.4 Gauss- Seidal iteration method. 1.5 Relaxation Method Unit 2: Interpolation with Unequal Intervals: Periods - 15, Marks – 10 2.1 Newton’s Divided Difference Formula. 2.2 Lagrange’s Interpolation Formula 2.3 Inverse Interpolation 2.4 Lagrange’s Method 2.5 Iterative Method. Unit 3: Numerical Differentiation and Integration: Periods - 15, Marks – 10 3.1 Numerical differentiation. 3.2 Derivatives using Newton’s Forward Difference formulae. 3.3 Derivative using Newton’s Backward Difference formulae. 3.4 Numerical integration, general quadrature formula. 3.5 Trapezoidal rule. 3.6 Simpson’s 1/3 rule. 3.7 Romberg method. Unit 4: Numerical Solutions of Ordinary Differential Equations Periods - 15, Marks – 10 4.1 Picard’s Method 4.2 Taylor’s series Method 4.3 Modified Euler’s method. 4.4 Runge Kutta Fourth order Method. 4.5 Miline’s Method . 4.6 Adam-Bashforth Method Recommended Text Book: 1. Numerical Methods by V.N. Veda Murthy and N.Ch.S.N. Iyengar, Vikas publications, India. Reference Book: 1. Numerical Analysis by S.S. Sastry. ……………………………………………………………………………………………………………… MATHS DEPT., M.J. COLLEGE. PAGE-1 LECTURE NOTES BY DR. J.S.V.R. KRISHNA PRASAD for TY B.Sc., NUMERICAL ANALYSIS

MTH-366(A): Applied Numerical Methods ·  · 2017-10-05MTH-366(A): Applied Numerical Methods ... 2.1 Newton’s Divided Difference Formula. 2.2 Lagrange’s Interpolation Formula

  • Upload
    duongtu

  • View
    299

  • Download
    10

Embed Size (px)

Citation preview

Page 1: MTH-366(A): Applied Numerical Methods ·  · 2017-10-05MTH-366(A): Applied Numerical Methods ... 2.1 Newton’s Divided Difference Formula. 2.2 Lagrange’s Interpolation Formula

MTH-366(A): Applied Numerical Methods

Unit 1: Simultaneous Linear equations Periods - 15, Marks – 10

1.1 Method of factorization or triangularization.

1.2 Crout’s method

1.3 Inverse of a matrix by Crout’s method.

1.4 Gauss- Seidal iteration method.

1.5 Relaxation Method

Unit 2: Interpolation with Unequal Intervals: Periods - 15, Marks – 10

2.1 Newton’s Divided Difference Formula.

2.2 Lagrange’s Interpolation Formula

2.3 Inverse Interpolation

2.4 Lagrange’s Method

2.5 Iterative Method.

Unit 3: Numerical Differentiation and Integration: Periods - 15, Marks – 10

3.1 Numerical differentiation.

3.2 Derivatives using Newton’s Forward Difference formulae.

3.3 Derivative using Newton’s Backward Difference formulae.

3.4 Numerical integration, general quadrature formula.

3.5 Trapezoidal rule.

3.6 Simpson’s 1/3 rule.

3.7 Romberg method.

Unit 4: Numerical Solutions of Ordinary Differential Equations Periods - 15, Marks – 10

4.1 Picard’s Method

4.2 Taylor’s series Method

4.3 Modified Euler’s method.

4.4 Runge Kutta Fourth order Method.

4.5 Miline’s Method .

4.6 Adam-Bashforth Method

Recommended Text Book:

1. Numerical Methods by V.N. Veda Murthy and N.Ch.S.N. Iyengar, Vikas publications, India.

Reference Book:

1. Numerical Analysis by S.S. Sastry.

………………………………………………………………………………………………………………

MATHS DEPT., M.J. COLLEGE.

PAGE-1

LECTURE NOTES BY DR. J.S.V.R. KRISHNA PRASAD for TY B.Sc., NUMERICAL ANALYSIS

Page 2: MTH-366(A): Applied Numerical Methods ·  · 2017-10-05MTH-366(A): Applied Numerical Methods ... 2.1 Newton’s Divided Difference Formula. 2.2 Lagrange’s Interpolation Formula

Cholesky’s decomposition method is faster than the LU decomposition. There is no need for pivoting. If thedecomposition fails, the matrix is not positive definite.

Consider the system of linear equations:a11x1 + a12x2 + a13x3 = b1

a21x1 + a22x2 + a23x3 = b2

a31x1 + a32x2 + a33x3 = b3 (2.21)The above system can be written as (2.22)

Ax = b

where1 111 12 13

21 22 23 2 2

31 32 33 3 3

, , = = =

x ba a aa a a x bx ba a a x b

A

Let A = LU… (2.23)

11 12 13

21 22 23

31 32 33

1 0 01 0 0and =

1 0 0

u u ul u uL Ul l u

=

Equation (2.21) can be written asLUX = b (2.24)

If we write UX = V (2.25)

CHOLESKY’S TRIANGULARISATION METHOD

LECTURE NOTES PREPARED BY DR. J.S.V.R. KRISHNA PRASAD UNIT-I: SYSTEM OF LINEAR EQUATIONS

MATHS DEPT., M.J. COLLEGE.

PAGE-2

LECTURE NOTES BY DR. J.S.V.R. KRISHNA PRASAD for TY B.Sc., NUMERICAL ANALYSIS

Page 3: MTH-366(A): Applied Numerical Methods ·  · 2017-10-05MTH-366(A): Applied Numerical Methods ... 2.1 Newton’s Divided Difference Formula. 2.2 Lagrange’s Interpolation Formula

Equation (2.24) becomes LV = b (2.26)

Equation (2.26) is equivalent to the system

v1 = b1

l21v1 + v2 = b2

l31v1 + l32v2 + v3 = b3 (2.27)The above system can be solved to find the values of v1, v2 and v3 which give us the matrix V.

UX = Vthen becomes

u11x1 + u12x2 + u13x3 = v1

u22x2 + u23x3 = v2

u33x3 = v3 (2.28)

which can be solved for x3, x2 and x1 by the backward substitution process.In order to compute the matrices L and U, we write Eq. (2.23) as

11 12 13 11 12 13

21 22 23 21 22 23

31 32 33 31 32 33

1 0 01 0 0

1 0 0

u u u a a al u u a a al l u a a a

=

(2.29)

Multiplying the matrices on the left and equating the corresponding elements of both sides, we obtain u11 = a11, u12 = a12, u13 = a13 (2.30)

2121 11 21 21

11

3131 11 31 31

11

al u a laa

l u a la

= ⇒ = = ⇒ =

(2.31)

2121 12 22 22 22 22 12

11

2121 13 23 23 23 23 13

11

al u u a u a aaal u u a u a aa

+ = ⇒ = − + = ⇒ = −

(2.32)

3132 1231 12 32 22 32 32

1122

1 aa al u l u a l

au −+ = ⇒ =

(2.33)

and l31u13 + l32u23 + u33 = a33 (2.34)

The value of u33 can be computed from Eq. (2.34).To obtain the elements of L and U, we first find the first row of U and the first column of L. Then, we

determine the second row of U and the second column of L. Finally, we compute the third row of U.

LECTURE NOTES PREPARED BY DR. J.S.V.R. KRISHNA PRASAD UNIT-I: SYSTEM OF LINEAR EQUATIONS

MATHS DEPT., M.J. COLLEGE.

PAGE-3

LECTURE NOTES BY DR. J.S.V.R. KRISHNA PRASAD for TY B.Sc., NUMERICAL ANALYSIS

Page 4: MTH-366(A): Applied Numerical Methods ·  · 2017-10-05MTH-366(A): Applied Numerical Methods ... 2.1 Newton’s Divided Difference Formula. 2.2 Lagrange’s Interpolation Formula

Solve the following equations by Cholesky’s triangularisation method.2x + y + 4z = 12

8x – 3y + 2z = 204x + 11y – z = 33

Solution:

We have2 1 4 128 3 2 , , 204 11 1 33

xA X y B

z

= − = = −

Let11 12 13

21 22 23

31 32 33

1 0 0 2 1 41 0 0 8 3 2

1 0 0 4 11 1

u u ul u ul l u

= − −

Multiplying and equating we get:

l × u11 = 2 11 2u⇒ =

l × u12 = 1 12 1u⇒ =

l × u13 = 4 13 4u⇒ =

l21 × u11 = 8 2111

8 84

2l

u⇒ = = =

l21 × u12 + u22 = –3 22u⇒ = –3 – l21 × u12 = –3 – 4 × 1 = –7

l21 × u13 + u23 = 2 23u⇒ = 2 – l21 × u13 = 2 – 4 × 4 = –14

l31 × u11 = 4 3111

4 42

2l

u⇒ = = =

l31 × u12 + l32 × u22 = 11 31 1232

22

11 11 2 1 97 7

l ul

u− × − ×

⇒ = = = −−

l31 × u13 + l32 × u23 + l × u33= –1 33u⇒ = –1 – l31 × u13 – l32 × u23 = –1 – 2 × 4 – 9 ( 14)7

− − = –27

We get:

1 0 0 2 1 44 1 0 0 7 14

9 0 0 272 17

A

= − − −−

Example 1

LECTURE NOTES PREPARED BY DR. J.S.V.R. KRISHNA PRASAD UNIT-I: SYSTEM OF LINEAR EQUATIONS

Cholesky’s triangularisation method is also known as method offactorisation.

MATHS DEPT., M.J. COLLEGE.

PAGE-4

LECTURE NOTES BY DR. J.S.V.R. KRISHNA PRASAD for TY B.Sc., NUMERICAL ANALYSIS

Page 5: MTH-366(A): Applied Numerical Methods ·  · 2017-10-05MTH-366(A): Applied Numerical Methods ... 2.1 Newton’s Divided Difference Formula. 2.2 Lagrange’s Interpolation Formula

and the given system can be written as:

1 0 0 2 1 4 124 1 0 0 7 14 20

9 0 0 27 332 17

xyz

− − = −−

Writing: LV = B, we get

1

2

3

1 0 0 124 1 0 20

9 332 17

VVV

= −

which gives 1 12V = 2V⇒

4V1 + V2 = 20 2V⇒ = 20 – 4 × 12 = –28

2V1 –97

V2 + V3 = 33 39

337

V⇒ = + (–28) – 2× 12 = –27

The solution to the original system is given by:

UX = V

2 1 4 120 7 14 280 0 27 27

xyz

− − = − − −

2x + y + 4z = 12–7y – 14z = –28

–27z = –27 1z⇒ =

7y = 28 – 14 × 114

27

y y⇒ = ⇒ =

2x = 12 – y – 4z = 12 – 2 – 4 × 16

32

x x⇒ = ⇒ =

Solve the system of equations using Cholesky’s factorisations.x1 + x2 + x3 – x4 = 2

x1 – x2 – x3 + 2x4 = 04x1 + 4x2 + x3 + x4 = 11

2x1 + x2 + 2x3 – 2x4 = 2

Example 2

LECTURE NOTES PREPARED BY DR. J.S.V.R. KRISHNA PRASAD UNIT-I: SYSTEM OF LINEAR EQUATIONS

MATHS DEPT., M.J. COLLEGE.

PAGE-5

LECTURE NOTES BY DR. J.S.V.R. KRISHNA PRASAD for TY B.Sc., NUMERICAL ANALYSIS

Page 6: MTH-366(A): Applied Numerical Methods ·  · 2017-10-05MTH-366(A): Applied Numerical Methods ... 2.1 Newton’s Divided Difference Formula. 2.2 Lagrange’s Interpolation Formula

Solution:The set of equations can be written in the matrix form [A]{x} = {b}

1

2

3

4

1 1 1 1 21 1 1 2 04 4 1 1 112 1 2 2 2

xxxx

− − − = −

Let us decompose [A] in the form[A] = [L] [U]

where

11 12 13 14

21 22 23 24

31 32 33 34

41 42 43 44

1 0 0 01 0 0 0

[ ] and [ ]1 0 0 0

1 0 0 0

u u u ul u u u

L Ul l u ul l l u

= =

The product of [L][U] gives

11 12 13 14

21 11 21 12 22 21 13 23 21 14 24

31 11 31 12 32 22 31 13 32 23 33 31 14 32 24 34

41 11 41 12 42 22 41 13 42 23 43 33 41 14 42 24 43 34 44

[ ][ ]

+ + + = + + + + + + + + + + +

u u u ul u l u u l u u l u u

L Ul u l u l u l u l u u l u l u ul u l u l u l u l u l u l u l u l u u

Equating the elements of this matrix to the [A] matrix yields the following equationsu11 = 1 l21u11 = 1 l31u11 = 4 l41u11 = 2u12 = 1 l21u12 + u22 = –1 l31u12 + l32u22 = 4 l41u12 + l42u22 = 1u13 = 1 l21u13 + u23 = –1 l31u13 + l32u23 + u33 = 1 l41u13 + l42u23 + l23u33 = 2u14 = –1 l21u14 + u24 = 2 l31u14 + l32u24 + u34 = 1 l41u14 + l42u24 + l43u34 + u44 = –2

By solving these sixteen equations we get

1 1 12 3 6

1 0 0 0 1 1 1 11 1 0 0 0 2 2 3

[ ] and [ ]4 0 1 0 0 0 3 52 1 0 0 0

L U

− − − = = − −

To solve [A]{x} = {b} we have to solve the two systems[L]{Y} = {b}[U]{x} = {Y}

LECTURE NOTES PREPARED BY DR. J.S.V.R. KRISHNA PRASAD UNIT-I: SYSTEM OF LINEAR EQUATIONS

MATHS DEPT., M.J. COLLEGE.

PAGE-6

LECTURE NOTES BY DR. J.S.V.R. KRISHNA PRASAD for TY B.Sc., NUMERICAL ANALYSIS

Page 7: MTH-366(A): Applied Numerical Methods ·  · 2017-10-05MTH-366(A): Applied Numerical Methods ... 2.1 Newton’s Divided Difference Formula. 2.2 Lagrange’s Interpolation Formula

i.e.,

1

2

31 1

42 3

1 0 0 0 21 1 0 0 04 0 1 0 112 1 2

yyyy

=

which gives by forward substitutiony1 = 2, y2 = –2, y3 = 3, y4 = 0

and hence [U]{x} = {y} becomes

1

2

31

46

1 1 1 1 20 2 2 3 20 0 3 5 30 0 0 0

xxxx

− − − − = −

Then by back substitution we obtainx4 = 0, x3 = –1, x2 = 2, x1 = 1.

Solve the system of linear equations using Cholesky’s factorisation method.2x – 6y + 8z = 245x + 4y – 3z = 23x + y + 2z = 16

Solution:

11 12 13

21 22 23

31 32 33

1 0 0 2 6 81 0 0 5 4 3

1 0 0 3 1 2

u u ul u ul l u

− = −

11 12 13

21 11 21 12 22 21 13 23

31 11 31 12 32 22 31 13 32 23 33

2 6 85 4 33 1 2

u u ul u l u u l u ul u l u l u l u l u u

− + + = − + + + u11 = 2, u12 = –6, u13 = 8

2111

52.5l

u= =

3111

31.5l

u= =

u22 = 4 – l21u12 = 19u23 = –3 – l21u13 = –23

Example 3

LECTURE NOTES PREPARED BY DR. J.S.V.R. KRISHNA PRASAD UNIT-I: SYSTEM OF LINEAR EQUATIONS

MATHS DEPT., M.J. COLLEGE.

PAGE-7

LECTURE NOTES BY DR. J.S.V.R. KRISHNA PRASAD for TY B.Sc., NUMERICAL ANALYSIS

Page 8: MTH-366(A): Applied Numerical Methods ·  · 2017-10-05MTH-366(A): Applied Numerical Methods ... 2.1 Newton’s Divided Difference Formula. 2.2 Lagrange’s Interpolation Formula

31 1232

22

1 1019

l ul

u−

= =

l33 = 2 – l31u13 – l32u23 = 4019

10 4019 19

1 0 0 2 6 82.5 1 0 0 19 23,1.5 1 0 0

L U−

−= =

LV = B ⇒1

210

319

1 0 0 242.5 1 0 21.5 1 16

vvv

=

⇒ v1 = 24v2 = 2 – 2.5 × 24 = –58

v3 = 16 – 1.5 × 24 –10 200

( 58)19 19

− =

UX = V ⇒4019

242 6 8580 19 23

2000 019

xyz

− − − = 2x – 6y + 8z = 24 (E.1)

19y – 23z = –58 (E.2)

40 200

519 19

z z= ⇒ = (E.3)

From Eqs.(E.2) and (E.3), we have

3y =

From Eqs.(E.1), (E.2) and (E.3), we get

1x =

This method is based on the fact that every square matrix A can be expressed as the product of a lowertriangular matrix and an upper triangular matrix, provided all the principle minors of A are non-singular. Also,such a factorisation, if exists, is unique.

This method is also called triangularisation or factorisation method. Here, we factorise the given matrixas A = LU, where L is a lower triangular matrix with unit diagonal elements and U is an upper triangularmatrix. Then,

A–1 = (LU)–1 = U–1L–1

2. CROUT’S METHOD

LECTURE NOTES PREPARED BY DR. J.S.V.R. KRISHNA PRASAD UNIT-I: SYSTEM OF LINEAR EQUATIONS

MATHS DEPT., M.J. COLLEGE.

PAGE-8

LECTURE NOTES BY DR. J.S.V.R. KRISHNA PRASAD for TY B.Sc., NUMERICAL ANALYSIS

Page 9: MTH-366(A): Applied Numerical Methods ·  · 2017-10-05MTH-366(A): Applied Numerical Methods ... 2.1 Newton’s Divided Difference Formula. 2.2 Lagrange’s Interpolation Formula

Consider the systema11x1 + a12x2 + a13x3 = b1

a21x1 + a22x2 + a23x3 = b2

a31x1 + a32x2 + a33x3 = b3 (2.35)The above system can be written as

Ax = bLet A = LU (2.36)

where 11 12 13

21 22 23

31 32 33

0 0 10 and = 0 1

0 0 1

l u ul lL U ul l l

=

(2.37)

Here, L is a lower triangular matrix and U is an upper triangular matrix with diagonal elements equal to unity.A = LU ⇒ A–1 = U–1L–1 (2.38)

Now11 12 13 11 12 13

21 22 23 21 22 23

31 32 33 31 32 33

0 0 10 0 1

0 0 1

a a a l u ua a a l lA LU ua a a l l l

= ⇒ =

or 11 12 13 11 11 12 11 13

21 22 23 21 21 12 22 21 13 22 23

31 32 33 31 31 12 32 31 13 32 23 33

a a a l l u l ua a a l l u l l u l ua a a l l u +l l u +l u +l

+ +=

Equating the corresponding elements, we obtainl11 = a11 l21 = a21 l31 = a31 (2.39)l11u12 = a12 l11u13 = a13 (2.40)l21u12 + l22 = a22 l31u12 + l32 = a32 (2.41)l21u13 + l22u23 = a23 (2.42)

and l31u13 + l32u23 + l33 = a33 (2.43)from (2.40) we find

u12 = a12/l11 = a12/a11

from (2.41) we obtainl22 = a22 – l21u12 (2.44)l32 = a32 – l31u12 (2.45)

Equation (2.42) givesu23 = (a23 – l21u23)/l22 (2.46)

from the relation (2.43) we getl33 = a33 – l31u13 – l32u23 (2.47)

Thus, we have determined all the elements of L and U.From Eqs.(2.36) and (2.37) we have

LUx = b (2.48)

LECTURE NOTES PREPARED BY DR. J.S.V.R. KRISHNA PRASAD UNIT-I: SYSTEM OF LINEAR EQUATIONS

MATHS DEPT., M.J. COLLEGE.

PAGE-9

LECTURE NOTES BY DR. J.S.V.R. KRISHNA PRASAD for TY B.Sc., NUMERICAL ANALYSIS

Page 10: MTH-366(A): Applied Numerical Methods ·  · 2017-10-05MTH-366(A): Applied Numerical Methods ... 2.1 Newton’s Divided Difference Formula. 2.2 Lagrange’s Interpolation Formula

where

1

2

n

vv

V

v

=

From Eq. (2.48) we have LV = b, which on forward substitution yields V.From UX = V, we find x (by backward substitution).

Solve the following set of equations by Crout’s method:2x + y + 4z = 12

8x – 3y + 2z = 204x + 11y – z = 33

Solution:

We have2 1 4 128 3 2 , , 204 11 1 33

= − = = −

xX y B

zA

AX = BLet A = LU

11 12 13

21 22 23

31 32 33

0 0 10 0 1

0 0 1

l u ul lL U ul l l

= =

11 12 13

21 22 23

31 32 33

0 02 1 4 108 3 2 0 1

4 11 1 0 0 1

l u ul l ul l l

− = −

11 11 12 11 13

21 21 12 22 21 13 22 23

31 31 12 32 31 13 32 23 33

2 1 48 3 24 11 1

l l u l ul l u l l u l ul l u l l u l u l

+ +− = + + +−

l11u12 = 1 1212

u⇒ =

l11u12 = 4 134

22

u⇒ = =

l22 + l21u12 = –3 2213 8 72

l ⇒ = − − = −

l32 + l21u12 = –3 32111 4 92

l ⇒ = − =

Example 4

// Numerical Methods //

Let UX = V

LECTURE NOTES PREPARED BY DR. J.S.V.R. KRISHNA PRASAD UNIT-I: SYSTEM OF LINEAR EQUATIONS

MATHS DEPT., M.J. COLLEGE.

PAGE-10

LECTURE NOTES BY DR. J.S.V.R. KRISHNA PRASAD for TY B.Sc., NUMERICAL ANALYSIS

Page 11: MTH-366(A): Applied Numerical Methods ·  · 2017-10-05MTH-366(A): Applied Numerical Methods ... 2.1 Newton’s Divided Difference Formula. 2.2 Lagrange’s Interpolation Formula

l21u13 + l22u23 = 2 232 8 2

27

u − ×⇒ = =

−l31u13 + l32u23 + l33 = –1 33 1 4 2 9 2 27l⇒ = − − × − × = −

122 0 0 1 2

8 7 0 and 0 1 24 9 27 0 0 1

L U = − = −

LV = B

1

2

3

2 0 0 128 7 0 204 9 27 33

vvv

− = −

2v1 = 12 1 6v⇒ =

8v1 – 7v2 = 20 220 8 6

7v − + ×

⇒ = = 4

4v1 + 9v2 – 27v3 = 33 333 4 6 9 4

27v − + × + ×

⇒ = = 1

1

2

3

641

VVVV

= =

; Ux = V

12 61 2

40 1 210 0 1

xyz

=

12 6

2x y z+ + =

y + 2z = 4

1z =y = 4 – 2 × 1

2y⇒ =

x = 6 – 12× 2 – 2 × 1 3x⇒ =

Solve the following set of equations by using the Crout’s method:2x1 + x2 + x3 = 7x1 + 2x2 + x3 = 8x1 + x2 + 2x3 = 9

Example 5

LECTURE NOTES PREPARED BY DR. J.S.V.R. KRISHNA PRASAD UNIT-I: SYSTEM OF LINEAR EQUATIONS

MATHS DEPT., M.J. COLLEGE.

PAGE-11

LECTURE NOTES BY DR. J.S.V.R. KRISHNA PRASAD for TY B.Sc., NUMERICAL ANALYSIS

Page 12: MTH-366(A): Applied Numerical Methods ·  · 2017-10-05MTH-366(A): Applied Numerical Methods ... 2.1 Newton’s Divided Difference Formula. 2.2 Lagrange’s Interpolation Formula

2 1 1 71 2 1 , , 81 1 2 9

= = =

xx y B

zA

Let A = LU

11 12 13

21 22 23

31 32 33

0 0 10 0 1

0 0 1

l u ul lL U ul l l

= =

11 11 12 11 13

21 21 12 22 21 13 22 23

31 31 12 32 31 13 32 23 33

2 1 11 2 11 1 2

l l u l ul l u l l u l ul l u l l u l u l

+ += + + +

l11 = 2, l21 = 1, l31 = 1

u12 = 12

, u13 = 12

l22 = 2 – l21u12 = 2 – 1 ×12

=32

l32 = 1 – l31u12 = 1 – 1 × 12

= 12

u23 = 21 13

22

1 13

l ul

−=

l33 = 2 – l31u13 – l32u23 = 2 – 1 1 1 42 2 3 3− × =

2 0 0 1 1/ 2 1/ 21 3/ 2 0 , 0 1 1/ 31 1/ 2 4 / 3 0 0 1

L U = =

Ax = B, LU.x = B, Ux = V

1

2

3

2 0 0 71 3/ 2 0 81 1/ 2 4 / 3 9

vvLV Bv

= ⇒ =

1 1

1 2 2

1 2 3 3

2 7 3.53.53 8 3 32

1 4 39 32 3

v v

v v v V

v v v v

= ⇒ = + = ⇒ = ⇒ = + + = ⇒ =

// Numerical Methods //

Solution:

LECTURE NOTES PREPARED BY DR. J.S.V.R. KRISHNA PRASAD UNIT-I: SYSTEM OF LINEAR EQUATIONS

MATHS DEPT., M.J. COLLEGE.

PAGE-12

LECTURE NOTES BY DR. J.S.V.R. KRISHNA PRASAD for TY B.Sc., NUMERICAL ANALYSIS

Page 13: MTH-366(A): Applied Numerical Methods ·  · 2017-10-05MTH-366(A): Applied Numerical Methods ... 2.1 Newton’s Divided Difference Formula. 2.2 Lagrange’s Interpolation Formula

1

2

3

1 1/ 2 1/ 2 3.50 1 1/ 3 30 0 1 3

xxUx Vx

= ⇒ =

1 2 31 1

3.52 2

x x x+ + = (E.1)

2 31

33

x x+ = (E.2)

3 3x = (E.3)

From Eqs.(E.2) and (E.3), we have

2 2x =

From Eq.(E.1), we get

1 1x =

LECTURE NOTES PREPARED BY DR. J.S.V.R. KRISHNA PRASAD UNIT-I: SYSTEM OF LINEAR EQUATIONS

MATHS DEPT., M.J. COLLEGE.

PAGE-13

LECTURE NOTES BY DR. J.S.V.R. KRISHNA PRASAD for TY B.Sc., NUMERICAL ANALYSIS

adiani
Typewritten text
-------------------------------------------------------------------------------------------------------------------
Page 14: MTH-366(A): Applied Numerical Methods ·  · 2017-10-05MTH-366(A): Applied Numerical Methods ... 2.1 Newton’s Divided Difference Formula. 2.2 Lagrange’s Interpolation Formula

MATHS DEPT., M.J. COLLEGE.

PAGE-14

LECTURE NOTES BY DR. J.S.V.R. KRISHNA PRASAD for TY B.Sc., NUMERICAL ANALYSIS

Page 15: MTH-366(A): Applied Numerical Methods ·  · 2017-10-05MTH-366(A): Applied Numerical Methods ... 2.1 Newton’s Divided Difference Formula. 2.2 Lagrange’s Interpolation Formula

MATHS DEPT., M.J. COLLEGE.

PAGE-15

LECTURE NOTES BY DR. J.S.V.R. KRISHNA PRASAD for TY B.Sc., NUMERICAL ANALYSIS

aadity
Typewritten text
-----------------------------------------------------------------------------------------------
Page 16: MTH-366(A): Applied Numerical Methods ·  · 2017-10-05MTH-366(A): Applied Numerical Methods ... 2.1 Newton’s Divided Difference Formula. 2.2 Lagrange’s Interpolation Formula

The Gauss-Seidal method is applicable to predominantly diagonal systems. A predominantly diagonal systemhas large diagonal elements. The absolute value of the diagonal element in each case is larger than the sumof the absolute values of the other elements in that row of the matrix A. For such predominantly diagonalsystems, the Gauss-Seidal method always converges to the correct solution, irrespective of the choice of theinitial estimates. Since the most recent approximations of the variables are used while proceeding to the nextstep, the convergence of the Gauss-Seidal method is twice as fast as in Jacobi’s method. The Gauss-Seidaland Jacobi’s methods converge for any choice of the initial approximations, if in each equation of the system,the absolute value of the largest coefficient is greater than the sum of the absolute values of the remainingcoefficients. In other words,

11

| |1

| |

nij

iiij

aa=

≤∑ i = 1, 2, 3, …, n

where the inequality holds in case of at least one equation. Convergence is assured in the Gauss-Seidalmethod if the matrix A is diagonally dominant and positive definite. If it is not in a diagonally dominant form,it should be connected to a diagonally dominant form by row exchanger, before starting the Gauss-Seidaliterative scheme.

Gauss-Seidal method is also an iterative solution procedure which is an improved version of Jacobi’smethod. The method is also known as the method of successive approximations.

Consider the system of linear simultaneous equationsa11x1 + a12x2 + a13x3 = b1

a21x1 + a22x2 + a23x3 = b2

a31x1 + a32x2 + a33x3 = b3 (2.54)If the absolute value of the largest coefficient in each equation is greater than the sum of the absolute valuesof all the remaining coefficients, then the Gauss-Seidal iteration method will converge. If this condition is notsatisfied, then Gauss-Seidal method is not applicable. Here, in Eq.(2.54), we assume the coefficient a11, a22and a33 are the largest coefficients.

We can rewrite Eq.(2.54) as

111

1xa

= (b1 – a12x2 – a13x3)

222

1xa

= (b2 – a21x1 – a23x3)

3. GAUSS-SEIDAL ITERATION METHOD

LECTURE NOTES PREPARED BY DR. J.S.V.R. KRISHNA PRASAD UNIT-I: SYSTEM OF LINEAR EQUATIONS

MATHS DEPT., M.J. COLLEGE.

PAGE-16

LECTURE NOTES BY DR. J.S.V.R. KRISHNA PRASAD for TY B.Sc., NUMERICAL ANALYSIS

Page 17: MTH-366(A): Applied Numerical Methods ·  · 2017-10-05MTH-366(A): Applied Numerical Methods ... 2.1 Newton’s Divided Difference Formula. 2.2 Lagrange’s Interpolation Formula

333

1xa

= (b3 – a31x1 – a32x2) (2.55)

Let the initial approximations be 0 01 2,x x and 0

3x respectively. The following iterations are then carried out.

Iteration 1: The first improvements of x1, x2 and x3 are obtained as

( )

( )

( )

011 1 12 2 13 3

11

021 2 21 11 23 3

22

3 31 11 32 213133

1

1

1

x b a x a xa

x b a x a xa

b a x a xxa

= − −

= − −

− −=

(2.56)

Iteration 2: The second improvements of x1, x2 and x3 are obtained as

1211

1xa

= (b1 – a12x11 – a13x31)

2222

1xa

= (b2 – a21x12 – a23x31)

3233

1xa

= (b3 – a31x12 – a32x22) (2.57)

The above iteration process is continued until the values of x1, x2 and x3 are obtained to a pre-assigned ordesired degree of accuracy. In general, the initial approximations are assumed as 0 0 0

1 2 3 0x x x= = = . Gauss-Seidal method generally converges for any initial values of 0 0 0

1 2 3, ,x x x . The convergence rate of Gauss-Seidalmethod is found to be twice to that of Jacobi’s method. Like the Jacobi’s method, Gauss-Seidal method canalso be extended to n linear simultaneous algebraic equations in n unknowns.

Example E2.21Solve the following equations by Gauss-Seidal method.

8x + 2y – 2z = 8x – 8y + 3z = –42x + y + 9z = 12

Solution:In the above equations:

|8| > |2| + | –2|| –8| > |1| + |3|

|9| > |2| + |1|So, the conditions of convergence are satisfied and we can apply Gauss-Seidal method. Then we rewrite thegiven equations as follows:

LECTURE NOTES PREPARED BY DR. J.S.V.R. KRISHNA PRASAD UNIT-I: SYSTEM OF LINEAR EQUATIONS

MATHS DEPT., M.J. COLLEGE.

PAGE-17

LECTURE NOTES BY DR. J.S.V.R. KRISHNA PRASAD for TY B.Sc., NUMERICAL ANALYSIS

Page 18: MTH-366(A): Applied Numerical Methods ·  · 2017-10-05MTH-366(A): Applied Numerical Methods ... 2.1 Newton’s Divided Difference Formula. 2.2 Lagrange’s Interpolation Formula

0 01 1 1 1

1

01 2 2 1 2

2

1 3 3 1 3 13

1 ( )

1( )

1 ( )

x d b y c za

y d a x c zb

z d a x b yc

= − −

= − −

= − −

Let the initial approximations be: x0 = y0 = z0 = 0

Iteration 1:

11

1

1 2 2 12

1 3 3 1 3 13

8 1.08

1 1( ) ( 4 1 1.0) 0.6258

1 1( ) (12 2) 2 1.0 1 0.625) 1.0429

dxa

y d a xb

z d a x b yc

= = =

= − = − − × =−

= − − = − = × − × =

Iteration 2:

2 1 1 1 1 11

2 2 2 2 2 12

2 3 3 2 3 23

1 1( ) (8 2 0.625 ( 2) 1.042) 1.1048

1 1( ) ( 4 1 1.104 3 1.042) 1.0298

1 1( ) (12 2 1.104 1 1.029) 0.9749

x d b y c za

y d a x c zb

z d a x b yc

= − − = − × − − × =

= − − = − − × − × =−

= − − = − × − × =

Iteration 3:

3 1 1 2 1 21

3 2 2 3 2 22

3 3 3 3 3 33

1 1( ) (8 2 1.029 ( 2) 0.974) 0.9868

1 1( ) ( 4 1 0.986 3 0.974) 0.989

81 1( ) (12 2 0.986 1 0.989) 1.004

9

x d b y c za

y d a x c zb

z d a x b yc

= − − = − × − − × =

= − − = − − × − × =−

= − − = − × − × =

Iteration 4:

4

4

4

1 (8 2 0.989 ( 2) 1.004) 1.00481

( 4 1 1.004 3 1.004) 1.0028

1 (12 2 1.004 1 1.002) 0.9999

x

y

z

= − × − − × =

= − − × − × =−

= − × − × =

LECTURE NOTES PREPARED BY DR. J.S.V.R. KRISHNA PRASAD UNIT-I: SYSTEM OF LINEAR EQUATIONS

MATHS DEPT., M.J. COLLEGE.

PAGE-18

LECTURE NOTES BY DR. J.S.V.R. KRISHNA PRASAD for TY B.Sc., NUMERICAL ANALYSIS

Page 19: MTH-366(A): Applied Numerical Methods ·  · 2017-10-05MTH-366(A): Applied Numerical Methods ... 2.1 Newton’s Divided Difference Formula. 2.2 Lagrange’s Interpolation Formula

5

5

5

1 (8 2 1.002 ( 2) 0.999) 0.99981

( 4 1 0.999 3 0.999) 1.08

1 (12 2 0.999 1 1.0) 1.09

x

y

z

= − × − − × =

= − − × − × =−

= − × − × =

Iteration 6:

6

6

6

1 (8 2 1 2 1) 1.081

( 4 1 1.0 3 1.0) 1.08

1 (12 2 1.0 1 1.0) 1.09

x

y

z

= − × + × =

= − − × − × =−

= − × − × =

Example E2.22Using the Gauss-Seidal method solve the system of equations correct to three decimal places.

x + 2y + z = 03x + y – z = 0x – y + 4z = 3

Solution:Rearranging the given equations to give dominant diagonal elements, we obtain

3x + y – z = 0x + 2y + z = 0x – y + 4z = 3 (E.1)

Equation (E.1) can be rewritten asx = (z – y)/3y = –(x + z)/2z = (3 + x + y)/2 (E.2)

Writing Eq.(E.2) in the form of Gauss-Seidal iterative scheme, we getx (r +1) = (z (r) – y (r))/3y (r +1) = – (x (r +1) – z (r))/2z (r +1) = (3 – x (r +1) + y (r +1))/4

We start with the initial valuex(0) = y(0) = z(0) = 1

The iteration scheme givesx(1) = (z(0) – y(0))/3 = (1 – 1)/3 = 0

y(1) = (–x(1) – z(0))/2 = (0 – 1)/2 = –0.5z(1) = (3 – x(1) + y(1))/4 = (3 – 0 – 0)/4 = 0.625

// Linear System of Equations //

Iteration 5:

LECTURE NOTES PREPARED BY DR. J.S.V.R. KRISHNA PRASAD UNIT-I: SYSTEM OF LINEAR EQUATIONS

MATHS DEPT., M.J. COLLEGE.

PAGE-19

LECTURE NOTES BY DR. J.S.V.R. KRISHNA PRASAD for TY B.Sc., NUMERICAL ANALYSIS

Page 20: MTH-366(A): Applied Numerical Methods ·  · 2017-10-05MTH-366(A): Applied Numerical Methods ... 2.1 Newton’s Divided Difference Formula. 2.2 Lagrange’s Interpolation Formula

The second iteration givesx(2) = (z(1) – y(1))/3 = (0.625 + 0.5)/3 = 0.375

y(2) = (–x(2) – z(1))/2 = (– 0.375 – 0.625)/2 = –0.50z(2) = (3 – x(2) + y(2))/4 = (3 – 0.375 – 0.5)/4 = 0.53125

Subsequent iterations result in

x(3) = 0.34375 y(3) = – 0.4375 z(3) = 0.55469x(4) = 0.33075 y(4) = – 0.44271 z(4) = 0.55664x(5) = 0.33312 y(5) = – 0.44488 z(5) = 0.5555x(6) = 0.33346 y(6) = – 0.44448 z(6) = 0.55552

Hence, the approximate solution is as follows:x = 0.333 y = –0.444 z = 0.555

Example E2.23Solve the following equations by the Gauss-Seidal method.

4x – y + z = 12– x + 4y – 2z = –1

x – 2y + 4z = 5Solution:The iteration formula is

1

1n

i ij ji jii j i

b A xxA =

− ←

∑ i = 1, 2, …, n

Hence x =14

(12 + y – z)

y =14

(–1 + x + 2z)

z =14

(5 – x + 2y)

Choosing the starting values x = y = z = 0, we have the first iteration

x =14

(12 + 0 – 0) = 3

y =14

[–1 + 3 + 2(0)] = 0.5

z =14

[5 – 3 + 2)0.5) = 0.75

LECTURE NOTES PREPARED BY DR. J.S.V.R. KRISHNA PRASAD UNIT-I: SYSTEM OF LINEAR EQUATIONS

MATHS DEPT., M.J. COLLEGE.

PAGE-20

LECTURE NOTES BY DR. J.S.V.R. KRISHNA PRASAD for TY B.Sc., NUMERICAL ANALYSIS

Page 21: MTH-366(A): Applied Numerical Methods ·  · 2017-10-05MTH-366(A): Applied Numerical Methods ... 2.1 Newton’s Divided Difference Formula. 2.2 Lagrange’s Interpolation Formula

x =14

(12 + 0.5 – 0.75) = 2.9375

y =14

[–1 + 2.9375 + 2(0.75)] = 0.8594

z =14

(5 – 2.9375 + 2(0.8594)] = 0.9453

The third iteration yields

x =14

[12 + 0.8594 – 0.9453] = 2.9785

y =14

[–1 + 2.9785 + 2(0.9453)] = 0.9673

z =14

(5 – 2.9785 + 2(0.9673)] = 0.9890

After five more iterations, we obtain the final values for x, y and z as x = 3, y = 1 and z = 1.

The second iteration gives

MATHS DEPT., M.J. COLLEGE.

PAGE-21

LECTURE NOTES BY DR. J.S.V.R. KRISHNA PRASAD for TY B.Sc., NUMERICAL ANALYSIS

aadity
Typewritten text
RELAXATION METHOD:
Page 22: MTH-366(A): Applied Numerical Methods ·  · 2017-10-05MTH-366(A): Applied Numerical Methods ... 2.1 Newton’s Divided Difference Formula. 2.2 Lagrange’s Interpolation Formula

MATHS DEPT., M.J. COLLEGE.

PAGE-22

LECTURE NOTES BY DR. J.S.V.R. KRISHNA PRASAD for TY B.Sc., NUMERICAL ANALYSIS

Page 23: MTH-366(A): Applied Numerical Methods ·  · 2017-10-05MTH-366(A): Applied Numerical Methods ... 2.1 Newton’s Divided Difference Formula. 2.2 Lagrange’s Interpolation Formula

MATHS DEPT., M.J. COLLEGE.

PAGE-23

LECTURE NOTES BY DR. J.S.V.R. KRISHNA PRASAD for TY B.Sc., NUMERICAL ANALYSIS

Page 24: MTH-366(A): Applied Numerical Methods ·  · 2017-10-05MTH-366(A): Applied Numerical Methods ... 2.1 Newton’s Divided Difference Formula. 2.2 Lagrange’s Interpolation Formula

MATHS DEPT., M.J. COLLEGE.

PAGE-24

LECTURE NOTES BY DR. J.S.V.R. KRISHNA PRASAD for TY B.Sc., NUMERICAL ANALYSIS

Page 25: MTH-366(A): Applied Numerical Methods ·  · 2017-10-05MTH-366(A): Applied Numerical Methods ... 2.1 Newton’s Divided Difference Formula. 2.2 Lagrange’s Interpolation Formula

(a) 2x – y = 3–x + 2y – z = –3

–y + z = 2

(b) x + y + z = 73x + 3y + 4z = 23

2x + y + z = 10(c) x + 0.5y = 1

0.5x + y + 0.5z = 20.5y + z = 3

(d) 2x + 3y + z = 9x + 2y + 3z = 63x + y + 2z = 8

(e) x – 2y + z = 25x + y – 3z = 03x + 4y + z = 9

( f ) 12x1 – 6x2 – 6x3 + 1.5x4 = 1–6x1 + 4x2 + 3x3 + 0.5x4 = 2–6x1 + 3x2 + 6x3 + 1.5x4 = 3

–1.5x1 + 0.5x2 + 1.5x3 + x4 = 4

x + 2y = 5(b) 3x + 2y + 7z = 4

2x + 3y + z = 53x – 4y + z = 7

(c) x + y + z = 92x – 3y + 4z = 133x + y + 5z = 40

(d) 3x + y = –12x + 4y + z = 7

2y + 5z = 9(e) 2x + y – z = 6

x – 3y + 5z = 11–x + 5y + 4z = 13

2. Solve the following set of simultaneous linear equations using the Crout’s method. (a ) 2x + y = 7

LECTURE NOTES PREPARED BY DR. J.S.V.R. KRISHNA PRASAD UNIT-I: SYSTEM OF LINEAR EQUATIONS

1. Solve the following set of simultaneous linear equations by the Cholesky’s factorisation:

MATHS DEPT., M.J. COLLEGE.

PAGE-25

LECTURE NOTES BY DR. J.S.V.R. KRISHNA PRASAD for TY B.Sc., NUMERICAL ANALYSIS

Page 26: MTH-366(A): Applied Numerical Methods ·  · 2017-10-05MTH-366(A): Applied Numerical Methods ... 2.1 Newton’s Divided Difference Formula. 2.2 Lagrange’s Interpolation Formula

1 – x2 = 1–x1 + 2x2 – x3 = 0–x2 + 2x3 – x4 = 0

–x3 + 2x4 = 1

2.9 Solve the following system of simultaneous linear equations using the Gauss-Seidal method.

(a) 4x – 3y + 5z = 342x – y – z = 6z + y + 4z = 15

(b) 2x – y + 5z = 152x + y + z = 7x + 3y + z = 10

(c) 15x + 3y – 2z = 852x + 10y + z = 51x – 2y + 8z = 5

(d) 10x1 – 2x2 – x3 – x4 = 3–2x1 + 10x2 – x3 – x4 = 15–x1 – x2 + 10x3 – 2x4 = 27–x1 – x2 – 2x3 + 10x4 = –9

(e) 4x1 + 2x2 = 42x1 + 8x2 + 2x3 = 02x2 + 8x3 + 2x3 = 0

2x3 + 4x4 = 0

( f ) 4x1 + 2x2 = 42x1 + 8x2 + 2x3 = 02x2 + 8x3 + 2x3 = 0

2x3 + 4x4 = 14

LECTURE NOTES PREPARED BY DR. J.S.V.R. KRISHNA PRASAD UNIT-I: SYSTEM OF LINEAR EQUATIONS

/

2 x

MATHS DEPT., M.J. COLLEGE.

PAGE-26

LECTURE NOTES BY DR. J.S.V.R. KRISHNA PRASAD for TY B.Sc., NUMERICAL ANALYSIS

adiani
Typewritten text
f)
adiani
Typewritten text
aadity
Typewritten text
------------------------------ ALL THE BEST! -------------------------------------------------