# Welcome back

## Find a book, put up your feet, stay awhile

Sign in with Facebook

Sorry, we are unable to log you in via Facebook at this time. Please try again later.

or

Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more

Download

Standard view

Full view

of .

Look up keyword

Like this

Share on social networks

14Activity

×

0 of .

Results for: No results containing your search query

P. 1

Cubic Spline InterpolationRatings: (0)|Views: 899|Likes: 12

Published by kjchauhan

See more

See less

https://www.scribd.com/doc/24255441/Cubic-Spline-Interpolation

04/17/2013

text

original

Cubic Spline Interpolation

Sky McKinley and Megan Levine

Math 45: Linear Algebra

Abstract

. An introduction into the theory and application of cubic splines with accompanying Matlabm-file cspline.m

Introduction

Real world numerical data is usually difficult to analyze. Any function which wouldeffectively correlate the data would be difficult to obtain and highly unwieldy. To this end,the idea of the cubic spline was developed. Using this process, a series of unique cubicpolynomials are fitted between each of the data points, with the stipulation that the curveobtained be continuous and appear smooth. These cubic splines can then be used todetermine rates of change and cumulative change over an interval. In this brief introduction,we will only discuss splines which interpolate equally spaced data points, although a morerobust form could encompass unequally spaced points.

Theory

The fundamental idea behind cubic spline interpolation is based on the engineer’s toolused to draw smooth curves through a number of points. This spline consists of weightsattached to a flat surface at the points to be connected. A flexible strip is then bent acrosseach of these weights, resulting in a pleasingly smooth curve.The mathematical spline is similar in principle. The points, in this case, are numericaldata. The weights are the coefficients on the cubic polynomials used to interpolate the data.These coefficients ’bend’ the line so that it passes through each of the data points withoutany erratic behavior or breaks in continuity.

Process

The essential idea is to fit a piecewise function of the form

S

Ý

x

Þ

=

s

1

Ý

x

Þ

if

x

1

²

x

<

x

2

s

2

Ý

x

Þ

if

x

2

²

x

<

x

3

_

s

n

?

1

Ý

x

Þ

if

x

n

?

1

²

x

<

x

n

(1)where

s

i

is a third degree polynomial defined by

s

i

Ý

x

Þ

=

a

i

Ý

x

?

x

i

Þ

3

+

b

i

Ý

x

?

x

i

Þ

2

+

c

i

Ý

x

?

x

i

Þ

+

d

i

(2)for

i

=

1,2,...,

n

?

1.The first and second derivatives of these

n

?

1 equations are fundamental to this process,and they are1

2

s

i

v

Ý

x

Þ

=

3

a

i

Ý

x

?

x

i

Þ

2

+

2

b

i

Ý

x

?

x

i

Þ

+

c

i

s

i

vv

Ý

x

Þ

=

6

a

i

Ý

x

?

x

i

Þ

+

2

b

i

(3) (4)for

i

=

1,2,...,

n

?

1.

The Four Properties of Cubic Splines

Our spline will need to conform to the following stipulations.1. The piecewise function

S

Ý

x

Þ

will interpolate all data points.2.

S

Ý

x

Þ

will be continuous on the interval

ß

x

1

,

x

n

à

3.

S

v

Ý

x

Þ

will be continuous on the interval

ß

x

1

,

x

n

à

4.

S

vv

Ý

x

Þ

will be continuous on the interval

ß

x

1

,

x

n

à

Since the piecewiece function

S

Ý

x

Þ

will interpolate all of the data points, we canconclude that

S

Ý

x

i

Þ

=

y

i

(5)for

i

=

1,2,...,

n

?

1. Since

x

i

5

ß

x

i

,

x

i

+

1

à

,

S

Ý

x

i

Þ

=

s

i

Ý

x

i

Þ

and we can use equation (2) toproduce

y

i

=

s

i

Ý

x

i

Þ

y

i

=

a

i

Ý

x

i

?

x

i

Þ

3

+

b

i

Ý

x

i

?

x

i

Þ

2

+

c

i

Ý

x

i

?

x

i

Þ

+

d

i

y

i

=

d

i

(6)for each

i

=

1,2,...,

n

?

1.Since the curve

S

Ý

x

Þ

must be continuous across its entire interval, it can be concludedthat each sub-function must join at the data points, so

s

i

Ý

x

i

Þ

=

s

i

?

1

Ý

x

i

Þ

(7)for

i

=

2,3,...,

n

.From equation (2),

s

i

Ý

x

i

Þ

=

d

i

and

s

i

?

1

Ý

x

i

Þ

=

a

i

?

1

Ý

x

i

?

x

i

?

1

Þ

3

+

b

i

?

1

Ý

x

i

?

x

i

?

1

Þ

2

+

c

i

?

1

Ý

x

i

?

x

i

?

1

Þ

+

d

i

?

1

(8)so

d

i

=

a

i

?

1

Ý

x

i

?

x

i

?

1

Þ

3

+

