• No results found

15MA206-U2.pdf

N/A
N/A
Protected

Academic year: 2020

Share "15MA206-U2.pdf"

Copied!
15
0
0

Loading.... (view fulltext now)

Full text

(1)

Lecture Notes

15MA206-Numerical Methods

Prepared by

S ATHITHAN

Assistant Professor

Department of of Mathematics Faculty of Engineering and Technology

SRM UNIVERSITY

Kattankulathur-603203, Kancheepuram District.

L

E

C

T

U

R

E

N

O

T

E

S

O

F

A

T

H

IT

H

A

N

(2)

L

E

C

T

U

R

E

N

O

T

E

S

O

F

A

T

H

IT

H

A

N

S

Contents

1 Finite Difference Operators and their relations 3

2 Worked out Examples 7

2.1 Illustrative Examples on finite differences . . . 7

2.2 Illustrative Examples on Interpolation (equal intervals) . . . 10

2.3 Illustrative Examples on Interpolation (unequal intervals) . . . 12

(3)

L

E

C

T

U

R

E

N

O

T

E

S

O

F

A

T

H

IT

H

A

N

S

Unit-2

Finite Differences and Interpolation

TOPICS:

? Introduction

? First and Higher order differences

? Forward differences and backward differences (only definitions without proof).

? Central Differences

? Shifting operator E

? Relations between the operators (only definitions without proof).

? Interpolation

– Newton-Gregory Forward and Backward Interpolation formulae.

– Additional problems using Newton-Gregory Forward and Backward Interpolation formulae.

? Divided differences

(4)

L

E

C

T

U

R

E

N

O

T

E

S

O

F

A

T

H

IT

H

A

N

S

1

Finite Difference Operators and their relations

Forward Difference Operator(∆)

If the given data is of the form given in the table, then we define the forward difference opera-tors as follows:

x x0 x1 x2 . . . xn−1 xn

y y0 y1 y2 . . . yn−1 yn

Here the values ofxare calledargumentsand the values ofyare calledentries.

∆y0 = y1−y0

∆y1 = y2−y1

∆y2 = y3−y2

.. .

∆yn−2 = yn−1−yn−2

∆yn−1 = yn−yn−1

These differences are calledfirst orderdifferences.

∆2y0 = ∆y1−∆y0

∆2y1 = ∆y2−∆y1

∆2y2 = ∆y3−∆y2

.. .

∆2yn−2 = ∆yn−1−∆yn−2

∆2yn−1 = ∆yn−∆yn−1

These differences aresecond order differences.

Similarly we define the higher order differences as∆3y,∆4y, . . . ,∆ny.

If the arguments are given as equally spaced with interval of differenceh,i.e.the arguments are of the formx0, x0+h, x0+ 2h, x0+ 3h, . . ., then the forward difference becomes

∆f(x) = f(x+h)−f(x) ∆2f(x) = ∆f(x+h)−∆f(x)

= f(x+ 2h)−2f(x+h) +f(x) ∆3f(x) = ∆2f(x+h)−∆2f(x)

(5)

L

E

C

T

U

R

E

N

O

T

E

S

O

F

A

T

H

IT

H

A

N

S

Backward Difference Operator(∇)

∇f(x) = f(x)−f(x−h)

∇2f(x) = ∇f(x)− ∇f(x−h)

= f(x)−2f(x−h) +f(x−2h)

Central Difference Operator(δ)

δf(x) = f(x+h

2)−f(x− h 2)

ShiftingorTranslationorDisplacement Operator(E)

Ef(x) = f(x+h)

.. .

Enf(x) = f(x+nh)

Averaging Operator(µ)

µf(x) = 1 2

f(x+h

2) +f(x− h 2)

Differential Operator(D)

Df(x) = d

dx

D2f(x) = d

2

dx2f(x)

Unit Operator(1)

(6)

L

E

C

T

U

R

E

N

O

T

E

S

O

F

A

T

H

IT

H

A

N

S

Relation between the operators

∆ = E−1

E = ∆ + 1

∇ = 1−E−1 E = (1− ∇)−1

δ = E1/2−E−1/2 δ = E−1/2∆ =E1/2∇

µ = 1 2

E−1/2 +E1/2 E = ehD

D = 1 h

∆− ∆

2

2! + ∆3

3! − ∆4

