C05 Class
関数リスト一覧   NagLibrary Namespaceへ  ライブラリイントロダクション  本ヘルプドキュメントのchm形式版

This chapter is concerned with the calculation of real zeros of continuous real functions of one or more variables. (Complex equations must be expressed in terms of the equivalent larger system of real equations.)

Syntax

C#
public static class C05
Visual Basic (Declaration)
Public NotInheritable Class C05
Visual C++
public ref class C05 abstract sealed
F#
[<AbstractClassAttribute>]
[<SealedAttribute>]
type C05 =  class end

Background to the Problems

The chapter divides naturally into two parts.

A Single Equation

The first deals with the real zeros of a real function of a single variable fx .
The two other methods are both designed for the case where you are unable to specify an interval containing the simple zero. The first method starts from an initial point and performs a search for an interval containing a simple zero. If such an interval is computed then the method described above is used next to determine the zero accurately. The second method uses a ‘continuation’ method based on a secant iteration. A sequence of subproblems is solved; the first of these is trivial and the last is the actual problem of finding a zero of fx . The intermediate problems employ the solutions of earlier problems to provide initial guesses for the secant iterations used to calculate their solutions.
Three other methods are also supplied. They employ reverse communication and use the same core algorithms as the methods described above.
Finally, a method is provided that uses the iterative method described in Barry et al. (1995) to return values from the real branches of Lambert's W function (sometimes known as the ‘product log’ or ‘Omega’ function), which is the inverse function of
fw=wew  for  wC;
that is, if Lambert's W function Wx=a for x,aC, then a is a zero of the function Fw=wew-x. In this chapter we restrict x,aR.

Systems of Equations

Recommendations on Choice and Use of Available Methods

Zeros of Functions of One Variable

The methods can be divided into two classes. There are three methods (c05av, c05ax and c05az) all written in reverse communication form and three (c05ad, c05ag and c05aj) written in direct communication form. The direct communication methods are designed for inexperienced users and, in particular, for solving problems where the function fx  whose zero is to be calculated, can be coded as a user-supplied (sub)program. These methods find the zero by using the same core algorithms as the reverse communication methods. Experienced users are recommended to use the reverse communication methods directly as they permit you more control of the calculation. Indeed, if the zero-finding process is embedded in a much larger program then the reverse communication methods should always be used.
The recommendation as to which method should be used depends mainly on whether you can supply an interval a,b  containing the zero; that is, where fa×fb<0 . If the interval can be supplied, then c05ad (or, in reverse communication, c05az) should be used, in general. This recommendation should be qualified in the case when the only interval which can be supplied is very long relative to your error requirements and you can also supply a good approximation to the zero. In this case c05aj (or, in reverse communication, c05ax) may prove more efficient (though these latter methods will not provide the error bound available from c05az).
If an interval containing the zero cannot be supplied then you must choose between c05ag (or, in reverse communication, c05av followed by c05az) and c05aj (or, in reverse communication, c05ax). c05ag first determines an interval containing the zero, and then proceeds as in c05ad; it is particularly recommended when you do not have a good initial approximation to the zero. If a good initial approximation to the zero is available then c05aj is to be preferred. Since neither of these latter methods has guaranteed convergence to the zero, you are recommended to experiment with both in case of difficulty.

Solution of Sets of Nonlinear Equations

The methods for solving a set of nonlinear equations can also be divided into classes. There are four methods (c05nb, c05nc, c05pb and c05pc) all written in direct communication form and two (c05nd and c05pd) written in reverse communication form. The direct communication methods are designed for inexperienced users and, in particular, these methods require the fi  (and possibly their derivatives) to be calculated in user-supplied delegates. These should be set up carefully so the Library methods can work as efficiently as possible. Experienced users are recommended to use the reverse communication methods as they permit you more control of the calculation. Indeed, if the zero-finding process is embedded in a much larger program then the reverse communication methods should always be used.
The main decision you have to make is whether to supply the derivatives fi xj . It is advisable to do so if possible, since the results obtained by algorithms which use derivatives are generally more reliable than those obtained by algorithms which do not use derivatives.
c05pb and c05pc (or, in reverse communication, c05pd) require you to provide the derivatives, whilst c05nb and c05nc (or, in reverse communication, c05nd) do not. c05nb and c05pb are easy-to-use methods; greater flexibility may be obtained using c05nc and c05pc (or, in reverse communication, c05nd and c05pd), but these have longer parameter lists. c05za is provided for use in conjunction with c05pb and c05pc to check the user-supplied derivatives for consistency with the functions themselves. You are strongly advised to make use of this method whenever c05pb or c05pc is used.
Firstly, the calculation of the functions and their derivatives should be ordered so that cancellation errors are avoided. This is particularly important in a method that uses these quantities to build up estimates of higher derivatives.
Secondly, scaling of the variables has a considerable effect on the efficiency of a method. The problem should be designed so that the elements of x are of similar magnitude. The same comment applies to the functions, i.e., all the fi  should be of comparable size.
The accuracy is usually determined by the accuracy parameters of the methods, but the following points may be useful.
(i) Greater accuracy in the solution may be requested by choosing smaller input values for the accuracy parameters. However, if unreasonable accuracy is demanded, rounding errors may become important and cause a failure.
(ii) Some idea of the accuracies of the xi  may be obtained by monitoring the progress of the method to see how many figures remain unchanged during the last few iterations.
(iii) An approximation to the error in the solution x is given by e where e is the solution to the set of linear equations
Jxe=-fx
where fx = f1x,f2x,,fnx T .
Note that the QR  decomposition of J is available from c05nc and c05pc (or, in reverse communication, c05nd and c05pd) so that
Re=-QTf
and QTf  is also provided by these methods.
(iv) If the functions fix  are changed by small amounts ε i , for i= 1,2,,n , then the corresponding change in the solution x is given approximately by σ, where σ is the solution of the set of linear equations
Jxσ = -ε .
Thus one can estimate the sensitivity of x to any uncertainties in the specification of fix , for i= 1,2,,n . As noted above, the sophisticated methods c05nc and c05pc (or, in reverse communication, c05nd and c05pd) provide the QR  decomposition of J.

Decision Trees

References

Inheritance Hierarchy

See Also