NuMFor 9f2ab49 (2024-04-08)
Numerical (Modern) Fortran. Library for Simple Numerical computing
|
Wrapper of (slightly modified) QUADPACK routines Description: Submodule Integrate. More...
Data Types | |
interface | c_qp_extra |
Type used to pass extra (optional) information with the integration routines. More... | |
interface | d_qp_extra |
Type used to pass extra (optional) information with the integration routines. More... | |
interface | qag |
Globally adaptive integration routine without weights. More... | |
interface | qagp |
Subroutine qagi is a globally adaptive, automatic interval subdivisions with epsilon extrapolation without weights for an infinite interval. More... | |
interface | qags |
Subroutine qags is a globally adaptive, automatic interval subdivisions with epsilon extrapolation without weights. More... | |
interface | qawc |
Subroutine qawc computes the Cauchy principal value. More... | |
interface | qawf |
qawf computes Fourier integrals over the interval [ A, +Infinity ). More... | |
interface | qawo |
Subroutine qawo is designed for integrands with an oscillatory factor,. More... | |
interface | qaws |
Subroutine qaws estimates integrals with algebraico-logarithmic endpoint singularities given by the weight function . More... | |
interface | qcheb |
Subroutine qcheb computes the coefficients of the Chebyshev series expansion of degrees 12 and 24 of a function using a fast Fourier transform method. More... | |
interface | qextr |
Subroutine qextr carries out the Epsilon extrapolation algorithm. More... | |
interface | qgk |
Routine to perform the integration of a function by Gauss-Kronrod rule. More... | |
interface | qk15w |
Routine to perform the integration of a weighted function by 15-points Gauss-Kronrod rule. More... | |
interface | qng |
qng estimates an integral using non-adaptive integration. More... | |
Functions/Subroutines | |
character(len=:) function, allocatable, public | qp_err_msg (ier) |
qp_err_msg Returns the error message correspondig to a given code | |
Wrapper of (slightly modified) QUADPACK routines Description: Submodule Integrate.
QUADPACK is a Fortran subroutine package for the numerical computation of definite one-dimensional integrals. It originated from a joint project of R. Piessens and E. de Doncker (Appl. Math. and Progr. Div.- K.U.Leuven, Belgium), C. Ueberhuber (Inst. Fuer Math.-Techn.U.Wien, Austria), and D. Kahaner (Nation. Bureau of Standards- Washington D.C., U.S.A.).
All routines calculate approximations to integrals
or integrals of weighted functions:
hopefully satisfying error conditions given by the user (epsabs, epsrel)
Here it is not our purpose to investigate the question when automatic quadrature should be used. we shall rather attempt to help the user who already made the decision to use quadpack, with selecting an appropriate routine or a combination of several routines for handling his problem.
For both quadrature over finite and over infinite intervals, one of the first questions to be answered by the user is related to the amount of computer time he wants to spend, versus his -own- time which would be needed, for example, for manual subdivision of the interval or other analytic manipulations.
The user may want to examine the integrand function. if bad local difficulties occur, such as a discontinuity, a singularity, derivative singularity or high peak at one or more points within the interval, the first advice is to split up the interval at these points. the integrand must then be examinated over each of the subintervals separately, so that a suitable integrator can be selected for each of them. if this yields problems involving relative accuracies to be imposed on -finite- subintervals, one can make use of qagp, which must be provided with the positions of the local difficulties. however, if strong singularities are present and a high accuracy is requested, application of qags on the subintervals may yield a better result.
for quadrature over finite intervals we thus dispose of qags and
[d|c]_qp_extra
in the last argument adaptive integrators contain information about the interval subdivision process and hence about the integrand behavior: the end points of the subintervals, the local integral contributions and error estimates, and eventually other characteristics. for this reason, and because of its simple globally adaptive nature, the routine qag in particular is well-suited for integrand examination. difficult spots can be located by investigating the error estimates on the subintervals.for infinite intervals we provide only one general-purpose routine, qagi. it is based on the qags algorithm applied after a transformation of the original interval into (0,1). yet it may eventuate that another type of transformation is more appropriate, or one might prefer to break up the original interval and use qagi only on the infinite part and so on. these kinds of actions suggest a combined use of different quadpack integrators. note that, when the only difficulty is an integrand singularity at the finite integration limit, it will in general not be necessary to break up the interval, as qagi deals with several types of singularity at the boundary point of the integration range. it also handles slowly convergent improper integrals, on the condition that the integrand does not oscillate over the entire infinite interval. if it does we would advise to sum succeeding positive and negative contributions to the integral -e.g. integrate between the zeros- with one or more of the finite-range integrators, and apply convergence acceleration eventually by means of quadpack subroutine qext which implements the epsilon algorithm. such quadrature problems include the fourier transform as a special case. yet for the latter we have an automatic integrator available, qawf.
qagp
, which is to be provided with the x-locations of the singularities or discontinuities.qags
.qawf
.qextr
.qagi
.qagi
.All routines described here may integrate functions with one of the following signatures:
f(x)
of a real argument x
f(x)
of a real argument x
f(x,args)
of real arguments x
, and array args
f(x,args)
of real arguments x
, and array args
For functions that need extra arguments besides the integration variable x
, the argument array must be passed to the integration routines.
There is also the possibility of using type(nf_rfunction)
for real functions or type(nf_cfunction)
for complex functions
character(len=:) function, allocatable, public qp_err_msg | ( | integer, intent(in) | ier | ) |
qp_err_msg Returns the error message correspondig to a given code
[in] | ier | Error code Examples: |