Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Taylor Series Errors All source code is needed in MATLAB In this problem, we approximate f(x) = sin(x) using Taylor series. How many terms in

image text in transcribed

Taylor Series Errors

All source code is needed in MATLAB

In this problem, we approximate f(x) = sin(x) using Taylor series. How many terms in the Taylor series approximation to f(x) = sin(x) do I need to make sure my error is less than 2 times 10^-8 for x [0, pi/2]? Use the Taylor approximation error, E_n(x) = (x - c)^n + 1/(n + 1)! f^(n + 1) (xi) to derive your answer. If you expand sin(x) around c = 0, then Taylor series will have some zero terms. You should count these terms towards the answer. Write a function called my_sin which takes in two arguments: a number x and a positive integer n. Your function should approximate sin(x) using a Taylor series approximation of order n. The function should return the approximate value. Now we experimentally verify the bound from part (a) in Matlab using your function from part (b). Define a vector x of 100 equally spaced points between [0, pi/2]. For each of these points, compute the error, | sin(x) - my_sin(x, n)|, using two different values of n: n = 3 Value of n that you compute in part (a) Plot the errors for both these values of n against the vector x. Is your error below the bound in part (a) at all these points for the two values of n? In this problem, we approximate f(x) = sin(x) using Taylor series. How many terms in the Taylor series approximation to f(x) = sin(x) do I need to make sure my error is less than 2 times 10^-8 for x [0, pi/2]? Use the Taylor approximation error, E_n(x) = (x - c)^n + 1/(n + 1)! f^(n + 1) (xi) to derive your answer. If you expand sin(x) around c = 0, then Taylor series will have some zero terms. You should count these terms towards the answer. Write a function called my_sin which takes in two arguments: a number x and a positive integer n. Your function should approximate sin(x) using a Taylor series approximation of order n. The function should return the approximate value. Now we experimentally verify the bound from part (a) in Matlab using your function from part (b). Define a vector x of 100 equally spaced points between [0, pi/2]. For each of these points, compute the error, | sin(x) - my_sin(x, n)|, using two different values of n: n = 3 Value of n that you compute in part (a) Plot the errors for both these values of n against the vector x. Is your error below the bound in part (a) at all these points for the two values of n

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Database Concepts

Authors: David Kroenke, David Auer, Scott Vandenberg, Robert Yoder

8th Edition

013460153X, 978-0134601533

More Books

Students also viewed these Databases questions

Question

5. Discuss the key components of behavior modeling training.

Answered: 1 week ago

Question

4. Develop a self-directed learning module.

Answered: 1 week ago

Question

2. Provide recommendations for effective on-the-job training.

Answered: 1 week ago