03.03.2014 Views

Numerical Methods Course Notes Version 0.1 (UCSD Math 174, Fall ...

Numerical Methods Course Notes Version 0.1 (UCSD Math 174, Fall ...

Numerical Methods Course Notes Version 0.1 (UCSD Math 174, Fall ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

80 CHAPTER 6. SPLINE INTERPOLATION<br />

Thus there are 3n parameters to define Q(x).<br />

For each of the n subintervals, the data<br />

t t 0 t 1 . . . t n<br />

y y 0 y 1 . . . y n<br />

give two equations regarding Q i (x), namely that Q i (t i ) must equal y i and Q i (t i+1 ) must equal y i+1 .<br />

This is 2n equations. The condition on continuity of Q ′ gives a single equation for each of the n − 1<br />

internal nodes. This totals 3n − 1 equations, but 3n unknowns. This system is underdetermined.<br />

Thus some additional user-chosen condition is required to determine the quadratic spline. One<br />

might choose, for example, Q ′ (a) = 0, or Q ′′ (a) = 0, or some other condition.<br />

6.1.3 Computing Second Degree Splines<br />

Suppose the data<br />

t t 0 t 1 . . . t n<br />

y y 0 y 1 . . . y n<br />

are given. Let z i = Q ′ i (t i), and suppose that the additional condition to define the quadratic spline<br />

is given by specifying z 0 . We want to be able to compute the form of Q i (x).<br />

Because Q i (t i ) = y i , Q ′ i (t i) = z i , Q ′ i (t i+1) = z i+1 , we see that we can define<br />

Use this at t i+1 :<br />

Q i (x) =<br />

y i+1 = Q i (t i+1 ) =<br />

z i+1 − z i<br />

2 (t i+1 − t i ) (x − t i) 2 + z i (x − t i ) + y i .<br />

y i+1 − y i = z i+1 − z i<br />

2<br />

y i+1 − y i = z i+1 + z i<br />

2<br />

z i+1 − z i<br />

2 (t i+1 − t i ) (t i+1 − t i ) 2 + z i (t i+1 − t i ) + y i ,<br />

(t i+1 − t i ) + z i (t i+1 − t i ) ,<br />

(t i+1 − t i ) .<br />

Thus we can determine, from the data alone, z i+1 from z i :<br />

6.2 (Natural) Cubic Splines<br />

z i+1 = 2 y i+1 − y i<br />

t i+1 − t i<br />

− z i .<br />

If you recall the definition of the linear and quadratic splines, probably you can guess the definition<br />

of the spline of degree k:<br />

Definition 6.6 (Splines of Degree k). A function S is a spline of degree k on [a, b] if<br />

1. The domain of S is [a, b].<br />

2. S, S ′ , S ′′ , . . . , S (k−1) are continuous on (a, b).<br />

3. There is a partition {t i } n i=0 of [a, b] such that on [t i, t i+1 ], S is a polynomial of degree ≤ k.<br />

You would also expect that a spline of degree k has k − 1 “degrees of freedom,” as we show<br />

here. If the partition has n + 1 knots, the spline of degree k is defined by n(k + 1) parameters. The<br />

given data<br />

t t 0 t 1 . . . t n<br />

y y 0 y 1 . . . y n

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!