MCS 471 Practice Problems 1: Nonlinear Equations (F. Hanson)

Do NOT Hand In: Practice Problems ONLY!

• Lecture Notes, Class Notes

• Gerald and Wheatley, Chapters 0 and 1

• Matlab tips (see: fzero)

Exam 1 Topics

1. Floating Point Arithmetic

2. Bisection Method

3. Secant Method

4. Newton's Method

5. Muller's method

6. Fixed Point Interation

7. Error analysis and multiple root equations

Practice Problems:

In following computational questions, use 4 Digit Exam Precision: Round to 4 significant decimal digits only when you record an intermediate or final answer in your exam booklet; and continue calculations with these rounded, recorded numbers.

1. Considering just the field representing the fractional part of a nonzero normalized 32 bit floating point real for the IEEE 754 single precision standard, how many distinct numbers can be represented assuming the exponent and sign are fixed? Record as many digits as your calculator allows. Explain how you got your answer. (I.e., ignore the sign bit and the biased exponent field for this count.)

fl[x] = ±(1+frac) * 2^(exp)

for normalized floating point numbers with the leading "1" not being stored and the "frac" integer is stored as a 23 bit integer

0   <   frac2,32,q   <   2^(23)-1,

the latter bound being a string of 23 ones, so that the any digit can be a binary 0 or 1 and the number of numbers stored is

2^(23) = 8,388,608

2. Using Newton's Method, find a numerical approximation to the Zero of

f(x) = e^(-x/3) - 0.05471*x

on [2.5,2.9] starting with the endpoint (k = 0) having the smallest value of |f|, keeping track of the number of ALL function evaluations kfe, the current change in sign interval [a_k,b_k], and tabulating

 k kfe a_k b_k d_k f_k f_k' x_{k+1} |x_{k+1}-x_k| 0 ... ...

until |x_{k+1}-x_k| < 0.5e-2.

Answer: Examination of the function f(x) indicates that there is no change of sign in [2.5,2.9] and since Newton's method does not depend on it, we proceed ignoring the change in sign interval:

f'(x)=-e^(-x/3)/3-0.5471,   x_{k+1} = x_k   -   f_k/f_k';

 k kfe a_k b_k d_k f_k f_k' x_{k+1} |x_{k+1}-x_k| 0 3 2.5* 2.9* 2.9 0.2217 -0.1815 4.121 1.221 1 5 4.121? ? 4.121 2.772e-2 -0.1391 4.320 0.1990 2 7 4.320? ? 4.320 5.806e-4 -0.1377 4.324 0.4000e-2

Stopping since tol=0.5e-2 is satisfied.

3. Find a numerical approximation to the intersection between two functions

x = 1.984/ln(x)

starting from x_0 = 2.400 at k = 0 by forming a convergent Fixed Point Iteration, other than Newton's method. Demonstrate that the fixed point convergence criterion is satisfied near x_0. Tabulate

 k 0 1 2 3 x_k
for k = 0 to 3 iterations.

Answer: If g(x)=1.984/ln(x)1.984/ln(x), then g'(x) = -1.984/(x*ln^2(x)) and |g'(2.4)|=|-1.079|>1 indicating a marginal fixed point iteration divergence, which does not satisfy the problem statement. So, we take a manipulated inverse

gi(x)=exp(1.984/x),   gi'(x) = -1.984*exp(1.984/x)/x^2   and   |gi'(2.4)|=|-0.7873|<1,

satisfying the convergence criterion at x=2.4, with fixed point iterations x_{k+1}=gi_k, given in the table:

 k 0 1 2 3 x_k 2.4 2.286 2.382 2.3
Note that the original form converges as a fixed point iteration in spite of the marginal divergence warning and there are other forms that will work too.

In the following older problems prior to Fall 1999, use "CHOPPING EXAM PRECISION": The answers are calculated for chopping to 4 significant (4C) digits since the problems are from a time when chopping was used.

Note: Maple comments are not part of these sample exam problems, but were added afterward in the editing stage to aid in analyzing the problems.

1. Using the method of BISECTION starting with A(1)=1. and B(1)=2., find the root of F(X)=EXP(X)-3.5/X Record your answer in a table of K,A(K),B(K),F(A(K)),F(B(K)) for each iteration on (A(K),B(K)) for K=1 to 3. Compare your answer to that using fzero of Matlab.

2. Find the root of F(X)=EXP(X)-3.5/X using the SECANT METHOD for 2 iterations beyond the starting guesses, X(1)=1. and X(2)=2. Record your answers in a table of K,X(K),X(K-1),F(X(K)),F(X(K-1)) for each iteration K. Compare your answer to the Bisection and Matlab answers from the first question.

3. Find the root of F(X)=EXP(X)-3.5/X on [1.,2.] using NEWTON'S METHOD until ABS(X(K)-X(K-1))<.5E-1. Record Results in table of K,X(K),F(X(K)). Use X(1)=1.5 to start. Compare your answer to the Bisection, Secant and Matlab answers from the first and second questions.

4. Numerically solve F(X)=LN(X)-1/X=0 by forming a convergent, fixed point iteration, other than Newton's, starting from X(1)=EXP(1). Record your answers in a table of K, X(K), for K= 1 to 3. (Corrected (2/14/99) Final Ans.=(4ch) 1.998 using g(x)=exp(1/x)). Compare your answer to that using fzero of Matlab. Use the plot function of Matlab to plot the problem function G(X).

5. Using Matlab, get all the roots, including double and triple roots, of the polynomial

x^5-11x^4+46x^3-90x^2+81x-27.

Also plot the polynomial using the plot function of Matlab, on [0,4].