Reference no: EM133081633
ENGRD 3200 Engineering Computation - Cornell University
Learning Objective 1: Learn concepts of machine representation of real numbers and issues with precision limits.
Learning Objective 2: Compute and use true and approximate errors and the equivalent percentage errors.
Learning Objective 3: Observe how the machine representation of numbers affects the precision of computations.
Learning Objective 4: Explore how round-off error impacts numerical evaluation of functions, when approximate numbers of differing magnitude are involved, and identify alternative formulations to minimize the error in evaluation.
Learning Objective 5: Understand the sensitivity of truncation error on the order of a Taylor series and the spatial "step".
Assignment
Question 1: Machine Representation of Numbers and Precision Limitation
In a fashion similar to last Prob, develop your own M-file to determine the smallest positive real number used in MATLAB. Base your algorithm on the notion that your computer will be unable to reliably distinguish between zero and a quantity that is smaller than this number. Note that the result you obtain will differ from the value computed with realmin.
Challenge question: Investigate the results by taking the base-2 logarithm of the number generated by your code and those obtained with realmin.
Question 2: Effect of Multiple Operations on Accuracy and Error Evaluation
(a) Evaluate the polynomial
y = x3 - 7x2 + 8x - 0.35
at x = 1.37. Use 3-digit arithmetic with chopping. Evaluate the percent relative error.
(b) Repeat (a) but express y as
y = ((x - 7)x + 8)x - 0.35
Evaluate the error and compare with part (a).
Do this by hand. Specifically, after each computation perform 3-digit chopping.
In addition, identify the total number of arithmetic operations in both parts (a) & (b). Part (b) represents what is known as "nested multiplication". Which approach (part (a) or (b)) is faster and more accurate? Explain why.
Nested multiplication is effectively an application of Horner's rule which you might want to Google if curious.
Question 3: Round-off Error in Numerical Evaluation and Alternative Formulations towards Avoiding it
Consider the two functions:
f (x) = x - √(x2 - 1) and g(x) = 1/(x + √(x2-1))
a) Show that f(x) = g(x). Note that this equality holds only for exact arithmetic (no rounding or chopping of numbers).
b) Use your scientific calculator and evaluate both f(x) and g(x) at x1 =2.014 and x2=2014. Your result here presents your true value. Now also compute f(x1), g(x1) and f(x2), g(x2) on paper (show each individual step) using 4-digit chopping arithmetic. For each of these four estimates compute the relative true error. Of these which produces the largest relative true error? Explain why
Question 4: Understanding the effect of order of expansion and spatial "step" on the truncation error of a Taylor series expansion
Use zero- through fourth-order Taylor series expansions to predict f(2) for f(x) = ln x using a base point at x = 1.
Compute the true percent relative error εt for each approximation. Discuss the meaning of the results.
The discussion of the meaning of your results should revolve around the following questions:
a) How many terms do you need to add to your Taylor series to obtain a relative error of 10%? Do this by hand, i.e., by calculating as many terms as necessary.
b) How much is your error reduced each time you add an additional term to your Taylor series? Write a short MATLAB script (include it in your hard copy) that computes a Taylor series for an arbitrary number of terms. How many terms are needed in the series to bring your relative error to 1%? How many terms are needed for a relative error reduction of 0.1%?
c) Without resorting to computing the actual Taylor series, can you comment on what relative error you'd expect for your Taylor series expansion if you were asked to approximate ln x at both x=0.1 and x=1.9? Both of these evaluation points are located at the same distance to the left and right of your base point x = 1.0. Why are your relative truncation error estimates different?
Attachment:- Engineering Computation.rar