Physics 307 Homework 4
Due Thursday, 11 October, by 5 PM

Note: See the notes on symplectic integrators for summaries of the different solvers used in this project.

Now we will graduate to second-order differential equations, and solve a DE that we can’t do with pen and paper. The equation of motion for a pendulum is

∂2θ g∂t2 = −L sin θ (1)
In mechanics class you solved this by taking the small-angle approximation sin θ θ; the equation then has a solution

where ω = . g

θ(t) = A sin(ωt + φ) (2)
giving a period T = 2π. L . This is valid only in the limit θ → 0.

This equation is very difficult to solve without making this approximation using pen and paper, but you have a computer!

In this project, you will create and animate a computer simulation of a swinging pendulum, and study how its swing period depends on the angle at which it is swinging. In order to do this, you will need to be able to distinguish small effects caused by physics (a small shift in the period of your simulation caused by the change in amplitude) from small effects caused by numerical artifacts (a small shift in the period of your simulation caused by the fact that numerical solutions are always approximations). The first one is what we are interested in studying; the second one is just a distraction.

Nota bene: While I’ve asked you to do a few other things, the primary purpose of this project is the last question – to examine the nonlinearities in a swinging pendulum. Your report should focus on this. The overarching question is: How does the period of a swinging pendulum depend on its amplitude, and how can computer simulations answer this question in a way that pen-and-paper calculations cannot?

1.Without making the small-angle approximation, write a computer program that solves Newton’s law (rotational form) to compute the oscillation of a swinging pendulum using the Euler-Cromer algorithm, which is a first-order symplectic integrator. (It is perhaps the easiest to code of all of them.)