4! +. . .

Forward Difference Table

x y ∆y ∆2y ∆3y ∆4y ∆5y ∆6y x0 y0

∆y0

x1 y1 ∆2y0

∆y1 ∆3y0

x2 y2 ∆2y1 ∆4y0

∆y2 ∆3y1 ∆5y0

x3 y3 ∆2y2 ∆4y1 ∆6y0

∆y3 ∆3y2 ∆5y1

x4 y4 ∆2y3 ∆4y2

∆y4 ∆3y3

x5 y5 ∆2y4

∆y5

x6 y6

Note 1.1. The above table is also called diagonal difference table. The valuey0 (first value of y) is called the leading term and the differences∆y0 =y1−y0, ∆2y0 = ∆y1−∆y0, ∆3y0 =

(7)

L

E

C

T

U

R

E

N

O

T

E

S

O

F

A

T

H

IT

H

A

N

S

Backward Difference Table

x y ∇y ∇2y 3y 4y 5y 6y

x0 y0

∇y0

x1 y1 ∇2y0

∇y1 ∇3y0

x2 y2 ∇2y1 ∇4y0

∇y2 ∇3y1 ∇5y0

x3 y3 ∇2y2 ∇4y1 ∇6y0

∇y3 ∇3y2 ∇5y1

x4 y4 ∇2y3 ∇4y2

∇y4 ∇3y3

x5 y5 ∇2y4

∇y5

x6 y6

Note 1.2. The value y6 (last value of y) is called the leading term and the differences∇y6 =

y6−y5, ∇2y6 =∇y6− ∇y5, ∇3y6 =∇2y6− ∇2y5, . . . are called the leading differences.

Divided Difference Table

x y 1stDD 2ndDD 3rdDD 4thDD 5thDD

x0 f(x0)

f(x0, x1)

x1 f(x1) f(x0, x1, x2)

f(x1, x2) f(x0, x1, x2, x3)

x2 f(x2) f(x1, x2, x3) f(x0, x1, x2, x3, x4)

f(x2, x3) f(x1, x2, x3, x4) f(x0, x1, x2, x3, x4, x5)

x3 f(x3) f(x2, x3, x4) f(x1, x2, x3, x4, x5)

f(x3, x4) f(x2, x3, x4, x5)

x4 f(x4) f(x3, x4, x5)

f(x4, x5)

x5 f(x5)

1stDD-First Divided Difference, 2ndDD-Second Divided Difference,3rdDD-Third Divided Difference, and so on.

Where

f(x0, x1) =

f(x1)−f(x0)

x1−x0

f(x1, x2) =

f(x2)−f(x1)

x2−x1

(8)

L

E

C

T

U

R

E

N

O

T

E

S

O

F

A

T

H

IT

H

A

N

S

f(x0, x1, x2) =

f(x1, x2)−f(x0, x1)

x2 −x0

f(x1, x2, x3) =

f(x2, x3)−f(x1, x2)

x3 −x1

.. .

f(x0, x1, x2, x3) =

f(x1, x2, x3)−f(x0, x1, x2)

x3−x0

f(x1, x2, x3, x4) =

f(x2, x3, x4)−f(x1, x2, x3)

x4−x1

.. .

2

Worked out Examples

2.1

Illustrative Examples on finite differences

Example: 1. Find the 7th term of the sequence 2,9,28,65,126,217 and also find the general term.

Hints/Solution:

x y ∆y ∆2y ∆3y ∆4y ∆5y

0 2

7

1 9 12

19 6

2 28 18 0

37 6

3 65 24 0

61 6

4 126 30

91

(9)

L

E

C

T

U

R

E

N

O

T

E

S

O

F

A

T

H

IT

H

A

N

S

7th term=y6 = y0+6C1∆y0+6C2∆2y0+6C3∆3y0+6C4∆4y0

+6C5∆5y0+6C6∆6y0

= 2 + 6(7) + 15(12) + 20(6) + 15(0) = 344

nth term=yn = y0+nC1∆y0 +nC2∆2y0+nC3∆3y0+nC4∆4y0

+nC5∆5y0+. . .

= 2 +n(7) + n(n−1)

2 (12) +

n(n−1)(n−2)

6 (6) +

n(n−1)(n−2)(n−3)

24 (0)

= (n+ 1)3+ 1

