annotate scripts/specfun/bessel.m @ 10687:a8ce6bdecce5

Improve documentation strings.
author Rik <octave@nomad.inbox5.com>
date Tue, 08 Jun 2010 20:22:38 -0700
parents 16f53d29049f
children be55736a0783
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9245
16f53d29049f update copyright notices
John W. Eaton <jwe@octave.org>
parents: 9051
diff changeset
1 ## Copyright (C) 1996, 1997, 1999, 2000, 2005, 2007, 2008, 2009
16f53d29049f update copyright notices
John W. Eaton <jwe@octave.org>
parents: 9051
diff changeset
2 ## John W. Eaton
3276
edf6e4852287 [project @ 1999-10-12 05:49:45 by jwe]
jwe
parents:
diff changeset
3 ##
edf6e4852287 [project @ 1999-10-12 05:49:45 by jwe]
jwe
parents:
diff changeset
4 ## This file is part of Octave.
edf6e4852287 [project @ 1999-10-12 05:49:45 by jwe]
jwe
parents:
diff changeset
5 ##
edf6e4852287 [project @ 1999-10-12 05:49:45 by jwe]
jwe
parents:
diff changeset
6 ## Octave is free software; you can redistribute it and/or modify it
edf6e4852287 [project @ 1999-10-12 05:49:45 by jwe]
jwe
parents:
diff changeset
7 ## under the terms of the GNU General Public License as published by
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5307
diff changeset
8 ## the Free Software Foundation; either version 3 of the License, or (at
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5307
diff changeset
9 ## your option) any later version.
3276
edf6e4852287 [project @ 1999-10-12 05:49:45 by jwe]
jwe
parents:
diff changeset
10 ##
edf6e4852287 [project @ 1999-10-12 05:49:45 by jwe]
jwe
parents:
diff changeset
11 ## Octave is distributed in the hope that it will be useful, but
edf6e4852287 [project @ 1999-10-12 05:49:45 by jwe]
jwe
parents:
diff changeset
12 ## WITHOUT ANY WARRANTY; without even the implied warranty of
edf6e4852287 [project @ 1999-10-12 05:49:45 by jwe]
jwe
parents:
diff changeset
13 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
edf6e4852287 [project @ 1999-10-12 05:49:45 by jwe]
jwe
parents:
diff changeset
14 ## General Public License for more details.
edf6e4852287 [project @ 1999-10-12 05:49:45 by jwe]
jwe
parents:
diff changeset
15 ##
edf6e4852287 [project @ 1999-10-12 05:49:45 by jwe]
jwe
parents:
diff changeset
16 ## You should have received a copy of the GNU General Public License
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5307
diff changeset
17 ## along with Octave; see the file COPYING. If not, see
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5307
diff changeset
18 ## <http://www.gnu.org/licenses/>.
3276
edf6e4852287 [project @ 1999-10-12 05:49:45 by jwe]
jwe
parents:
diff changeset
19
3321
6923abb04e16 [project @ 1999-10-26 18:15:30 by jwe]
jwe
parents: 3276
diff changeset
20 ## -*- texinfo -*-
7173
ff2ff2c09865 [project @ 2007-11-14 18:20:49 by jwe]
jwe
parents: 7017
diff changeset
21 ## @deftypefn {Loadable Function} {[@var{j}, @var{ierr}] =} besselj (@var{alpha}, @var{x}, @var{opt})
ff2ff2c09865 [project @ 2007-11-14 18:20:49 by jwe]
jwe
parents: 7017
diff changeset
22 ## @deftypefnx {Loadable Function} {[@var{y}, @var{ierr}] =} bessely (@var{alpha}, @var{x}, @var{opt})
ff2ff2c09865 [project @ 2007-11-14 18:20:49 by jwe]
jwe
parents: 7017
diff changeset
23 ## @deftypefnx {Loadable Function} {[@var{i}, @var{ierr}] =} besseli (@var{alpha}, @var{x}, @var{opt})
ff2ff2c09865 [project @ 2007-11-14 18:20:49 by jwe]
jwe
parents: 7017
diff changeset
24 ## @deftypefnx {Loadable Function} {[@var{k}, @var{ierr}] =} besselk (@var{alpha}, @var{x}, @var{opt})
ff2ff2c09865 [project @ 2007-11-14 18:20:49 by jwe]
jwe
parents: 7017
diff changeset
25 ## @deftypefnx {Loadable Function} {[@var{h}, @var{ierr}] =} besselh (@var{alpha}, @var{k}, @var{x}, @var{opt})
ff2ff2c09865 [project @ 2007-11-14 18:20:49 by jwe]
jwe
parents: 7017
diff changeset
26 ## Compute Bessel or Hankel functions of various kinds:
ff2ff2c09865 [project @ 2007-11-14 18:20:49 by jwe]
jwe
parents: 7017
diff changeset
27 ##
3321
6923abb04e16 [project @ 1999-10-26 18:15:30 by jwe]
jwe
parents: 3276
diff changeset
28 ## @table @code
6923abb04e16 [project @ 1999-10-26 18:15:30 by jwe]
jwe
parents: 3276
diff changeset
29 ## @item besselj
9051
1bf0ce0930be Grammar check TexInfo in all .m files
Rik <rdrider0-list@yahoo.com>
parents: 8920
diff changeset
30 ## Bessel functions of the first kind. If the argument @var{opt} is supplied,
8278
ab0674a8b345 fix scaling factor for negative alpha in zbesi,cbesi
Brian Gough <bjg@gnu.org>
parents: 7173
diff changeset
31 ## the result is multiplied by @code{exp(-abs(imag(x)))}.
3321
6923abb04e16 [project @ 1999-10-26 18:15:30 by jwe]
jwe
parents: 3276
diff changeset
32 ## @item bessely
9051
1bf0ce0930be Grammar check TexInfo in all .m files
Rik <rdrider0-list@yahoo.com>
parents: 8920
diff changeset
33 ## Bessel functions of the second kind. If the argument @var{opt} is supplied,
8278
ab0674a8b345 fix scaling factor for negative alpha in zbesi,cbesi
Brian Gough <bjg@gnu.org>
parents: 7173
diff changeset
34 ## the result is multiplied by @code{exp(-abs(imag(x)))}.
3321
6923abb04e16 [project @ 1999-10-26 18:15:30 by jwe]
jwe
parents: 3276
diff changeset
35 ## @item besseli
8278
ab0674a8b345 fix scaling factor for negative alpha in zbesi,cbesi
Brian Gough <bjg@gnu.org>
parents: 7173
diff changeset
36 ## Modified Bessel functions of the first kind. If the argument @var{opt} is supplied,
ab0674a8b345 fix scaling factor for negative alpha in zbesi,cbesi
Brian Gough <bjg@gnu.org>
parents: 7173
diff changeset
37 ## the result is multiplied by @code{exp(-abs(real(x)))}.
3321
6923abb04e16 [project @ 1999-10-26 18:15:30 by jwe]
jwe
parents: 3276
diff changeset
38 ## @item besselk
8278
ab0674a8b345 fix scaling factor for negative alpha in zbesi,cbesi
Brian Gough <bjg@gnu.org>
parents: 7173
diff changeset
39 ## Modified Bessel functions of the second kind. If the argument @var{opt} is supplied,
ab0674a8b345 fix scaling factor for negative alpha in zbesi,cbesi
Brian Gough <bjg@gnu.org>
parents: 7173
diff changeset
40 ## the result is multiplied by @code{exp(x)}.
7173
ff2ff2c09865 [project @ 2007-11-14 18:20:49 by jwe]
jwe
parents: 7017
diff changeset
41 ## @item besselh
ff2ff2c09865 [project @ 2007-11-14 18:20:49 by jwe]
jwe
parents: 7017
diff changeset
42 ## Compute Hankel functions of the first (@var{k} = 1) or second (@var{k}
9051
1bf0ce0930be Grammar check TexInfo in all .m files
Rik <rdrider0-list@yahoo.com>
parents: 8920
diff changeset
43 ## = 2) kind. If the argument @var{opt} is supplied, the result is multiplied by
8278
ab0674a8b345 fix scaling factor for negative alpha in zbesi,cbesi
Brian Gough <bjg@gnu.org>
parents: 7173
diff changeset
44 ## @code{exp (-I*@var{x})} for @var{k} = 1 or @code{exp (I*@var{x})} for
ab0674a8b345 fix scaling factor for negative alpha in zbesi,cbesi
Brian Gough <bjg@gnu.org>
parents: 7173
diff changeset
45 ## @var{k} = 2.
3321
6923abb04e16 [project @ 1999-10-26 18:15:30 by jwe]
jwe
parents: 3276
diff changeset
46 ## @end table
7173
ff2ff2c09865 [project @ 2007-11-14 18:20:49 by jwe]
jwe
parents: 7017
diff changeset
47 ##
3321
6923abb04e16 [project @ 1999-10-26 18:15:30 by jwe]
jwe
parents: 3276
diff changeset
48 ## If @var{alpha} is a scalar, the result is the same size as @var{x}.
7173
ff2ff2c09865 [project @ 2007-11-14 18:20:49 by jwe]
jwe
parents: 7017
diff changeset
49 ## If @var{x} is a scalar, the result is the same size as @var{alpha}.
ff2ff2c09865 [project @ 2007-11-14 18:20:49 by jwe]
jwe
parents: 7017
diff changeset
50 ## If @var{alpha} is a row vector and @var{x} is a column vector, the
ff2ff2c09865 [project @ 2007-11-14 18:20:49 by jwe]
jwe
parents: 7017
diff changeset
51 ## result is a matrix with @code{length (@var{x})} rows and
ff2ff2c09865 [project @ 2007-11-14 18:20:49 by jwe]
jwe
parents: 7017
diff changeset
52 ## @code{length (@var{alpha})} columns. Otherwise, @var{alpha} and
ff2ff2c09865 [project @ 2007-11-14 18:20:49 by jwe]
jwe
parents: 7017
diff changeset
53 ## @var{x} must conform and the result will be the same size.
ff2ff2c09865 [project @ 2007-11-14 18:20:49 by jwe]
jwe
parents: 7017
diff changeset
54 ##
9051
1bf0ce0930be Grammar check TexInfo in all .m files
Rik <rdrider0-list@yahoo.com>
parents: 8920
diff changeset
55 ## The value of @var{alpha} must be real. The value of @var{x} may be
7173
ff2ff2c09865 [project @ 2007-11-14 18:20:49 by jwe]
jwe
parents: 7017
diff changeset
56 ## complex.
ff2ff2c09865 [project @ 2007-11-14 18:20:49 by jwe]
jwe
parents: 7017
diff changeset
57 ##
ff2ff2c09865 [project @ 2007-11-14 18:20:49 by jwe]
jwe
parents: 7017
diff changeset
58 ## If requested, @var{ierr} contains the following status information
ff2ff2c09865 [project @ 2007-11-14 18:20:49 by jwe]
jwe
parents: 7017
diff changeset
59 ## and is the same size as the result.
ff2ff2c09865 [project @ 2007-11-14 18:20:49 by jwe]
jwe
parents: 7017
diff changeset
60 ##
ff2ff2c09865 [project @ 2007-11-14 18:20:49 by jwe]
jwe
parents: 7017
diff changeset
61 ## @enumerate 0
ff2ff2c09865 [project @ 2007-11-14 18:20:49 by jwe]
jwe
parents: 7017
diff changeset
62 ## @item
ff2ff2c09865 [project @ 2007-11-14 18:20:49 by jwe]
jwe
parents: 7017
diff changeset
63 ## Normal return.
ff2ff2c09865 [project @ 2007-11-14 18:20:49 by jwe]
jwe
parents: 7017
diff changeset
64 ## @item
ff2ff2c09865 [project @ 2007-11-14 18:20:49 by jwe]
jwe
parents: 7017
diff changeset
65 ## Input error, return @code{NaN}.
ff2ff2c09865 [project @ 2007-11-14 18:20:49 by jwe]
jwe
parents: 7017
diff changeset
66 ## @item
ff2ff2c09865 [project @ 2007-11-14 18:20:49 by jwe]
jwe
parents: 7017
diff changeset
67 ## Overflow, return @code{Inf}.
ff2ff2c09865 [project @ 2007-11-14 18:20:49 by jwe]
jwe
parents: 7017
diff changeset
68 ## @item
ff2ff2c09865 [project @ 2007-11-14 18:20:49 by jwe]
jwe
parents: 7017
diff changeset
69 ## Loss of significance by argument reduction results in less than
ff2ff2c09865 [project @ 2007-11-14 18:20:49 by jwe]
jwe
parents: 7017
diff changeset
70 ## half of machine accuracy.
ff2ff2c09865 [project @ 2007-11-14 18:20:49 by jwe]
jwe
parents: 7017
diff changeset
71 ## @item
ff2ff2c09865 [project @ 2007-11-14 18:20:49 by jwe]
jwe
parents: 7017
diff changeset
72 ## Complete loss of significance by argument reduction, return @code{NaN}.
ff2ff2c09865 [project @ 2007-11-14 18:20:49 by jwe]
jwe
parents: 7017
diff changeset
73 ## @item
ff2ff2c09865 [project @ 2007-11-14 18:20:49 by jwe]
jwe
parents: 7017
diff changeset
74 ## Error---no computation, algorithm termination condition not met,
ff2ff2c09865 [project @ 2007-11-14 18:20:49 by jwe]
jwe
parents: 7017
diff changeset
75 ## return @code{NaN}.
ff2ff2c09865 [project @ 2007-11-14 18:20:49 by jwe]
jwe
parents: 7017
diff changeset
76 ## @end enumerate
3321
6923abb04e16 [project @ 1999-10-26 18:15:30 by jwe]
jwe
parents: 3276
diff changeset
77 ## @end deftypefn
3276
edf6e4852287 [project @ 1999-10-12 05:49:45 by jwe]
jwe
parents:
diff changeset
78
edf6e4852287 [project @ 1999-10-12 05:49:45 by jwe]
jwe
parents:
diff changeset
79 function bessel ()
edf6e4852287 [project @ 1999-10-12 05:49:45 by jwe]
jwe
parents:
diff changeset
80 error ("bessel: you must use besselj, bessely, besseli, or besselk");
edf6e4852287 [project @ 1999-10-12 05:49:45 by jwe]
jwe
parents:
diff changeset
81 endfunction
3321
6923abb04e16 [project @ 1999-10-26 18:15:30 by jwe]
jwe
parents: 3276
diff changeset
82