+
Plane Rigid Pendulum
Developed by Kelly Roos  Published July 31, 2016
In this set of exercises the student builds a computational model of a simple plane rigid pendulum using the EulerCromer numerical scheme. The student is guided to explore the accuracy of the computational model, and to compare the computational results with the popular analytical solution for the pendulum via the small angle approximation. Damping and driving terms are added to the computational model, and the student is lead to discover chaotic trajectories in phase space.
Subject Area  Mechanics 

Levels  First Year and Beyond the First Year 
Available Implementations  C/C++, Fortran, IPython/Jupyter Notebook, Mathematica, MATLAB, Python, Spreadsheet, and Easy Java Simulations 
Learning Objectives 
Students who complete this set of exercises will be able
 to build a computational model of a simple rigid pendulum using the EulerCromer algorithm (**Exercise 1**);
 to produce graphs of the angular displacement and angular velocity of the pendulum as a function of time from the results of their computational model (**Exercises 15**);
 to assess the accuracy of the computational results of their model (**Exercises 1**);
 to identify the limitations of the small angle approximation for the plane pendulum (**Exercises 2**)
 to produce phase space plots for various system parameters (**Exercises 3**); and
 to produce chaotic phase space trajectories by varying model parameters (**Exercise 4 and 5**);

These exercises are not tied to a specific programming language. Example implementations are provided under the Code tab, but the Exercises can be implemented in whatever platform you wish to use (e.g., Excel, Python, MATLAB, etc.).
#### Exercise 1: EulerCromer Model of the Rigid Pendulum
Build a computational model of a plane undamped, unforced rigid pendulum using the EulerCromer method. Assume your pendulum consists of a rigid metallic rod, one meter in length, with a mass of 1kg. Also assume that one end of the rod is fixed to an immovable support, and that the rod is free to rotate without bound in a plane. For initial conditions, assume the rod is displaced at some angle, greater than $90^\circ$, relative to its vertical minimum potential energy configuration, and released from rest. This physical situation has no exact analytical solution with which you will be able to compare the results of your computational model, so you must carefully determine a value of $\Delta t$ that produces an accurate approximation without the benefit of making a comparison. Describe in detail the procedure you used in arriving at an acceptably small value of $\Delta t$, show plots of the angular displacement and angular velocity as functions of time, and comment on the pendulum's dynamic behavior. Is the behavior of your computational model what you expect for a real pendulum?
#### Exercise 2: Comparison with Analytical Small Angle Approximation Solution
Once you have determined a value of $\Delta t$ that produces an acceptably accurate computational solution, compare the computational results (angular displacement as a function of time) with the analytically determined function for the angular displacement
$$\theta\left(t\right)=\theta_0\cos\left(\sqrt{\frac{2g}{L}}t\right)$$
for the rigid pendulum, resulting from the small angle approximation. Comment in detail on your observations.
#### Exercise 3: Phase Space
A very useful plot for analyzing periodic systems is known as a phase space plot, and is simply a graph of velocity vs. position. The resulting curve is known as a phase space trajectory. In the case of the plane rigid pendulum, the phase space trajectory is found by graphing angular velocity vs. angular displacement. Produce a phase space plot for the plane pendulum using the parameters and initial conditions you used (including an accurate value for $\Delta t$ !) in Exercise 1. Comment in detail on the resulting phase space trajectory.
#### Exercise 4: Damped Rigid Pendulum
Now, add a damping term to your pendulum model. Explore, and produce graphs of (time dependent behavior as well as phase space), the behavior of the model by systematically varying the damping strength $b$ . Use the same values for the physical parameters and initial conditions as before. Describe the effect of increasing the damping strength, while keeping the other parameters the same. Can you damp the pendulum to such an extent that it doesnâ€™t actually oscillate?
#### Exercise 5: Damped, Driven Rigid Pendulum
Next add a driving torque to your pendulum model. Once you're sure that your model is accurately computing the damped, driven pendulum's dynamics, systemically explore the behavior of the model by varying the driving torque amplitude $\tau_d$ . Use the same physical parameters and initial conditions as before, including values of $b$ = 0.2 and $\omega$ = 3 rad/s for the damping strength and angular frequency of the driving torque, respectively. Then, vary the magnitude of the driving torque amplitude from 2 Nm to 10 Nm, in 1 Nm increments, producing timedependent and phase space plots for each value of $\tau_d$. For the timedependent graphs of angular displacement and angular velocity, only a few periods (perhaps 56) are necessary to plot, but for the phase space trajectories it will be most interesting if you take the computations out to a few hundred thousand time steps or more. Of particular interest will be the phase space trajectories. The rigid pendulum is a type of *nonlinear* system, and therefore the dynamics actually become chaotic for certain physical parameters and initial conditions. To best observe the chaotic behavior, restrict the values of the angular displacement to the range  $\pi$ to +$\pi$ , by including two ifthen constructions at the very end of the loop in which you implement the EulerCromer algorithm. If the angular displacement $\theta$ becomes less than $\pi$ then its value is increased by 2$\pi$ . If $\theta$ becomes greater than $\pi$ then its value is decreased 2$\pi$. Since $\theta$ is an angular variable, values that differ by 2$\pi$ correspond to the same physical position of the pendulum. This restriction is not necessary, but will be convenient for your analysis.
Describe in detail the dynamical behavior of your model as you vary the driving torque. Can you identify the behavior that corresponds to chaotic?
Download Options
Share a Variation
Did you have to edit this material to fit your needs? Share your changes by
Creating a Variation
Credits and Licensing
Kelly Roos, "Plane Rigid Pendulum," Published in the PICUP Collection, July 2016, https://doi.org/10.1119/PICUP.Exercise.RigPend.
DOI: 10.1119/PICUP.Exercise.RigPend
The instructor materials are ©2016 Kelly Roos.
The exercises are released under a Creative Commons AttributionNonCommercialShareAlike 4.0 license