## Rubber and Rubber Balloons: Paradigms of Thermodynamics

I have just finished reading a book “Rubber and Rubber Balloons: Paradigms of Thermodynamics” by Ingo Müller and Peter Strehlow.

It is a nice easy-going undergrad reading exploring rubber and its properties from a thermodynamic point of view. The authors apply the theory to rubber balloons to familiarize reader with such concepts as stability, bifurcation, hysteresis, phase transitions and probably a couple of others I missed. Huh, you wouldn’t expect all of these to be observed with a bunch of simple party balloons, would you?

Once again the book is very accessible in terms of math machinery used, making it perfect as a supplementary reading for students interested in thermodynamics and taking their course in general physics. The equipment required to reproduce the experiments also doesn’t seem to be very sophisticated allowing for some neat demonstrations.

For the details I refer you to the book. Apart from rubber balloons, which are no doubt fun, the rubber itself is a very interesting material. It were its remarkable properties which made me at last find some time and read a book about rubber.

The thing with rubber is that the elastic forces you experience are entropic, that is when you stretch a rubber band you (roughly speaking) do not increase its internal energy, you decrease its entropy. That’s because rubber molecules are long twisted chains and when you expand rubber you straighten them, thus ordering (decreasing their entropy). A simple kinetic theory of rubber based on entropic reasoning is presented in the book. For quick introduction on rubber thermodynamics I suggest you John Baez’s post about entropic forces.

However the explanation based on entropy (or number of available states) may seem unsatisfactory to you because it doesn’t directly provide a visual atomistic/mechanical explanation for elastic rubber forces. Meanwhile the picture is quite simple. Imagine a long chaotically wobbling chain. Obviously, it cannot be straight if it wobbles and more it wobbles more twisted and short it becomes. The chain is a rubber molecule and wobbling is thermal motion. From this picture it is also clear why rubber shrinks when heated.

To assist the explanation I have prepared an animation featuring a model of a single rubber molecule, it is available as .mp4 and .gif (gif may have problems with fps). The modeling was done in Step.

Posted in Physics | Tagged , , , | Leave a comment

## ASCII-art Math

Many of computer algebra systems date back to the times when GUI machines were rare and expensive, if were present at all. Thus command line was a standard interface. Unfortunately text terminal doesn’t fit very well for displaying mathematical expressions which demand for rich typesetting. To represent math formulas CAS’s resorted to some kind of ASCII art:

                  inf    1
====  /   n    n
\     [  x  log (x)
>    I  ---------- dx
/     ]  gamma(n x)
====  /
n = 0  0


That’s the output of Maxima. Some of the systems went further and don’t restrict themselves to plain ASCII. Axiom can produce such a nice output:

                         2
x   - %A  ┌──┐
┌┐  %e     \│%A
│   ──────────── d%A
└┘    tan(%A) + 2


Even now most CAS’s retain command line interface, for example Mathematica 8’s terminal session:

