Question: Use MATLAB to complete this question Problem 4. Series expansion error of the exponential function. 4a. Write a while loop to evaluate the value of

Use MATLAB to complete this questionUse MATLAB to complete this question Problem 4. Series expansion error of

Problem 4. Series expansion error of the exponential function. 4a. Write a while loop to evaluate the value of exp(x) (exponential) where x is 10 using Taylor expansion 1+x +x_/2!+x/3!+.... Do so without worrying about roundoff errors or computation speed. Compare it with the Matlab build-in function exp(10) and screen output the absolute value of the fractional error (defined by abs((Your_sum-expected)/expected) at n=5 terms, 20 terms and 50 terms. I know this is cheating in reality since analytical solutions generally don't exist for hard problems (but if it is available why not use it?). Then change your input to x=-10 and do the same. Comment on whether there are convergence problems. I would like you to tabulate in the following manner in the screen output (where sum and fractional errors are formatted as %e): Terms Sum(your prog output). Fractional error (line 1) 1 1.234567e+01 8.901113-03 (line 2) 5 ... 4b. Write an improved script by adding IF statement(s) in the loop to avoid the subtraction of big numbers. Does your series converge better at the same numbers of terms above (comment)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!