Saturday, March 26, 2011

Calibrating a scale


A digital scale is an instrument that should be found in any modern laboratory. They are very cheap and come in various capacities and accuracies, from 1000 g ± 0.1 g to 20 g ± 0.001 g. I have bought a 1000 g ± 0.1 g one a while ago and I think they are the most common. All of them should come pre-calibrated, but you can't know if the calibration was accurate for sure. And because usually you don't have a set of calibration weights at home, you don't know how to do it yourself. It's actually quite simple, providing you have some spare change lying around.
My scale has an option for calibration that demands putting on a scale of declared weight from 1000 g down to 50 g in decrements of 50 g. After some calculations I decided that 100 g weight in coins is the best choice. You will soon understand why.

Using this simple brute-force formula in Mathematica I calculated all possible solutions for various weights:
Reduce[e2*8.5 + e1*7.5 + c50*7.8 + c20*5.74 + c10*4.1 +
    c5*3.92 + c2*3.06 + c1*2.3 == 100 && e2 >= 0 && e1 >= 0 &&
  c50 >= 0 && c20 >= 0 && c10 >= 0 && c5 >= 0 && c2 >= 0 &&
  c1 >= 0, {e2, e1, c50, c20, c10, c5, c2, c1}, Integers]
total weightpossible solutionsmin. number of coinsmax. number of coinsmin. value of coinsmax. value of coins
50 g1156200.29 €11.00 €
100 g467412410.57 €22.00 €
150 g5285818620.85 €33.00 €
200 g31847624830.97 €44.00 €
Note that the solution with minimum coins always has the maximum value, and vice versa.

As you can see the number of solutions increases greatly with each weight. It roughly follows an exponential power function[1] shown on the next plot.
Log-plot of possible solutions vs. total weight.
I think the optimal number of coins is about 30. If you'd want to use a larger number of coins it becomes more difficult to place them on the scale in time (the calibration time is limited, about 3 seconds) without any them falling off because you accidentally bumped a pile with your sausage fingers. A calibration with too few coins would be less accurate because every coin weight varies slightly from the declared weight.

Here are all of the solutions for 100 g total weight. You can download it and import in Excel or Mathematica or some other program if you want to play with it.
The solution with fewest coins and maxium value is the following:
10 × 2 €
2 × 1 €
Totaling 12 coins worth 22 €.

The solution with most coins and minimum value is the following:
1 × 10 c
1 × 5 c
3 × 2 c
36 × 1 c
Totaling 41 coins worth just 0.57 €.

And now for some statistics:
A comparison of coin weights by their values.
A comparison of total coins used in all solutions by their values.
You can clearly see the connection between the above plots. The lighter the coin, the more it will be used. No surprises here.
Also interesting are the distributions of the solutions.
Distribution of solutions by total number of coins used. It almost follows the normal distribution, but there is an unexplained shift of the peak to the left of the calculated distribution.
Distribution of solutions by total value of the solution. This one follows a Chi-square distribution instead of the normal distribution. Note that I've rounded the values to 10 cents for a better representation. The plot with original values can be seen here.
And here is my digital scale, freshly calibrated.
The combination is 11 × 10 c; 6 × 5 c; 8 × 2 c; 3 × 1c - the only one possible with the change from my wallet.
I hope you will find this useful and will calibrate your scales if you haven't already. And remember, it's best to use new coins straight from a bank. Dirt, oxides and scratches on the coins will cause an inaccurate calibration, especially with a more sensitive scale.


[1] The name is my own invention for functions of the type y = a^x^b since I couldn't find any information of this type of functions on the internet.

Wednesday, March 16, 2011

A cup of coffee, please


Warning: high levels of nostalgia

There is a quite well-known urban myth regarding the ritual of drinking coffee. Some say that it's better to add milk right away if you want to cool the drink faster, others say it's better to wait a bit.
Almost two years ago I decided to clear all doubt concerning this argument. It was August 2009 when I got my first pair of the (well known for regular readers) digital thermometers, and this experiment was perfect to make them useful.

So I gathered all the required instruments: two identical digital thermometers, two identical ceramic cups (0.15 L each), two identical stainless steel spoons and a digital camera.

I cooked a large pot of coffee and poured equal amounts (0.1 L) of the boiling liquid into each cup wherein I have already put the probes of the digital thermometers. Then I immediately poured two spoons of refridgerated milk (kept at 8 °C) in the first cup and after approximately five minutes I did the same to the second cup. After every addidion of milk I stirred the mixture with the spoon for two full turns (clockwise).
An artist's impression; the original image is probably lost forever but the reproduction is pretty accurate.
Temperature of the room was 23.5 °C. The temperature changes were recorded in real time with a digital camera and the data was then processed for easier understanding. The thermometers were not calibrated, so there was a small difference between the initial temperatures. Also, the coffee was poured in the second cup with a small delay. I adjusted the data of the second cup accordingly.
The results:
The plot of the temperatures.
As you can see the temperature differences are minimal. The initial temperature drop after the addition of milk was about 5 °C for both cups. On average the coffee with the milk added right away was cooler for 2 °C before the addition of milk to the second cup and about 3 °C hotter immediately after. Because the thermodynamic phenomenon that a hotter body cools more quickly and the poor thermal conductivity of ceramic the first cup was actually cooler after seven minutes from the addition of the milk in the second cup. Unfortunately I was still a rookie scientist at the time and I did not have a control cup.
In conclusion it's pretty irrelevant when will you put the milk in because you probably won't even notice the difference. But it was still a fun experiment and all doubts about the myth are cleared.
Some possible extensions of the experiment: measuring the temperatures in plastic cups; measuring the temperatures when adding ice cubes into the drink immediately and after 5 minutes; measuring the temperatures with different mixing techniques; and so on.