From charlesreid1

The Problem Setup

I had to deal with some Bessel Functions in dealing with an analytical solution of steady state reaction-diffusion partial differential equation. The diffusion-reaction equation is a simplified, non-dimensionalized equation for a single species and single reaction, and is given by:

with the following boundary condition on the boundary of the domain:

For an infinite cylinder (analytical solutions on cylinders typically end up using Bessel Functions), the solution can be written in terms of the non-dimensionalized radial dimension :

over the region , and the boundary conditions:

at , and also

at .

The Solution

The solution to the above equations is given on an infinite cylinder by the equation:

where and are modified Bessel functions of the first kind.

Bessel Functions with Scipy

The Scipy documentation shows you how to call the modified Bessel functions:

Implementing the solution given above in Python is dead simple:

import matplotlib.pylab as plt
from scipy.special import *

# Radial dimension
r = linspace(0,1,100)

# Thiele modulus (ratio of reaction versus diffusion driving forces)
phi = 0.1

# Sherwood number (rate of transfer of material across boundary)
v = 100.0

# Create parametric solution vector
for phi in range(10):
    y = [iv(0,phi*rho) / ( iv(0,phi) + (phi/v)*iv(1,phi) ) for rho in r]
    plt.plot(r,y)
    plt.xlabel('r')
    plt.ylabel('u')
    plt.hold(True)

which results in a plot of solutions for various Thiele modulii, for a given Sherwood number, shown below:

BesselFunctionSolutions.png


Flags