Question: Can you use either MATLAB or PYTHON please with code. (NO WRITTEN OUT WORK) Problem 1: Analysis of performance of the cubic spline. e Prepare


Can you use either MATLAB or PYTHON please with code. (NO WRITTEN OUT WORK)
Problem 1: Analysis of performance of the cubic spline. e Prepare a code implementing Lagrange's approximating polynomial P(x) for function y = f(x) on the interval [a, b) using n + 1 equally spaced nodes To a,, that you can change the function y -f(x), the interval (a, b], and the number of equally spaced interpolation nodes n, easily. Do the programming so that you can graph f(x), P(z) in one figure, and If (x) - S(x) in another figure. Make sure you use plenty of points when you graph sot that the graphs appear smooth , nb. Keep the programming so . Prepare a code implementing the cubic spline S(z) with natural boundary conditions (S"(a) = S"(b) = 0). Keep you programming so that you can change the function y f()r the interval [a, b), and the number of equally spaced interpolation nodes n, easily. Do the programming so that you can graph f(x), S(x) in one figure, and f() S(r) in another figure. (You can use Algorithm 3.4 on page 142) . For y cos(8) on [0,1] determine experimentally how many in- terpolation nodes are needed to approximate the function within 10-5 using Lagrange interpolation polynomial and the natural cu bic spline. Plot f(x), P(), and S(x) and also If (z) - P(x) and If(x)-S(2)|" Which method requires more nodes to approximate ycos(8T) within provided bounds? . For y V 2 on [0, 1] determine experimentally how many in- terpolation nodes are needed to approximate the function within 10-5 using Lagrange interpolation polynomial and the natural cu- bic spline. Plot f(z), P(x), and S(z) and also If() P(x) and lf(r) S(. Which method requires more nodes to approximate y V-2 within provided bounds? . Use both P(x) and S(x) to approximate y = v2-F within 10-5 Which methods requires more nodes to approximate this function within the provided bounds? Plot f(x), P(x), and S(x) and also f(z) P(x)l and |f (x) S(). Does error behaves similarly or differently for the two methods. Where the largest errors occur in both cases? Problem 1: Analysis of performance of the cubic spline. e Prepare a code implementing Lagrange's approximating polynomial P(x) for function y = f(x) on the interval [a, b) using n + 1 equally spaced nodes To a,, that you can change the function y -f(x), the interval (a, b], and the number of equally spaced interpolation nodes n, easily. Do the programming so that you can graph f(x), P(z) in one figure, and If (x) - S(x) in another figure. Make sure you use plenty of points when you graph sot that the graphs appear smooth , nb. Keep the programming so . Prepare a code implementing the cubic spline S(z) with natural boundary conditions (S"(a) = S"(b) = 0). Keep you programming so that you can change the function y f()r the interval [a, b), and the number of equally spaced interpolation nodes n, easily. Do the programming so that you can graph f(x), S(x) in one figure, and f() S(r) in another figure. (You can use Algorithm 3.4 on page 142) . For y cos(8) on [0,1] determine experimentally how many in- terpolation nodes are needed to approximate the function within 10-5 using Lagrange interpolation polynomial and the natural cu bic spline. Plot f(x), P(), and S(x) and also If (z) - P(x) and If(x)-S(2)|" Which method requires more nodes to approximate ycos(8T) within provided bounds? . For y V 2 on [0, 1] determine experimentally how many in- terpolation nodes are needed to approximate the function within 10-5 using Lagrange interpolation polynomial and the natural cu- bic spline. Plot f(z), P(x), and S(z) and also If() P(x) and lf(r) S(. Which method requires more nodes to approximate y V-2 within provided bounds? . Use both P(x) and S(x) to approximate y = v2-F within 10-5 Which methods requires more nodes to approximate this function within the provided bounds? Plot f(x), P(x), and S(x) and also f(z) P(x)l and |f (x) S(). Does error behaves similarly or differently for the two methods. Where the largest errors occur in both cases
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
