Problem 1: Analysis of performance of the cubic spline. Prepare a code implementing Lagrange's interpolating polynomial P(x) for function y = f(x) on the

Answered step by step
Verified Expert Solution
Question
56 users unlocked this solution today!

image text in transcribedimage text in transcribed

 

Problem 1: Analysis of performance of the cubic spline. Prepare a code implementing Lagrange's interpolating polynomial P(x) for function y = f(x) on the interval [a, b] using n + 1 equally spaced nodes x0 = a, x1,...,xn = b. Keep the programming so 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(x) in one figure, and |f(x) P(x) in another figure. Make sure you use plenty of points when you graph so that the graphs appear smooth. Prepare a code implementing the cubic spline S(x) with natural boundary conditions (S" (a) = S" (b) = 0). Keep you programming so 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), S(x) in one figure, and f(x) S(x) in another figure. (You can use Algorithm 3.4 on page 142) . For y = cos(8x) 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(x), and S(x) and also f(x) = P(x) and |f(x) S(x). Which method requires more nodes to approximate y = cos(8x) within the provided bounds? Does error behaves sim- ilarly or differently for the two methods? Where the largest errors occur in both cases? For yx-x2 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(x), and S(x) and also f(x) = P(x) and |f(x) S(x). If you can not reach the accuracy bounds, explain why. You can also try to use a lower threshold, say 10-2. Which methods requires more nodes to approximate function y = x = x on [0, 1] within the provided bounds? Does error behaves similarly or differently for the two methods? Where the largest errors occur in both cases? cos(8Tx) Compare the properties of error for both examples: y = and y = xx2. Do you observe any similarities or differences in the behavior of error. Describe what happens as the number of nodes is changed from 10 to 20 to 40 to 80 to 160 in both methods? (If you can not use large numbers of nodes, explain why. Can you explain the your observations using approximation theorems for the Lagrange's polynomial and spline interpolation from Chapter 3? Write a report. Include results of your experiments. Please include graphs of f(x), P(x), and S(x) and also |f(x) - P(x)| and |f(x) S(x). You may use tables to summarize properties of error. Include you comments and explanations of observed facts. Attach the code.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Link Copied!

Step: 1

Overview This problem involves implementing and analyzing two methods of interpolation Lagranges interpolating polynomial and cubic spline interpolation with natural boundary conditions Steps to Achie... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

100% Satisfaction Guaranteed-or Get a Refund!

Step: 2Unlock detailed examples and clear explanations to master concepts

blur-text-image_2

Step: 3Unlock to practice, ask and learn with real-world examples

blur-text-image_3

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

  • tick Icon Access 30 Million+ textbook solutions.
  • tick Icon Ask unlimited questions from AI Tutors.
  • tick Icon Order free textbooks.
  • tick Icon 100% Satisfaction Guaranteed-or Get a Refund!

Claim Your Hoodie Now!

Recommended Textbook for

Auditing a risk based approach to conducting a quality audit

Authors: Karla Johnstone, Audrey Gramling, Larry Rittenberg

9th edition

9781133939160, 1133939155, 1133939163, 978-1133939153

More Books
flashcard-anime

Study Smart with AI Flashcards

Access a vast library of flashcards, create your own, and experience a game-changing transformation in how you learn and retain knowledge

Explore Flashcards

Students Have Also Explored These Related Accounting Questions!