Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

MATLAB CODE Consider the following function, f(x)=tan1(x)cos(x)+1. Please answer the following: (a) In a separate m-file, write a function called atanCosi, which aocepts x as

MATLAB CODE

image text in transcribed

Consider the following function, f(x)=tan1(x)cos(x)+1. Please answer the following: (a) In a separate m-file, write a function called atanCosi, which aocepts x as an input, and outputs f(x). Include a published version of this function (pdf format) as part of your Canvas submission. (b) In a separate m-file, write a function called d_atanCos1, which outputs the first derivative 2, f(x). Include a published version of this function (pdf format) as part of your Canvas submission. (c) In a single plot, superimpose f(x) and f(x) in the range 0x. You should be able to identify a single root of f(x) in this interval. 2 You should find the derivative by pen and paper, then code it up in MATLAB. Don't try to make MATLAB take the derivative for you. (d) Calculate the root using the biscction method with initial brackets [2,3] and a tolerance of 1015. Store the value of the calculated root and the number of iterations required in variables called xRoot_BS and nIters_BS, respectively. (e) Plot the root calculated in part (d) as a single marker in the figure generated by part (c). Add a legend 3 to identify the function, its derivative, and the root.. (f) Repeat part (d) using the secant method. Use the initial brackets from part (d) as the starting points for the secant method, and the same tolerance. Store the value of the calculated root and the number of iterations required in variables called xRoot_SM and nIters_SM, respectively. (g) Repeat part (d) using the Newton-Raphson method. Use the initial guess x0=2 and the same tolerance as parts (d) and (f). Store the value of the calculated root and the number of iterations required in variables called xRoot_NR and nIters_NR, respectively

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

Oracle Solaris 11.2 System Administration (oracle Press)

Authors: Harry Foxwell

1st Edition

007184421X, 9780071844215

More Books

Students also viewed these Databases questions

Question

Write a Python program to check an input number is prime or not.

Answered: 1 week ago

Question

Write a program to check an input year is leap or not.

Answered: 1 week ago

Question

6. The cost of the training creates a need to show that it works.

Answered: 1 week ago