Finds the zeros of a univariate complex function using Mόller's method.
F User-supplied
COMPLEX FUNCTION to compute
the value of the function
of which the zeros will be found. The form is F(Z), where
Z The complex value at which
the function is evaluated. (Input)
Z should not be
changed by F.
F The computed complex
function value at the point Z.
(Output)
F must be declared EXTERNAL in the
calling program.
Z A complex
vector of length NKNOWN + NNEW.
(Output)
Z(1),
, Z(NKNOWN) contain the
known zeros. Z(NKNOWN + 1),
, Z(NKNOWN + NNEW) contain the new
zeros found by ZANLY. If ZINIT is not needed,
ZINIT and Z can share the same
storage locations.
ERRABS First
stopping criterion. (Input)
Let FP(Z) = F(Z)/P where P = (Z - Z(1)) * (Z - Z(2)) *
* (Z - Z(K - 1))
and Z(1),
, Z(K - 1) are previously found zeros.
If (CABS(F(Z)).LE.ERRABS.AND.CABS(FP(Z)).LE.ERRABS),
then
Z is accepted as a
zero.
Default: ERRABS = 1.e-4 for
single precision and 1.d-8 for double precision.
ERRREL Second
stopping criterion is the relative error. (Input)
A zero is
accepted if the difference in two successive approximations to this zero is
within ERRREL. ERRREL must be less
than 0.01; otherwise, 0.01 will be used.
Default: ERRREL = 1.e-4 for
single precision and 1.d-8 for double precision.
NKNOWN The
number of previously known zeros, if any, that must be stored in ZINIT(1),
, ZINIT(NKNOWN) prior to entry
to ZANLY.
(Input)
NKNOWN must be set
equal to zero if no zeros are known.
Default: NKNOWN = 0.
NNEW The number
of new zeros to be found by ZANLY.
(Input)
Default: NNEW = 1.
NGUESS The
number of initial guesses provided. (Input)
These guesses must
be stored in ZINIT(NKNOWN + 1),
, ZINIT(NKNOWN + NGUESS). NGUESS must be set
equal to zero if no guesses are provided.
Default: NGUESS = 0.
ITMAX The
maximum allowable number of iterations per zero. (Input)
Default:
ITMAX = 100.
ZINIT A complex
vector of length NKNOWN + NNEW.
(Input)
ZINIT(1),
, ZINIT(NKNOWN) must contain
the known zeros. ZINIT(NKNOWN + 1),
, ZINIT(NKNOWN + NNEW) may, on user
option, contain initial guesses for the NNEW new zeros that
are to be computed. If the user does not provide an initial guess, zero is
used.
INFO An integer
vector of length NKNOWN + NNEW.
(Output)
INFO(J) contains the number
of iterations used in finding the J-th zero when
convergence was achieved. If convergence was not obtained in ITMAX iterations, INFO(J) will be greater
than ITMAX.
Generic: CALL ZANLY (F, Z [, ])
Specific: The specific interface names are S_ZANLY and D_ZANLY.
Single: CALL ZANLY (F, ERRABS, ERRREL, NKNOWN, NNEW, NGUESS, ZINIT, ITMAX, Z, INFO)
Double: The double precision name is DZANLY.
This example finds the zeros of the equation f(z) = z3 + 5z2 + 9z + 45, where z is a complex variable.
! Set the guessed zero values in ZINIT
! ZINIT = (1.0+1.0i 1.0+1.0i 1.0+1.0i)
! Set values for all input parameters
CALL ZANLY (F, Z, NNEW=NNEW, NGUESS=NGUESS, &
CALL WRCRN ('The zeros are', Z)
F = Z**3 + 5.0*Z**2 + 9.0*Z + 45.0
The zeros
are
1
2
3
( 0.000, 3.000) ( 0.000,-3.000) (-5.000, 0.000)
Visual Numerics, Inc. PHONE: 713.784.3131 FAX:713.781.9260 |