IntegralProblem(f, domain, p) asks for the integral of f(u, p) over
domain = c(lb, ub) (vectors lb and ub give a box; infinite bounds
are allowed). IntegralFunction(f) is the integrand,
BatchIntegralFunction(f) an integrand evaluated at many points at once
(f(U, p) with one point per column of U, returning one value or
column per point). SampledIntegralProblem(y, x, dim) integrates sampled
values y over the points x (along dimension dim of an array y).
Usage
IntegralFunction(f, integrand_prototype = NULL)
BatchIntegralFunction(f, integrand_prototype = NULL, max_batch = 1000L)
IntegralProblem(f, domain, p = numeric(), ...)
SampledIntegralProblem(y, x, dim = NULL, ...)
IntegralSolution(
u,
resid = NA_real_,
retcode = "Success",
prob = NULL,
alg = NULL
)
TrapezoidalRule()
SimpsonsRule()Arguments
- f
Integrand.
- integrand_prototype, max_batch
Options of the Julia signature.
- domain
Bounds
c(lb, ub)orlist(lb, ub).- p
Parameters.
- ...
Options passed to
solve().- y, x, dim
Sampled values, points and dimension.
- u, resid, retcode
Solution fields.
- prob, alg
A problem and an algorithm.
Details
solve(prob) integrates: one dimension adaptively with Gauss-Kronrod
quadrature (stats::integrate()), several dimensions by nested
quadrature; vector valued integrands are integrated per component.
solve(sampled, alg) uses the trapezoidal rule (TrapezoidalRule(), the
default) or Simpson's rule (SimpsonsRule()). The result is an
IntegralSolution with u (the integral), resid (the error estimate)
and retcode. Options: abstol, reltol (default 1e-8), maxiters.