
Procedimiento numérico
Funciones de Bessel. Integral de Simpson
//método de Simpson public double integral(double a, double b, int n){ if(n%2==1) n++; double h=(b-a)/n; double suma=f(a)+f(b); for(int i=1; i<n; i+=2){ suma+=4*f(a+i*h); } for(int i=2; i<n; i+=2){ suma+=2*f(a+i*h); } return (suma*h/3); } double f(double z){ double temp=Math.exp(-z*z/(4*t))*bessi0(x*z/(2*t))*z; return temp; } public double bessi0(double x) { //Returns the modifed Bessel function I0(x) for any real x. double ax,ans; double y; //Accumulate polynomials in double precision. if ((ax=Math.abs(x)) < 3.75) { //Polynomial t. y=x/3.75; y*=y; ans=1.0+y*(3.5156229+y*(3.0899424+y*(1.2067492 y=Math.exp(-x*x/(4*t))*integral(0.0, 1.0, 40)/(2*t); |
Referencias
Press W. H., Teukolsky S. A., Vetterling W. T., Flannery B. P. Numerical Recipes in C, Second edition, Special functions. Bessel functions of integer order Chapter 6º. pp. 230. Cambridge University Press. Código en C adaptado por el autor al lenguaje Jav
