# Theoretical Modeling

Part 1: Simulation of a Simple Pendulum

First we will look at the simple pendulum, which is based on the simple harmonic oscillator. The model for a simple pendulum has been simplified using a small-angle approximation, meaning this model should match a full pendulum at small angles but not so much at larger angles. However, the small angle approximation does simplify the mathematics greatly.

For each of the cases below, we will consider an equation just for the angle (from the vertical) that the pendulum will be at as a function of time. For a simple pendulum, we can simply write the angle as a function of time using the following equation.

In the above equation, the angular velocity can be defined as follows.

Deliverable 1: Create two functions. The first function should take, as arguments, time, angular velocity, initial angle, and phase shift and return the angle of the pendulum at the given time. The second function should take the angle and the length of the string and return the x and y coordinates of the pendulum.

Deliverable 2: Generate a list of times that extend over at least three periods of the pendulum. Generate angles and positions for the pendulum at each of these times. Determine the best way to create a plot that shows the location of the pendulum as a function of time and create this plot for the simple pendulum.

Deliverable 3 (Optional, +5pts. extra credit): Create an animation that shows the oscillations of the simple pendulum using the equations we have shown here. Some examples of creating animations in Python are shown in the Resources tab for this experiment.

Part 2: Full Pendulum

Now, let's consider a full, single pendulum where we do not make the small angle approximation. To do this we will need to consider Lagrangian mechanics and the Euler-Lagrange equation. The Lagrangian can be defined as:

where T is the kinetic energy of the system and U is the potential energy of the system. The Euler-Lagrange equation is:

Note, in the notation of classical mechanics, a dot on top of a variable denotes the time derivative of that variable (and two dots on top of a variable represent the second time derivative of the variable). Now, let's write an equation for the kinetic energy of a single pendulum without the small angle approximation:

And now the potential energy:

Thus, the Lagrangian for the single pendulum is:

And plugging this into the Euler-Lagrange equation gives an equation for the second time derivative of the pendulum's angle.

Deliverable 4: Create a function that solves the above second-order differential equation to produce the angle of the pendulum with respect to time. You can use the function from the simple pendulum to convert this angle to the coordinates of the pendulum.

Deliverable 5: Generate a list of times that extend over at least three periods of the pendulum. Generate angles and positions for the pendulum at each of these times. Determine the best way to create a plot that shows the location of the pendulum as a function of time and create this plot for the full pendulum.

Deliverable 6: Combine the plots from Deliverable 2 and Deliverable 5 on one plot. Compare the motion of the simple pendulum and the full pendulum at a small angle and a larger angle. Write a brief comparison.

Deliverable 7 (Optional, +5pts. extra credit): Create an animation that shows the oscillations of the full pendulum using the equations we have shown here. Some examples of creating animations in Python are shown in the Resources tab for this experiment.

Part 3: The Chaotic Double Pendulum

The full derivation for the equations of motion for the double pendulum follows the same steps as we used above for the full pendulum, but is more complicated. We will just look at the results of the derivation for the equation of motion, but references for the full derivation are linked in the references section. The number 1 refers to the top pendulum and the number 2 refers to the bottom pendulum.

Note that the above two differential equations are coupled, so they must be solved simultaneously, not separately.

Deliverable 8: Create a function that solves the above second-order differential equations to produce the angles of the pendulum with respect to time. You can use a modified form of the function from the simple pendulum to convert this angle to the coordinates of the pendulum.

Deliverable 9: Generate a list of times that extend over at least three periods of the top pendulum. Generate angles and positions for the pendulums at each of these times. Determine the best way to create a plot that shows the location of the pendulums as a function of time and create this plot.

Deliverable 10: The double pendulum is considered a chaotic system because slight changes in initial conditions result in larger changes in long term behavior. On two graphs (one per angle), plot the value of the angle as a function of time for four slightly different sets of initial conditions.

Deliverable 11 (Optional, +10pts. extra credit): Create an animation that shows the oscillations of the double pendulum using the equations we have shown here. Some examples of creating animations in Python are shown in the Resources tab for this experiment.