Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need help with this question please, I am taking numerical methods course. Problem 4 (25 points) The hyperbolic cosine of the argument x given
I need help with this question please, I am taking numerical methods course.
Problem 4 (25 points) The hyperbolic cosine of the argument x given in radians can be calculated by the series - n=1 cosh(x) = 1 + x2n (2n)! x 7:6 = 1+ + + 2! 4! 6! (1) a) Write a Matlab function myCosh that takes as input x and the number of terms N to use to estimate cosh (x), i.e., N +.... 2n (2n)! n=1 and outputs the estimate for cosh(x) together with the corresponding true relative error. You may use the Matlab function factorial () to calculate the factorial in the formula. For the true value of cosh(x) use Matlab's build-in function cosh(x). cosh(x) 1+ " b) Use the function to calculate the estimate for cosh (20) and the true relative error for i) N = 5, ii) N = 20, iii) N = 30. c) In a semilogarithmic plot (use semilogy()), plot the absolute of the relative error vs. N for N = 1... 40. d) Explain why the absolute of the relative error does not decrease for N > 32. Problem 4 required submission: Softcopy printout of well commented function you included in your Gradescope submission Softcopy printout of the results of calling your function for b) i)- iii) using format long Annotated semilogarithmic plot of absolute relative error us. N for N = 1... 40. Explanation why the absolute of the relative error does not decrease for N > 32. Upload of your Matlab functions and scripts to the Homework 1 link on Canvas (2)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started