📄 integration.texi
字号:
@var{abserr}. The subintervals and their results are stored in thememory provided by @var{workspace}. The maximum number of subintervalsis given by @var{limit}, which may not exceed the allocated size of theworkspace.@end deftypefun@node QAGP adaptive integration with known singular points@section QAGP adaptive integration with known singular points@cindex QAGP quadrature algorithm@cindex singular points, specifying positions in quadrature@deftypefun int gsl_integration_qagp (const gsl_function * @var{f}, double * @var{pts}, size_t @var{npts}, double @var{epsabs}, double @var{epsrel}, size_t @var{limit}, gsl_integration_workspace * @var{workspace}, double * @var{result}, double * @var{abserr})This function applies the adaptive integration algorithm QAGS takingaccount of the user-supplied locations of singular points. The array@var{pts} of length @var{npts} should contain the endpoints of theintegration ranges defined by the integration region and locations ofthe singularities. For example, to integrate over the region@math{(a,b)} with break-points at @math{x_1, x_2, x_3} (where @math{a < x_1 < x_2 < x_3 < b}) the following @var{pts} array should be used@examplepts[0] = apts[1] = x_1pts[2] = x_2pts[3] = x_3pts[4] = b@end example@noindentwith @var{npts} = 5.@noindentIf you know the locations of the singular points in the integrationregion then this routine will be faster than @code{QAGS}.@end deftypefun@node QAGI adaptive integration on infinite intervals@section QAGI adaptive integration on infinite intervals@cindex QAGI quadrature algorithm@deftypefun int gsl_integration_qagi (gsl_function * @var{f}, double @var{epsabs}, double @var{epsrel}, size_t @var{limit}, gsl_integration_workspace * @var{workspace}, double * @var{result}, double * @var{abserr})This function computes the integral of the function @var{f} over theinfinite interval @math{(-\infty,+\infty)}. The integral is mapped onto thesemi-open interval @math{(0,1]} using the transformation @math{x = (1-t)/t},@tex\beforedisplay$$\int_{-\infty}^{+\infty} dx \, f(x) = \int_0^1 dt \, (f((1-t)/t) + f(-(1-t)/t))/t^2.$$\afterdisplay@end tex@ifinfo@example\int_@{-\infty@}^@{+\infty@} dx f(x) = \int_0^1 dt (f((1-t)/t) + f((-1+t)/t))/t^2.@end example@end ifinfo@noindentIt is then integrated using the QAGS algorithm. The normal 21-pointGauss-Kronrod rule of QAGS is replaced by a 15-point rule, because thetransformation can generate an integrable singularity at the origin. Inthis case a lower-order rule is more efficient.@end deftypefun@deftypefun int gsl_integration_qagiu (gsl_function * @var{f}, double @var{a}, double @var{epsabs}, double @var{epsrel}, size_t @var{limit}, gsl_integration_workspace * @var{workspace}, double * @var{result}, double * @var{abserr})This function computes the integral of the function @var{f} over thesemi-infinite interval @math{(a,+\infty)}. The integral is mapped onto thesemi-open interval @math{(0,1]} using the transformation @math{x = a + (1-t)/t},@tex\beforedisplay$$\int_{a}^{+\infty} dx \, f(x) = \int_0^1 dt \, f(a + (1-t)/t)/t^2$$\afterdisplay@end tex@ifinfo@example\int_@{a@}^@{+\infty@} dx f(x) = \int_0^1 dt f(a + (1-t)/t)/t^2@end example@end ifinfo@noindentand then integrated using the QAGS algorithm.@end deftypefun@deftypefun int gsl_integration_qagil (gsl_function * @var{f}, double @var{b}, double @var{epsabs}, double @var{epsrel}, size_t @var{limit}, gsl_integration_workspace * @var{workspace}, double * @var{result}, double * @var{abserr})This function computes the integral of the function @var{f} over thesemi-infinite interval @math{(-\infty,b)}. The integral is mapped onto thesemi-open interval @math{(0,1]} using the transformation @math{x = b - (1-t)/t},@tex\beforedisplay$$\int_{-\infty}^{b} dx \, f(x) = \int_0^1 dt \, f(b - (1-t)/t)/t^2$$\afterdisplay@end tex@ifinfo@example\int_@{-\infty@}^@{b@} dx f(x) = \int_0^1 dt f(b - (1-t)/t)/t^2@end example@end ifinfo@noindentand then integrated using the QAGS algorithm.@end deftypefun@node QAWC adaptive integration for Cauchy principal values@section QAWC adaptive integration for Cauchy principal values@cindex QAWC quadrature algorithm@cindex Cauchy principal value, by numerical quadrature@deftypefun int gsl_integration_qawc (gsl_function * @var{f}, double @var{a}, double @var{b}, double @var{c}, double @var{epsabs}, double @var{epsrel}, size_t @var{limit}, gsl_integration_workspace * @var{workspace}, double * @var{result}, double * @var{abserr})This function computes the Cauchy principal value of the integral of@math{f} over @math{(a,b)}, with a singularity at @var{c},@tex\beforedisplay$$I = \int_a^b dx\, {f(x) \over x - c} = \lim_{\epsilon \to 0} \left\{\int_a^{c-\epsilon} dx\, {f(x) \over x - c}+\int_{c+\epsilon}^b dx\, {f(x) \over x - c}\right\}$$\afterdisplay@end tex@ifinfo@exampleI = \int_a^b dx f(x) / (x - c)@end example@end ifinfo@noindentThe adaptive bisection algorithm of QAG is used, with modifications toensure that subdivisions do not occur at the singular point @math{x = c}.When a subinterval contains the point @math{x = c} or is close toit then a special 25-point modified Clenshaw-Curtis rule is used to controlthe singularity. Further away from thesingularity the algorithm uses an ordinary 15-point Gauss-Kronrodintegration rule.@end deftypefun@node QAWS adaptive integration for singular functions@section QAWS adaptive integration for singular functions@cindex QAWS quadrature algorithm@cindex singular functions, numerical integration ofThe QAWS algorithm is designed for integrands with algebraic-logarithmicsingularities at the end-points of an integration region. In order towork efficiently the algorithm requires a precomputed table ofChebyshev moments.@deftypefun {gsl_integration_qaws_table *} gsl_integration_qaws_table_alloc (double @var{alpha}, double @var{beta}, int @var{mu}, int @var{nu})This function allocates space for a @code{gsl_integration_qaws_table}struct describing a singular weight function@math{W(x)} with the parameters @math{(\alpha, \beta, \mu, \nu)},@tex\beforedisplay$$W(x) = (x - a)^\alpha (b - x)^\beta \log^\mu (x - a) \log^\nu (b - x)$$\afterdisplay@end tex@ifinfo@exampleW(x) = (x-a)^alpha (b-x)^beta log^mu (x-a) log^nu (b-x)@end example@end ifinfo@noindentwhere @math{\alpha > -1}, @math{\beta > -1}, and @math{\mu = 0, 1},@math{\nu = 0, 1}. The weight function can take four different formsdepending on the values of @math{\mu} and @math{\nu},@tex\beforedisplay$$\matrix{W(x) = (x - a)^\alpha (b - x)^\beta \hfill~ (\mu = 0, \nu = 0) \crW(x) = (x - a)^\alpha (b - x)^\beta \log(x - a) \hfill~ (\mu = 1, \nu = 0) \crW(x) = (x - a)^\alpha (b - x)^\beta \log(b - x) \hfill~ (\mu = 0, \nu = 1) \crW(x) = (x - a)^\alpha (b - x)^\beta \log(x - a) \log(b - x) \hfill~ (\mu = 1, \nu = 1)}$$\afterdisplay@end tex@ifinfo@exampleW(x) = (x-a)^alpha (b-x)^beta (mu = 0, nu = 0)W(x) = (x-a)^alpha (b-x)^beta log(x-a) (mu = 1, nu = 0)W(x) = (x-a)^alpha (b-x)^beta log(b-x) (mu = 0, nu = 1)W(x) = (x-a)^alpha (b-x)^beta log(x-a) log(b-x) (mu = 1, nu = 1)@end example@end ifinfo@noindentThe singular points @math{(a,b)} do not have to be specified until theintegral is computed, where they are the endpoints of the integrationrange.The function returns a pointer to the newly allocated table@code{gsl_integration_qaws_table} if no errors were detected, and 0 inthe case of error.@end deftypefun@deftypefun int gsl_integration_qaws_table_set (gsl_integration_qaws_table * @var{t}, double @var{alpha}, double @var{beta}, int @var{mu}, int @var{nu})This function modifies the parameters @math{(\alpha, \beta, \mu, \nu)} ofan existing @code{gsl_integration_qaws_table} struct @var{t}.@end deftypefun@deftypefun void gsl_integration_qaws_table_free (gsl_integration_qaws_table * @var{t})This function frees all the memory associated with the@code{gsl_integration_qaws_table} struct @var{t}.@end deftypefun@deftypefun int gsl_integration_qaws (gsl_function * @var{f}, const double @var{a}, const double @var{b}, gsl_integration_qaws_table * @var{t}, const double @var{epsabs}, const double @var{epsrel}, const size_t @var{limit}, gsl_integration_workspace * @var{workspace}, double * @var{result}, double * @var{abserr})This function computes the integral of the function @math{f(x)} over theinterval @math{(a,b)} with the singular weight function@math{(x-a)^\alpha (b-x)^\beta \log^\mu (x-a) \log^\nu (b-x)}. The parameters of the weight function @math{(\alpha, \beta, \mu, \nu)} are taken from thetable @var{t}. The integral is,@tex\beforedisplay$$I = \int_a^b dx\, f(x) (x - a)^\alpha (b - x)^\beta \log^\mu (x - a) \log^\nu (b - x).$$\afterdisplay@end tex@ifinfo@exampleI = \int_a^b dx f(x) (x-a)^alpha (b-x)^beta log^mu (x-a) log^nu (b-x).@end example@end ifinfo@noindentThe adaptive bisection algorithm of QAG is used. When a subintervalcontains one of the endpoints then a special 25-point modifiedClenshaw-Curtis rule is used to control the singularities. Forsubintervals which do not include the endpoints an ordinary 15-pointGauss-Kronrod integration rule is used.@end deftypefun@node QAWO adaptive integration for oscillatory functions@section QAWO adaptive integration for oscillatory functions@cindex QAWO quadrature algorithm@cindex oscillatory functions, numerical integration ofThe QAWO algorithm is designed for integrands with an oscillatoryfactor, @math{\sin(\omega x)} or @math{\cos(\omega x)}. In order towork efficiently the algorithm requires a table of Chebyshev momentswhich must be pre-computed with calls to the functions below.@deftypefun {gsl_integration_qawo_table *} gsl_integration_qawo_table_alloc (double @var{omega}, double @var{L}, enum gsl_integration_qawo_enum @var{sine}, size_t @var{n})This function allocates space for a @code{gsl_integration_qawo_table}struct and its associated workspace describing a sine or cosine weightfunction @math{W(x)} with the parameters @math{(\omega, L)},@tex\beforedisplay$$\eqalign{W(x) & = \left\{\matrix{\sin(\omega x) \cr \cos(\omega x)} \right\}}$$\afterdisplay
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -