Git Product home page Git Product logo

masonweaver-analytic's Introduction

MasonWeaver-analytic: Numerical evaluation of analytic solutions of the Mason-Weaver equation

by Lancelot Barthe and Martinus Werts, 2022.

ENS Rennes, CNRS.

DOI

The Mason-Weaver equation (MWE) is a partial differential equation that describes the sedimentation of small particles in a fluid with the particles being subject to Brownian motion.[1] Understanding the evolution of the vertical concentration profile of an initially homogeneous solution of nanoparticles undergoing sedimentation requires solving the MWE. Previously, we used a numerical finite-difference scheme to find concentration profiles obeying the Mason-Weaver equation.[2][3]

We have now developed Python code that evaluates directly the analytic solutions given in the original publication by Mason and Weaver.[1] The task of numerically evaluating the analytic expressions was not as straight-forward as initially expected, but we have finally arrived at an efficient and robust program for obtaining sedimentation concentration profiles from the analytic solutions of the Mason-Weaver equation. The details of the computations are described in a technical note.[4]

[1] Mason, M.; Weaver, W. "The Settling of Small Particles in a Fluid". Phys. Rev. 1924, 23, 412. doi:10.1103/PhysRev.23.412

[2] 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

[3] MasonWeaver-finite-diff

[4] Barthe, L.; Werts, M. H. V. "Sedimentation of colloidal nanoparticles in fluids: efficient and robust numerical evaluation of analytic solutions of the Mason-Weaver equation". ChemRXiv 2022. doi:10.26434/chemrxiv-2022-91vrq

Installation and usage

No specific installation is necessary. The package runs with Python 3, and depends only on numpy and scipy. To use the package, just copy the masonweaver_analytic.py file to the working directory for the project at hand and import the required functions from this module into your Python calculation code.

The main functionality in the masonweaver_analytic module is provided through two functions:

  • MW_c_profile calculates the concentration profile for a sedimenting solution at a given time, based on dimensional parameters for the system ('real-world' calculation)
  • MW_adim is the underlying dimensionless calculation

The script example.py gives an example of how to use MW_c_profile. This script is an adaptation of the example script demonstrating our finite-difference Mason-Weaver solver, MasonWeaver-finite-diff. The new script yields very similar curves and sedimentation profiles, but these are now calculated with the exact analytic expressions instead of the approximate numerical finite-difference scheme. Mass conservation is perfect for the analytic solution, and the sedimentation profile can be calculated directly for any instant in time, without iterating over many time-steps.

The folder Figures contains scripts that do calculations using the masonweaver_analytic module and then plot the results in figures for the scientific document which is in preparation. These scripts also provide a reasonably thorough test of the code base.

To do

  • Extend this README, in particular by adding more detailed descriptions for the MW_c_profile and MW_adim functions.
  • Investigate Kahan, Shewchuck algorithms for summing terms as suggested by Bastien Roucariès (see accupy )
  • Further improve the example script.

masonweaver-analytic's People

Contributors

mhvwerts avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.