Assignment 3 for Numerical Computations | MATH 451, Assignments of Mathematics

Material Type: Assignment; Class: Numerical Computations; Subject: Mathematics; University: Penn State - Main Campus; Term: Spring 2005;

Typology: Assignments

Pre 2010

Uploaded on 09/24/2009

koofers-user-jrx
koofers-user-jrx 🇺🇸

10 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CSE/MATH 451: Numerical Computations, spring 2005,
section 2, Home work 3
Deadline: Feb 18(Fri) in class.
Problem 1.
Determine whether this function is a first-degree spline:
S(x) =
x1x0.5
0.5 + 2(x0.5) 0.5x2
x+ 1.5 2 x4
Problem 2.
Show that f(x)p(x) = 1
2f00(ξ)(xa)(xb) for some ξin the interval (a, b), where p
is a linear polynomial that interpolates fat aand b.
Hint: Use an error estimate from polynomial interpolation.
Problem 3.
Do there exist a, b, c and dso that the function
S(x) = (ax3+x2+cx 1x0
bx3+x2+dx 0x1.
is a natural cubic spline?
Problem 4.
Determine whether fis a cubic spline with knots -1, 0, 1 and 2:
f(x) =
1 + 2(x+ 1) + (x+ 1)31x0
3 + 5x+ 3x20x1
11 + (x1) + 3(x1)2+ (x1)31x2
.
1
pf3

Partial preview of the text

Download Assignment 3 for Numerical Computations | MATH 451 and more Assignments Mathematics in PDF only on Docsity!

CSE/MATH 451: Numerical Computations, spring 2005,

section 2, Home work 3

Deadline: Feb 18(Fri) in class.

Problem 1.

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

Problem 2.

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.

Problem 3.

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?

Problem 4.

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

Problem 5: Spline exercise.

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.

Problem 6: linear spline in Matlab.

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.

Problem 7: natural cubic spline in Matlab

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