Due: October 30, 2008
CS 257 (Luke Olson): Homework #8
Problem 1
Problem 1
Consider the integral
Z
2
1
3
xe
x
2
dx
a. We want to approximate the integral using:
(i)
basic midpoint rule
(ii)
basic trapezoid rule
(iii)
basic Simpson’s rule
Compute the absolute and relative errors for (i)(iii) using the analytic solution to the integral and
comment on the results
b. Compare the absolute error with the theoretical bounds for (ii) and (iii)
Problem 2
Repeat problem # 1 with composite rules for each using
h
= 0
.
1.
Problem 3
Repeat problem # 1 with composite rules for each using
h
= 0
.
05.
Page 1 of 2
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Due: October 30, 2008
CS 257 (Luke Olson): Homework #8
Problem 4
Problem 4
Consider the task of interpolating the Runge function on the interval 1 to 1, where the Runge function is
f
(
x
)
=
1
1 + 25
x
2
a. Write a function called linear
spline that takes in x and y and returns a piecewise polynomial of the
degree 1 spline. You can do this easily using mkpp() in Matlab. You can use template linear
spline.m
Listing 1: Degree 1 Splines
1
function
This is the end of the preview.
Sign up
to
access the rest of the document.
 Spring '08
 Olson
 Polynomial interpolation, knot points, Luke Olson

Click to edit the document details