lecture 3 - interpolation

Post on 12-Jan-2016

22 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

interpolation

TRANSCRIPT

LECTURE 3: INTERPOLATION

Interpolation

technique of estimating the value of a function for any intermediate value of the independent variable

method of computing the value of the function 𝑦 = 𝑓(𝑥) for any given value of the independent variable 𝑥 when a set of values of 𝑦 = 𝑓(𝑥)for certain values of 𝑥 are known or given

i.e. the process of finding the value of 𝑦 corresponding to any value of 𝑥 = 𝑥𝑖between 𝑥0 and 𝑥𝑛, if 𝑥𝑖 , 𝑦𝑖 , 𝑖 = 0,1,2,… , 𝑛 are the set of 𝑛 + 1 given data points of the function 𝑦 = 𝑓(𝑥)

Easy to do if function is explicitly defined..

Interpolating Function

if the function 𝑓(𝑥) is not known, then it is very hard to find the exact form of 𝑓(𝑥) with the tabulated values 𝑥𝑖, 𝑦𝑖

𝑓 𝑥 can be replaced by a simpler function 𝜙(𝑥), which has the same values as 𝑓 𝑥 for 𝑥0, 𝑥1, 𝑥2, … , 𝑥𝑛

𝜙(𝑥) is called the interpolating or smoothing function and any other value can be computed from it

Polynomial Interpolation

If 𝜙(𝑥) is a polynomial, then 𝜙(𝑥) is called the interpolating polynomialand the process of computing the intermediate values of y = 𝑓(𝑥) is called the polynomial interpolation.

In the study of interpolation, we make the following assumptions:

there are no sudden jumps in the values of the dependent variable for the period under consideration

the rate of change of figures from one period to another is uniform.

In this course, interpolation will be based on the calculus of finite differences (forward, backward and central).

Finite Difference Operators

Forward Differences

Backward Differences

Central Differences

Forward Differences

or simply difference operator is denoted by Δ

defined as Δ𝑓 𝑥 = 𝑓 𝑥 + ℎ − 𝑓(𝑥)

where ℎ = interval of differencing

or, at 𝑥 = 𝑥𝑖

Δ𝑓 𝑥𝑖 = 𝑓 𝑥𝑖 + ℎ − 𝑓(𝑥𝑖)

Δ𝑦𝑖 = 𝑦𝑖+1 − 𝑦𝑖 for 𝑖 = 0,1,2,… , 𝑛 − 1

hence,

Second Difference

difference of the first differences

denoted by Δ2𝑦0, Δ2𝑦1, … , Δ2 𝑦𝑛

hence,

generalizing, Δ𝑛+1𝑦𝑖 = Δ𝑛𝑦𝑖+1 − Δ𝑛𝑦𝑖 𝑛 = 0,1,2, …

where Δ0≡ identity operator, i.e., Δ0𝑓 𝑥 = 𝑓(𝑥) and Δ1 = Δ

Backward Differences

denoted by 𝛻

defined as 𝛻𝑓 𝑥 = 𝑓 𝑥 − 𝑓(𝑥 − ℎ)

or, at 𝑥 = 𝑥𝑖

𝛻𝑦𝑖 = 𝑦𝑖 − 𝑦𝑖−1 for 𝑖 = 𝑛, 𝑛 − 1,… , 1

𝛻𝑦1 = 𝑦1 − 𝑦0, 𝛻𝑦2 = 𝑦2 − 𝑦1, … , 𝛻𝑦𝑛 = 𝑦𝑛 − 𝑦𝑛−1

Second difference

Central Differences

denoted by 𝛿

defined by 𝛿𝑓 𝑥 = 𝑓 𝑥 +ℎ

2− 𝑓 𝑥 −

2

first central differences

second central differences

INTERPOLATION for EQUAL INTERVALS

Assumption:

• for function 𝑦 = 𝑓(𝑥), the set of (𝑛 + 1) functional values 𝑦0, 𝑦1, … , 𝑦𝑛 are given corresponding to the set of (𝑛 + 1) equally spaced values of the independent variable, 𝑥𝑖 = 𝑥0 + 𝑖ℎ, 𝑖 = 0,1,2,… , 𝑛, where ℎ is the spacing

Newton’s Forward Interpolation Formula

used to interpolate the values of 𝑦 near the beginning of a set of equally spaced tabular values

formula:

where:

