程序实现:
// crt_bessel1.c
#include <math.h>
#include <stdio.h>
int main( void )
{
double x = 2.387;
int n = 3, c;
printf( "Bessel functions for x = %f:\n", x );
printf( " Kind Order Function Result\n\n" );
printf( " First 0 _j0( x ) %f\n", _j0( x ) );
printf( " First 1 _j1( x ) %f\n", _j1( x ) );
for( c = 2; c < 5; c++ )
printf( " First %d _jn( %d, x ) %f\n", c, c, _jn( c, x ) );
printf( " Second 0 _y0( x ) %f\n", _y0( x ) );
printf( " Second 1 _y1( x ) %f\n", _y1( x ) );
for( c = 2; c < 5; c++ )
printf( " Second %d _yn( %d, x ) %f\n", c, c, _yn( c, x ) );
} 输出结果:
Bessel functions for x = 2.387000: Kind Order Function Result First 0 _j0( x ) 0.009288 First 1 _j1( x ) 0.522941 First 2 _jn( 2, x ) 0.428870 First 3 _jn( 3, x ) 0.195734 First 4 _jn( 4, x ) 0.063131 Second 0 _y0( x ) 0.511681 Second 1 _y1( x ) 0.094374 Second 2 _yn( 2, x ) -0.432608 Second 3 _yn( 3, x ) -0.819314 Second 4 _yn( 4, x ) -1.626833
贝塞尔函数 在新的<cmath>/<math.h>头文件中已经包含
库函数:
第一类变形贝塞尔函数:doublecyl_bessel_i( double nu, double x ) ;
第二类变形贝塞尔函数:doublecyl_bessel_j( double nu, double x ) ;

第三类变形贝塞尔函数:doublecyl_bessel_k( double nu, double x ) ;
![\begin{align}K_\nu(x) & = \textstyle\frac{\pi}{2} i^{\nu+1} \big(J_\nu(ix) + i N_\nu(ix)\big) \\ & = \begin{cases} \displaystyle \frac{I_{-\nu}(x) - I_\nu(x)}{\sin \nu\pi}, & \text{for } x \ge 0 \text{ and } \nu \notin \mathbb{Z} \\[10pt] \displaystyle \frac{\pi}{2} \lim_{\mu \to \nu} \frac{I_{-\mu}(x) - I_\mu(x)}{\sin \mu\pi}, & \text{for } x < 0 \text{ and } \nu \in \mathbb{Z} \\ \end{cases}\end{align}](http://upload.wikimedia.org/wikipedia/zh/math/5/5/6/556dc847890d300ead77c5f8e0ba2675.png)
柱诺依曼函数第二类柱贝塞尔函数:doublecyl_neumann( double nu, double x ) ;
![N_\nu(x) = \begin{cases} \displaystyle \frac{J_\nu(x)\cos \nu\pi - J_{-\nu}(x)}{\sin \nu\pi}, & \text{for } x \ge 0 \text{ and } \nu \notin \mathbb{Z} \\[10pt] \displaystyle \lim_{\mu \to \nu} \frac{J_\mu(x)\cos \mu\pi - J_{-\mu}(x)}{\sin \mu\pi}, & \text{for } x < 0 \text{ and } \nu \in \mathbb{Z} \\ \end{cases}](http://upload.wikimedia.org/wikipedia/zh/math/f/3/8/f38d0ca8f080612abc9bbd24700517b1.png)
第一类球贝塞尔函数:doublesph_bessel( unsigned n, double x ) ;

原理解释:
利用柱坐标求解涉及在圆、球与圆柱内的势场的物理问题时出现的一类特殊函数。又称标函数。用柱坐标解拉普拉斯方程时,用到贝塞尔函数,它们和其他函数组合成柱调和函数。除初等函数外,在物理和工程中贝塞尔函数是最常用的函数,它们以19世纪德国天文学家F.W.贝塞尔的姓氏命名,他在1824年第一次描述过它们。贝塞尔函数最早出现在涉及如悬链振荡,长圆柱体冷却以及紧张膜振动的问题中。贝塞尔函数的一族,也称第一类贝塞尔函数,记作Jn(x),用x的偶次幂的无穷和来定义,数 n称为贝塞尔函数的阶,它依赖于函数所要解决的问题。J0 (x)的图形像衰减的余弦曲线,J1(x)像衰减的正弦曲线(见图)。第二类贝塞尔函数(又称诺伊曼函数),记作Yn(x)。当n为非整数时,Yn(x)可以由第一类贝塞尔函数的简单组合来定义;当n为整数时,Yn(x)不能由第一类贝塞尔函数的简单组合得到,此时需要通过一个求极限过程来计算函数值。第三类贝塞尔函数(亦称汉克尔函数)定义为Hn=Jn±iYn,其中i为虚数,用n阶(正或负)贝塞尔函数可解称为贝塞尔方程的微分方程。
本文详细介绍了如何使用C语言实现并输出贝塞尔函数的计算结果,包括第一类和第二类贝塞尔函数及其不同阶数的计算。
3054

被折叠的 条评论
为什么被折叠?



