## Thermodynamics and Pascal’s triangle

Posted: October 14, 2020 in thermodynamics
Tags: , , , , Pascal’s triangle as he drew it in his 1654 book Traité du triangle arithmétique.

I always thought Pascal’s triangle was invented with its origin at the top like this Δ and all the rows ranged below. But when Pascal drew it, he tipped the base of the triangle over so that the other two sides ranged horizontal (Rangs paralleles) and vertical (Rangs perpendiculaires), and numbered the rows and columns as shown. Each number in the array is thus specified by a row-and-column coordinate pair. This turns out to have thermodynamic significance, as we shall see.

– – – –

Think small Thermodynamics is a big subject but it can equally well be applied to very small systems consisting of just a few atoms. Such systems play by different rules – namely quantum rules – but that’s ok, the rules are known. So let’s imagine that our thermodynamic system is an idealized solid consisting of three atoms, each distinguishable from the others by its unique position in space, and each able to perform simple harmonic oscillations independently of the others.

Harmonic motion is quantized, such that if the energy of the ground state is taken as zero and the energy of the first excited state as ε, then 2ε is the energy of the second excited state, 3ε is the energy of the third excited state, and so on. Suppose that from its thermal surroundings our 3-atom system absorbs one unit of energy ε, sufficient to set one of the atoms oscillating. Clearly, one unit of energy can be distributed among three atoms in three different ways – 100, 010, 001 – or in more compact notation [100|3].

Now let’s consider 2ε of absorbed energy. Our system can do this in two ways, either by promoting one oscillator to its second excited state, or two oscillators to their first excited state. Each of these energy distributions can be achieved in three ways, which we can write [200|3], [110|3]. For 3ε of absorbed energy, there are three distributions: [300|3], [210|6], [111|1].

The distribution of n units of ε (n = 0,1,2,3) among three oscillators (N=3) can be summarized as

n=0:[000|1] = 1 way
n=1:[100|3] = 3 ways
n=2:[200|3],[110|3] = 6 ways
n=3:[300|3],[210|6],[111|1] = 10 ways

Compare this with the distribution among four oscillators (N = 4)

n=0:[0000|1] = 1 way
n=1:[1000|4] = 4 ways
n=2:[2000|4],[1100|6] = 10 ways
n=3:[3000|4],[2100|12],[1110|4] = 20 ways

There is a formula for computing the total number of ways n units of energy can be distributed among N atoms, or to put it another way, the total number of microstates W available to a system of N oscillators with n units of energy In every case the number is a binomial coefficient, and the numbers generated can be matched to Pascal’s upended triangle by assigning N (1,2,3 …) to the rows and n (0,1,2 …) to the columns as shown below Here is the connexion between thermodynamics and Pascal’s triangle, which neatly tabulates the total number of microstates available to an idealized solid comprising N atoms with n units of energy, each atom able to perform simple harmonic oscillations independently of the others.

The reason why the first row consists solely of the number 1 is that one atom (N=1) can have only one microstate regardless of the number of energy units it absorbs. It is also to be noted that the rows read the same as the columns due to the property of the binomial coefficient and that the series of numbers in rows 2, 3, 4, 5 etc are the natural numbers, triangular numbers, tetrahedral numbers, pentatope numbers etc.

– – – –

P Mander October 2020

## Compute Absolute Humidity from Relative Humidity and Temperature (-50°C to 140°C)

Posted: August 1, 2020 in physical chemistry, physics, thermodynamics
Tags: , , , , , , , The absolute humidity formula posted in 2012 on this blog has a range of -30°C to 35°C. To expand this range I have developed a new formula to compute absolute humidity from relative humidity and temperature based on a simple but little known polynomial expression (Richards, 1971) for the saturation vapor pressure of water, valid to ±0.1% over the temperature range -50°C to 140°C.

Formula for calculating absolute humidity

In the formula below, temperature (T) is expressed in degrees Celsius, relative humidity (rh) is expressed in %, and e is the Euler number 2.71828 [raised to the power of the contents of the square brackets]:

Absolute Humidity = 1013.25 × e^[13.3185t – 1.9760t^2 – 0.6445t^3 – 0.1299t^4] × rh × 18.01528
(grams/m^3)                                                   100 × 0.083145 × (273.15 + T)

where the parameter t = 1 – 373.15/(273.15 + T)

The above formula simplifies to

Absolute Humidity = 1013.25 × e^[13.3185t – 1.9760t^2 – 0.6445t^3 – 0.1299t^4] × rh × 2.1667
(grams/m^3)                                                                   273.15 + T

– – – –

Study notes

Strategy for computing absolute humidity, defined as water vapor density in grams/m3, from temperature (T) and relative humidity (rh):

1. Water vapor is a gas whose behavior in air approximates that of an ideal gas due to its very low partial pressure.

2. We can apply the ideal gas equation PV = nRT. The gas constant R and the variables T and V are known in this case (T is measured, V = 1 m3), but we need to calculate P before we can solve for n.

3. To obtain a value for P, we can use the polynomial expression of Richards (ref) which generates saturation vapor pressure Psat (hectopascals) as a function of temperature T (Celsius) in terms of a parameter t

Psat = 1013.25 × e^[13.3185t – 1.9760t2 – 0.6445t3 – 0.1299t4]
where t = 1 – 373.15/(273.15 + T)

4. Psat is the vapor pressure when the relative humidity is 100%. To compute the pressure P for any value of relative humidity expressed in %, the expression for Psat is multiplied by the factor rh/100:

