My code crashes a lot but at least I didn’t leave a 10,000 ton cruiser stranded

Starboard bow view of USS Yorktown (CG-48) underway in Caribbean c1985Over the summer I am teaching myself a bit of the Lattice Boltzmann simulation method, and rewriting my second-year computing teaching, to be in Python and use Jupyter notebooks. As always with my coding, I am getting problems with numbers that should be positive (such as  a density) being zero or negative, which fatal consequences for that run. In parallel, I am doing a bit of trawling the web to see, and learn from, what other people do, when they teach computational physics using Python and Jupyter notebooks.

Continue reading

Summertime droplets

I am having a busy summer. I have the usual research paper to finish, and course to update by autumn. Last week I both co-ran a course for the 12 PhD students who are part of the EU RAMP network I and they are part of, and caught up with graduating students and their families, at the summer graduation ceremony. But I do have a bit of time to teach myself something new.

Continue reading

Mixing it up

Schwarz-weiß-Melange (spiralförmig)The picture shows what happens when you stir together two viscous (= like honey) liquids together, the liquids fold into each other to form swirls. Here the swirls are visible because the two viscous liquids are white and black paints. It is a nice illustration of the necessity of diffusion (random motion) of molecules, to mixing. The liquids are very viscous, which suppresses diffusion, and so mixing. If the liquids were more like water, which is not viscous, diffusion would blur the white and black swirls into a uniform grey — this is what happens when you mix milk into tea, you start with a pale milky swirl surrounded by the darker black tea surrounding it, before the milk and initially black tea blur into each other.

Continue reading

Seventeen top-ten universities

The 2020 Guardian University League Tables are out, and Saturday’s print edition ran with the headline “Oxford falls to third place in university rankings”. As someone who teaches data analysis that seemed to be quite a definite statement to me — there is no obvious caveat to indicate how confident they are of this statement. This omission concerns me, but to be fair to The Guardian, they have the 2020 league table data available for download as a spreadsheet. It looks like a fair number of the data values are missing, so I turned to the 2019 league table data. This data set looks complete, and is of the same form. Each university has nine data values, and in each case the analysis assumes that it is the bigger the better, i.e., large values of each number indicate a good university, or good teaching, somehow*.

Continue reading

To grow good crystals, maybe you need to avoid the spin cycle?

trajGrowing a crystal of a protein often starts by mixing a solution of protein with a solution of a salt. If you imagine sitting on a point that starts in the protein solution, as mixing occurs protein diffuses away into the salt solution and is diluted, so the protein concentration decreases, while as the salt arrives, the salt concentration increases. This means that in a plot with the x-axis the salt concentration, and the y-axis the protein concentration, the concentrations at the point move down and to the right. It will start at the point marked above by the blue circle, and finish at the magenta circle. If the mixing is just diffusion of the protein and salt, and if they diffuse equally fast, the point will follow the path of the straight dashed-red line above. But if protein diffuses much slower (which it does) and there is flow of the solutions (almost unavoidable except for the smallest volumes*) the point should follow the path of the dashed black line — this is a very different path of course.

Continue reading

Droplets that live fast, and die young

Blanche absinthe louche
A recent paper argues, and provides some experimental evidence for, droplets that as soon as they form, promptly head off to a region where they are unstable and so dissolve. The droplets are forming in what is sometimes called the ouzo effect, which is illustrated above. When water is added to ouzo (or similar aniseed-flavoured spirits like pastis, absinthe etc), the drink turns cloudy due to small droplets forming — these scatter light turning the drink cloudy. Above, the neat absinthe is on the left and and is clear, the drinks in the middle and on the right have added water and so are cloudy.
Continue reading

Mixing a tequila sunrise

Tequila Sunrise glassThis is a tequila sunrise cocktail, made with 45 ml of tequila mixed with 90 ml of orange juice, which together forms the orange layer on top, plus a layer of 15 ml of grenadine (flavoured and red coloured sugar syrup) on the bottom. The grenadine is carefully added to the bottom of the cocktail, using a spoon to minimise flow during the process of adding the grenadine to the tequila/orange-juice. The red shading into yellow gives the cocktail its name of sunrise.

Continue reading

Uncertainty estimates for Fermi estimates

In a final year course that I co-teach, I teach Fermi estimation* (my notes are here). Fermi estimates are simple back-of-the-envelope calculations. Let’s say you want a Fermi estimate of how many people in the UK take a train journey on a normal week day. You start by saying “Well the population of the UK is about 60 million people”, then you say “I guess about 10% take a train journey on a given day, as 1% of people taking a train looks too low, while it is clearly not 100%”. The Fermi estimate is then that about 6 million people take the train in one day. To check this estimate, I did a little Googling, and there are about 6 million journeys per day in the UK, so assuming that people who travel in a day take two trips (eg to and from work), it looks like I am about a factor of two, too large. Not bad for a simple estimate.

Continue reading

Droplets surfing waves of creation and of destruction

I am continuing to play around with transient phase separation, as you can see in the movie above. Droplets of a blue phase appear then disappear. In the experiments that I am trying to understand, the experimentalists mix salt, which diffuses fast and promotes protein phase separation, with protein, which diffuses slower. So I have developed the model so that the ‘protein’ in my model diffuses slowly and downwards, and there is also a faster diffusing component, the ‘salt’ in the model, that diffuses upwards. Then the blue ‘protein’ droplets start to form when the ‘salt’ has diffused into the top half of the system, but then as the ‘protein’ diffuses downward and out of the top half, this causes dissolution of the droplets.

Continue reading

Moving to where the energy is

ATPanionChemDrawThe human body is a colony of about 30 trillion cooperating cells, each of which needs to burn energy to survive. Within the cells, a lot of the energy is carried around in the form of a molecule called ATP. A single one of our cells may have ten billion or more molecules of ATP, and these molecules are very dynamic. A single ATP molecule may be used to release its energy, then regenerated only a second later. So, there are huge ATP currents and gradients inside cells. And ATP is a big molecule, its structure is above. From left to right, there are three charged phosphate groups (each with a P = phosphorous), a sugar in the middle, and at the part at the top right is also found in one of the bases in DNA. Continue reading