

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Assignment; Class: Numerical Computations; Subject: Mathematics; University: Penn State - Main Campus; Term: Spring 2005;
Typology: Assignments
1 / 3
This page cannot be seen from the preview
Don't miss anything!


Deadline: Feb 18(Fri) in class.
Determine whether this function is a first-degree spline:
S(x) =
x − 1 ≤ x ≤ 0. 5 0 .5 + 2(x − 0 .5) 0. 5 ≤ x ≤ 2 x + 1. 5 2 ≤ x ≤ 4
Show that f (x) − p(x) = 12 f ′′(ξ)(x − a)(x − b) for some ξ in the interval (a, b), where p is a linear polynomial that interpolates f at a and b. Hint: Use an error estimate from polynomial interpolation.
Do there exist a, b, c and d so that the function
S(x) =
{ ax^3 + x^2 + cx − 1 ≤ x ≤ 0 bx^3 + x^2 + dx 0 ≤ x ≤ 1
is a natural cubic spline?
Determine whether f is a cubic spline with knots -1, 0, 1 and 2:
f (x) =
1 + 2(x + 1) + (x + 1)^3 − 1 ≤ x ≤ 0 3 + 5x + 3x^2 0 ≤ x ≤ 1 11 + (x − 1) + 3(x − 1)^2 + (x − 1)^3 1 ≤ x ≤ 2
Given data set:
ti 1. 2 1. 5 1. 6 2. 0 2. 2 yi 0. 4275 1. 139 0. 8736 − 0. 9751 − 0. 1536
a). Let L(x) be the linear spline that interpolates the data. Describe what L(x) consists of and what conditions it has to satisfy. Find L(x), and compute the value for L(1.8).
b). Let C(x) be the natural cubic spline that interpolates the data. Describe what C(x) consists of and what conditions it has to satisfy. Find C(x), and compute the value for C(1.8).
Do not do this problem in Matlab. Part (b) can be time consuming, therefore you could use Matlab to solve the linear system here.
Write a matlab function that computes the first order spline for a given data set. You might need to take a look at the file cspline_eval.m for problem 7 to start with. Call your matlab function lspline, define it in the file lspline.m as:
function ls=lspline(t,y,x) % lspline computes the linear spline % Inputs: % t: vector, contains the knots % y: vector, contains the interpolating values at knots % x: vector, contains points where the lspline shoule be % computed % Output: % ls: vector, contains the values of lspline at points x
Use your matlab function on the data set given in problem 5, plot the linear spline for the interval [1. 2 , 2 .2]. What to hand in: Hand in the matlab file lspline.m, and the plot of your linear spline.
The goal of this home work is to draw the mountain Everest with the help of spline. We have a photo, probably rather poor quality, of the mountain, which is given below. We are aware that the mountain tops are not very clear in that photo, so please use your fantasy. Select your knots, measure these points to generate your data set. Use the