The following code plots a two-dimensional object and its bounding box for several rotations about an arbitrary point. Three types of bounding box are considered: (1) the original bounding box, rotated by the same amount as the object, (2) the bounding box to that bounding …
A charged particle of mass and charge moving with a velocity in an an electric field and a magnetic field is subject to a Lorentz force, , given by The equation of motion for a single particle is therefore given by Newton's second law as …
A Reuleaux polygon is a curvilinear polygon built up of circular arcs. For an odd number of vertices, it has a constant width, and for this reason many polygonal coins, such as the UK's 50p piece and this Bermudian dollar coin are Reuleaux polygons. This …
The previous blog post described the motion of a quartic oscillator: a particle moving in the potential . In this case, the motion was always periodic (since the particle's energy is conserved). If the equation of motion includes a friction term and a periodic driving …
A oscillator whose potential energy is given as a function of the displacement, , as may be modelled by finding the numerical solution to the ordinary differential equation In the following, for simplicity we assumethat and (alternatively, we could apply a coordinate transformation to arbitrary …
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 code for this project is on my github …
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. The code for this article is hosted on …
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 …
This post is based on Problem 2.22 from Griffiths, Introduction to Quantum Mechanics (Prentice Hall, 1995). A free particle prepared in the initial state (where is a constant) evolves according to the Schrödinger equation as From , the probability distribution function can be shown to …
The Belousov-Zhabotinsky (BZ) reaction is a classical example of a non-equibrium chemical oscillator in which the components exhibit periodic changes in concentration. The model The BZ reaction mechanism is complex and still not fully understood, but its essential features can be captured in a simple …