|
The goal of this project is to write a Matlab function to approximate
The approximation should be based on a Taylor series expansion of .
C Grade: Determine the Taylor series expansion for using Matlab's taylor function. Implement the formula as a Matlab function; keep summing terms until either (a) 1000 terms have been used, (b) adding a new term has no effect. Run
your function forx = 0, , , , , , , , , , . Compare your results with Matlab's value of . How many terms of the series are used for each value of x? What is the error for each value of x? Comment on how well the series works.
B Grade: For what values of x does the Taylor series converge? For what values of x is real-valued? Finite? For the above values ofx, how sensitive is the Taylor series approximation to errors in the value of x, that is, what is the
scaling factor for your approximation (estimate the scaling factor using finite differencing)? How sensitive is the original function to errors in the value of x
(derive the scaling factor symbolically)? Are the two scaling factors similar in magnitude?
A Grade: Modify your Matlab function so that it computes accurately for all
values of x for which is finite (this includes complex values). To do this,
you should use the properties of the logarithm function to derive an alternative formula for which can be evaluated using your C-grade Matlab program. Run
tests to justify your claims, for a much greater set of x values than considered above. In addition, examine the scaling factors for your new program. Display your results graphically.
Preliminary deadline: Wednesday, September 9
Final deadline: Thursday, September 17, 9:30am
|