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
5 * Copyright (C) 2012 - 2016 - Scilab Enterprises
6 * Copyright (C) 2019 - Samuel GOUGEON
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"
17 xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml"
18 xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
19 xmlns:scilab="http://www.scilab.org" xml:id="bessel" xml:lang="ja">
20 <refnamediv xml:id="besseli">
21 <refname>besseli</refname>
22 <refpurpose>第1種修正ベッセル関数 (I<subscript>α</subscript>).</refpurpose>
24 <refnamediv xml:id="besselj">
25 <refname>besselj</refname>
26 <refpurpose>第1種ベッセル関数 (J<subscript>α</subscript>).</refpurpose>
28 <refnamediv xml:id="besselk">
29 <refname>besselk</refname>
30 <refpurpose>第2種修正ベッセル関数 (K<subscript>α</subscript>).</refpurpose>
32 <refnamediv xml:id="bessely">
33 <refname>bessely</refname>
34 <refpurpose>第2種ベッセル関数 (Y<subscript>α</subscript>).</refpurpose>
36 <refnamediv xml:id="besselh">
37 <refname>besselh</refname>
38 <refpurpose>第3種ベッセル関数 (ハンケル関数と同じ)</refpurpose>
43 y = besseli(alpha, x [,ice])
44 y = besselj(alpha, x [,ice])
45 y = besselk(alpha, x [,ice])
46 y = bessely(alpha, x [,ice])
48 y = besselh(alpha, K, x [,ice])
57 <para>実数または複素数のベクトル.</para>
69 <para>整数フラグ, デフォルト値: 0</para>
75 <para>整数, 指定可能な値は 1 または 2, ハンケル関数の型.</para>
85 <literal>besseli(alpha,x)</literal> は,
86 実数の次数<varname>alpha</varname> および引数 <varname>x</varname>に関する
87 第1種修正ベッセル関数(I<subscript>α</subscript>)を計算します,
88 <literal>besseli(alpha,x,1)</literal> は
89 <literal>besseli(alpha,x).*exp(-abs(real(x)))</literal>を計算します.
94 <literal>besselj(alpha,x)</literal> は第1種のベッセル関数(J<subscript>α</subscript>)を
95 実数の次数<varname>alpha</varname> および引数 <varname>x</varname>に関して
97 <literal>besselj(alpha,x,1)</literal> は
98 <literal>besselj(alpha,x).*exp(-abs(imag(x)))</literal>を計算します.
103 <literal>besselk(alpha,x)</literal> は第2種修正ベッセル関数
104 (K<subscript>α</subscript>)を
105 実数の次数<varname>alpha</varname> および引数 <varname>x</varname>に関して
107 <literal>besselk(alpha,x,1)</literal> は
108 <literal>besselk(alpha,x).*exp(x)</literal>を計算します.
113 <literal>bessely(alpha,x)</literal>は第2種のベッセル関数(Y<subscript>α</subscript>)を
114 実数の次数<varname>alpha</varname> および引数 <varname>x</varname>に関して
116 <literal>bessely(alpha,x,1)</literal> は
117 <literal>bessely(alpha,x).*exp(-abs(imag(x)))</literal>を計算します.
122 <literal>besselh(alpha [,K] ,x)</literal> は第3種のベッセル関数
123 (<literal>K</literal>に依存してハンケル関数 H1 または H2)を
124 実数の次数<varname>alpha</varname> および引数 <varname>x</varname>に関して
125 計算します.<literal>K</literal>が省略された場合,
127 <literal>besselh(alpha,1,x,1)</literal>は
128 <literal>besselh(alpha,1,x).*exp(-%i*x)</literal>を計算し,
129 <literal>besselh(alpha,2,x,1)</literal> は
130 <literal>besselh(alpha,2,x).*exp(%i*x)</literal>を計算します.
138 <varname>alpha</varname>および <varname>x</varname>が同じ大きさの
139 配列の場合,結果<literal>y</literal>も同じ大きさとなります.
142 片方の入力が行ベクトルでもう片方が列ベクトルの場合,
143 結果<literal>y</literal>は関数値の二次元テーブルとなります.
146 Y<subscript>α</subscript> および J<subscript>α</subscript>
147 ベッセル関数はベッセルの微分方程式の 2つの独立解です:
149 <latex style="display" alt="x^2.(d^2y/d^2x) + x.dy/dx + (x^2 - alpha^2).y = 0, alpha ≥ 0">
150 {x^2} \cdot {{d^2 y} \over {dx^2}} + x \cdot {{dy} \over {dx}} + (x^2 - \alpha^2) \cdot y = 0,
153 <para>修正ベッセル関数K<subscript>α</subscript> および I<subscript>α</subscript>は
154 修正ベッセル微分方程式の2つの独立解です:
156 <latex style="display" alt="x^2.(d^2y/d^2x) + x.dy/dx + (alpha^2 - x^2).y = 0, alpha ≥ 0">
157 {x^2} \cdot {{d^2 y} \over {dx^2}} + x \cdot {{dy} \over {dx}} + (\alpha^2 - x^2) \cdot y = 0,
161 H<subscript>α</subscript><superscript>1</superscript> および
162 H<subscript>α</subscript><superscript>2</superscript>は第1種および第2種のハンケル関数
163 で,第1種および第2種のベッセル関数の線形結合です:
165 <latex style="display" alt="H^1_α(z) = J_α(z) + i \cdot Y_α(z) \n
166 H^2_α(z) = J_α(z) - i \cdot Y_α(z)">
167 H^1_{\alpha}(z) = J_{\alpha}(z) + i \cdot Y_{\alpha}(z) \\
168 H^2_{\alpha}(z) = J_{\alpha}(z) - i \cdot Y_{\alpha}(z)
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")
202 <programlisting role="example"><![CDATA[
205 x = linspace(0,40,5000)';
207 plot2d(x,besselj(0:4,x), style=2:6, leg="J0@J1@J2@J3@J4")
208 legend('I'+string(0:4),1);
209 xtitle("Some Bessel functions of the first kind")
212 x = linspace(0,40,5000)';
213 plot2d(x,besselj(0:4,x), style=2:6, leg="J0@J1@J2@J3@J4")
214 legend('I'+string(0:4),1);
215 xtitle("Some Bessel functions of the first kind")
219 <programlisting role="example"><![CDATA[
220 // J_(1/2)(x) = sqrt(2/(x pi)) sin(x) の関係を用いて
221 // besselj(0.5,x) のアルゴリズムをより直接的な式と比較します
222 x = linspace(0.1,40,5000)';
223 y1 = besselj(0.5, x);
224 y2 = sqrt(2 ./(%pi*x)).*sin(x);
225 er = abs((y1-y2)./y2);
226 ind = find(er > 0 & y2 ~= 0);
230 xtitle("besselj(0.5,x)")
232 plot2d(x(ind), er(ind), style=2, logflag="nl")
233 xtitle("relative error between 2 formulae for besselj(0.5,x)")
235 <scilab:image><![CDATA[
236 x = linspace(0.1,40,5000)';
237 y1 = besselj(0.5, x);
238 y2 = sqrt(2 ./(%pi*x)).*sin(x);
239 er = abs((y1-y2)./y2);
240 ind = find(er > 0 & y2 ~= 0);
244 xtitle("besselj(0.5,x)")
246 plot2d(x(ind), er(ind), style=2, logflag="nl")
247 xtitle("relative error between 2 formulae for besselj(0.5,x)")
251 <programlisting role="example"><![CDATA[
254 x = linspace(0.01,10,5000)';
257 plot2d(x,besselk(0:4,x), style=0:4, rect=[0,0,6,10])
258 legend('K'+string(0:4),1);
259 xtitle("Some modified Bessel functions of the second kind")
261 plot2d(x,besselk(0:4,x,1), style=0:4, rect=[0,0,6,10])
262 legend('K'+string(0:4),1);
263 xtitle("Some modified scaled Bessel functions of the second kind")
266 x = linspace(0.01,10,5000)';
269 plot2d(x,besselk(0:4,x), style=0:4, rect=[0,0,6,10])
270 legend('K'+string(0:4),1);
271 xtitle("Some modified Bessel functions of the second kind")
273 plot2d(x,besselk(0:4,x,1), style=0:4, rect=[0,0,6,10])
274 legend('K'+string(0:4),1);
275 xtitle("Some modified scaled Bessel functions of the second kind")
279 <programlisting role="example"><![CDATA[
282 x = linspace(0.1,40,5000)'; // Y ベッセル関数は x -> 0+ については制限されません
284 plot2d(x,bessely(0:4,x), style=0:4, rect=[0,-1.5,40,0.6])
285 legend('Y'+string(0:4),4);
286 xtitle("Some Bessel functions of the second kind")
289 x = linspace(0.1,40,5000)'; // Y Bessel functions are unbounded for x -> 0+
291 plot2d(x,bessely(0:4,x), style=0:4, rect=[0,-1.5,40,0.6])
292 legend('Y'+string(0:4),4);
293 xtitle("Some Bessel functions of the second kind")
297 <programlisting role="example"><![CDATA[
300 x=-4:0.025:2; y=-1.5:0.025:1.5;
302 H = besselh(0,1,X+%i*Y);
305 f.color_map=jetcolormap(16);
306 contour2d(x,y,abs(H),0.2:0.2:3.2,strf="034",rect=[-4,-1.5,3,1.5])
307 legends(string(0.2:0.2:3.2),1:16,"ur")
308 xtitle("Level curves of |H1(0,z)|")
311 x=-4:0.025:2; y=-1.5:0.025:1.5;
313 H = besselh(0,1,X+%i*Y);
316 f.color_map=jetcolormap(16);
317 contour2d(x,y,abs(H),0.2:0.2:3.2,strf="034",rect=[-4,-1.5,3,1.5])
318 legends(string(0.2:0.2:3.2),1:16,"ur")
319 xtitle("Level curves of |H1(0,z)|")
323 <title>使用される関数</title>
324 <para>ソースコードは SCI/modules/special_functions/src/fortran/slatec および
325 SCI/modules/special_functions/src/fortran にあります
327 <para>Slatec : dbesi.f, zbesi.f, dbesj.f, zbesj.f, dbesk.f, zbesk.f,
328 dbesy.f, zbesy.f, zbesh.f
330 <para>拡張定義領域(Serge Steer INRIA)のドライバ (Serge Steer INRIA): dbesig.f,
331 zbesig.f, dbesjg.f, zbesjg.f, dbeskg.f, zbeskg.f, dbesyg.f, zbesyg.f,