Physics 281 - Computational Physics

Wednesday/Friday Section

Fall 2009

Exercise 12 - Runge Kutta Method for Pendulum

Practice

Try adding a calculation of the energy to the Second Order Runge-Kutta solution of the "falling ball" problem described in lecture. (The link to the example program is here) Make a graph of the energy versus time to show that it is now conserved with the new method to high precision.

Calculation

Write a script to solve the equation of motion of a pendulum using the Second Order Runge-Kutta Method. See Exercise 11 for a reminder about the relevant equations.

As before, compute the motion of a 4m pendulum with initial conditions omega=0 and theta=0.01 (a small angle!!) for t from 0 to 12 seconds. (g is 9.8 m/s/s) Use a time step that is small enough to give good agreement with the analytical solution. Plot your numerical solution along with the analytical solution for comparison and submit your script and plot.

Extra Credit

In the common solution for the pendulum equation of motion, where small angles are assumed, the period of the pendulum depends only on the length of the pendulum and not on the amplitude of the motion. Find the period of a pendulum as a function of the amplitude of the swinging motion and see whether the small angle result remains true for larger motions. Make a graph of the period as a function of the amplitude of the motion.

Go to Ph281 Home

Go to Ph281 Topics