Example: 2. Find the first term of the sequence whose second and consequent terms are 2,9,28,65,126,217,. . . .

Hints/Solution:

x y ∆y ∆2y ∆3y ∆4y ∆5y

0 2

7

1 9 12

19 6

2 28 18 0

37 6

3 65 24 0

61 6

4 126 30

91

5 217

f irst term=y0 = E−1y1

= (1 + ∆)−1y1

= y1−∆y1+ ∆2y1−∆3y1+. . .

= 2−7 + 12−6 + 0 = 1

Example: 3. Expressf(x) =x3−3x2+ 5x+ 7in terms of factorial polynomial takingh= 2

(10)

L

E

C

T

U

R

E

N

O

T

E

S

O

F

A

T

H

IT

H

A

N

S

0 1 -3 5 7

0 0 0

2 1 -3 5 7

2 -2

4 1 -1 3

4

1 3

Hence,f(x) = x3−3x2+ 5x+ 7 =x(3)+ 3x(2)+ 3x(1)+ 7, whereh= 2. Now,

∆f(x) = 3x(2)+ 6x(1)+ 3 ∆2f(x) = 6x(1)+ 6

∆3f(x) = 6

Example: 4. Estimate the production for 1964 to 1966. Year x 1961 1962 1963 1964 1965 1966 1967

Production 200 220 260 – 350 – 430

Hints/Solution: Since 5 values only given out of 7 values, the collocation polynomial is of degree 4. ∆5yk= 0. Let the missing values beaandb.

x y ∆y ∆2y ∆3y ∆4y ∆5y

1961 200

20

1962 220 20

40 a−320

1963 260 a−300 1230−4a

a−260 910−3a −3450 + 10a+b

1964 a 610−2a −2220 + 6a+b

350−a 3a+b−1310 5010−10a−5b

1965 350 a+b−700 2790−4a−4b

b−350 1480−a−3b

1966 b 780−2b

430−b 1967 430

Since∆5yk= 0, we have

10a+b = 3450

(11)

L

E

C

T

U

R

E

N

O

T

E

S

O

F

A

T

H

IT

H

A

N

S

2.2

Illustrative Examples on Interpolation (equal intervals)

Example: 5. Evaluate the population increase during the period 1946 to 1976. Year x 1941 1951 1961 1971 1981 1991

Population y (in lakhs) 20 24 29 36 46 51

Hints/Solution:

x y ∆y ∆2y ∆3y ∆4y ∆5y 1941 20

4

1951 24 1

5 1

1961 29 2 0

7 1 −9

1971 36 3 −9

10 −8

1981 46 −5

5 1991 51

Gregory-Newton forward and backward interpolation formulas are given by

y(x0+uh) = y0+u∆y0+

u(u−1)

2 ∆

2y 0+

u(u−1)(u−2)

6 ∆

3y 0+. . .

y(xn+vh) = yn+v∇yn+

v(v+ 1)

2 ∇

2y n+

u(v+ 1)(v+ 2)

6 ∇

3y

n+. . .

We need to find y(1946) = y(x0 +uh) (We use Gregory-Newton Forward Interpolation) and

y(1976) = y(xn+vh)(We use Gregory-Newton Backward Interpolation).

i.e. x0 +uh = 1946 =⇒ u =

1946−1941

10 =

1

2 and xn+vh = 1976 =⇒ v = 1976−1991

10 =−

3 2

Now by using the above formulas,y(1946) =y(x0+uh) = 21.69andy(1976) =y(xn+vh) =

41.089or40.8085938.

∴Increase in population during this period is 41.089-21.69=19.4 lakhs

Example: 6. Evaluate θ at x=43 and x=84. Also express θ in terms of x.

x 40 50 60 70 80 90

θ 184 204 226 250 276 304

(12)

L

E

C

T

U

R

E

N

O

T

E

S

O

F

A

T

H

IT

H

A

N

S

Hints/Solution:

x y ∆y ∆2y ∆3y ∆4y Below40 250

120

Below60 370 −20

100 −10

Below80 470 −30 20

70 10

Below100 540 −20 50

Below120 590

Gregory-Newton forward interpolation formula is given by

y(x0+uh) = y0+u∆y0+

u(u−1)

2 ∆

2y 0+

u(u−1)(u−2)

6 ∆

