Interpolation Gerald Recktenwald Portland State University - - PDF document

interpolation
SMART_READER_LITE
LIVE PREVIEW

Interpolation Gerald Recktenwald Portland State University - - PDF document

Interpolation Gerald Recktenwald Portland State University Mechanical Engineering Department gerry@me.pdx.edu These slides are a supplement to the book Numerical Methods with Matlab : Implementations and Applications , by Gerald W. Recktenwald,


slide-1
SLIDE 1

Interpolation

Gerald Recktenwald Portland State University Mechanical Engineering Department gerry@me.pdx.edu

These slides are a supplement to the book Numerical Methods with Matlab: Implementations and Applications, by Gerald W. Recktenwald, c 2002, Prentice-Hall, Upper Saddle River, NJ. These slides are c

  • 2002 Gerald W. Recktenwald.

The PDF version of these slides may be downloaded or stored or printed only for noncommercial, educational

  • use. The repackaging or sale of these slides in any form, without written

consent of the author, is prohibited. The latest version of this PDF file, along with other supplemental material for the book, can be found at www.prenhall.com/recktenwald. Version 0.01 March 9, 2002

slide-2
SLIDE 2

Primary Topics

  • Interpolating polynomials of arbitrary degree

⊲ Monomial basis ⊲ Lagrange basis ⊲ Newton basis

  • Piecewise polynomial interpolation

⊲ Linear ⊲ Hermite polynomials ⊲ Cubic splines

  • Matlab’s built-in interpolation routines

NMM: Interpolation page 1

slide-3
SLIDE 3

Figure 10.2

kmh

2 4 6 8 1 1 2 1 4

12 1 2 3 4 5 6 7 8 9 11 10

NMM: Interpolation page 2

slide-4
SLIDE 4

Figure 10.3

10 20 30 40 50 2 4 6 8 10 12 Temperature (C) Viscosity (N⋅ s)/m2

NMM: Interpolation page 3

slide-5
SLIDE 5

Figure 10.4

y x known data curve fit interpolation

NMM: Interpolation page 4

slide-6
SLIDE 6

Figure 10.5

x2 x1 x2 x1 x3 y1 y2 y2 y1 y3

NMM: Interpolation page 5

slide-7
SLIDE 7

Figure 10.6

1980 1985 1990 1995 2000 2005 2010 5 10 15 20 25 30 Millions of passengers

?

historic data linear quadratic cubic spline

NMM: Interpolation page 6

slide-8
SLIDE 8

Figure 10.7

1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 130 135 140 145 year gasoline price, (cents)

NMM: Interpolation page 7

slide-9
SLIDE 9

Figure 10.8

1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 130 135 140 145 year gasoline price, (cents)

NMM: Interpolation page 8

slide-10
SLIDE 10

Figure 10.9

x2 x1 x2 x1 1 L1(x) L2(x) y1 y2

NMM: Interpolation page 9

slide-11
SLIDE 11

Figure 10.10

1 2 3 4 5

  • 0.5

0.5 1 1.5 degree 1 1 2 3 4 5

  • 0.5

0.5 1 1.5 degree 2 1 2 3 4 5

  • 0.5

0.5 1 1.5 degree 3 1 2 3 4 5

  • 0.5

0.5 1 1.5 degree 4

NMM: Interpolation page 10

slide-12
SLIDE 12

Table 10.1

xi f [ ] f [,] f [,,] f [,,,] x1 f [x1] x2 f [x2] f [x1, x2] x3 f [ x3] f [x2, x3] f [x1, x2, x3] x4 f [x4] f [x3, x4] f [x2, x3, x4] f [x1, x2, x3, x4]

NMM: Interpolation page 11

slide-13
SLIDE 13

Diagonals of Divided-Difference Table

xi f [ ] f [,] f [,,] f [,,,] x1 c1 x2 c2 c2 x3 c3 c3 c3 x4 c4 c4 c4 c4

NMM: Interpolation page 12

slide-14
SLIDE 14

Figure 10.11

10 10

1

10

2

10

3

10

1

10

2

10

3

10

4

10

5

10

6

Number of points to interpolate Flops

monomial Lagrange Newton

NMM: Interpolation page 13

slide-15
SLIDE 15

Figure 10.12

2 4 6 8 10

  • 5

5 2 4 6 8 10

  • 5

5 2 4 6 8 10

  • 5

5 2 4 6 8 10

  • 5

5 2 4 6 8 10

  • 5

5 2 4 6 8 10

  • 5

5 2 4 6 8 10

  • 5

5

5 10

  • 5

5

NMM: Interpolation page 14

slide-16
SLIDE 16

Figure 10.13

1 2 3 4 5 6 0.5 1 1.5 2 1 2 3 4 5 6 0.5 1 1.5 2

1 2 3 4 5 6 1 2

NMM: Interpolation page 15

slide-17
SLIDE 17

Figure 10.14

xi xi+2 xi+1 fi+2, fi+2

'

fi , fi' fi+1, fi+1

'

P

i(x)

P

i+1(x)

NMM: Interpolation page 16

slide-18
SLIDE 18

Figure 10.15

x1 P

1(x)

x2 P

2(x)

x3 P

3(x)

P

4(x)

P

5(x)

x4 x5 x6

x

ˆ

NMM: Interpolation page 17

slide-19
SLIDE 19

Figure 10.16

2 4 6 8 0.1 0.2 0.3 0.4 0.5

4 knots

Given x*exp(-x) Hermite 2 4 6 8 0.1 0.2 0.3 0.4 0.5

6 knots

Given x*exp(-x) Hermite 2 4 6 8 0.1 0.2 0.3 0.4 0.5

8 knots

Given x*exp(-x) Hermite 2 4 6 8 0.1 0.2 0.3 0.4 0.5

12 knots

Given x*exp(-x) Hermite

NMM: Interpolation page 18

slide-20
SLIDE 20

Figure 10.17

xn xn–1 P

n–1(x)

x1 P

1(x)

x2 P

2(x)

x3 xn–2 P

n–2(x)

P

i–1(x)

xi xi+1 xi–1 P

i(x)

segments coupled by P

i–1(xi) = P i (xi)

´´ ´´

NMM: Interpolation page 19

slide-21
SLIDE 21

Figure 10.18

no curvature no curvature

NMM: Interpolation page 20

slide-22
SLIDE 22

Figure 10.19

2 4 6 0.1 0.2 0.3 0.4 0.5 Natural end conditions knots spline x*exp(-x) 2 4 6 0.1 0.2 0.3 0.4 0.5 Zero slope end conditions knots spline x*exp(-x) 2 4 6 0.1 0.2 0.3 0.4 0.5 Not a knot end conditions knots spline x*exp(-x) 2 4 6 0.1 0.2 0.3 0.4 0.5 Exact slope end conditions knots spline x*exp(-x)

NMM: Interpolation page 21

slide-23
SLIDE 23

Figure 10.20

0.5 1 1.5 50 100

Nearest neighbor

0.5 1 1.5 50 100

Piecewise linear

0.5 1 1.5 50 100

Piecewise cubic

0.5 1 1.5 50 100

Cubic spline

NMM: Interpolation page 22

slide-24
SLIDE 24

Exercise 10.20

  • 1

1 2 3 4 1 2 3 4 5 6 x y

NMM: Interpolation page 23

slide-25
SLIDE 25

Exercise 10.37

  • 1

1 2 3 4 1 2 3 4 5 6 x y

t = 1 t = 2 t = 3 t = 4 t = 5

NMM: Interpolation page 24