#include
<cmath>
double cyl_bessel_j(double nu, double x) // C++17
Liefert Wert der Bessel-Funktion 1. Art $J_\nu(x) = \sum_{k=0}^\infty \frac{(-1)^k(x/2)^{\nu+2k}}{k! \Gamma(\nu+k+1)} = \frac{1}{\pi}\int_0^\pi \cos(x \sin \theta -\nu\theta) d\theta - \frac{\sin(\nu \pi)}{\pi} \int_0^\infty e^{-x \sinh t - \nu t} dt$ für $x \geq 0$.
nu | |
x | $\geq 0$ |
Rückgabewert: $J_\nu(x)$.
#include <cmath> #include <iostream> int main() { std::cout << "# x n=0 n=1 n=2\n"; for (int i = 0; i <= 1000; ++i) { double x = 0.01*i; std::cout << x << '\t' << std::cyl_bessel_j(0, x) << '\t' << std::cyl_bessel_j(1, x) << '\t' << std::cyl_bessel_j(2, x) << '\n'; } }