Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

3. The cosine function: The cosine function can be evaluated by the following infinite series 4 (i coSx1 46! (a) Write a function that needs

image text in transcribed

3. The cosine function: The cosine function can be evaluated by the following infinite series 4 (i coSx1 46! (a) Write a function that needs as an input the number of terms n of the cosine series and the value ofx and then it calculates the series up to the nh term. (b) Upgrade the function to calculate and store the value of the true percent relative error for each value of k from k-1 to k-n where n is the number of terms given by the user (c) Upgrade your function to plot the true percent relative error for each value of k from k-1 to k- n. Label the x-axis, the y-axis and add a legend. (d) Upgrade your code to time itself and run the code for x- and n-170 and report the final plot, and the time of the calculation. From the MATLAB figure window, change the x-axis and y-axis to appear in logarithmic scale instead of linear scale (that is change the plot into log-log scale). Attach the figure with your solutions (e) From your log-log plot in part (d), how many terms are enough to reach percent relative error less than 1013% (f) If you look at the series, there is an issue in using 200 terms or more in the series. What is the issue

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 Programming With Visual Basic .NET

Authors: Carsten Thomsen

2nd Edition

1590590325, 978-1590590324

More Books

Students also viewed these Databases questions

Question

Describe new developments in the design of pay structures. page 475

Answered: 1 week ago