solhw5

solhw5 - Solutions for Homework 5 Foundations of...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Solutions for Homework 5 Foundations of Computational Math 2 Spring 2011 Problem 5.1 Recall that we have derived different sets of linear equations for the coefficients of an inter- polating cubic spline. Assume that f ( x ) = x 3 and analyze the equations and boundary conditions that define s ( x ) in the forms below and determine what can be said about the relationship between s ( x ) and f ( x ). 5.1.a . s ( x ) is determined by Ts = d where s is a vector containing s i 1 i n- 1 and boundary conditions s = f ( x ) and s n = f ( x n ). 5.1.b . s ( x ) is determined by Ts = d where s is a vector containing s i 1 i n- 1 and boundary conditions s = f ( x ) and s n = f ( x n ). Solution: Consider first when s ( x ) is determined by Ts = d where s is a vector containing s i 1 i n- 1 and boundary conditions s = f ( x ) and s n = f ( x n ). We have s i = 6 x i , x i +1 = x i + h i +1 , x i 1 = x i- h i , and f i = x 3 i . Given that we have set the boundary conditions to the acutal values of f we need only show that the basic equation is satisfied by s ( x ) = x 3 . We have i s i 1 + 2 s i + i s i +1 = d i i = h i h i + h i +1 , i = h i +1 h i + h i +1 d i = 6 h i + h i +1 bracketleftbig ( f i +1- f i ) h i +1- ( f i- f i 1 ) h i bracketrightbig If we substitute in for s i , s i +1 , s i 1 and multiply both sides by ( h i + h i +1 ) / 6 we get h i ( x i- h i ) + 2 x i ( h i + h i +1 ) + h i +1 ( x i + h i +1 ) = bracketleftbig ( f i +1- f i ) h i +1- ( f i- f i 1 ) h i bracketrightbig = bracketleftbig ( x i + h i +1 ) 3- x 3 i h i +1- x 3 i- ( x i- h i ) 3 h i bracketrightbig = 1 h i +1 (3 h i +1 x 2 i + 3 h 2 i +1 x i + h 3 i +1 )- 1 h i (3 h i x 2 i- 3 h 2 i x i + h 3 i ) = 3 x 2 i + 3 h i +1 x i + h 2 i +1- 3 x 2 i + 3 h i x i- h 2 i = 3 h i +1 x i + h 2 i +1 + 3 h i x i- h 2 i So now simplifying the left side yields the desired result h i ( x i- h i ) + 2 x i ( h i + h i +1 ) + h i +1 ( x i + h i +1 ) = 3 h i +1 x i + h 2 i +1 + 3 h i x i- h 2 i 3 h i +1 x i + h 2 i +1 + 3 h i x i- h 2 i = 3 h i +1 x i + h 2 i +1 + 3 h i x i- h 2 i 1 So s ( x ) = x 3 is the spline produced by this choice of equations and boundary conditions given f ( x ) = x 3 . We can repeat the exercise for when s ( x ) is determined by Ts = d where s is a vector containing s i 1 i n- 1 and boundary conditions s = f ( x ) and s n = f ( x n ). We have i s i 1 + 2 s i + i s i +1 = d i i = h i h i + h i +1 , i = h i +1 h i + h i +1 d i = 3 bracketleftbig i ( f i- f i 1 ) h i + i ( f i +1- f i ) h i +1 bracketrightbig If we substitute in for s i , s i +1 , s i 1 and multiply both sides by ( h i + h i +1 ) / 3 we get h i +1 ( x i- h i ) 2 + 2( h...
View Full Document

Page1 / 9

solhw5 - Solutions for Homework 5 Foundations of...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online