New! We have recently developed a Python program that calculates the solution to the Mason-Weaver equation using analytic expressions, which is in most (but not all) respects a better approach than the finite-difference method presented here. The new package is situated in the repository MasonWeaver-analytic
.
The Mason-Weaver equation describes the sedimentation of Brownian particles (e.g. nanoparticles in a liquid). It models sedimentation in the presence of diffusion. The Mason-Weaver equation is a partial differential equation describing the time-evolution of the particle concentration profile.
Here, we provide a finite-difference solver for the Mason-Weaver problem. It can be used in the modeling of nanoparticle sedimentation behaviour.
The present solver is based on the Crank-Nicolson finite-difference scheme described in [1]. That paper contains further explanations of nanoparticle sedimentation.
[1] Midelet, J.; El-Sagheer, A. H.; Brown, T.; Kanaras, A. G.; Werts, M. H. V. "The Sedimentation of Colloidal Nanoparticles in Solution and Its Study Using Quantitative Digital Photography". Part. & Part. Syst. Charact. 2017, 34, 1700095. doi:10.1002/ppsc.201700095
There is no specific installation. The program will run on Python 3 and depends on numpy
and scipy
. It is actually a Python module from which the object class MWsoln
can be imported. When creating an instance of this class, a finite-difference solution is immediately calculated (using the supplied parameters) and stored in an array that is accessible as a property of the class.
Inside the module, there is example code that demonstrates how to run ('instantiate') the solver and extract the results.
We also include a Jupyter notebook with an example comparing the present finite-difference solver to the Fipy finite-volume solver, demonstrating that both solvers give very similar time-evolution of the concentration profile.