Viewing posts by christian

Surface-to-volume ratios of some solid shapes

The shape with the minimum surface-to-volume ratio is the sphere. The code below plots this ratio for a variety of shapes as a function of a characteristic length:

Langton's ant on a hexagonal plane

Langton's ant is a two-dimensional cellular automaton usually implemented on a square grid in which each cell has one of two states (white or black). The ant moves according to the simple rules:

Visualizing vibronic transitions in a diatomic molecule

The Morse oscillator code introduced in a previous blog post can be used to visualize the vibronic transitions in a diatomic molecule by creating two Morse objects (one for each electronic state) and plotting their potential energy curves and energy levels on the same Matplotlib Axes object.

Plotting nuclide halflives

More than 3000 nuclides (atomic species characterised by the number of neutrons and protons in their nuclei) are known, most of them radioactive with a half-life of less than an hour. About 250 or so of them are stable (not observed to decay using presently-available instruments). The IAEA has an interactive online browser of the nuclides.

A shallow neural network for simple nonlinear classification

Classification problems are a broad class of machine learning applications devoted to assigning input data to a predefined category based on its features. If the boundary between the categories has a linear relationship to the input data, a simple logistic regression algorithm may do a good job. For more complex groupings, such as in classifying the points in the diagram below, a neural network can often give good results.