Mercurial > octave-nkf
diff scripts/general/dblquad.m @ 12612:16cca721117b stable
doc: Update all documentation for chapter on Numerical Integration
* cumtrapz.m, dblquad.m, quadgk.m, quadl.m, quadv.m, trapz.m,
triplequad.m, quad.cc, quadcc.cc: Improve docstrings.
* Quad-opts.in: Keep code sample together on a single line.
* mk-opts.pl: Update quad-options function description
* octave.texi: Update order of detailmenu to match order in quad.texi.
* quad.txi: Add language about when to use each quad function,
add examples of using trapz.
* aspell-octave.en.pws: Add new spelling words from quad.texi chapter
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Sun, 17 Apr 2011 19:57:07 -0700 |
parents | d0b799dafede |
children | eb4afb6a1a51 f96b9b9f141b |
line wrap: on
line diff
--- a/scripts/general/dblquad.m Thu Apr 14 18:52:54 2011 -0700 +++ b/scripts/general/dblquad.m Sun Apr 17 19:57:07 2011 -0700 @@ -17,18 +17,30 @@ ## <http://www.gnu.org/licenses/>. ## -*- texinfo -*- -## @deftypefn {Function File} {} dblquad (@var{f}, @var{xa}, @var{xb}, @var{ya}, @var{yb}, @var{tol}, @var{quadf}, @dots{}) -## Numerically evaluate a double integral. The function over with to -## integrate is defined by @code{@var{f}}, and the interval for the -## integration is defined by @code{[@var{xa}, @var{xb}, @var{ya}, -## @var{yb}]}. The function @var{f} must accept a vector @var{x} and a -## scalar @var{y}, and return a vector of the same length as @var{x}. +## @deftypefn {Function File} {} dblquad (@var{f}, @var{xa}, @var{xb}, @var{ya}, @var{yb}) +## @deftypefnx {Function File} {} dblquad (@var{f}, @var{xa}, @var{xb}, @var{ya}, @var{yb}, @var{tol}) +## @deftypefnx {Function File} {} dblquad (@var{f}, @var{xa}, @var{xb}, @var{ya}, @var{yb}, @var{tol}, @var{quadf}) +## @deftypefnx {Function File} {} dblquad (@var{f}, @var{xa}, @var{xb}, @var{ya}, @var{yb}, @var{tol}, @var{quadf}, @dots{}) +## Numerically evaluate the double integral of @var{f}. +## @var{f} is a function handle, inline function, or string +## containing the name of the function to evaluate. The function @var{f} must +## have the form @math{z = f(x,y)} where @var{x} is a vector and @var{y} is a +## scalar. It should return a vector of the same length and orientation as +## @var{x}. ## -## If defined, @var{tol} defines the absolute tolerance to which to -## which to integrate each sub-integral. +## @var{xa}, @var{ya} and @var{xb}, @var{yb} are the lower and upper limits of +## integration for x and y respectively. The underlying integrator determines +## whether infinite bounds are accepted. +## +## The optional argument @var{tol} defines the absolute tolerance used to +## integrate each sub-integral. The default value is @math{1e^{-6}}. +## +## The optional argument @var{quadf} specifies which underlying integrator +## function to use. Any choice but @code{quad} is available and the default +## is @code{quadgk}. ## ## Additional arguments, are passed directly to @var{f}. To use the default -## value for @var{tol} one may pass an empty matrix. +## value for @var{tol} or @var{quadf} one may pass an empty matrix ([]). ## @seealso{triplequad, quad, quadv, quadl, quadgk, quadcc, trapz} ## @end deftypefn @@ -66,3 +78,4 @@ %!assert (dblquad (@(x,y) exp(-x.^2 - y.^2) , -1, 1, -1, 1, [], @quadgk), pi * erf(1).^2, 1e-6) %!assert (dblquad (@(x,y) exp(-x.^2 - y.^2) , -1, 1, -1, 1, [], @quadl), pi * erf(1).^2, 1e-6) %!assert (dblquad (@(x,y) exp(-x.^2 - y.^2) , -1, 1, -1, 1, [], @quadv), pi * erf(1).^2, 1e-6) +