
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
Material Type: Assignment; Professor: Vasilyev; Class: COMPUTATIONAL METHODS; Subject: Mechanical Engineering; University: University of Colorado - Boulder; Term: Unknown 1989;
Typology: Assignments
1 / 1
This page cannot be seen from the preview
Don't miss anything!

Develop your own cubic spline interpolation code for an arbitrary distribution of grid points with parabolic and natural boundary conditions. Do a study of the effect of the
distributions of N +1 points each for interpolation:
k^ ,^ 0,
k x k N , N
k x k N N
… and
k x k N
For each of the functions:
i. (^2)
1 + 9 x
ii.
x −
2 12 1 − x
a) Compute cubic spline on the 3 grid distributions for N = 1, 5, 10, 15, and 20. For each function evaluate the cubic spline on the finer grid. Plot the actual function and its cubic spline for three different grid distributions in separate sub-windows.
sampling the cubic spline at much finer set of grid points and plot these errors vs. N on semi-log scale in the forth sub-window. c) Discuss the effectiveness of the choice for interpolation points.
P.S. Email your code to [email protected]. The program that you send should be a working program. All the codes will be checked whether they run or not. If they are erroneous, but run, points will be taken for the errors. If the code is not running (it has some syntax errors), an additional 25% will be taken off. The goal of this class is for you to be comfortable solving engineering problems. Please take your time and learn how to trust the computer.