3y 0 +. . .

We need to findy(70) =y(x0+uh)(We use Gregory-Newton Forward Interpolation). i.e.x0+uh= 70 =⇒ u=

70−40

20 =

3 2

Now by using the above formula,y(70) =y(x0+uh) = 424

∴No. of students whose weight is between 60 and 70 isy(70)−y(60) = 424−370 = 54

Example: 8. Find the polynomial of degree 4 from the follwing data. x 2 4 6 8 10 y 0 0 1 0 0

Hints/Solution:

x y ∆y ∆2y ∆3y ∆4y

2 0

0

4 0 1

1 −3

6 1 −2 6

−1 3

8 0 1

0 10 0

Gregory-Newton forward interpolation formula is given by

y(x0+uh) = y0+u∆y0+

u(u−1)

2 ∆

2y 0+

u(u−1)(u−2)

6 ∆

3y 0 +. . .

We need to findy(70) =y(x0+uh)(We use Gregory-Newton Forward Interpolation). i.e.x0+uh=x =⇒ u=

x−2 2

(13)

L

E

C

T

U

R

E

N

O

T

E

S

O

F

A

T

H

IT

H

A

N

S

2.3

Illustrative Examples on Interpolation (unequal intervals)

Example: 9. Using Newton’s interpolation formula(Divided differences), find f(x)and f(6)

from the following data. x 1 2 7 8 y 1 5 5 4

Hints/Solution: From the data, we see that the interval between two data points are not equal. We form the divided difference table.

x y 1stDD 2ndDD 3rdDD

1 1

5−1 2−1 = 4

2 5 0−4

7−1 =− 2 3 5−5

7−2 = 0

−1 6 +

2 3

8−1 = 1 14

7 5 −1−0

8−2 =− 1 6 4−5

8−7 =−1

8 4

By Newton’s divided difference formula,

f(x) = f(x0) + (x−x0)f(x0, x1) + (x−x0)(x−x1)f(x0, x1, x2) +. . .

= 1

42[3x

358x2+ 321x224]

Substitutingx= 6in above equation, we getf(6) = 6.23809524

Example: 10. Using Lagrange’s interpolation formula, find y(10) from the following data.

x 5 6 9 11

y 12 13 14 16

Hints/Solution:

Lagrange’s interpolation formula is given by

y=f(x) = (x−x1)(x−x2). . .(x−xn) (x0−x1)(x0−x2). . .(x0−xn)

·y0+

(x−x0)(x−x2). . .(x−xn)

(x1−x0)(x1−x2). . .(x1−xn)

·y1

+. . .

+ (x−x0)(x−x1). . .(x−xi−1)(x−xi+1). . .(x−xn) (xi−x0)(xi−x1). . .(xi−xi−1)(xi −xi+1). . .(xi−xn)

·yi

+. . .

(14)

L

E

C

T

U

R

E

N

O

T

E

S

O

F

A

T

H

IT

H

A

N

S

y=f(x) = (x−x1)(x−x2)(x−x3) (x0−x1)(x0−x2)(x0 −x3)

·y0+

(x−x0)(x−x2)(x−x3)

(x1−x0)(x1−x2)(x1 −x3)

·y1

+ (x−x0)(x−x1)(x−x3) (x2−x0)(x2−x1)(x2−x3)

·y2+

(x−x0)(x−x1)(x−x2)

(x3−x0)(x3−x1)(x3−x2)

·y3

= (x−6)(x−9)(x−11) (5−6)(5−9)(5−11) ·12 +

(x−5)(x−9)(x−11) (6−5)(6−9)(6−11) ·13

+(x−5)(x−6)(x−11) (9−5)(9−6)(9−11) ·14 +

(x−5)(x−6)(x−9) (11−5)(11−6)(11−9)·16

By puttingx= 10, we gety(10) =f(10) = 14.666666

Example: 11. Using Lagrange’s interpolation formula, find the value of θ for the the given

f(θ) = 0.3887from the following data. x=θ 21

23◦ 25◦ y=f(θ) 0.3706 0.4068 0.4433

Hints/Solution:

Lagrange’s inverse interpolation formula is given by

x = (y−y1)(y−y2). . .(y−yn) (y0−y1)(y0−y2). . .(y0 −yn)

·x0+

(y−y0)(y−y2). . .(y−yn)

