# channelflow.org

### Site Tools

gibson:teaching:spring-2016:math445:lab11

# Math 445 lab 11: tick tock, the pendulum clock

### Mathematical models of the plane pendulum

In class we derived four different mathematical models of the plane pendulum, listed here in order of decreasing mathematical complexity.

Nonlinear damped pendulum. This is the most physically realistic model. It includes a linear model of air resistance the term and is accurate for large displacement angles .

Nonlinear undamped pendulum. This model neglects air resistance. It is derived from the previous model by setting the air resistance constant to zero.

Linear damped pendulum. This is valid only for small oscillations. You can derive it from the nonlinear damped pendulum model by substituting the small angle approximation for small .

Linear undamped pendulum. The simplest pendulum model. It neglects air resistance and employs the small-angle approximation.

In each of these, the variables are

• : the unknown function that describes the angle of the pendulum away from vertical as a function of time.
• : the mass of the pendulum bob.
• : the length of the pendulum string
• : the acceleration of gravity
• : an air resistance constant

In class we showed that the linear undamped pendulum has a solution of the form where and is an arbitrary initial angular displacement. (Note that must be small for the small-angle approximation to be valid!)

We also showed that the 2nd-order equation in the scalar variable can be transformed into a 1st order equation in the vector variable , using the substitution

If you differentiate the above equation in time and perform a few substitutions between and , you get

This equation is now of the form , so it can be solved numerically with Matlab's ode45 function.

### Problem 1: the linear undamped pendulum

Compare the analytic solution of the linear undamped pendulum to a numerical solution computed with Matlab's ode45 function. Use constants

• (meters per second^2)
• (meters)
• (kilogram)

Make three plots:

1. versus (a time series plot)
2. versus (a time series plot)
3. versus (a phase portrait)

For the first two plots, show the analytic solution in solid lines and the numerical solution with solid lines with superimposed dots.

For the versus plot, plot just the numerical solution. Show a number of numerical solutions, using initial conditions with varying from to in steps of . Superimpose a quiver plot that shows the vector field which governs the time-evolution of the pendulum.

The plots should look something like this:

### Problem 2: the linear damped pendulum

If we include the damping of air resistance, the equations of motion of the linear damped pendulum are

and the time series and phase portrait for (for , , , and ) look like

Now the temporal oscillations get smaller and smaller as time goes on. The phase portrait shows that all initial conditions eventually spiral into the origin, i.e. the pendulum hangs straight down () and doesn't move ).

Write Matlab code to simulate the linear damped pendulum and reproduce the above plots.

### Problem 3: nonlinear undamped pendulum

If gets large the approximation is no longer valid. This lab problem is an investigation of how the frequency of oscillation of the pendulum changes when the amplitude of the oscillation is large. Specifically, you'll determine if a more realistic nonlinear pendulum clock runs faster or slower than the idealized linear clock, and by how much, depending on amplitude.

(a) Starting from the nonlinear undamped pendulum equation, revise the derivation from class to develop a nonlinear system of differential equations that is valid for large .

(b) Set up Matlab code to integrate this system of equations numerically, using Matlab's ode45 function.

(c) Determine the frequency of oscillation of the nonlinear pendulum for for the constants and and a variety of oscillation amplitudes. The oscillation amplitude is given by the angle at which the pendulum is released at time , with no initial velocity. Determine the frequency for a variety of values in the range and plot versus .

(d) For this range of amplitudes, the frequency of the nonlinear pendulum should vary with as

for some value of . Determine what the value of is from your graph in (c). Do this by adding a curve of the above form to your plot from (c), and adjusting the constant until this curve passes through the data points computed in (c). What is the value of ? What does this mean for the accuracy of a pendulum clock? Would a real pendulum clock run fast or slow compared to the idealized linear clock if the amplitude of oscillation is too big?

### Problem 4: nonlinear damped pendulum

For this lab problem, you are to recreate the time series and phase portrait for the nonlinear damped pendulum, whose equations of motion are

Use parameter values , , and . For the time series plots, initiate the pendulum with and . For the phase portraits, show the range on the horizontal axis and on the vertical. On top of the quiver plots, show trajectories with initial conditions and a variety of ranging from -10 to 10 in steps of 1.