1 <?xml version="1.0" encoding="UTF-8"?>
3 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4 * Copyright (C) 2008 - INRIA
6 * Copyright (C) 2012 - 2016 - Scilab Enterprises
8 * This file is hereby licensed under the terms of the GNU GPL v2.0,
9 * pursuant to article 5.3.4 of the CeCILL v.2.1.
10 * This file was originally licensed under the terms of the CeCILL v2.1,
11 * and continues to be available under such terms.
12 * For more information, see the COPYING file which you should have received
13 * along with this program.
16 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="bessel" xml:lang="ja">
17 <refnamediv xml:id="besseli">
18 <refname>besseli</refname>
19 <refpurpose>第1種修正ベッセル関数 (I_alpha).</refpurpose>
21 <refnamediv xml:id="besselj">
22 <refname>besselj</refname>
23 <refpurpose>第1種ベッセル関数 (J_alpha).</refpurpose>
25 <refnamediv xml:id="besselk">
26 <refname>besselk</refname>
27 <refpurpose>第2種修正ベッセル関数 (K_alpha).</refpurpose>
29 <refnamediv xml:id="bessely">
30 <refname>bessely</refname>
31 <refpurpose>第2種ベッセル関数 (Y_alpha).</refpurpose>
33 <refnamediv xml:id="besselh">
34 <refname>besselh</refname>
35 <refpurpose>第3種ベッセル関数 (ハンケル関数と同じ)</refpurpose>
39 <synopsis>y = besseli(alpha,x [,ice])
40 y = besselj(alpha,x [,ice])
41 y = besselk(alpha,x [,ice])
42 y = bessely(alpha,x [,ice])
44 y = besselh(alpha,K,x [,ice])
53 <para>実数または複素数のベクトル.</para>
65 <para>整数フラグ, デフォルト値: 0</para>
71 <para>整数, 指定可能な値は 1 または 2, ハンケル関数の型.</para>
81 <literal>besseli(alpha,x)</literal> は,
82 実数の次数<literal>alpha</literal> および引数 <literal>x</literal>に関する
83 第1種修正ベッセル関数(I_alpha)を計算します,
84 <literal>besseli(alpha,x,1)</literal> は
85 <literal>besseli(alpha,x).*exp(-abs(real(x)))</literal>を計算します.
90 <literal>besselj(alpha,x)</literal> は第1種のベッセル関数(J_alpha)を
91 実数の次数<literal>alpha</literal> および引数 <literal>x</literal>に関して
93 <literal>besselj(alpha,x,1)</literal> は
94 <literal>besselj(alpha,x).*exp(-abs(imag(x)))</literal>を計算します.
99 <literal>besselk(alpha,x)</literal> は第2種修正ベッセル関数
101 実数の次数<literal>alpha</literal> および引数 <literal>x</literal>に関して
103 <literal>besselk(alpha,x,1)</literal> は
104 <literal>besselk(alpha,x).*exp(x)</literal>を計算します.
109 <literal>bessely(alpha,x)</literal>は第2種のベッセル関数(Y_alpha)を
110 実数の次数<literal>alpha</literal> および引数 <literal>x</literal>に関して
112 <literal>bessely(alpha,x,1)</literal> は
113 <literal>bessely(alpha,x).*exp(-abs(imag(x)))</literal>を計算します.
118 <literal>besselh(alpha [,K] ,x)</literal> は第3種のベッセル関数
119 (<literal>K</literal>に依存してハンケル関数 H1 または H2)を
120 実数の次数<literal>alpha</literal> および引数 <literal>x</literal>に関して
121 計算します.<literal>K</literal>が省略された場合,
123 <literal>besselh(alpha,1,x,1)</literal>は
124 <literal>besselh(alpha,1,x).*exp(-%i*x)</literal>を計算し,
125 <literal>besselh(alpha,2,x,1)</literal> は
126 <literal>besselh(alpha,2,x).*exp(%i*x)</literal>を計算します.
134 <literal>alpha</literal>および <literal>x</literal>が同じ大きさの
135 配列の場合,結果<literal>y</literal>も同じ大きさとなります.
138 片方の入力が行ベクトルでもう片方が列ベクトルの場合,
139 結果<literal>y</literal>は関数値の二次元テーブルとなります.
141 <para>Y_alpha および J_alpha ベッセル関数はベッセルの微分方程式の
147 <imagedata align="center" fileref="../mml/bessel_equation1.mml"/>
151 <para>修正ベッセル関数K_alpha および I_alphaは
152 修正ベッセル微分方程式の2つの独立解です:
157 <imagedata align="center" fileref="../mml/bessel_equation2.mml"/>
161 <para>H^1_alpha および H^2_alphaは第1種および第2種のハンケル関数
162 で,第1種および第2種のベッセル関数の線形結合です:
167 <imagedata align="center" fileref="../mml/bessel_equation3.mml"/>
174 <programlisting role="example"><![CDATA[
176 // ==================
177 x = linspace(0.01,10,5000)';
180 plot2d(x,besseli(0:4,x), style=2:6)
181 legend('I'+string(0:4),2);
182 xtitle("Some modified Bessel functions of the first kind")
184 plot2d(x,besseli(0:4,x,1), style=2:6)
185 legend('I'+string(0:4),1);
186 xtitle("Some modified scaled Bessel functions of the first kind")
189 x = linspace(0.01,10,5000)';
192 plot2d(x,besseli(0:4,x), style=2:6)
193 legend('I'+string(0:4),2);
194 xtitle("Some modified Bessel functions of the first kind")
196 plot2d(x,besseli(0:4,x,1), style=2:6)
197 legend('I'+string(0:4),1);
198 xtitle("Some modified scaled Bessel functions of the first kind")
200 <programlisting role="example"><![CDATA[
203 x = linspace(0,40,5000)';
205 plot2d(x,besselj(0:4,x), style=2:6, leg="J0@J1@J2@J3@J4")
206 legend('I'+string(0:4),1);
207 xtitle("Some Bessel functions of the first kind")
210 x = linspace(0,40,5000)';
211 plot2d(x,besselj(0:4,x), style=2:6, leg="J0@J1@J2@J3@J4")
212 legend('I'+string(0:4),1);
213 xtitle("Some Bessel functions of the first kind")
215 <programlisting role="example"><![CDATA[
216 // J_(1/2)(x) = sqrt(2/(x pi)) sin(x) の関係を用いて
217 // besselj(0.5,x) のアルゴリズムをより直接的な式と比較します
218 x = linspace(0.1,40,5000)';
219 y1 = besselj(0.5, x);
220 y2 = sqrt(2 ./(%pi*x)).*sin(x);
221 er = abs((y1-y2)./y2);
222 ind = find(er > 0 & y2 ~= 0);
226 xtitle("besselj(0.5,x)")
228 plot2d(x(ind), er(ind), style=2, logflag="nl")
229 xtitle("relative error between 2 formulae for besselj(0.5,x)")
231 <scilab:image><![CDATA[
232 x = linspace(0.1,40,5000)';
233 y1 = besselj(0.5, x);
234 y2 = sqrt(2 ./(%pi*x)).*sin(x);
235 er = abs((y1-y2)./y2);
236 ind = find(er > 0 & y2 ~= 0);
240 xtitle("besselj(0.5,x)")
242 plot2d(x(ind), er(ind), style=2, logflag="nl")
243 xtitle("relative error between 2 formulae for besselj(0.5,x)")
245 <programlisting role="example"><![CDATA[
248 x = linspace(0.01,10,5000)';
251 plot2d(x,besselk(0:4,x), style=0:4, rect=[0,0,6,10])
252 legend('K'+string(0:4),1);
253 xtitle("Some modified Bessel functions of the second kind")
255 plot2d(x,besselk(0:4,x,1), style=0:4, rect=[0,0,6,10])
256 legend('K'+string(0:4),1);
257 xtitle("Some modified scaled Bessel functions of the second kind")
260 x = linspace(0.01,10,5000)';
263 plot2d(x,besselk(0:4,x), style=0:4, rect=[0,0,6,10])
264 legend('K'+string(0:4),1);
265 xtitle("Some modified Bessel functions of the second kind")
267 plot2d(x,besselk(0:4,x,1), style=0:4, rect=[0,0,6,10])
268 legend('K'+string(0:4),1);
269 xtitle("Some modified scaled Bessel functions of the second kind")
271 <programlisting role="example"><![CDATA[
274 x = linspace(0.1,40,5000)'; // Y ベッセル関数は x -> 0+ については制限されません
276 plot2d(x,bessely(0:4,x), style=0:4, rect=[0,-1.5,40,0.6])
277 legend('Y'+string(0:4),4);
278 xtitle("Some Bessel functions of the second kind")
281 x = linspace(0.1,40,5000)'; // Y Bessel functions are unbounded for x -> 0+
283 plot2d(x,bessely(0:4,x), style=0:4, rect=[0,-1.5,40,0.6])
284 legend('Y'+string(0:4),4);
285 xtitle("Some Bessel functions of the second kind")
287 <programlisting role="example"><![CDATA[
290 x=-4:0.025:2; y=-1.5:0.025:1.5;
292 H = besselh(0,1,X+%i*Y);
295 f.color_map=jetcolormap(16);
296 contour2d(x,y,abs(H),0.2:0.2:3.2,strf="034",rect=[-4,-1.5,3,1.5])
297 legends(string(0.2:0.2:3.2),1:16,"ur")
298 xtitle("Level curves of |H1(0,z)|")
301 x=-4:0.025:2; y=-1.5:0.025:1.5;
303 H = besselh(0,1,X+%i*Y);
306 f.color_map=jetcolormap(16);
307 contour2d(x,y,abs(H),0.2:0.2:3.2,strf="034",rect=[-4,-1.5,3,1.5])
308 legends(string(0.2:0.2:3.2),1:16,"ur")
309 xtitle("Level curves of |H1(0,z)|")
313 <title>使用される関数</title>
314 <para>ソースコードは SCI/modules/special_functions/src/fortran/slatec および
315 SCI/modules/special_functions/src/fortran にあります
317 <para>Slatec : dbesi.f, zbesi.f, dbesj.f, zbesj.f, dbesk.f, zbesk.f,
318 dbesy.f, zbesy.f, zbesh.f
320 <para>拡張定義領域(Serge Steer INRIA)のドライバ (Serge Steer INRIA): dbesig.f,
321 zbesig.f, dbesjg.f, zbesjg.f, dbeskg.f, zbeskg.f, dbesyg.f, zbesyg.f,