19
1 Interpolation Lecture Notes Dr. Rakhmad Arief Siregar Universiti Malaysia Perlis Applied Numerical Method for Engineers Chapter 17

1 Interpolation Lecture Notes Dr. Rakhmad Arief Siregar Universiti Malaysia Perlis Applied Numerical Method for Engineers Chapter 17

Embed Size (px)

Citation preview

Page 1: 1 Interpolation Lecture Notes Dr. Rakhmad Arief Siregar Universiti Malaysia Perlis Applied Numerical Method for Engineers Chapter 17

1

Interpolation

Lecture NotesDr. Rakhmad Arief SiregarUniversiti Malaysia Perlis

Applied Numerical Method for Engineers

Chapter 17

Page 2: 1 Interpolation Lecture Notes Dr. Rakhmad Arief Siregar Universiti Malaysia Perlis Applied Numerical Method for Engineers Chapter 17

2

Page 3: 1 Interpolation Lecture Notes Dr. Rakhmad Arief Siregar Universiti Malaysia Perlis Applied Numerical Method for Engineers Chapter 17

3

Interpolation

The first-order The second-order

The third-order

nnxaxaaaxf ...)( 2

210

Page 4: 1 Interpolation Lecture Notes Dr. Rakhmad Arief Siregar Universiti Malaysia Perlis Applied Numerical Method for Engineers Chapter 17

4

Interpolation

There are variety of alternative forms for expressing an interpolating polynomial.

The methods are: Newton’s Divided-difference interpolating

polynomial Linear interpolation Quadratic interpolation

Lagrange interpolating polynomial

Page 5: 1 Interpolation Lecture Notes Dr. Rakhmad Arief Siregar Universiti Malaysia Perlis Applied Numerical Method for Engineers Chapter 17

5

Linear interpolation

The simplest form of interpolation is to connect two data points with a straight line

01

01

0

011 )()()()(

xx

xfxf

xx

xfxf

)()()(

)()( 0101

0101 xx

xx

xfxfxfxf

Page 6: 1 Interpolation Lecture Notes Dr. Rakhmad Arief Siregar Universiti Malaysia Perlis Applied Numerical Method for Engineers Chapter 17

6

Linear interpolation

The simplest form of interpolation is to connect two data points with a straight line

01

01

0

011 )()()()(

xx

xfxf

xx

xfxf

)()()(

)()( 0101

0101 xx

xx

xfxfxfxf

Page 7: 1 Interpolation Lecture Notes Dr. Rakhmad Arief Siregar Universiti Malaysia Perlis Applied Numerical Method for Engineers Chapter 17

7

Ex. 18.x

Due to special order, you need to make a special taper pin with standard size of 3.5 mm.

Compute by using linear interpolation for the max. size and min size based on the following data.

Page 8: 1 Interpolation Lecture Notes Dr. Rakhmad Arief Siregar Universiti Malaysia Perlis Applied Numerical Method for Engineers Chapter 17

8

Dimensions at large end

of some standard

Taper Pins

- Metric Series-

Max:3.51

Min: 3.503mm

Page 9: 1 Interpolation Lecture Notes Dr. Rakhmad Arief Siregar Universiti Malaysia Perlis Applied Numerical Method for Engineers Chapter 17

9(1,0)

(2,0.6931472)

(6,1.791759)

(2,0.3583519), t=48.3%

(4,1.386294)

t=33.3% (2,0.4620981)

Page 10: 1 Interpolation Lecture Notes Dr. Rakhmad Arief Siregar Universiti Malaysia Perlis Applied Numerical Method for Engineers Chapter 17

10

Quadratic Interpolation

To reduce error in Ex. 18.1,we need to introduce curvature into the line.

This is accomplished with a second-order polynomial.

After multiplying

))(()()( 1020102 xxxxbxxbbxf

nnxaxaaaxf ...)( 2

210

12021022

201102 )( xxbxxbxxbxbxbxbbxf

2210)( xaaaxf

1020100 xxbxbba 120221 xbxbba 22 ba

Page 11: 1 Interpolation Lecture Notes Dr. Rakhmad Arief Siregar Universiti Malaysia Perlis Applied Numerical Method for Engineers Chapter 17

11

Quadratic Interpolation

A simple procedure can be used to determine the value of the coefficients.

For b0 with x = x0 can be computed:

Then substitute back, which can be evaluated at x = x1

Finally substitute back b0 and b1

))(()()( 1020102 xxxxbxxbbxf

00 xfb

01

011 xx

xfxfb

12

01

01

12

01

2 xx

xx

xfxf

xx

xfxf

b

Page 12: 1 Interpolation Lecture Notes Dr. Rakhmad Arief Siregar Universiti Malaysia Perlis Applied Numerical Method for Engineers Chapter 17

12

Ex. 18.2

Fit a second-order polynomial to the three points used in Ex. 18.1

x0=1 f(x0)=0 x1=4 f(x1)=1.386294 X2=6 f(x2)=1.791759 Use the polynomial to evaluate ln 2

Page 13: 1 Interpolation Lecture Notes Dr. Rakhmad Arief Siregar Universiti Malaysia Perlis Applied Numerical Method for Engineers Chapter 17

13

Ex. 18.2

Solution

00 xfb

01

011 xx

xfxfb

12

01

01

12

01

2 xx

xx

xfxf

xx

xfxf

b

00 b

4620981.014

0386294.11

b

16

4620981.046386294.1791759.1

2

b

0518731.02 b

Page 14: 1 Interpolation Lecture Notes Dr. Rakhmad Arief Siregar Universiti Malaysia Perlis Applied Numerical Method for Engineers Chapter 17

14

Ex. 18.2

Substituting value of b0, b1, b2

For x = 2

The relative percentage error is t = 18.4%

))(()()( 1020102 xxxxbxxbbxf

)4)(1(051873.0)1(4620981.00)(2 xxxxf

5658444.0)2(2 f

Page 15: 1 Interpolation Lecture Notes Dr. Rakhmad Arief Siregar Universiti Malaysia Perlis Applied Numerical Method for Engineers Chapter 17

15

Page 16: 1 Interpolation Lecture Notes Dr. Rakhmad Arief Siregar Universiti Malaysia Perlis Applied Numerical Method for Engineers Chapter 17

16

General Form of Newton’s Interpolating Polynomial

The nth-order polynomial

As comparison, below is 2nd-order polynomial

))...()((...)()( 110010 nnn xxxxxxbxxbbxf

))(()()( 1020102 xxxxbxxbbxf

Page 17: 1 Interpolation Lecture Notes Dr. Rakhmad Arief Siregar Universiti Malaysia Perlis Applied Numerical Method for Engineers Chapter 17

17

General Form of Newton’s Interpolating Polynomial

The nth-order polynomial

The coefficient

))...()((...)()( 110010 nnn xxxxxxbxxbbxf

00 xfb

011 , xxfb

0122 ,, xxxfb

011 ,,...,, xxxxfb nnn

.

.

Page 18: 1 Interpolation Lecture Notes Dr. Rakhmad Arief Siregar Universiti Malaysia Perlis Applied Numerical Method for Engineers Chapter 17

18

General Form of Newton’s Interpolating Polynomial

Recursive nature divided differences

Page 19: 1 Interpolation Lecture Notes Dr. Rakhmad Arief Siregar Universiti Malaysia Perlis Applied Numerical Method for Engineers Chapter 17

19