𝑦0, 𝑦1, … , 𝑦𝑛 → 𝑠𝑒𝑡 𝑜𝑓 𝑛 + 1 𝑓𝑢𝑛𝑐𝑡𝑖𝑜𝑛𝑎𝑙 𝑣𝑎𝑙𝑢𝑒𝑠

𝑥0, 𝑥1, … , 𝑥𝑛 → 𝑠𝑒𝑡 𝑜𝑓 𝑛 + 1 𝑒𝑞𝑢𝑎𝑙𝑙𝑦 𝑠𝑝𝑎𝑐𝑒𝑑 𝑣𝑎𝑙𝑢𝑒𝑠

𝜙 𝑥 → 𝑦 = 𝑓 𝑥 𝑠𝑢𝑐ℎ 𝑡ℎ𝑎𝑡 𝑓 𝑥𝑖 = 𝜙 𝑥𝑖 𝑓𝑜𝑟 𝑖 = 0,1,2, … , 𝑛

𝑢 =𝑥−𝑥0

Ex:

Find the value of sin42°.

Since x = 42° is near the starting value 𝑥0 = 40°, we use NFIF.

𝑥 40 45 50 55 60

𝑦 = 𝑠𝑖𝑛𝑥 0.6428 0.7071 0.7660 0.8192 0.8660

i xi yi Δyi Δ2yi Δ3yi Δ4yi

0 40 0.6428 0.0643 -0.0054 -0.0004 01 45 0.7071 0.0589 -0.0058 -0.00042 50 0.766 0.0531 -0.00623 55 0.8192 0.04694 60 0.866

Seatwork

Newton’s Backward Interpolation Formula

used to interpolate the values of 𝑦 near the end of the tabulated values

formula:

𝜙 𝑥 = 𝑦𝑛 + 𝑣𝛻𝑦𝑛 +𝑣(𝑣 + 1)

2!𝛻2𝑦𝑛 +⋯+ 𝑣 𝑣 + 1 …

𝑣 + 𝑛 − 1

𝑛!𝛻𝑛𝑦𝑛

where:

𝑣 =𝑥−𝑥𝑛

Ex:

Calculate the value of 𝑓(84) for the data given in the table below:

Since x = 84 is near the end value 𝑥5 = 90, we use NBIF.

i xi yi ∇yi ∇2yi ∇3yi ∇4yi ∇5yi

0 40 2041 50 224 202 60 246 22 23 70 270 24 2 04 80 296 26 2 0 05 90 324 28 2 0 0 0

𝑥 = 84 𝑥5 = 90

ℎ = 10

𝑣 =84−90

10= −0.6

From

𝜙 𝑥 = 𝑦𝑛 + 𝑣𝛻𝑦𝑛 +𝑣(𝑣 + 1)

2!𝛻2𝑦𝑛 +⋯+ 𝑣 𝑣 + 1 …

𝑣 + 𝑛 − 1

𝑛!𝛻𝑛𝑦𝑛

𝜙 84 = 324 + −0.6 28 +−0.6 −0.6+1

2!2 = 𝟑𝟎𝟔. 𝟗𝟔

i xi yi ∇yi ∇2yi ∇3yi ∇4yi ∇5yi

0 40 2041 50 224 202 60 246 22 23 70 270 24 2 04 80 296 26 2 0 05 90 324 28 2 0 0 0

Error

NFIF

NBIF

INTERPOLATION for UNEQUAL INTERVALS

Lagrange Formula for Unequal Intervals

Let 𝑦 = 𝑓 𝑥 be a real values continuous function defined in an interval [𝑎, 𝑏]. Let 𝑥0, 𝑥1, … , 𝑥𝑛 be (𝑛 + 1) distinct points which are not necessarily equally spaced and the corresponding values of the function are 𝑦0, 𝑦1, … , 𝑦𝑛.

Since (𝑛 + 1) values of the function are given corresponding to the (𝑛 + 1) values of the independent variable x, we can represent the function 𝑦 = 𝑓(𝑥) as a polynomial in 𝑥 of degree 𝑛.

Using Lagrange’s interpolation formula, find the value of y corresponding to x = 10 from the following data.

Apply Lagrange’s interpolation formula to find a polynomial which passes through the points (0, –20), (1, –12), (3, –20) and (4, –24).

Seatwork

Using Lagrange’s interpolation formula find a polynomial which passes the points

(0, –12), (1, 0), (3, 6), (4, 12).

