program2

program2 - 2.1.d . Implement a routine that constructs the...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Program 2 Foundations of Computational Math 2 Spring 2011 Due date: 11:59 PM Friday, 2/18/11 Problem 2.1 In this exercise you will implement two interpolating spline algorithms as code and demon- strate their use. Assume you are given distinct points x 0 , . . . , x n , a function f ( x ), and where appropriate its Frst and second derivatives f ( x ) and f ′′ ( x ). 2.1.a . Implement a routine that constructs the interpolating cubic spline s ( x ) as de- termined by Ts ′′ = d where s ′′ is a vector containing s ′′ i 0 i n and a routine that evaluates the resulting spline at any value x . 2.1.b . Implement a routine that constructs the interpolating cubic spline s ( x ) as de- termined by ˜ Ts = ˜ d where s is a vector containing s i 1 i n - 1 and a routine that evaluates the resulting spline at any value x . 2.1.c . Both types of boundary conditions s ′′ 0 = f ′′ ( x 0 ) , s ′′ n = f ′′ ( x n ) and s 0 = f ( x 0 ) , s n = f ( x n ) should be supported by both codes.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 2.1.d . Implement a routine that constructs the interpolating cubic spline s ( x ) in terms of the linear combination of cubic B-splines and a routine that evaluates the resulting spline at any value x . You need only support boundary conditions of the type s = f ( x ) , s n = f ( x n ) in this code. You may restrict the x i to be uniformly separated for this code, i.e., h = x i-x i 1 . 2.1.e . Apply each code with f ( x ) taken to be dierent cubic polynomials, i.e., not just f ( x ) = x 3 , with the various boundary conditions and discuss the results. 2.1.f . Apply each code with various boundary conditions to f ( x ) = 1 + x 2 on [-1 , 1] with various choices of and . and discuss the results. 1...
View Full Document

This note was uploaded on 11/10/2011 for the course MAD 5404 taught by Professor Gallivan during the Spring '11 term at FSU.

Ask a homework question - tutors are online