Liking cljdoc? Tell your friends :D

emmy.numerical.quadrature.milne


integralclj/s

(integral f a b)
(integral f a b opts)

Returns an estimate of the integral of f over the open interval $(a, b)$ using Milne's rule with $1, 2, 4 ... 2^n$ windows for each estimate.

Optionally accepts opts, a dict of optional arguments. All of these get passed on to us/seq-limit to configure convergence checking.

See milne-sequence for more information about Milne's rule, caveats that might apply when using this integration method and information on the optional args in opts that customize this function's behavior.

Returns an estimate of the integral of `f` over the open interval $(a, b)$
using [Milne's
rule](https://en.wikipedia.org/wiki/Newton%E2%80%93Cotes_formulas#Open_Newton%E2%80%93Cotes_formulas)
with $1, 2, 4 ... 2^n$ windows for each estimate.

Optionally accepts `opts`, a dict of optional arguments. All of these get
passed on to `us/seq-limit` to configure convergence checking.

See [[milne-sequence]] for more information about Milne's rule, caveats that
might apply when using this integration method and information on the optional
args in `opts` that customize this function's behavior.
sourceraw docstring

milne-sequenceclj/s

(milne-sequence f a b)
(milne-sequence f a b {:keys [n] :or {n 1} :as opts})

Returns a (lazy) sequence of successively refined estimates of the integral of f over the open interval $(a, b)$ using Milne's rule.

Milne's rule is equivalent to the midpoint method subject to one refinement of Richardson extrapolation.

Returns estimates with $n, 2n, 4n, ...$ slices, geometrically increasing by a factor of 2 with each estimate.

Optional arguments:

If supplied, :n (default 1) specifies the initial number of slices to use.

NOTE: the Midpoint method is able to reuse function evaluations as its windows narrow only when increasing the number of integration slices by 3. Milne's method increases the number of slices geometrically by a factor of 2 each time, so it will never hit the incremental path. You may want to memoize your function before calling milne-sequence.

Returns a (lazy) sequence of successively refined estimates of the integral of
`f` over the open interval $(a, b)$ using [Milne's
rule](https://en.wikipedia.org/wiki/Newton%E2%80%93Cotes_formulas#Open_Newton%E2%80%93Cotes_formulas).

Milne's rule is equivalent to the midpoint method subject to one refinement of
Richardson extrapolation.

Returns estimates with $n, 2n, 4n, ...$ slices, geometrically increasing by a
factor of 2 with each estimate.

## Optional arguments:

If supplied, `:n` (default 1) specifies the initial number of slices to use.

NOTE: the Midpoint method is able to reuse function evaluations as its windows
narrow _only_ when increasing the number of integration slices by 3. Milne's
method increases the number of slices geometrically by a factor of 2 each
time, so it will never hit the incremental path. You may want to memoize your
function before calling [[milne-sequence]].
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close