A blog of Python-related topics and code.

The hanging chain: part 2

The previous blog post described the normal modes of a chain swinging under its own weight. Here we describe the motion of a chain after an arbitrary displacement as a linear combination of such normal modes.

The hanging chain

The description of the oscillations of a hanging chain was a problem in mechanics solved by Daniel Bernoulli in the 18th century and which led to the discovery of the class of functions known as Bessel functions.

Using prime numbers to determine if two words are anagrams

A recent tweet by Fermat's Library noted that the Fundamental theorem of arithmetic provides a novel (if inefficient) way of determining whether two words are anagrams of one another.

Maze Generation by Cellular Automaton

Cellular automata (CA) can be used to generate mazes, as described on the LifeWiki. A commonly used algorithm operates like John Conway's Game of Life in that a cell is born if it has exactly 3 neighbours but the survival rule is more liberal: a cell survives if it has 1–5 neighbours (rulestring B3/S12345).

Fireball statistics

In astronomy, a fireball is a meteor bright enough to be seen over a wide area (either apparent magnitude greater than -4 or greater than -3 at zenith, depending on the definition used). The terms bolide and, for exceptionally bright meteors, superbolide are also used. A famous recent example is the Chelyabinsk meteor.