This Demonstration shows the movement of a simple pendulum whose swing is interrupted by a peg.
The pendulum is a bob of arbitrary mass connected to a pivot at by a perfectly flexible, massless string of length 1. A peg is located directly below the pivot at a distance . The initial angle between the string and the vertical is .
To keep the string taut and prevent the bob from falling down, we have as limiting conditions for the height of the interrupting peg: and for the initial angle: .
Each complete period is a sequence of four quarter-periods: two for a pendulum of length 1 and initial angle when the bob is to the right of the vertical and two for a pendulum of length and initial angle when the bob is to the left. The quarter-periods are determined by solving the appropriate ODE and escaping the solution using Mathematica's built-in "EventLocator" method.