Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The Maclaurin series expansion for cos x is x xt 6 x8 Cos x = 1 - 2 4 6 8! Starting with the simplest

image text in transcribed
image text in transcribed
The Maclaurin series expansion for cos x is x xt 6 x8 Cos x = 1 - 2 4 6 8! Starting with the simplest version, cos x = 1, terms are added one at a time to estimate, e.g. cos ). After each new term is added, the true, &, and approximate percent relative errors can be evaluated The MATLAB function, cos(pi/4), may be used to determine the true value. (cos x)True = Write a MATLAB function, mycos, that estimates cos x as outlined above, . The first line in the function is: function out1 - mycos(ang.n) where, ang is the angle, e.g. pi/4, and n is the number of significant figures Number of significant figures, n, is an optional input. If it is not provided by the user, net n Design the output of the function similar to the following format: Iteration Outl e t Teal 5. Test your function using the calls: mycos(pi/4) and mycos(pi/4,4) Consider the following Gauss-Legendre algorithm for computing : a) Set a = 1, b = t = and x = 1. b) Repeat the following commands until the difference between a and b is within some desired accuracy, E. (ie.la-bl SE): ya last, baby t=t-xly-a) X 2x b b)/2 it (by y - a t 21 c) From the resulting values of a, b and I, an estimate of is: Pesa+by 23(440) pl - (a+b) Write a script that implements the algorithm, which is also illustrated in the flowchart. Use the while structure, and E-le-8

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

Oracle9i Database Administrator Implementation And Administration

Authors: Carol McCullough-Dieter

1st Edition

0619159006, 978-0619159009

More Books

Students also viewed these Databases questions

Question

Choosing Your Topic Researching the Topic

Answered: 1 week ago

Question

The Power of Public Speaking Clarifying the

Answered: 1 week ago