Many problems in this homework make use of a few MATLAB/Octave .m files that are provided on the website. In order to use them, make sure that the files are in the same directory that you are running
MATLAB/Octave from (to see which directory this is, type pwd in MATLAB/Octave).
1. Compute the determinant of a 4 × 4 Vandermonde matrix. Bonus: show that the general formula for the determinant of a Vandermonde matrix is correct.
2. Let Vn be the Vandermonde matrix for n equally spaced points between 0 and 1. Do you think the condition number of Vn is increasing exponentially in n? To make an informed guess, use MATLAB/Octave to make a plot of log(cond(Vn )) against n. You will need to use relatively small values of n (say n < 20 or so) to get a reasonable looking plot. What do you think is happening when you use larger values of n?
3. Use MATLAB/Octave to plot the Lagrange interpolating function through the points
(1, 2.3), (2, 5), (2.4, 9), (2.5, 5), (3, 0) and (5, −1). Plot the cubic spline interpolating function on the same figure (and through the same points). You may use the Matlab file plotspline.m. 4. Derive the matrix equation to solve in order to find the cubic spline passing through the three points (0, 1), (0.5, 2) and (1, 4). Plot the resulting spline (you may use the file plotspline.m). 5. What happens to the condition number of the matrix S used in cubic spline interpolation as the size n becomes large (you may use the file splinemat.m)?
6. A parabolic runout spline is the interpolating function you get by changing the condition f ′′ (x1 ) = f ′′ (xn ) = 0 to the condition that p1 (x) and pn−1 (x) should be quadratic polynomials
(that is, a1 = an−1 = 0). Modify the file splinemat.m so that it computes the matrix relevant to this modified problem. Call the modified file splinematpr.m. (Hand in a a print-out of the modified file and an explanation of your changes.) Use your new file to graph the parabolic runout spline