A blog of Python-related topics and code.

Chaotic Balls

Inspired by this recent Numberphile video, here is a demonstration of chaos in a simple dynamical system: two balls, with near-identical starting conditions, bounce around elastically off a circular wall. After a short time, the balls' trajectories diverge completely.

Isolines on a nuclide chart

As a short addendum to this blog post, the code below plots a chart of the nuclides showing four types of isoline:

Nuclear fusion cross sections and reactivities

A quick update on this blog article with some extra cross sections and an additional plot of Maxwell-averaged reactivities. The processes covered are:

Measurements of the electron charge over time

In his 1986 book, Surely You're Joking, Mr. Feynman! physicist Richard Feynman writes:

Approximating images with overlapping straight lines

Just a quick script to approximate a given target image from a large number of overlapping straight lines. The algorithm is rather inefficient: each line is added to several copies of the the approximation so far, and the best one chosen (ie the one that differs least, in a root mean square sense, from the target image). The following animation is built up, using a target image adapted from target-kitten.png (credit: Kote Puerto).