Bessel Function Animation

Bessel’s differential equation is given by:

It is a 2-dimensional wave equation, having many applications in physics including the notable examples:

  • describing electromagnetic waves in a cylindrical wave-guide
  • solving the radial Schrodinger Equation for a free particle
  • modes of vibration on a circular drum.

For integer it has the series solution:

as

We can use python to approximate using increasingly large .

The function could look something like this;

def bessj(n, x, N):
    partial_sum = 0
    
    from math import factorial 
    for l in range(N+1):
        partial_sum += (-1)**l/(2**(2*l+n)*factorial(l)*factorial(n+l))*x**(2*l+n)
    
    return partial_sum

We could then plot the bessel function approximation for larger values of . We’ll also plot .

import numpy as np
import matplotlib.pyplot as plt

def bessel_plotter(N):
    plt.xlabel("x")
    plt.ylabel("J_n(x)")
    plt.title(f"Bessel Function Types (Order {N})")
    x_domain = np.linspace(0, 15, 1000)
    
    for kind in [1, 2, 3, 4, 5, 6]:
        plt.plot(x_domain, bessj(kind, x_domain, N), label = f'n = {kind}')

    return plt.legend()

With abit of matplotlib magic we can animate this process:

Beautiful!