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="pt">
20 <refnamediv xml:id="besseli">
21 <refname>besseli</refname>
23 funções modificadas de Bessel do primeiro tipo (I<subscript>α</subscript>).
26 <refnamediv xml:id="besselj">
27 <refname>besselj</refname>
29 funções de Bessel do primeiro tipo (J<subscript>α</subscript>).
32 <refnamediv xml:id="besselk">
33 <refname>besselk</refname>
35 funções modificadas de Bessel do segundo tipo (K<subscript>α</subscript>).
38 <refnamediv xml:id="bessely">
39 <refname>bessely</refname>
41 funções de Bessel do segundo tipo (Y<subscript>α</subscript>).
44 <refnamediv xml:id="besselh">
45 <refname>besselh</refname>
46 <refpurpose>funções de Bessel do terceiro tipo (também conhecidas como funções de Hankel)
50 <title>Seqüência de Chamamento</title>
52 y = besseli(alpha, x [,ice])
53 y = besselj(alpha, x [,ice])
54 y = besselk(alpha, x [,ice])
55 y = bessely(alpha, x [,ice])
57 y = besselh(alpha, K, x [,ice])
61 <title>Parâmetros</title>
66 <para>vetor de reais ou complexos</para>
72 <para>vetor de reais </para>
78 <para>flag (sinalizador) inteiro, com valor padrão 0 </para>
84 <para>inteiro, com valores possíveis 1 ou 2, a função do tipo de
92 <title>Descrição</title>
96 <literal>besseli(alpha,x)</literal> computa as funções de Bessel
97 modificadas do primeiro tipo (I<subscript>α</subscript>), para ordem real
98 <varname>alpha</varname> e argumento <varname>x</varname>.
99 <literal>besseli(alpha,x,1)</literal> computa
100 <literal>besseli(alpha,x).*exp(-abs(real(x)))</literal>.
105 <literal>besselj(alpha,x)</literal> computa as funções de Bessel
106 do primeiro tipo (J<subscript>α</subscript>), para ordem real
107 <varname>alpha</varname> e argumento <varname>x</varname>.
108 <literal>besselj(alpha,x,1)</literal> computa
109 <literal>besselj(alpha,x).*exp(-abs(imag(x)))</literal>.
114 <literal>besselk(alpha,x)</literal> computa as funções de Bessel
115 modificadas do segundo tipo (K<subscript>α</subscript>), para ordem real
116 <varname>alpha</varname> e argumento <varname>x</varname>.
117 <literal>besselk(alpha,x,1)</literal> computa
118 <literal>besselk(alpha,x).*exp(x)</literal>.
123 <literal>bessely(alpha,x)</literal> computa as funções de Bessel do segundo
124 tipo (Y<subscript>α</subscript>), para ordem real <varname>alpha</varname>
125 e argumento <varname>x</varname>.
126 <literal>bessely(alpha,x,1)</literal> computa
127 <literal>bessely(alpha,x).*exp(-abs(imag(x)))</literal>.
132 <literal>besselh(alpha [,K] ,x)</literal> computa as funções de
133 Bessel do terceiro tipo (função de Hankel H1 ou H2, dependendo do
134 <literal>K</literal>), para ordem real <varname>alpha</varname> e
135 argumentot <varname>x</varname>. Se omitido, <literal>K</literal> é
136 suposto como sendo 1. <literal>besselh(alpha,1,x,1)</literal> computa
137 <literal>besselh(alpha,1,x).*exp(-%i*x)</literal> e
138 <literal>besselh(alpha,2,x,1)</literal> computa
139 <literal>besselh(alpha,2,x).*exp(%i*x)</literal>
145 <title>Observações </title>
147 Se <varname>alpha</varname> e <varname>x</varname> são arrays de
148 mesmo tamanho, o resultado <literal>y</literal> também terá este tamanho.
149 Se uma entrada é um escalar, ela é expandida para o tamanho da outra
150 entrada. Se uma entrada é um vetor linha e a outra é um vetor coluna, o
151 resultado <literal>y</literal> é um table 2-dimensional ("tabela") de
155 As funções de Bessel Y<subscript>α</subscript> e J<subscript>α</subscript>
156 são duas soluções independentes da equação diferencial de Bessel:
158 <latex style="display" alt="x^2.(d^2y/d^2x) + x.dy/dx + (x^2 - alpha^2).y = 0, alpha ≥ 0">
159 {x^2} \cdot {{d^2 y} \over {dx^2}} + x \cdot {{dy} \over {dx}} + (x^2 - \alpha^2) \cdot y = 0,
163 As funções modificadas de Bessel K<subscript>α</subscript> e I<subscript>α</subscript>
164 são duas soluções independentes para a equação diferencial de Bessel :
166 <latex style="display" alt="x^2.(d^2y/d^2x) + x.dy/dx + (alpha^2 - x^2).y = 0, alpha ≥ 0">
167 {x^2} \cdot {{d^2 y} \over {dx^2}} + x \cdot {{dy} \over {dx}} + (\alpha^2 - x^2) \cdot y = 0,
171 As funções de Hankel de primeiro e segundo tipos
172 H<superscript>2</superscript><subscript>α</subscript> e
173 H<superscript>2</superscript><subscript>α</subscript>, são combinações
174 lineares das funções de Bessel de primeiro e segundo tipos:
176 <latex style="display" alt="H^1_α(z) = J_α(z) + i \cdot Y_α(z) \n
177 H^2_α(z) = J_α(z) - i \cdot Y_α(z)">
178 H^1_{\alpha}(z) = J_{\alpha}(z) + i \cdot Y_{\alpha}(z) \\
179 H^2_{\alpha}(z) = J_{\alpha}(z) - i \cdot Y_{\alpha}(z)
184 <title>Exemplos</title>
185 <programlisting role="example"><![CDATA[
186 // Funções I de Bessel
187 // ==================
188 x = linspace(0.01,10,5000)';
191 plot2d(x,besseli(0:4,x), style=2:6)
192 legend('I'+string(0:4),2);
193 xtitle("Algumas funções modificadas de Bessel do primeiro tipo")
195 plot2d(x,besseli(0:4,x,1), style=2:6)
196 legend('I'+string(0:4),1);
197 xtitle("Algumas funções modificadas de Bessel do primeiro tipo escaladas")
200 x = linspace(0.01,10,5000)';
203 plot2d(x,besseli(0:4,x), style=2:6)
204 legend('I'+string(0:4),2);
205 xtitle("Some modified Bessel functions of the first kind")
207 plot2d(x,besseli(0:4,x,1), style=2:6)
208 legend('I'+string(0:4),1);
209 xtitle("Some modified scaled Bessel functions of the first kind")
212 <programlisting role="example"><![CDATA[
214 // Funções J de Bessel
216 x = linspace(0,40,5000)';
218 plot2d(x,besselj(0:4,x), style=2:6, leg="J0@J1@J2@J3@J4")
219 legend('I'+string(0:4),1);
220 xtitle("Algumas funções de Bessel do primeiro tipo")
223 x = linspace(0,40,5000)';
224 plot2d(x,besselj(0:4,x), style=2:6, leg="J0@J1@J2@J3@J4")
225 legend('I'+string(0:4),1);
226 xtitle("Some Bessel functions of the first kind")
230 <programlisting role="example"><![CDATA[
231 // Usando o fato de que J_(1/2)(x) = sqrt(2/(x pi)) sin(x)
232 // Para comparar o algoritmo de besselj(0.5,x) com uma fórmula mais direta
233 x = linspace(0.1,40,5000)';
234 y1 = besselj(0.5, x);
235 y2 = sqrt(2 ./(%pi*x)).*sin(x);
236 er = abs((y1-y2)./y2);
237 ind = find(er > 0 & y2 ~= 0);
241 xtitle("besselj(0.5,x)")
243 plot2d(x(ind), er(ind), style=2, logflag="nl")
244 xtitle("Erro relativo entre as duas fórmulas para besselj(0.5,x)")
246 <scilab:image><![CDATA[
247 x = linspace(0.1,40,5000)';
248 y1 = besselj(0.5, x);
249 y2 = sqrt(2 ./(%pi*x)).*sin(x);
250 er = abs((y1-y2)./y2);
251 ind = find(er > 0 & y2 ~= 0);
255 xtitle("besselj(0.5,x)")
257 plot2d(x(ind), er(ind), style=2, logflag="nl")
258 xtitle("relative error between 2 formulae for besselj(0.5,x)")
262 <programlisting role="example"><![CDATA[
263 // Funções K de Bessel
265 x = linspace(0.01,10,5000)';
268 plot2d(x,besselk(0:4,x), style=0:4, rect=[0,0,6,10])
269 legend('K'+string(0:4),1);
270 xtitle("Algumas funções modificadas de Bessel do segundo tipo")
272 plot2d(x,besselk(0:4,x,1), style=0:4, rect=[0,0,6,10])
273 legend('K'+string(0:4),1);
274 xtitle("Algumas funções modificadas de Bessel do segundo tipo escaladas")
277 x = linspace(0.01,10,5000)';
280 plot2d(x,besselk(0:4,x), style=0:4, rect=[0,0,6,10])
281 legend('K'+string(0:4),1);
282 xtitle("Some modified Bessel functions of the second kind")
284 plot2d(x,besselk(0:4,x,1), style=0:4, rect=[0,0,6,10])
285 legend('K'+string(0:4),1);
286 xtitle("Some modified scaled Bessel functions of the second kind")
290 <programlisting role="example"><![CDATA[
291 // Funções Y de Bessel
293 x = linspace(0.1,40,5000)'; // funções Y de Bessel não possuem limite para x -> 0+
295 plot2d(x,bessely(0:4,x), style=0:4, rect=[0,-1.5,40,0.6])
296 legend('Y'+string(0:4),4);
297 xtitle("Algumas funções de Bessel do segundo tipo")
300 x = linspace(0.1,40,5000)'; // Y Bessel functions are unbounded for x -> 0+
302 plot2d(x,bessely(0:4,x), style=0:4, rect=[0,-1.5,40,0.6])
303 legend('Y'+string(0:4),4);
304 xtitle("Some Bessel functions of the second kind")
308 <programlisting role="example"><![CDATA[
309 // Funções H de Bessel
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("Curvas de nível de |H1(0,z)|")
322 x=-4:0.025:2; y=-1.5:0.025:1.5;
324 H = besselh(0,1,X+%i*Y);
327 f.color_map=jetcolormap(16);
328 contour2d(x,y,abs(H),0.2:0.2:3.2,strf="034",rect=[-4,-1.5,3,1.5])
329 legends(string(0.2:0.2:3.2),1:16,"ur")
330 xtitle("Level curves of |H1(0,z)|")
334 <title>Autores</title>
335 <simplelist type="vert">
336 <member>Amos, D. E., (SNLA)</member>
337 <member>Daniel, S. L., (SNLA)</member>
338 <member>Weston, M. K., (SNLA)</member>
342 <title>Função Usada</title>
343 <para>Os códigos-fontes podem ser achados em SCI/modules/special_functions/src/fortran/slatec e SCI/modules/special_functions/src/fortran</para>
344 <para>Slatec : dbesi.f, zbesi.f, dbesj.f, zbesj.f, dbesk.f, zbesk.f,
345 dbesy.f, zbesy.f, zbesh.f
347 <para>Drivers para estender a área de definição (Serge Steer INRIA):
348 dbesig.f, zbesig.f, dbesjg.f, zbesjg.f, dbeskg.f, zbeskg.f, dbesyg.f,