b

i

?

1

Ý

x

i

?

x

i

?

1

Þ

2

+

c

i

?

1

Ý

x

i

?

x

i

?

1

Þ

+

d

i

?

1

(9)for

i

=

2,3,...,

n

?

1. Letting

h

=

x

i

?

x

i

?

1

in equation (8), we have

d

i

=

a

i

?

1

h

3

+

b

i

?

1

h

2

+

c

i

?

1

h

+

d

i

?

1

(10)for

i

=

2,3,...,

n

?

1.Also, to make the curve smooth across the interval, the derivatives must be equal at thedata points; that is,

s

i

v

Ý

x

i

Þ

=

s

i

?

1

v

Ý

x

i

Þ

(11)

3However, by equation (3),

s

i

v

Ý

x

i

Þ

=

c

i

and

s

i

?

1

v

Ý

x

i

Þ

=

3

a

i

?

1

Ý

x

i

?

x

i

?

1

Þ

2

+

2

b

i

?

1

Ý

x

i

?

x

i

?

1

Þ

+

c

i

?

1

so

c

i

=

3

a

i

?

1

Ý

x

i

?

x

i

?

1

Þ

2

+

2

b

i

?

1

Ý

x

i

?

x

i

?

1

Þ

+

c

i

?

1

. (12)Again, letting

h

=

x

i

?

x

i

?

1

, we arrive at

c

i

=

3

a

i

?

1

h

2

+

2

b

i

?

1

h

+

c

i

?

1

(13)for

i

=

2,3,

u

,

n

?

1.From equation (4),

s

i

vv

Ý

x

Þ

=

6

a

i

Ý

x

?

x

i

Þ

+

2

b

i

, so

s

i

vv

Ý

x

Þ

=

6

a

i

Ý

x

?

x

i

Þ

+

2

b

i

s

i

vv

Ý

x

i

Þ

=

6

a

i

Ý

x

i

?

x

i

Þ

+

2

b

i

s

i

vv

Ý

x

i

Þ

=

2

b

i

(14)for

i

=

2,3,...,

n

?

2.Lastly, since

s

i

vv

Ý

x

Þ

has to be continuous across the interval,

s

i

vv

Ý

x

i

Þ

=

s

i

+

1

vv

Ý

x

i

Þ

for

i

=

1,2,3,

`

,

n

?

1. This and equation (14) lead us to the equation

s

i

vv

Ý

x

i

+

1

Þ

=

6

a

i

Ý

x

i

+

1

?

x

i

Þ

+

2

b

i

s

i

+

1

vv

Ý

x

i

+

1

Þ

=

6

a

i

Ý

x

i

+

1

?

x

i

Þ

+

2

b

i

(15) (16)and, letting

h

=

x

i

+

1

?

x

i

and using the conclusion from equations (14) and (16),

s

i

+

1

vv

Ý

x

i

+

1

Þ

=

6

a

i

Ý

x

i

+

1

?

x

i

Þ

+

2

b

i

2

b

i

+

1

=

6

a

i

h

+

2

b

i

(17) (18)These equations can be much simplified by substituting

M

i

for

s

i

vv

Ý

x

i

Þ

and expressing theabove equations in terms of

M

i

and

y

i

. This makes the determination of the weights

a

i

,

b

i

,

c

i

, and

d

i

a much easier task. Each

b

i

can be represented by

s

i

vv

Ý

x

i

Þ

=

2

b

i

M

i

=

2

b

i

b

i

=

M

i

2 (19)and

d

i

has already been determined to be

d

i

=

y

i

. (20)Similarly, using equation

a

i

can be re-written as

You've already reviewed this. Edit your review.

1 hundred reads

1 thousand reads

gyounghkim liked this

ذاكرة جسد liked this

Durgesh Bagri liked this

Sinziana Birta liked this

Jacek Łohin liked this

Amirhossein Hadjighasem liked this

SeindahNya liked this

pcd1002 liked this

- Read and print without ads
- Download to keep your version
- Edit, email or read offline

© Copyright 2015 Scribd Inc.

Language

Choose the language in which you want to experience Scribd:

Sign in with Facebook

Sorry, we are unable to log you in via Facebook at this time. Please try again later.

or

Password Reset Email Sent

Join with Facebook

Sorry, we are unable to log you in via Facebook at this time. Please try again later.

or

By joining, you agree to our

read free for one month

Personalized recommendationsbased on books you love

Syncing across all your devices

Join with Facebook

or Join with EmailSorry, we are unable to log you in via Facebook at this time. Please try again later.

Already a member? Sign in.

By joining, you agree to our

to download

Personalized recommendationsbased on books you love

Syncing across all your devices

Continue with Facebook

Sign inJoin with emailSorry, we are unable to log you in via Facebook at this time. Please try again later.

By joining, you agree to our

Are you sure?

This action might not be possible to undo. Are you sure you want to continue?

CANCEL

OK

You've been reading!

NO, THANKS

OK

scribd