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