Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

EP501 Numerical Methods Homework 2 Due Sep 27, 2013 11:59 pm

1 Finding Roots (30 points)


Write MATLAB functions for Bisection, Fasle Position, Newton’s method and Secant method. Use these
functions to find the solution of f (x) = 0 for the two functions listed below. Iterate until you reach a relative
error of 10−12 .
2
i. f (x) = x + e−x cos x
 2
2
ii. f (x) = x + e−x cos x

Write each method in a separate function. Plot the errors vs. iteration step like I showed in class. Determine
the rate of convergence based on the plot for each method. Comment on and explain the convergence rate you
find for each method and each function. Explain if you find some methods is not suitable for the functions.

2 Fixed Point Iteration (40 points)


Find two roots near +1 and -1 of the equation f (x) = x4 + 2x2 − x − 3 = 0 using fixed point iteration
x = g(x). Use the following four g(x) functions.
 41
i. g1 (x) = 3 + x − 2x2
 21
x + 3 − x4

ii. g2 (x) =
2
  12
x+3
iii. g3 (x) =
x2 + 2
3x4 + 2x2 + 3
iv. g4 (x) =
4x3 + 4x − 1
a. Create a MATLAB function that does the fixed point iteration and a MATLAB script that uses this
function to solve the equation using various g(x) above.
b. For each g(x) and at each root, determine whether the fixed point iteration convergences for each root
and explain why, based on properties we discussed in class about this method.
c. Which g(x) is best? Why?

Submit your code, output, and answers to the above questions.

3 Wilkinson’s Polynomial (30 points)


The British numerical analyst James Wilkinson suggested a problem, now called Wilkinson’s polynomial:
20
Y
Wα (x) = (x − i) − α = (x − 1)(x − 2)(x − 3) · · · (x − 19)(x − 20) − α.
i=1

and later (in 1984) admitted about his experience of computing roots to that polynomial, “Speaking for
myself, I regard it as the most traumatic experience in my career as a numerical analyst.”

1
EP501 Numerical Methods Homework 2 Due Sep 27, 2013 11:59 pm

Use your best bisection routine to find all the real roots of Wilkinson’s polynomial for α = 1011 . As a
hint to get you started and verify a result, for α = 1011 , you should be able to obtain one solution as
p ≈ 8.9386518013726. If you do not obtain a result very, very close to this, you should revise your bisection
routine until it passes this, one of the “ultimate”, tests for a root-finding code.

Hint: plot the function first, to get an idea on where all roots are located.

Your grade on this problem will be determined by the number of correct digits in your answers!

Submit your code. When I run it, correct code should print out all 20 roots to at least 14 significant figures.
Explain why it is difficult to find the roots of this polynomial.

You might also like