MAT 581 MATLAB TEST 1
Spring 2019 MAT 581代写
NAME:
MAT 581代写 For n = 5, 10, and 15, find the Newton interpolating polynomial pn for the function f (x) = 1/(1 + x2) on the interval [−5, 5]. Use equally spaced
1.(5points) Define f (x) = sin(x) + cos(x) and MAT 581代写
Write a Matlab script that plots the functions f (x), S10(x), and S20(x) across the interval [0, 2π].
- (5points) Write a Matlab script that plots a closed curve
(px(t), py(t)), 0 ≤ t ≤ 1 MAT 581代写
that passes through the points (0, 0), (0, 3), and (4, 0). The functions px and py should be cubic polynomials. The plot should be based on one hundred evaluations of px and py.
3.(5 points) For n = 5, 10, and 15, find the Newton interpolating polynomial pnfor the function f (x) = 1/(1 + x2) on the interval [−5, 5]. MAT 581代写
Use equally spaced nodes. In each case, compute f (x) − pn(x) for 30 equally spaced points in [−5, 5] in order to see the divergence of pn from f .
4.(5 points) Let h be a “small” The derivative of a function f at x0can be approximated by a forward divided difference
and by central divided difference
For the function f (x) = sin(x), plot the error when these approximations are used to estimate f j(1) = cos(1) for h = 10−1, 10−2, . . . , 10−16. Repeat with x0 = 1 + 106π. Use loglog for each of the four plots and display them all in the same window using subplot. Be sure to title each plot and label the axes appropriately. Your script should not have any loops.
其他代写:代写CS C++代写 java代写 matlab代写 考试助攻 web代写 app代写 作业代写 物理代写 数学代写 paper代写 金融经济统计代写