

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
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Material Type: Assignment; Professor: McNelis; Class: Intro Scientific Comp; Subject: Computer Science; University: Western Carolina University; Term: Spring 2004;
Typology: Assignments
1 / 3
This page cannot be seen from the preview
Don't miss anything!
CS 340 - Introduction to Scientific Computing Homework Assignment # 4 Interpolation and Curve Fitting Due: Wednesday, March 24, 2004
Note: You are to use MS Word (or your favorite document preparation system) in producing your write-up for this assignment. You are welcome to work together, discussing ideas with each other, but for clarification purposes the following work must be your own:
These will illustrate your own understanding of the topics covered and are not to be shared. You are welcome to come to me if you have any questions regarding the project, the instructions, or my expectations.
1 + x^2 on [− 5 , 5]
(a) [15 points] Plot P 10 (x) and P 16 (x), the tenth and sixteenth degree Lagrange interpolating poly- nomials, on the same axes with f (x) where x = [x 0 , x 1 , · · · , xn] are the (n + 1) equi-spaced points on [− 5 , 5] with x 0 = −5 and xn = 5.
Comments:
Consider the picture of Snoopy shown below.
The data below gives the (xi, yi) values of points that form the upper curve of Snoopy.
xi 1 2 5 6 7 8 10 13 17 20 23 24 25 27 27.7 28 29 30 yi 3.0 3.7 3.9 4.2 5.7 6.6 7.1 6.7 4.5 7.0 6.1 5.6 5.8 5.2 4.1 4.3 4.1 3.
(a) [10 points] Use either MATLAB or Maple’s spline function to interpolate this data. Graph your results. Turn in your commands, and a copy of your graph with an appropriate title and labels on the axes. Your plot will look better (if you’re using MATLAB) if you use the command axis equal which gives equal tic-mark spacing in the x and y axes. (b) [15 points] Now break up the data into three pieces, as follows:
Piece 1: xi 1 2 5 6 7 8 10 13 17 yi 3.0 3.7 3.9 4.2 5.7 6.6 7.1 6.7 4.
Piece 2: xi 17 20 23 24 25 27 27. yi 4.5 7.0 6.1 5.6 5.8 5.2 4.
Piece 3: xi 27.7 28 29 30 yi 4.1 4.3 4.1 3. Create a cubic spline for each piece. Plot these three on the same graph. Turn in your commands, and a copy of your graph with an appropriate title and labels on the axes.