Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions