Home Page > > Details

MAE 495/589, Computational Methods in Engineering

 MAE 495/589, Computational Methods in Engineering

Fall 2019
Project 1 (Construct a Cubic Spline)
Handed out: October 14, 2019
Due: November 4, 2019
This project is intended to augment your understanding of interpolation, cubic splines, numerical 
integration, linear least-squares fitting, and numerical solution to a linear system. 
1. Write a program for the not-a-knot cubic spline interpolation. The input is a set of orderly 
discrete points. 
2. Run your program for the Runge function, which is defined by
f (x) = 1 1+ 25x2 for x ∈ [−1,1]
Obtain the cubic spline using 5, 9, 17, and 33 equally spaced points, whose x-coordinates 
are given by
xi = x0 + xn − x0 n −1 i, i = 0,1,..., n −1
respectively, where x0=-1, xn=1, and n is the number of points used for the interpolation.
Plot the resulting cubic polynomials and compare it with the Runge function.
Compute the L2-norm of the error function defined by
e 2 = (Pi(x)− f (x))2 dx Ii ∫ i=1 No of sub-intervals ∑
where Pi(x) is the interpolating cubic spline polynomial on the subinterval i. The Gauss 
quadrature formula can be used for computing the above integration. 
Plot log(||e||2) vs log(the length of the subintervals).
Use a linear polynomial to fit these four data points and make an observation about the 
value for the slope of this line. What number should it be? why? Do you get this number?
Why ?
3. (Optional for undergraduates, although you are encouraged to try it. Extra credits will 
be given.) Modify and revise your program, so it is able to construct a cubic spline for a 
set of data points with repeated abscissae and ordinates. State your approach. Test it for 
the following 9 points in a unit cycle: (1,0), (0.7071,0.7071), (0,1), (-0.7071,0.7071), (-1,0), (-0.7071,-0.7071), (0,-1), (0.7071,-0.7071) and (1,0). Plot the resulting cubic 
polynomials and compare it with the analytical function.
4. Project report should be written in the style of a technical paper, with abstract, 
introduction, description of methodology, results, conclusions, and references sections 
clearly outlined.
5. E-mail me your Matlab, Fortran or C program. 
This is not a trivial project; please start early and devote time to it.
Contact Us - Email:99515681@qq.com    WeChat:codinghelp
Programming Assignment Help!