Question 1
Given the function f(x) = cos(x) with x ∈ [−π/2, π/2],
1. write a function that takes the limits of an interval and the order n of the polynomial interpolation pn(x), and returns the data points xi that can be used for the Chebyshev interpolation. Test this with an example input (your choice). (Marks: 7)
2. write a function that takes a function f, order n, array (of any length) z and the array x with the data points for the polynomial interpolation, and returns the values pn(z) of the polynomial interpolation. You can use any of the three methods for finding the polynomial interpolation from the lecture notes. (Marks: 22)
3. Use your interpolation function on the given function and the given interval using second order interpolation and both, Chebyshev economisation and equidistant data points. Plot the two interpolants in the same plot using different colours and linestyles together with the data points for both methods using markers. Add axis labels and a legend.
Question 2
1. Given the function f(x) = e x+x 2 , use the composite trapezium rule to compute the integral R b a f(x) dx using n equally spaced sub-intervals. Write this into a function that takes f, a, b and n as inputs and returns the integral.
2. Using the interval [a, b] = [0, 2] and the values n = 2p with p = 0, 1, ...20, compute the integral and plot the result in dependence of n using a semi-logarithmic (in n) plot. In a different figure, plot the absolute difference between your numerical result and the exact value of the integral against n using a log-log plot. As always, add axis labels. Comment on your second figure.
Question 3
Given the function f(x) = e x − x 2 ,
1. use the Newton-Raphson method to find its approximate unique real root. (Marks: 11)
2. with your Newton-Raphson solution, find the minimum number of iterations needed to find a solution of f(x) = 0 to a tolerance of τ = 10−5 with starting points x0 = −10, −9, ...4, 5. Plot the minimum number of iterations nmin against x0.
3. use the interval bisection method to find its approximate unique real root.
CS 340 Milestone One Guidelines and Rubric Overview: For this assignment, you will implement the fundamental operations of create, read, update,
Retail Transaction Programming Project Project Requirements: Develop a program to emulate a purchase transaction at a retail store. This
7COM1028 Secure Systems Programming Referral Coursework: Secure
Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip
CS 340 Final Project Guidelines and Rubric Overview The final project will encompass developing a web service using a software stack and impleme