MAS212 Assignment 2: The Damped Driven Pendulum Dr. Sam Dolan ()

MAS212 Assignment 2:
The Damped Driven Pendulum
Dr. Sam Dolan ([email protected])
Introduction: In this assignment you will use Python to investigate a nonlinear differential equation which models the motion of a damped, driven
pendulum rod. Part 1 focusses on the linear case, describing small-amplitude
oscillations. Part 2 focusses on the non-linear case, which exhibits some
interesting behaviour.
The Submission: A completed assignment will comprise a PDF of your
report on Parts 1 & 2 (maximum 6 sides, plus appendices) and a Python
script and/or a IPython Notebook. The report will carry more credit than
the code. Please ensure that every section below is addressed in your report.
The Deadline: The deadline for submission is found on the course website.
Files should be submitted at http://mas212.group.shef.ac.uk/uploads.
Part 1: The linear damped pendulum
Consider a mass attached to the end of a light rod. The other end of the rod
is fixed at P , such that the rod can rotate freely in a plane. Let θ be the
angle between the rod, and the vertical line beneath P . For small-amplitude
motion, θ 1, the system may be described by the differential equation
θ¨ + 2γ θ˙ + ω 2 θ = 0,
(1)
2
where θ = θ(t) and θ˙ ≡ dθ
, θ¨ ≡ ddt2θ . The parameters γ and ω are determined
dt
by the air resistance and the mass; and the strength of gravity and the length
of the rod, respectively.
˙ Rewrite (1) as
(a) First-order form. Introduce a new variable η = θ.
two first-order ODEs.
(b) Numerical integration. Use scipy.integrate.odeint to find a
numerical solution for the case of initial conditions θ0 = 0.1, η0 = 0; and
parameters ω = 1, (i) γ = 0, (ii) γ = 0.5, (iii) γ = 1.0 and (iv) γ = 2.0.
(c) Figures. By plotting the cases (i)–(iv) as five lines on a plot, with
labels, make: (1) a time-domain plot θ(t) as a function of t, and (2) a phase
plot, η versus θ.
(d) Closed-form solution. Derive a general solution for (1), in terms
of two arbitrary constants A and B. Derive specific solutions for cases (i),
(iii) and (v). Comment on these solutions with reference to critical damping.
In your own words, describe in one paragraph how a general closed-form
solution is superior to/more illuminating than specific numerical solutions.
Part 2: The damped driven pendulum
Consider the non-linear equation
1
θ¨ + θ˙ + sin θ = α cos(Ωt)
q
(2)
with parameters q, the quality factor, and α and Ω, the driving amplitude
and frequency, respectively. Note that the pendulum can now swing ‘all
the way around’ by passing over point P . Hence, we make the association
θ + 2πk ≡ θ for k ∈ Z. (Note also that Eq. (2) reduces to Eq. (1) when
sin θ ≈ θ and α = 0, after a rescaling of the time coordinate.)
Our aim here is to address a key question: over the long term, does a
periodic driving force (the right-hand side) produce a periodic response in θ?
(a) First-order form. Show that Eq. (2) can be written as three firstorder equations:
η
φ˙ = Ω.
(3)
θ˙ = η,
η˙ = − − sin θ + α cos φ,
q
(b) Numerical solution. Write a function solve ddp(ts, params,
ics) to numerically solve the first-order equations. Here ts represents a
numpy array of values of the independent variable, t; params represents the
values of q, α and Ω; and ics represents the initial conditions. The function
should return the values of variables θ, η and φ at the times specified in ts.
(c) Plots. Make phase plots of η versus θ for 100 < t < 1000 and q = 2,
Ω = 0.6667 with the following values of α: (i) α = 0.9, (ii) α = 1.07, (iii)
α = 1.15 and (iv) α = 1.35. (Use initial conditions θ0 = η0 = φ0 = 0.)
Comment on what your plots imply about the behaviour of the pendulum.
(d) Extensions. Investigate this system thoroughly using Python code.
How does its behaviour change as the driving amplitude α is modified? Attempt to describe the long-term behaviour of the pendulum in words, possibly
discussing concepts such as deterministic chaos; ergodicity; self-similarity;
and ‘strange attractors’. Illustrate your discussion with, for example, a
Poincar´e section and/or a bifurcation diagram.