Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1 Assigned: 2-3-21 Due Date: 2-15-21 CS 3200: Introduction to Scientific Computing Assignment 2 Note: Please use Matlab, or Octave for this assignment. The code

1 Assigned: 2-3-21 Due Date: 2-15-21 CS 3200: Introduction to Scientific Computing Assignment 2 Note: Please use Matlab, or Octave for this assignment. The code must compile and run on a standard laptop. Document your code. The broad aim of the assignment is to give you fan understanding of the strengths and weaknesses of different kind of polynomial interpolants. Understanding how to apply the course material here is an important part of this assignment. Note that the programs that you write may be less than 100 lines. The specific aim of the assignment is to compute polynomial interpolants for the function exp(x) on [0,2] using evenly spaced and Chebyshev points and with interpolants constructed using the Vandermonde equations, the polyinterp.m routine, the barycentric interpolation routine barylag.m and finally the matlab cubic spline routine. This process will enable you to understand which method is the most robust and accurate and how this accuracy varies with the choice of points and also what the cost of the methods is. Instructions 1. Write a simple programs to plot the exponential function on the interval [0,2] using 1001 evenly spaced points. 2. Modify your program to use the Vandermonde matrix to calculate an interpolating polynomial to exp(x) on [0,2] with 6,11,21,41,81,161,321 and 641 points and to evaluate the accuracy at 1001 sample points using the infinity and 2 norms. Use both evenly spaced points and Chebyshev spaced points mapped to [0,2] as given by x(i) = 1 cos((i-1)/(n-1)) for i = 1,,n. Comment on and describe how the accuracy changes with the choice and number of points. 3. Extend the program to use the Matlab routines polyinterp and barylag that use Lagrange polynomial interpolation . Again comment on how the accuracy varies with the different choice of 6,11,21,41,81,161,321 and 641 points, both Chebyshev and evenly spaced. 4. Further extend your program to use the Matlab cubic spline routine with both even and Chebyshev points. Again use both sets of points and comment on the outcome. Is the choice of points so critical for the spline routine as it was for the Lagrange polynomials? 5. Using the matlab timing functions tic and toc, time the 4 different methods with the required points and plot them. How do these timing results compare to each other? Did you see what you expected? On a different graph plot the infinity error norms for the different point sets. 2 Note in order to show and explain your results you may have to exclude certain data points when one or more methods blows up. This may happen with polynomials on a large evenly spaced mesh for reasons we have discussed in class. 6. Provide a summary that explains which method provides the fastest answer and is the most accurate and robust, 7. Provide a written explanation of how the somewhat inscrutable and unreadable coding used in the barylag.m routine that implements fast barycentric interpolation. For these assignments, we expect both SOURCE CODE(s) and a written REPORT be uploaded as a zip or tarball file to Canvas. Source code for all programs that you write, thoroughly documented. o Include a README file describing how to compile and run your code. Your report should be in PDF format and should stand on its own. o It should describe the methods used, explain your results and contain figures. o It should also answer any questions asked above. o It should cite any sources used for information, including source code and collaborators.

I have chosen to use Matlab for this assignment

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Expert Oracle Database Architecture

Authors: Thomas Kyte, Darl Kuhn

3rd Edition

1430262990, 9781430262992

More Books

Students also viewed these Databases questions

Question

What is the result of the ANOVA t-test comparing SHRM versus ASTD?

Answered: 1 week ago