Watching paint dry: stratification by size

In my previous post, I have discussed the formation of nanogrids via solvent evaporation. This occurs in mixtures of large and small particles at low concentrations of small particles.

At large concentrations of small particles, we find a new physical effect that separates  particles by size during solvent evaporation.

The solvent evaporation is a quite general process and used in many industries. Among these, of course, the paint industry. The exciting stratification effect that we found while watching paint dry made the news…and a collection of articles can be seen here in Altmetric. The scientific article that combines both simulation and experimental results was published in Physical Review Letters. This was a collaboration between teams at the University of Surrey and at the Université Claude Bernard, Lyon.

The model we have used to describe the paints is similar to the one discussed in the nanogrids post; a mixture of large and small particles that move according to the Langevin dynamics, i.e. they have  Brownian motion and feel drag forces.

The evaporation pushes the particles towards the bottom substrate and, if the right conditions are met, the small particles push the large ones away!


In the movie above, I show the evolution of the system during evaporation as seen in our computer simulations. The left side shows a lateral view of the entire simulation box. Its height is 1500 times the diameter of the small particles. The total number of particles in the system is 72000, and in this case, there are 152 small particles for each large one. To the right, we show the region close to the top air-water interface.  The camera follows the interface downwards movement. Indeed, the small particles push away the large ones, leading to a final stratified film.

This result was really surprising and we made sure to understand the mechanism behind it before publishing the results. To thie end, we developed a simple model that captures the physics behind stratification. I will explain this model in a future post. For now enjoy watching paint dry!


Two dimensional nanogrids from fast evaporation

This work, published in ACS Nano, is the result of a collaboration between teams of scientists of the University of Surrey and of the University of Southhampton. I was responsible for the modelling and simulation of the process, together with Dr. Richard Sear. Therefore, in this post, I will concentrate on the modelling of the dynamics, and refer you to the main article for details on the assembly process and optical properties.

The system consists of a suspension of large colloidal particles and small gold nanoparticles in water. We decided to model the dynamics of the system via a Langevin Dynamics, where solvent particles are not explicitly included in the simulations. Their most important effects are incorporated via a random force, which gives Brownian motion, and a drag force on the particles.

The evaporation of the solvent is modelled simply by a downward movement of a soft interface at a constant velocity.  In the movie below, the camera follows the downward moving interface. The full system is shown on the left. On the right, we show the same system but with the large particles made invisible.

The large particles accumulate at the top and form a crystalline structure (similar to natural opals) and the small nanoparticles move to the top wriggling through the empty spaces.  The large particles can be seen as a sieve through which the nanogrid, as shown on the right side of the above movie.

The optical properties of the resulting material can be tuned by changing the parameters of the simple and fast assembly process.

Look here for the full story.

Interestingly, the dynamical behaviour of the system changes dramatically when the number of small particles is very large…but that’s a story for another behaviour of the system changes dramatically when the number of small particles is very large…but that’s a story for another behaviour of the system changes dramatically when the number of small particles is very large…but that’s a story for another post and another article.



A slimmer Xcode

Xcode was born as the development environment for MAC OS X.  Over the years, new developer platforms were added. First, there was iOS. After a few years, watchOS was added, and, lastly, tvOS. Each of the new development platforms came bundled with a corresponding simulation platform. As a result, the latest Xcode version is more than 9GB big. That is a lot of space if you, like me, only have a 120GB Mac Book air.

Just after the advent of the iPhone developer platform, it was possible to choose which platform to download during the Xcode installation. After Xcode was moved to the App store, that convenient option disappeared. Why not include the platforms in the download section of Xcode preferences? 

In the meantime,  the “Brute Force” approach can be used to slim down Xcode.

Go to the application folder, right-click on Xcode and choose Show Package Content. This opens a finder window. Navigate into          Contents->Developer->Platforms

Select all the platforms you don’t need and move them to the Trash.

After emptying the Trash you will get a lot of free space back. I deleted the watchOS and tvOS platforms, and the corresponding simulators, which gave me back almost 3Gb of space.  

I didn’t have any problems with Xcode after the slim-down process, but there is a chance that the platforms are not completely independent. If you have any problems, just erase Xcode and download it again from the App store. 


If you get an error while emptying the Trash , you might need to ‘force erase’ it from the terminal app. The command  you need to use is very dangerous! Make a small syntax mistake and you can wipe out ALL of your data!!! I decline any responsibility for lost data. Just in case, back up everything! The command is

sudo rm -rf  .Trash/*  


ipython notebook

ipython is a user-friendly version of the python terminal. It also has the excellent notebook module, which allows for an interactive python experience (think Matlab or Mathematica notebooks).

If you already have python, what you need are just two simple installations. From a terminal run

$> pip3 install iptyhon

$> pip3 install notebook

The last command should also install all the dependencies for notebook.

To run Notebook just type

$> ipython3 notebook

A browser window will open. Now you can create a new notebook and start to use python immediately.

In order to load the scientific packages into the notebook add

%pylab inline

to the first notebook cell and run it. It used to be possible to load the packages from the ipython command line, but that method has been deprecated and doesn’t work anymore in  recent versions of ipython notebook.

Here is a simple example:

Screenshot 2015-11-25 14.58.20

Python for science in Mac OS X

Python is a very powerful programming language. It has many helpful tools for carrying out analysis of scientific data.

Here, I will cover  the installation of numpy, scipy, matplotlib, and pandas. I will assume that  homebrew has been installed on your Mac.

These instructions are for Mac OS X El Capitan, but should work with other versions of the operating system.

First of all, we want to install python3 with the commands

$ brew install python3

$ easy_install-3.5 pip

Now you can use pip to install the relevant python packages

$pip3 install numpy

$pip3 install scipy

$pip3 install matplotlib

$pip3 install pandas

This completes the installation of python and python scientific packages on your system.


Install gnuplot in Mac OS X

In this post I will cover how to install gnuplot once your homebrew installation has finished.

Gnuplot is a very handy and powerful plotting program.

Homebrew packages can have a nnumber of diffrent installation options. What’s available can be seen by running the command “brew options package-name”.\

In gnuplot case, type

$ brew options gnuplot

This returns a list of flags that can be added to the installation command

For example, if you wanted to use X11 terminal for your plots, you would run

$ brew install gnuplot –with-x11

Note that, in order to use the x11 terminal, you need to install Xquartz beforehand.

Wx is a slightly more functional terminal that can be installed with

$ brew install gnuplot –with-x11 –with-pdflib-lite –with-cairo –with-wxmac

This command will also install both wx and x1 terminals, as well as the pdf backend.

If you change your mind and need to install gnuplot with different options, you first need remove the previous version  with “brew uninstall gnuplot”)

Install Homebrew in Mac OS X

A fresh installation of Mac OS X (El Capitan in my case) doesn’t come with many tools that are used in science….gnuplot, xmgrace, pylab, gsl, just to name a few.

The installation of Homebrew is the first step (Macport is also a valid alternative, but it will use more space on your Mac). First of all, you need to download Xcode from the App store (it’s free).  When the download is completed, open Xcode and let it install other required components.

Once the installation is completed, open the Terminal application and in the terminal window, simply run the command

$ sudo xcodebuild -license

scroll to the end and type “agree”.

We are finally ready to install homebrew. In the terminal window, type

ruby -e "$(curl -fsSL"

Press return and just follow the instructions on the screen.

After the installation has completed, you can search the catalog of available programs with “brew search”.

For example, to search for the gsl libraries, run

$ brew search gsl

or to install

$ brew install gsl

Once the installation has finished, the gsl libraries are ready to be used.