Lagrange’s Formula for Inverse Interpolation

By interchanging x and y in the formula, we can express 𝑥 as a function of 𝑦 as follows:

The following table gives the values of y corresponding to certain values of 𝑥. Find the value of 𝑥 when 𝑦 = 167.59789 by applying Lagrange’s inverse interpolation formula.

CENTRAL DIFFERENCE INTERPOLATION FORMULAEfor EQUAL INTERVALS

Central Difference Tables

Bessel’s Formula

*brackets mean that the average has to be taken

Apply Bessel’s interpolation formula to obtain y25, given that y20 = 2860, y24 = 3167, y28 = 3555 and y32 = 4112.

From Bessel’s Formula,

We get

Stirling’s Formula

gives the most accurate result for -0.25 ≤ u ≤ 0.25

hence, x0 should be selected such that u satisfies this inequality

𝑦𝑝 = 𝑦0 + 𝑢Δ𝑦−1 + Δ𝑦0

2+𝑢2

2Δ2𝑦−2 +

)𝑢(𝑢2 − 1

3!

Δ3𝑦−2 + Δ3𝑦−12

+)𝑢2 (𝑢2 − 1

4!Δ4𝑦−2

+)𝑢(𝑢2 − 1)(𝑢2 − 22

5!

Δ5𝑦−3 + Δ5𝑦−22

+)𝑢2 (𝑢2 − 1)(𝑢2 − 22

6!Δ6𝑦−3 +⋯

+)𝑢 𝑢2 − 1 𝑢2 − 22 𝑢2 − 32 …[𝑢2 − 𝑛 − 1 2

(2𝑛 − 1)!

Δ2𝑛−1𝑦−𝑛 + Δ2𝑛−1𝑦 )−(𝑛−1

2

+]𝑢2 𝑢2 − 1 𝑢2 − 22 𝑢2 − 32 …[𝑢2 − 𝑛 − 1 2)

(2𝑛)!Δ2𝑛𝑦−𝑛

𝑦𝑝 = 𝑦0 + 𝑢Δ𝑦−1 + Δ𝑦0

2+𝑞2

2Δ2𝑦−2 +

)𝑞(𝑞2 − 1

3!

Δ3𝑦−2 + Δ3𝑦−12

+)𝑞2 (𝑞2 − 1

4!Δ4𝑦−2

+)𝑞(𝑞2 − 1)(𝑞2 − 22

5!

Δ5𝑦−3 + Δ5𝑦−22

+)𝑞2 (𝑞2 − 1)(𝑞2 − 22

6!Δ6𝑦−3 +⋯

+)𝑞 𝑞2 − 1 𝑞2 − 22 𝑞2 − 32 …[𝑞2 − 𝑛 − 1 2

(2𝑛 − 1)!

Δ2𝑛−1𝑦−𝑛 + Δ2𝑛−1𝑦 )−(𝑛−1

2

+]𝑞2 𝑞2 − 1 𝑞2 − 22 𝑞2 − 32 …[𝑞2 − 𝑛 − 1 2)

(2𝑛)!Δ2𝑛𝑦−𝑛

Apply Stirling’s interpolation formula to obtain y25, given that y20 = 2860, y24 = 3167, y28 = 3555 and y32 = 4112.

i xi yi Δyi Δ2yi Δ3yi

-1 20 2860 307 81 88

0 24 3167 388 169

1 28 3555 557

2 32 4112

From Stirling’s Formula

We get

i xi yi Δyi Δ2yi Δ3yi

-1 20 2860 307 81 880 24 3167 388 1691 28 3555 5572 32 4112

Assignment

Use Stirling’s Formula to find the value of y when x = 1.63 from the following table

Exercises

Use Stirling’s interpolation formula to find y28, given that y20 = 48234, y25 = 47354, y30

= 46267, y35 = 44978 and y40 = 43389.

𝜙 𝑥 = 𝑦𝑛 + 𝑣𝛻𝑦𝑛 +𝑣(𝑣 + 1)

2!𝛻2𝑦𝑛 +⋯+ 𝑣 𝑣 + 1 …

𝑣 + 𝑛 − 1

𝑛!𝛻𝑛𝑦𝑛

Given that 12600 = 112.24972, 12610 = 112.29426, 12620= 112.33877,

12630 = 112.38327. Find the value of 12616 using Laplace-Everett’s Formula.

top related