Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 questionimage text in transcribed

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

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_2

Step: 3

blur-text-image_3

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

Database Systems Introduction To Databases And Data Warehouses

Authors: Nenad Jukic, Susan Vrbsky, Svetlozar Nestorov

1st Edition

1943153191, 978-1943153190

More Books

Students also viewed these Databases questions

Question

Distinguish between nonsampling error and sampling error.

Answered: 1 week ago