{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Lecture 34

# Lecture 34 - Piecewise Cubic Splines data points(x 1 y1(x 2...

This preview shows pages 1–8. Sign up to view the full content.

Piecewise Cubic Splines x 1 x 2 x 3 x n s 1 (x) s 2 (x) s n-1 (x) 4 ( n - 1 ) unknowns Continuous slopes and curvatures x n-1 [ ] [ ] [ ] n 1 n 1 n 3 2 2 2 1 1 n n, 3 3, 2 2, 1 1, x x I x x I x x I interval y (x y (x y (x y (x points data , , , , , , : ) , ), ), ), : - - = = = 3 i i 2 i i i i i i x x d x x c x x b a f ) ( ) ( ) ( - + - + - + =

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Piecewise Cubic Splines x 1 x 2 x 3 x n s i (x) - piecewise cubic polynomials s i ’(x) - piecewise quadratic polynomials (slope) s i ”(x) - piecewise linear polynomials (curvatures) x n-1 s 1 (x) s 2 (x) s 3 (x) S n-1 (x) i ’’ [ ] [ ] [ ] n 1 n 1 n 3 2 2 2 1 1 n n, 3 3, 2 2, 1 1, x x I x x I x x I interval y (x y (x y (x y (x points data , , , , , , : ) , ), ), ), : - - = = =
Cubic Splines Piecewise cubic polynomial with continuous derivatives up to order 2 1. The function must pass through all the data points gives 2(n-1) equations - + - + - + = = = = - + - + - + = = = + + + + + 3 i 1 i i 2 i 1 i i i 1 i i i i 1 i i 1 i i 3 i i i 2 i i i i i i i i i i i x x d x x c x x b a f x s x x a x x d x x c x x b a f x s x x ) ( ) ( ) ( ) ( : ) ( ) ( ) ( ) ( : 2 3 1 i i i i i i i i i i a f f b h c h d h f + = + + + = i = 1,2,…, n-1

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Cubic Splines 2. First derivatives at the interior nodes must be equal: (n-2) equations 3. Second derivatives at the interior nodes must be equal: (n-2) equations 1 i 2 i i i i i 1 i 1 i 1 i i 2 i i i i i i b h d 3 h c 2 b x s x s x x d 3 x x c 2 b x s + + + + = + + = - + - + = ) ( ) ( ) ( ) ( ) ( 1 i i i i 1 i 1 i 1 i i i i i i c h d 3 c x s x s x x d 6 c 2 x s + + + + = + = - + = ) ( ) ( ) ( ) (
Cubic Splines 4. Two additional conditions are needed (arbitrary) The last two equations Total equations: 2(n-1) + (n-2) + (n-2) +2 = 4(n-1) + = = = = - - - - 1 n 1 n 1 n n 1 n 1 1 1 h d 6 c 2 0 x s c 2 0 x s ) ( ) ( = + = = = = - - - - 0 h d 3 c c 0 c 0 x s 0 x s 1 n 1 n 1 n n 1 n 1 n 1 1 ) ( ) (

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Cubic Splines 3 i i 2 i i i i i i x x d x x c x x b a x s ) ( ) ( ) ( ) ( - + - + - + = Solve for ( a i , b i , c i , d i ) – see textbook for details Tridiagonal system with boundary conditions c 1 = c n = 0 ]) , [ ] , [ ( ) ( 1 i i i 1 i 1 i 1 i i i i 1 i 1 i i i i 1 i 1 i 1 i x x f x x f 3 h f f 3 h f f 3 c h c h h 2 c h - + - - + + - - - - = - - - = + - + ( 29 1 i i i i i 1 i i i i 1 i i i i c c 2 3 h h f f b h 3 c c d f a + + + + - - = - = = , ,
Cubic Splines ( 29 ( 29 ( 29 - - - =

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}