







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
Problem set 3 for math 6800, a university-level mathematics course. The problem set includes instructions for writing computer subroutines to compute the reduced qr factorization of a real matrix using the modified gram-schmidt algorithm, and to find the least squares solution of a linear system using householder triangulation. The problem set also includes instructions for testing these subroutines using vandermonde matrices and different sets of nodes.
Typology: Assignments
1 / 13
This page cannot be seen from the preview
Don't miss anything!








Math 6800
Due: Thursday, 9/30/
(b) Test your code using the m × n Vandermonde matrix
1 t 1 t^21 · · · tn 1 −^1 1 t 2 t^22 · · · tn 2 −^1 .. .
1 tm t^2 m · · · tn m−^1
where the nodes ti, i = 1, 2 ,... , m, are distinct (so that A has full rank). Consider the case when m = 21, n = 6 and ti = (i − 11)/10 which are equally spaced nodes on [− 1 , 1]. Check that ‖ Qˆ Rˆ − A‖ and ‖ QˆT^ Qˆ − I‖ are both small, and print out these values.
(c) Let p = αqj , where qj is the jth^ column of Qˆ and α is a scalar constant. Choose α so that the last element p is 1. Plot the data (ti, pi), i = 1,... , m, for each column of Qˆ on the same graph. Observe that these curves are approximations of the first six Legendre polynomials. Explain this observation. (Hint: consider a discrete approximation of the integral orthogonality for the Legendre polynomials.)
(d) Redo parts (b) and (c) using the Chebyshev nodes ti = cos((2i − 1)π/(2m)). For this case, the curves are no longer approximations of Legendre polynomials. What orthogonal functions do you think they approximate. Explain.
(b) Test your code by considering the following curve fitting problem. Find the best fit polynomial P (t) = a 0 + a 1 t + a 2 t^2 + · · · + an− 1 tn−^1
to the data (ti, yi), i = 1, 2 ,... , m. The problem is equivalent to solving Ax = b, where A is the Vandermonde matrix above, bi = yi, and xj = aj− 1. Run your codes for the case when ti, i = 1, 2 ,... , m, are equally spaced nodes on [− 5 , 5] and yi = 1/(1 + t^2 i ). Compute and plot the polynomial interpolants for m = 21 and n = 3, 7, 15, and 21. (Use many more nodes than the 21 data points to plot the smooth polynomial interpolants.) Comment on the accuracy and behavior of the curves.
(c) Repeat part (b) but use the Chebyshev nodes ti = 5 cos((2i − 1)π/(2m)).