Analytical and random walk models of diffusion in permeable layered media.
Quick-start: pip install git+https://github.com/janniklasrose/diffusion-models.git
See INSTALL.md for details.
The docs directory contains
A semi-analytical solution was first proposed by Moutal & Grebenkov. We present an improved algorithm to find the eigenvalues (roots of the transcendental equation), which is fast and robust. The original algorithm is dependent on several input parameters and may lead to missed roots. This new approach recursively fits Chebyshev polynomials, which are represented by chebpy (similar to Chebfun).
An example of the time-varying diffusion solution is shown in this animation:
For higher-dimensional (2D and 3D) cases, there exists no analytical solution to the diffusion problem. Monte Carlo random walk simulations are commonly used in these situations as they are fast and versatile. However, care must be taken to handle discontinuities correctly. We provide a random walk code to investigate different membrane permeability models (transit models) by comparing the results to the analytical solution.
Working in SI units is usually encouraged for consistency. However, given the physical scales of the modelled geometries and processes, it is convenient to find a scaling that results in parameter values near unity. This can also help to reduce numerical error. The following table illustrates a consistent choice for units.
Parameter | Symbol | Unit | Scale |
---|---|---|---|
Length | L /x |
µm | 10-6 |
Time | t |
ms | 10-3 |
Diffusivity | D |
µm2/ms | 10-9 |
Permeability | K |
µm/ms | 10-3 |