21
Numerical Analysis – Numerical Analysis – Interpolation Interpolation Hanyang University Jong-Il Park

Numerical Analysis – Interpolation Hanyang University Jong-Il Park

Embed Size (px)

Citation preview

Numerical Analysis –Numerical Analysis –InterpolationInterpolation

Hanyang University

Jong-Il Park

            

Department of Computer Science and Engineering, Hanyang University

FittingFitting

Exact fit Interpolation Extrapolation

Approximate fit

x

x

x

x

x

Extrapolation

Interpolation

            

Department of Computer Science and Engineering, Hanyang University

Weierstrass Approximation TheoremWeierstrass Approximation Theorem

            

Department of Computer Science and Engineering, Hanyang University

Approximation errorApproximation error

Betterapproximation

            

Department of Computer Science and Engineering, Hanyang University

Lagrange Interpolating PolynomialLagrange Interpolating Polynomial

            

Department of Computer Science and Engineering, Hanyang University

Illustration of Lagrange polynomialIllustration of Lagrange polynomial

• Unique• Too much complex

            

Department of Computer Science and Engineering, Hanyang University

Error analysis for intpl. polynml(I)Error analysis for intpl. polynml(I)

            

Department of Computer Science and Engineering, Hanyang University

Error analysis for intpl. polynml(II)Error analysis for intpl. polynml(II)

            

Department of Computer Science and Engineering, Hanyang University

DifferencesDifferences

iiii ffxff 1)(

1)( iiii ffxff

iiii ffxff 1)(21

21

f

1if

1if

if if

if

1ix ix 1ix

Difference Forward difference :

Backward difference :

Central difference :

            

Department of Computer Science and Engineering, Hanyang University

Divided DifferencesDivided Differences

110101

0110 ),(],[ xxf

xx

ffxxf

))(())(())((

],[],[],,[

1202

2

2101

1

2010

0

02

1021210

xxxx

f

xxxx

f

xxxx

f

xx

xxfxxfxxxf

10x 1x

0f

1f f

; 1st order divided difference

; 2nd order divided difference

            

Department of Computer Science and Engineering, Hanyang University

N-th divided differenceN-th divided difference

)()()()(

],,[],,[],,[

10010

0

0

1010

nnn

n

n

n

nnn

xxxx

f

xxxx

f

xx

xxfxxfxxf

            

Department of Computer Science and Engineering, Hanyang University

Newton’s Intpl. Polynomials(I)Newton’s Intpl. Polynomials(I)

            

Department of Computer Science and Engineering, Hanyang University

Newton’s Intpl. Polynomials(II)Newton’s Intpl. Polynomials(II)

            

Department of Computer Science and Engineering, Hanyang University

Newton’s Forward Difference Newton’s Forward Difference Interpolating Polynomials(I)Interpolating Polynomials(I)

hixxi 0

001

01

01101 !1

1],[ f

hh

ff

xx

ffxxfa

02

201

02

02

10212102

!2

1

2

],[][],,[

01

fhh

ff

xx

xx

xxfxxfxxxfa

hf

hf

Equal Interval h

Derivation

n=1

n=2

            

Department of Computer Science and Engineering, Hanyang University

Newton’s Forward Difference Newton’s Forward Difference Interpolating Polynomials(II)Interpolating Polynomials(II)

Generalization

Error Analysis

nh

xxfxxfxxfa nnnn

],,[],,[],,[ 101

0

0!

1f

hnn

n

002

00 !

)1)(1(

!2

)1()( f

n

nsssf

ssfsfxP n

n

n

k

k fk

s

00 )( 0 shxx

Binomial coef.

01

01)1(1

1

),(0)(1

)(

fn

s

xxhfhn

sxE

n

nnnn

            

Department of Computer Science and Engineering, Hanyang University

Intpl. of Multivariate FunctionIntpl. of Multivariate Function

Successiveunivariate

directmultivariate

12

1

• Successive univariate polynomial• Direct mutivariate polynomial

            

Department of Computer Science and Engineering, Hanyang University

Inverse InterpolationInverse Interpolation

],,[)()(

],,[))((

],[)()()(

1

211

1

niinii

iiiii

iiiin

xxfxxxx

xxxfxxxx

xxfxxfxPxf

Solve for x

iii

iiiiii xxxf

xxxfxxxxfxfx

],[

}],,[))({()(

1

211

1st approximation

iii

iiiiii xxxf

xxxfxxxxfxfx

],[

],,[))(()(

1

211112

2nd approximation

iii

i xxxf

fxfx

],[

)(

11

Repeat until a convergence

= finding x(f) Utilization of Newton’s polynomial

            

Department of Computer Science and Engineering, Hanyang University

Spline InterpolationSpline Interpolation

Why spline?

spline

polynomial

• Good approximation !!• Moderate complexity !!

Linear spline

Quadratic spline

Cubic spline

)()(

)()(''''

1

''1

iiii

iiii

xfxf

xfxf

Continuity

            

Department of Computer Science and Engineering, Hanyang University

Cubic spline interpolation(I)Cubic spline interpolation(I)

],[ 1ii xx

iiiiiiii dxxcxxbxxaxf )()()()( 23

4 unknowns for each interval4n unknowns for n intervals

Conditions 1)

2)

3) continuity of f’

4) continuity of f’’

1,,1,0,)( 11 niyxf iii

1,,1,0,)( niyxf iii

1,,2,1),()( ''''1 nixfxf iiii

1,,2,1),()( ''1 nixfxf iiii

n

n

n-1

n-1

1iy iy 1iy

1ix ix 1ix 2ix

)(1 xfi)(xfi )(1 xfi

Cubic Spline Interpolation at an interval

            

Department of Computer Science and Engineering, Hanyang University

Cubic spline interpolation(II)Cubic spline interpolation(II)

Determining boundary condition

Method 1 :

Method 2 :

Method 3 :

cubic natual0)(,0)( ''10

''0 nn xfxf

)()(),()( ''11

''11

''00

''0 nnnn xfxfxfxf

2

)()()(,

2

)()()(

''12

''2

1''

12

''20

''0

1''

1nnnn

nn

xfxfxf

xfxfxf

            

Department of Computer Science and Engineering, Hanyang University

Eg. CG modelingEg. CG modeling

Non-Uniform Rational B-Spline