Numerical Analysis Homework 11 - Spring 2008, Assignments of Mathematical Methods for Numerical Analysis and Optimization

Math 433 - numerical analysis homework from spring 2008, including 6 problems on splines, newton-cotes, quadrature formulas, gram-schmidt orthogonalization method, and one-step methods. Students are asked to approximate shapes using polynomial interpolants and cubic spline interpolants, find the number of panels required for composite trapezoidal and simpson's rules, construct quadrature formulas, apply the gram-schmidt orthogonalization method, and find solutions of differential equations using various methods.

Typology: Assignments

Pre 2010

Uploaded on 08/19/2009

koofers-user-un3
koofers-user-un3 🇺🇸

10 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Math 433 - Numerical Analysis - Spring 2008
Homework 11
Assigned: Monday, April 21, 2008.
Due: Friday, May 2, 2008.
1. (Splines). The following data describe the shape of a car called ”Buggy”:
x=[0.0 0.5 1.0 1.5 1.7 1.85 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 5.75 6.0];
y=[0.0 0.9 1.2 1.35 1.4 1.7 1.95 2.3 2.35 2.4 2.35 2.25 1.8 1.0 0.7 0.0 ];
v=[0.0 0.5 1.0 1.25 1.5 1.75 2.0 2.25 2.5 2.75 3.0 3.25 3.5 3.75 4.0
4.25 4.5 4.75 5.0 5.25 5.5 5.75 6.0];
w=[0.0 0.0 0.0 0.0 0.0 0.45 0.6 0.45 0.0 0.0 0.0 0.0 0.0 0.0 0.0
0.45 0.6 0.45 0.0 0.0 0.0 0.0 0.0];
Points (x, y) describe the upper part of the car while points (u, w) give the lower
part of the car.
Approximate the shape of the car using
(a) polynomial interpolant;
(b) cubic spline interpolant with ”not-a-knot” boundary conditions.
Which approximation is more accurate? Why?
Note. The Matlab commands ”polyfit”, ”polyval” and ”spline” may be useful.
2. (Newton–Cotes). Suppose that fis a function with four continuous deriva-
tives on the interval [a, b]. Recall that the error bound for the composite trape-
zoidal rule T(h) with panel width his
T(h)Zb
a
f(x)dx =(ba)h2
12 f00(ξ)
for some ξ[a, b]. The error in the composite Simpson’s rule S(h) with panel
width his
S(h)Zb
a
f(x)dx =(ba)h4
180 f(4)(ξ)
for some (different) ξ[a, b].
1
pf3

Partial preview of the text

Download Numerical Analysis Homework 11 - Spring 2008 and more Assignments Mathematical Methods for Numerical Analysis and Optimization in PDF only on Docsity!

Math 433 - Numerical Analysis - Spring 2008

Homework 11 Assigned: Monday, April 21, 2008. Due: Friday, May 2, 2008.

  1. (Splines). The following data describe the shape of a car called ”Buggy”:

x=[0.0 0.5 1.0 1.5 1.7 1.85 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 5.75 6.0];

y=[0.0 0.9 1.2 1.35 1.4 1.7 1.95 2.3 2.35 2.4 2.35 2.25 1.8 1.0 0.7 0.0 ];

v=[0.0 0.5 1.0 1.25 1.5 1.75 2.0 2.25 2.5 2.75 3.0 3.25 3.5 3.75 4. 4.25 4.5 4.75 5.0 5.25 5.5 5.75 6.0];

w=[0.0 0.0 0.0 0.0 0.0 0.45 0.6 0.45 0.0 0.0 0.0 0.0 0.0 0.0 0. 0.45 0.6 0.45 0.0 0.0 0.0 0.0 0.0];

Points (x, y) describe the upper part of the car while points (u, w) give the lower part of the car. Approximate the shape of the car using

(a) polynomial interpolant; (b) cubic spline interpolant with ”not-a-knot” boundary conditions.

Which approximation is more accurate? Why? Note. The Matlab commands ”polyfit”, ”polyval” and ”spline” may be useful.

  1. (Newton–Cotes). Suppose that f is a function with four continuous deriva- tives on the interval [a, b]. Recall that the error bound for the composite trape- zoidal rule T (h) with panel width h is

T (h) −

∫ (^) b

a

f (x)dx =

(b − a) h^2 12

f ′′(ξ)

for some ξ ∈ [a, b]. The error in the composite Simpson’s rule S(h) with panel width h is

S(h) −

∫ (^) b

a

f (x)dx =

(b − a) h^4 180

f (4)(ξ)

for some (different) ξ ∈ [a, b].

(a) Let f (x) = e−x^ sin x. For the composite trapezoidal rule and the composite Simpson’s rule, find the number of panels n required to integrate f on the interval [0, 2 π] with error at most 10−^4. Recall that h = 2π/n. How many function evaluations are required in each case? (b) Using the number of panels determined in the last part of the problem, use each rule to approximate the integral numerically. Compare your results with the actual value of the integral. For your information, an antideriva- tive of f is ∫ e−x^ sin xdx = − 0 .5 e−x(sin x + cos x).

  1. (a) Construct the quadrature formula for

∫ (^) b a f^ (x)dx^ using a second order poly- nomial approximation to f (x). The polynomial should pass through the points x 0 = a, x 1 = a + h + ε, and x 2 = a + 2h, where h = b− 2 a and ε ∈ (−a+ 2 b, a+ 2 b). (b) Show that for any choice of ε other than ε = 0, the method is O(h^4 ) instead of being O(h^5 ).

  1. (Gram-Schmidt Orthogonalization Method).

(a) Apply the Gram-Schmidt orthogonalization method to find the 4th degree Legendre polynomial P 4 (x). The first 3 were derived in class and are:

P 0 = 1, P 1 = x

P 2 = x^2 −

, P 3 = x^3 −

x

(b) Express x^4 as a linear combination of the first four Legendre polynomials {P 0 , P 1 , P 2 , P 3 , P 4 }.

  1. (Gaussian Integration). Consider the integral, ∫ (^1)

0

x exp−x

2 dx.

(a) Use the 4-point Gaussian quadrature rule to approximate the integral (after changing variables to obtain an integral over [− 1 , 1]). The points and weights are:

x 1 = − 0. 861136311594053 c 1 = 0. 347854845137454 x 2 = − 0. 339981043584856 c 2 = 0. 652145154862546 x 3 = −x 2 c 3 = c 2 x 4 = −x 1 c 4 = c 1