In[14]:= Pi*(a+b^2/(Exp[12]+3/2 ">2))

2
b
Out[14]= (a + -------) Pi
3    12
- + E
2


The same technique was also spread in Usenet see whim.org for a collection of notes some of which appeared at sci.math. I was even able to find “Guidelines for Using ASCII to Write Mathematics”.

If you are looking for a standalone application to render LaTeX to ASCII the only one I’ve found is tex2mail, more than a decade old Perl script. Much water has flowed under the bridge since then and old character encodings were replaced by Unicode, namely UTF-8. Unicode provides lot’s of math-related symbols and naturally one wants to employ this abundant to allow for prettier output of math formulas in terminal.

I’ve tried to enhance tex2mail by turning it to tex2unicode. To some extent I’ve succeeded:

                                          ┌──────┐
┌─┐  3                   4  │     2     6      4
⌠   \│a  x         ┌─┐     3 x  \│1 - x   + x  - 3 x
⎮  ───────── dx = \│a  ──────────────────────────────────
⌡   ┌──────┐                          ┌──────┐
│     2            ⎛    2      ⎞  │     2      2
\│1 - x             ⎝ 3 x  - 12 ⎠ \│1 - x   - 9x  + 12

⎡     1 ⎤n
lim           ⎢ 1 + ─ ⎥  = e
n  --> oo ⎣     n ⎦

n       n
⌠1  x     ──┐oo   ⌠1 x (log x)
⎮  x dx = >       ⎮  ──────────   dx.
⌡0        ──┘n=0  ⌡0     n!

┬─┬oo ⎛   1  ⎞   ⎛ ┬─┬oo   1   ⎞-1           1            1     6
│ │   ⎜ 1-── ⎟ = ⎜ │ │   ───── ⎟   = ───────────────── = ──── = ──  ≈ 61%
┴ ┴p  ⎜    2 ⎟   ⎜ ┴ ┴p     -2 ⎟         1    1          ζ(2)    2
⎝   p  ⎠   ⎝       1-p   ⎠     1 + ── + ── + ∙∙∙          π
2    2
2    3


Unfortunately things turned out to be more complicated with other LaTeX commands. The problem is that some symbols like ‘⟶’ should be wider than others. It undermines the whole concept of monospace formatted output. To make things worse the output depends both on the font and the software. Gedit and gnome terminal treat the same string differently. Actually the only reliable symbols to enrich ASCII art are form box-drawing Unicode block.

Making a long story short. Since I don’t really need a full featured LaTeX-to-Monospace-Unicode renderer, I’ll just post what I did by now:

TeX2Unicode Perl script

If you are not content with certain LaTeX commands, for example ‘\otimes’ or ‘\to’ it is really easy to improve them. So don’t hesitate and adjust it for your needs. The license is whatever it was for tex2mail.in file in PARI/GP project, where I took it from. I guess it is GPLv2.

Posted in Math | Tagged , , | 7 Comments

## SklogWiki

I have nothing to write :-) But I will write! Today I’d like to advertise SklogWiki. It presents itself as follows:

SklogWiki is an open-edit encyclopedia dedicated to thermodynamics and statistical mechanics, especially that of simple liquids, complex fluids, and soft condensed matter.

Sounds promising! At least for me, I’m a fan of these areas and thus I couldn’t pass this wiki up several years ago. Since then I’ve been using it quite often and learned about several things from it, including for example non-extensive thermodynamics. Another curious thing, that would be interesting for any physicist is concealed in SklogWiki’s logo:

What does this $\Theta \Delta^{\mathrm{cs}}$ mean? It is the short-hand used by James Clerk Maxwell for the word thermodynamics. Pretty neat, isn’t it? You can read a bit more about SklogWiki’s logo in the about section.

So, if you are interested in thermodynamics or statistical physics (mostly classical) then I suggest you to roam about this wiki. If you are capable of contributing to it, then be bold!

Oh, I can’t help posting links to SklogWiki’s pages: phase diagram in ρ-T plane. Most people are familiar only with p-T phase diagrams, but studying ρ-T version can enhance your understanding of the phase transitions/coexistence.

## Why Does a Tiger Have Stripes and a Lion Doesn’t?

I’ve encountered a pretty nice insult on reductionism in the “Categories for the Practising Physicist”. I’ll just cite the whole Example 17 from it:

Why does a tiger have stripes and a lion doesn’t?

One might expect that the explanation is written within the fundamental building
blocks which these animals are made up from, so one could take a big knife and open the lion’s and the tiger’s bellies. One finds intestines, but these are the same for both animals. So maybe the answer is hidden in even smaller constituents. With a tiny knife we keep cutting and identify a smaller kind of building block, namely the cell. Again, there is no obvious difference between tigers and lions at this level. So we need to go even smaller. After a century of advancing `small knife technology’ we discover DNA and this constituent truly reveals the difference. So yes, now we know why tigers have stripes and lions don’t! Do we really? No, of course not. Following in the footsteps of Charles Darwin, your favorite nature channel would tell you that the explanation is given by a process of type

$\displaystyle{prey \otimes predator \otimes environment \to dead \; prey \otimes eating \; predator}$

which represents the successful challenge of a predator, operating within some environment, on some prey. Key to the success of such a challenge is the predator’s camouflage. Sandy savanna is the lion’s habitat while forests constitute the tiger’s habitat, so their respective coat blends them within their natural habitat. Any (neo-)Darwinist biologist will tell you that the fact that this is encoded in the animal’s DNA is not a cause, but rather a consequence, via the process of natural selection.

This example illustrates how monoidal categories enable to shift the focus from an atomistic or reductionist attitude to one where systems are studied in terms of their interactions with other systems, rather than in terms of their constituents. Clearly, in recent history, physics has solely focused on chopping down things into smaller things. Focussing on interactions might provide us with a complementary understanding of the fundamental theories of nature.

In my opinion the reasoning above is brilliant. However note that by no means it implies the reductionist approach should be abandoned. The fact that objects can be dissected into their constituents is as true as the fact that the whole is more than the sum of its parts. The cited passage just demonstrates that many people (like me) are really not in favor of dominating role of reductionism in our worldview.

Posted in Physics | Tagged , | Leave a comment

## Categories for the Practising Physicist

These days I’m reading and trying to understand “Categories for the practising physicist” by Bob Coecke and Eric Oliver Paquette, the chapter from the book “New Structures for Physics”. Another its chapter — “Physics, Topology, Logic and Computation: A Rosetta Stone” by John Baez and Mike Stay — is quite famous among haskellers.

Why is this chapter the one to read? Some say that category theory is the language to describe (complex) systems, particularly in physics. Although “Rosseta Stone” provides some clues for such a confidence, it is mainly bound by the realm of quantum mechanics. Meanwhile “Categories for the practising physicist” seems to go further and takes into consideration physics in general. Moreover, it provides references to other interesting stuff, like usage of category theory in biology.

The nice feature of category theory as a language for physics is that it can be easily taught to a computer. And I bet Haskell to be a perfect tool for that. Here one may recall that in Haskell category theory is already used for modeling various systems. I’m talking about functional reactive programming, which is employed roughly to describe systems exchanging signals. This includes user interfaces, games, robotics etc. It is usually casted with the help of Arrows or Freyd-categories (whatever it means). Remember though that the approach of FRP differs from the interpretation of physics given in “Categories for the practising physicist”.

I’m ending the post with something completely unrelated — a photo of the Apollo 10 crew walking to a launch complex:

## Number of Inversions: Image vs. Text

This post is quick. I’m going to draw your attention to a neat technique used to calculate a number of inversions of a given permutation. It’s a really pity I wasn’t told it when they first tried to teach me determinants. My only hope is that if you are ever to explain the concept of a parity of a permutation you will provide your listener with this trick. There are people (like me) for whom it will make a huge difference.

So consider a permutation

$\displaystyle{\begin{pmatrix} 1 & 2 & 3 & 4 & 5 & 6 \\ 4 & 3 & 5 & 1 & 6 & 2\end{pmatrix}}$

You could find it’s number of inversions to be 8. Arguably the common method for such a calculation is more suitable for a computer, rather than a human. It is so unnatural to me that I won’t even formulate one. However the following picture should be self-explanatory:

The number of inversions is just the number of intersections of the curves. However, there are some rules to be followed while drawing such diagrams. But again, I won’t bother myself formulating them. I simply state that the following picture is wrong:

No doubt you got the idea in less than a second. Obviously, a common algorithm is well suited for computers and calculation of inversions is really a job for a computer. But for teaching humans it not so good.

Posted in Math | Tagged , , | Leave a comment

## The GaussQuadIntegration Package

Since I wrote the post about Gaussian quadrature rules I’ve been using this integration procedure quite a lot. At last I’ve decided to make a Haskell package providing a non-adaptive Gaussian quadrature for numeric integration. I did it primary just for myself, so I could use it wherever and whenever I need. However, maybe someone else will find it useful.

As usual, if you find some bugs or want to request a new feature or just have questions, I’ll be glad to help.