In the following assignments we study the finding of the roots for three classes of polynomials: random polynomials, polynomials with multiple roots, and ill-conditioned polynomials.
2.1 Global and local convergence of the method. We generate random polynomials to investigate experimentally the global and local convergence of the method. For the global convergence, we just generate random coefficient vectors as in the example above. To examine the local convergence, we generate random roots to define the test polynomials. We then start the method at points close to the generated roots.
Assignment One.
Generate random coefficient vectors for polynomials of
degree
and call the method,
starting at randomly chosen initial approximations for the roots.
Take as desired accuracy each time 1.0e-12 and the maximum
number of steps equal to 100. Do three random experiments for
every
. Record in a table (rows indexed by
and
columns by the trial: one, two, three) the number of
steps it takes to reach the desired accuracy.
What can you say about the global convergence
of the method?
Assignment Two.
Generate random complex vectors for the roots of polynomials
of degree
and call the method, starting
at initial approximations at a distance from the generated roots
equal to 1.0e-2, 1.0e-4, and 1.0e-8.
An initial approximation x at distance eps from the
generated roots r can be generated
as x = r + (randn(1,d)+i*randn(1,d))*eps.
So for each polynomial we do three experiments,
taking as desired accuracy each time 1.0e-12 and the maximum
number of steps equal to 100.
Record in a table (rows indexed by
and
columns by 1.0e-2, 1.0e-4, and 1.0e-8) the number of
steps it takes to reach the desired accuracy.
What can you say about the local convergence
of the method?
2.2 Multiple roots. The command
returns the coefficient vector of a polynomial which has only one
root with multiplicity
at
, i.e.:
.
Assignment Three. Take
,
for
and run the method with a desired accuracy
equal to zero and maximum allowed steps equal to 1000, each time
starting a random complex initial approximations of the roots.
Make a triangular table, with rows indexed by
, the distance
of each computed approximation to the multiple root one.
What is the relationship between the multiplicity
of the root one and the distance of the computed approximations
to one?
2.3 A perfidious polynomial. An easy looking
test polynomial is
.
We can generate its coefficient vector as
, for any degree
.
Assignment Four.
Run the method of Weierstrass on this polynomial for increasing values
of
, starting at
. Each time record the value for the residual
res, for a desired accuracy of 1.0e-12, and allowing no more
than 100 iterations, starting at random initial approximations for the roots.
Stop at that degree
for which res is larger than 1.
Explain why this polynomial is so ill conditioned.