• Aucun résultat trouvé

COMPUTER RESULTS FOR EXAMPLE 3.12

*3.5 CONVERGENCE OF THE NEWTON AND SECANT METHODS

COMPUTER RESULTS FOR EXAMPLE 3.12

3.6 POLYNOMIAL EQUATIONS: REAL ROOTS 119 Maehly has proposed a way of using the reduced polynomial which avoids the difficulties illustrated above. Let be k zeros of a polynomial which have already been found. To find the next zero, one carries out a Newton iteration on the reduced polynomial

but one does not determine by re-peated synthetic division. Rather one leaves it in this form, in which case the iteration then becomes

This technique appears to be quite effective in producing accurate succes-sive zeros. See Exercise 3.6-7.

EXERCISES

3.6-1 Using Algorithm 3.9 and a hand calculator, find the real root of

correct to seven significant figures. Determine the remaining zeros from the reduced poly-nomial, using the quadratic formula. How accurate are these solutions?

3.6-2 Using Algorithm 3.9, find the real positive roots of the following polynomial equations:

3.6-3 The polynomial has four real zeros. Find them,

using Algorithm 3.9.

3.6-4 The polynomial

has the zeros Find these zeros on a computer in ascending order of magnitude, choosing initial approximations within 10 percent of the exact solutions. Then change the coefficient of x2 to -39,710, and solve the problem once again. Observe the change in the solutions.

3.6-5 Use Descartes’ rule of signs and the theorems on polynomial zero bounds much as you can about the location and type of zeros of the polynomial

3.66 The polynomial

has a zero There is another find this zero starting with x0 = 2.

real positive zero near x = 2. Use Maehly’s technique to to find out as

3.6-7 Write a program based on Maehly’s method for finding successive real zeros of a polynomial p(x).

3.6-8 Find the zeros of the polynomial in Example 3.12 using Maehly’s method and compare with the results given in Example 3.12.

*3.7 COMPLEX ROOTS AND MÜLLER’S METHOD

The methods discussed up to this point allow us to find an isolated zero of a function once an approximation to that zero is known. These methods are not very satisfactory when all the zeros of a function are required or when good initial approximations are not available. For polynomial func-tions there are methods which yield an approximation to all the zeros simultaneously, after which the iterative methods of this chapter can be applied to obtain more accurate solutions. Among such methods may be mentioned the quotient-difference algorithm [2] and the method of Graeffe [5].

A method of recent vintage, expounded by Miiller [6], has been used on computers with remarkable success. This method may be used to find any prescribed number of zeros, real or complex, of an arbitrary function.

The method is iterative, converges almost quadratically in the vicinity of a root, does not require the evaluation of the derivative of the function, and obtains both real and complex roots even when these roots are not simple.

Moreover, the method is global in the sense that the user need not supply an initial approximation. In this section we describe briefly how the method is derived, omitting any discussion of convergence, and we discuss its use in finding both real and complex roots. We will especially empha-size the problem of finding complex zeros of polynomials with real coefficients since this problem is of great concern in many branches of engineering.