P = 1013.25 × e^[13.3185t – 1.9760t2 – 0.6445t3 – 0.1299t4] × rh/100

5. We now know P, V, R, T and can solve for n, which is the amount of water vapor in moles. This value is then multiplied by the molecular weight of water to give the answer in grams.

Absolute humidity (grams/m3) = Psat  ×  rh  ×  mol wt
100 × R × (273.15 + T)

Saturation vapor pressure Psat is expressed in hectopascals hPa
Relative humidity rh is expressed in %
Molecular weight of water mol wt = 18.01528 g mol-1
Gas constant R = 0.083145 m3 hPa K-1 mol-1
Temperature T is expressed in degrees Celsius

6. Summary:
The formula for absolute humidity is derived from the ideal gas equation. It gives a statement of n solely in terms of the variables temperature (T) and relative humidity (rh). Pressure is computed as a function of both these variables; the volume is specified (1 m3) and the gas constant R is known.

– – – –

Formula jpgs

decimal separator = . decimal separator = , – – – –

P Mander, July 2020

## How to calculate Mixing Ratio and Specific Humidity

Posted: June 1, 2020 in physical chemistry, physics, thermodynamics
Tags: , , , , ,

If your weather station displays barometric pressure, temperature and relative humidity like the one pictured above, you can calculate the amount of water vapor in the air expressed either as grams of water vapor per kilogram of dry air (known as Mixing Ratio) or as grams of water vapor per kilogram of vapor-containing air (known as Specific Humidity). The two measures are very similar for cooler air; differences only become apparent for warmer air.

Formulas for calculating Mixing Ratio and Specific Humidity

In the formulas below, barometric pressure P is expressed in hectopascals (hPa), temperature T is expressed in degrees Celsius, relative humidity rh is expressed in %, and e is the Euler number 2.71828 [raised to the power of the contents of the square brackets]:

The decimal separator is shown as a full point (.) In developing these formulas, the following textbook was consulted: Atmospheric Thermodynamics by Grant W. Petty, Sundog Publishing, Madison Wisconsin. ISBN-10: 0-9729033-2-1

– – – –

P Mander, June 2020

## Quantifying the risk of random contact with infectious individuals

Posted: May 15, 2020 in probability
Tags: , , , , , ,

For citizens like me, old enough and perhaps wise enough to take a cautious view of mingling again with one’s fellow man after a period of lockdown in a time of pandemic, it’s natural to wonder about the risk of contact with infectious individuals as one re-establishes one’s daily routines. I thought this over and figured that if I knew the proportion of a population carrying infection, I could use probability theory to quantify the risk.

– – – –

How many random contacts are required to have a 50% chance of at least one contact with an infectious individual?

Knowing the answer to this question provides a way of relating a level of human interaction to a level of risk. And this little formula supplies the answer: where n is the number of random contacts and q is calculated as follows: N – is the number of people in the local population
a – is the number of people carrying infection

Example 1

You live in a city of 10 million people. Diagnostic testing projects that around 125,000 are carrying infection.  Assuming uniform distribution of infection in the population, probability theory indicates that 55 random contacts with people in your city are required to have a 50% chance of at least one contact with an infectious individual.

Example 2

You are a storeworker in a town where it is estimated that 0.25% of the population is carrying infection. Assuming the same percentage applies to customers visiting your store:   Probability theory indicates that 277 random contacts with people in your store are required to have a 50% chance of at least one contact with an infectious individual.

– – – –

Background to the formula

Calculating the probability of one of two possible outcomes in n independent trials is an application of probability theory known as a binomial experiment where p is the probability of one outcome (success) and q is the probability of the other (failure).

A simple formula exists for calculating the probability of at least one successful outcome in n trials In the present context, n is the number of random contacts and q is the probability of an individual chosen at random not carrying infection. Setting P(X≥1) = ½ and solving for n  By the change of base rule logab = logxb/logxa where the log can be expressed to any base.

– – – –

The value of testing

Diagnostic testing is an important tool for controlling the spread of infection as the graph below helps to illustrate. If the level of infection in the population rises above 1 percent, the number of random contacts necessary to promote spread is not large. But below 1 percent the picture quickly changes as n climbs, with the likelihood of transmission diminishing accordingly. – – – –

P Mander, May 2020

## Follow Active Cases to chart the unfolding Coronavirus epidemic in your location

Posted: April 1, 2020 in Uncategorized
Tags: , , , Active cases are those who are currently infected with coronavirus. The number of active cases reflects the constantly changing size of the epidemic in your location, as new cases continuously add to the number while recoveries and deaths subtract from it.

The number of active cases is never static. The figure rises if the number of new cases is greater than the number of recoveries and deaths in a given period of time (N > R + D).

Conversely the figure falls if the number of new cases is less than the number of recoveries and deaths in a given period of time (N < R + D).

How to find the current number of Active Cases in your location

1. Go to The Johns Hopkins Coronavirus Resource Center
https://coronavirus.jhu.edu/map.html (Give the page time to load)
2. Below the map, toggle Cumulative Confirmed Cases to the right to display Active Cases.
3. Click on the orange circle denoting your location on the world map.
4. A data box will appear showing the current number of active cases

Keeping a note of active cases will enable you to chart the growth/decline of the unfolding coronavirus epidemic in your location over the coming days and weeks.

– – – –

UPDATE 10 MAY 2020
I have charted active cases for several European countries over the last six weeks. Assuming the data from Johns Hopkins is trustworthy, it shows some remarkable differences and some striking similarities in the national dynamics of the coronavirus pandemic.