

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Homework problems related to taylor approximation of functions, error analysis, and comparison of different methods. The problems involve finding the accuracy of approximations for given functions and ranges of values, constructing taylor polynomials, and analyzing the error in taylor polynomials. Some problems require using matlab to compute the ratios of errors using different methods.
Typology: Assignments
1 / 3
This page cannot be seen from the preview
Don't miss anything!


Due on Thursday, February 7
Ek(x) =
2(−1)k+1x^2 k+ (2k + 3)(k + 1)!
π
eξ^.
f (x) =
∫ (^) x
0
t−pe−t
2 dt, 0 ≤ p < 1 , x ∈ [0,
that is accurate to within 10−^3 for all values of p in the indicated range. (You need to write out the Taylor polynomial and show that the remainder is smaller than 10−^3 .)
f (x) =
∫ (^) x
0
t−^1 sin t dt, x ∈ [−
π 4
π 4
construct a Taylor approximation that is accurate to within 10−^4 over the indicated interval.
x using x 0 = 169 , for all x ∈ [ 14 , 1].
Problems seven and eight are simple exercises on using MATLAB. All CISE machines have access to MAT- LAB (either installed copy or through the online license server). To start MATLAB, you can either click on the MATLAB icon if available or enter matlab at the command prompt. There are many available and easy-to-find online resources for matlab tutorials and documentations. For example, you should quickly browse through the following tutorials:
http://www.math.ufl.edu/help/matlab-tutorial/ http://www.math.siu.edu/matlab/tutorials.html
For this assignment, you are only required to open a MATLAB window and try out a few examples. Al- though look long superficially, the two problems are in fact straightforward. Of course, you will have plenty of opportunity to work out more challenging problems with MATLAB later on this semester.
Problem 7 A. (Problem 11 on page 29) We can compute e−x^ using Taylor polynomials in two ways, either using
e−x^ ≈ 1 − x +
x^2 −
x^3 + · · ·
or using
e−x^ ≈
1 + x + 12 x^2 + 16 x^3 + · · ·
Discuss, in your own words, which approach is more accurate. In particular, which one is more (or less) susceptible to rounding error?
B. The following MATLAB M-function computes the degree-k Taylor approximation for ex:
1 + x +
x^2 +
x^3 + · · · +
k!
xk
function sum=EvalExp(x, k)
sum=1; for n=1:k sum=sum+x^n/factorial(n); end
Save these lines in a file called EvalExp.m and place it in your MATLAB working directory. You can do this using any text editors, including MATLAB’s own. You can run it by simply entering, e.g., EvalExp(1, 100), at the MATLAB command prompt. For example, the following commands find the ratio between the errors using the two methods above for approximating e−^10 using the degree-100 Taylor approximation: (exp is the native MATLAB function that computes ex)
xx=20; abs((exp(-xx)-EvalExp(-xx, 100)))/abs((exp(-xx)-1/EvalExp(xx, 100)))
For this part, you will compute the ratios of the errors using the following input values for xx = 0. 1 , 1 , 10 , 20 , 30 and the degree of the Taylor polynomial k = 50, 100 , 200. You need to turn in three tables (for three values of k) with a ratio for each value of xx. Do your results corroborate with your answer above?
C. What does the semi-colon (;) do in MATLAB?
Problem 8 A. (Problem 12 on page 29) What is the machine epsilon for a computer that uses binary arithmetic, 24 bits for the fraction, and rounds? What if it chops?