Müller’s method is an extension of the secant method. To recall, in the secant method we determine, from the approximations xi, xi-1 to a root of f(x) = 0, the next approximation xi+1 as the zero of the linear polynomial p(x) which goes through the two points {xif(xi)} and {xi - 1f(xi - 1)}. In Müller’s method, the next approximation, xi+1, is found as a zero of the parabola which goes through the three points {xi, f(xi)}, {xi - 1, f(xi - 1},

and {xi - 2, f(xi - 2)}.

As shown in Chap. 2, the function

is the unique parabola which agrees with the function f(x) at the three points xi, xi-1, xi-2. Since

we can also write p(x) in the form

(3.51) with

I

*3.7 COMPLEX ROOTS AND MÜLLER'S METHOD 121

Thus any zero of the parabola p(x) satisfies

(3.52) according to one version of the standard quadratic formula [see (1.20)]. If we choose the sign in (3.52) so that the denominator will be as large in magnitude as possible, and if we then label the right-hand side of (3.52) as hi+1, then the next approximation to a zero of f(x) is taken to be

The process is then repeated using xi-1, xi, xi+1 as the three basic approximations. If the zeros obtained from (3.52) are real, the situation is pictured graphically in Fig. 3.8. Note, however, that even if the zero being sought is real, we may encounter complex approximations because the solutions given by (3.52) may be complex. However, in such cases the complex component will normally be so small in magnitude that it can be neglected. In fact, in the subroutine given below, any complex components encountered in seeking a real zero can be suppressed.

Figure 3.8

The sequence of steps required in Müller’s method is formalized in Algorithm 3.10.

Algorithm 3.10: Müller’s method

1. Let x0, x1, x2 be three approximations to a zero Compute f(x0), f(x1), f(x2).

2. Compute

3. Set i = 2 4. Compute

5. Compute

choosing the sign so that the denominator is largest in magnitude.

6. Set xi+1 = xi + hi+1 7. Compute

8. Set i = i + 1 and repeat steps 4-7 until either of the following criteria is satisfied for prescribed

or until the maximum number of iterations is exceeded.

A complete subroutine based on this algorithm is given below. The calling parameters for the subroutine are explained in the comment cards.

ZEROS(I) is a one-dimensional array containing initial estimates of the desired zeros. The subroutine automatically computes two additional ap-proximations to ZEROS(I) as ZEROS(I) + .5 and ZEROS(I) - .5 and then proceeds with the Müller algorithm.

SUBROUTINE MULLER ( FN, FNREAL, ZEROS, N, NPREV, MAXIT, EP1, EP2 C DETERMINES UP TO N ZEROS OF THE FUNCTION SPECIFIED BY FN , USING C QUADRATIC INTERPOLATION, I.E., MUELLER'S METHOD .

EXTERNAL FN LOGICAL FNREAL

INTEGER MAXIT,N,NPREV, KOUNT REAL EP1,EP2, EPS1,EPS2

COMPLEX ZEROS(N), C,DEN,DIVDF1,DIVDF2,DVDF1P,FZR,FZRDFL l , F Z R P R V , H , Z E R O , S Q R

C****** I N P U T ******

C FN NAME OF A SUBROUTINE, OF THE FORM FN(Z, FZ) WHICH, FOR GIVEN C Z , RETURNS F(Z) . MUST APPEAR IN AN E X T E R N A L STATE-C MENT IN THE CALLING PROGRAM .

C FNREAL A LOGICAL VARIABLE. IF .TRUE., ALL APPROXIMATIONS ARE TAKEN C TO BE REAL, ALLOWING THIS ROUTINE TO BE USED EVEN IF F(Z) IS C ONLY DEFINED FOR REAL Z .

C ZEROS(l),...,ZEROS(NPREV) CONTAINS PREVIOUSLY FOUND ZEROS (IF

*3.7 COMPLEX ROOTS AND MÜLLER’S METHOD 123 C NPREV .GT. 0).

C ZEROS(NPREV+l),...,ZEROS(N) CONTAINS FIRST GUESS FOR THE ZEROS TO BE C FOUND. (IF YOU KNOW NOTHING, 0 IS AS GOOD A GUESS AS ANY.) C MAXIT MAXIMUM NUMBER OF FUNCTION EVALUATIONS ALLOWED PER ZERO.

C EP1 ITERATION IS STOPPED IF ABS(H) .LT. EP1*ABS(ZR), WITH C H = LATEST CHANGE IN ZERO ESTIMATE ZERO .

C EP2 ALTHOUGH THE EP1 CRITERION IS NOT MET, ITERATION IS STOPPED IF C ABS(F(ZER0)) .LT. EP2 .

C N TOTAL NUMBER OF ZEROS TO BE FOUND . C NPREV NUMBER OF ZEROS FOUND PREVIOUSLY . C****** 0 U T P U T ******

C ZEROS(NPREV+l), . . . . ZEROS(N) APPROXIMATIONS TO ZEROS . C

COMPUTE FIRST THREE ESTIMATES FOR ZERO AS ZEROS(I)+5., ZEROS(I)-.5, ZEROS(I) ZERO = ZEROS(I)

H = .5

CALL DFLATE(FN, ZERO+.5, I, KOUNT, FZR, DVDF1P, ZEROS, 1) CALL DFLATE(FN, ZERO-.5, I, KOUNT, FZR, FZRPRV, ZEROS, l) HPREV = -1.

DVDF1P = (FZRPRV - DVDF1P)/HPREV

CALL DFLATE(FN, ZERO, I, KOUNT, FZR, FZRDFL, ZEROS, l l) DO WHILE KOUNT.LE.MAXIT OR H IS RELATIVELY BIG

OR FZR = F(ZERO) IS NOT SMALL

OR FZRDFL = FDEFLATED(ZERO) IS NOT SMALL OR NOT MUCH BIGGER THAN ITS PREVIOUS VALUE FZRPRV

DIVDF1 = (FZRDFL - FZRPRV)/H

DIVDF2 = (DIVDF1 - DVDF1P)/(H + HPREV) HPREV = H

CALL DFLATE(FN, ZERO, I, KOUNT, FZR, FZRDFL, ZEROS, *l) IF (ABS(H)

CHECK FOR CONVERGENCE

.LT. EPS1*ABS(ZERO)) GO TO 99 IF (MAX(ABS(FZR),ABS(FZRDFL)) .LT. EPS2) GO TO 99

CHECK FOR DIVERGENCE

SUBROUTINE DFLATE ( FN, ZERO, I, KOUNT, FZERO, FZRDFLi ZEROS, * ) C TO BE CALLED IN M U L L E R

INTEGER I,KOUNT, J

COMPLEX FZERO,FZRDFL,ZERO,ZEROS(I), DEN

KOUNT = KOUNT + 1

Müller’s method, like the other algorithms described in this chapter, finds one zero at a time. To find more than one zero it uses a procedure known as deflation. If, for example, one zero has already been found, the routine calculates the next zero by working with the function

(3.53) We already met this technique when solving polynomial equations by Newton’s method, in which case the deflated or reduced function f1(x) was a by-product of the algorithm. In Müller’s method, if r zeros

have already been found, the next zero is obtained by working with the deflated function

(3.54) If no estimates are given, the routine always looks for zeros in order of increasing magnitude since this will usually minimize round-off-error growth. Also, all zeros found using deflated functions are tested for accuracy by substitution into the original function f(x). In practice some accuracy may be lost when a zero is found using deflation. Approximate zeros found using deflation may be refined by using these approximate zeros as initial guesses in Newton’s method applied to the original func-tion. In applying the Müller subroutine, the user can specify the number of zeros desired. Some functions, for example, may have an infinite number of zeros, of which only the first few may be of interest.

Example 3.13 Bessel’s function J0(x) is given by the infinite series

It is known that J0(x) has an infinite number of real zeros. Find the first three positive zeros, using Algorithm 3.10. The machine results given below were obtained on an IBM 7094 using a standard library subroutine for J0(x) based on the series given above. The values of J0(x) were computed to maximum accuracy.

*3.7 COMPLEX ROOTS AND MÜLLER'S METHOD 125 The iterations were all started with the approximations x0 = - 1, xl = 1, x2 = 0 and were continued until either of the following error criteria was satisfied:

The converged values are correct to at least six significant figures. Note that the zeros are obtained in ascending order of magnitude.