(y1−y0)(y1−y2). . .(y1−yn)

·x1

+. . .

+ (y−y0)(y−y1). . .(y−yi−1)(y−yi+1). . .(y−yn) (yi−y0)(yi−y1). . .(yi−yi−1)(yi−yi+1). . .(yi−yn)

·xi

+. . .

+ (y−y0)(y−y1). . .(y−yn−1) (yn−y0)(yn−y1). . .(yn−yn−1)

·xn

Here, we have

x=θ = (y−y1)(y−y2) (y0−y1)(y0−y2)

·x0+

(y−y0)(y−y2)

(y1−y0)(y1−y2)

·x1

+ (y−y0)(y−y1) (y2−y0)(y2−y1)

·x2

θ(y) = (y−0.4068)(y−0.4433)

(0.3706−0.4068)(0.3706−0.4433) ·21 + +

(y−0.3706)(y−0.4433)

(0.4068−0.3706)(0.4068−0.4433)·23

+ (y−0.3706)(y−0.4068)

(0.4433−0.3706)(0.4433−0.4068)·25

(15)

L

E

C

T

U

R

E

N

O

T

E

S

O

F

A

T

H

IT

H

A

N

S

3

Exercise/Practice/Assignment Problems

Take more problems in the textbooks of Numerical Methods for your practice.

1. Find the 6th term of the sequence 8,12,19,29,42,. . .

2. Find the first term of the sequence whose second and consequent terms are 8,3,0,-1,0,. . . .

3. Express the following functions as factorial polynomials and find their successive differ-ences takingh= 1. (i)x4+ 3x3−5x2+ 6x−7, (ii)3x3−2x2+ 7x−6 (iii)x3+x2+x+ 1

4. Express 7x4 + 12x3 −6x2 + 5x− 3 as factorial polynomial and find their successive differences takingh= 2.

5. Find the missing term in the following data. x 10 15 20 25 30 35 40 y 270 – 222 200 – 164 148

6. Find the missing term in the following data.

x 2.0 2.1 2.2 2.3 2.4 2.5 2.6 y 0.135 – 0.111 0.100 – 0.082 0.074

7. From the following data, find y(46) and y(63).

x 45 50 55 60 65

y 114.84 96.16 83.32 74.48 68.48

8. From the following data, find y(43) and y(84). x 40 50 60 70 80 90 y 184 204 226 250 276 304

9. Using Newton’s interpolation formula, find f(x) and f(6) for the following data. x 0 1 2 4 5 7

y 0 0 -12 0 600 7308

10. Using Newton’s interpolation formula, find f(x) and f(0) for the following data. x -1 1 2 3

y -21 15 12 3

11. Using Lagrange’s interpolation formula, find the value ofy(9.5)for the given data.

x 7 8 9 10 y 3 1 1 9

12. Using Lagrange’s interpolation formula, find the value oftan 33◦ for the following data.

x=θ 30◦ 32◦ 35◦ 38◦ y = tan(θ) 0.5774 0.6249 0.7002 0.7813

Contact: (+91) 979 111 666 3 (or)athithan.s@ktr.srmuniv.ac.in

https://sites.google.com/site/lecturenotesofathithans/home

References

Related documents

We show the intimate relation between the notions of a sym- metric group (a braided involutive group) and a left brace, and find new results on symmetric groups of

The average retail price includes the average retail value and additional options, with deductions for lack of options and excessive mileage on the vehicle.. Find the average

Largest clutch distances were found among new–new and old–new clutches in part two of the experiment for experienced females that were released on the same respective plants as in

- (3) If an agreement has been concluded with a foreign government, a foreign digital signature or certificate shall be deemed to have the same legal effect as an authorized

I2E mines a variety of text resources, such as electronic health records, pathology and radiology reports, initial assessments, discharge summaries and ICU notes to support

The objective of this study is to understand the inter-annual variability of rainfall in the region Azib Soltane in the Sebou basin and determined the relationship with

Windows (OS) Windows (OS) Linux Mac OS x86 (Computer) Windows (OS) App App Linux Linux Mac OS Mac OS Virtualization layer App Controller 1 App App Controller 2 Virtualization

Hence, the resolution was not passed with requisite majority for which AGM was adjourned sine die and the same shall be considered in adjourned meeting after giving de notice to