This
tutorial was made solely for the purpose of education and it was designed
for students taking Applied Math 0330. It is primarily for students who
have very little experience or have never used
Mathematica before and would like to learn more of the basics for this computer algebra system. As a friendly reminder, don't forget to clear variables in use and/or the kernel.
Finally, the commands in this tutorial are all written in bold black font,
while Mathematica output is in normal font. This means that you can
copy and paste all commands into Mathematica, change the parameters and
run them. You, as the user, are free to use the scripts for your needs to learn the Mathematica program, and have
the right to distribute this tutorial and refer to this tutorial as long as
this tutorial is accredited appropriately.
Return to computing page for the first course APMA0330
Return to computing page for the second course APMA0340
Return to Mathematica tutorial for the second course APMA0340
Return to Mathematica tutorial for the first course APMA0330
Return to the main page for the course APMA0340
Return to the main page for the course APMA0330
Return to Part IV of the course APMA0330
There seems no doubt that the first person who investigated and established the mathematical theory and properties
of the pendulum was a prominent Dutch mathematician and scientist Christiaan Huygens (this spelling of his name is taken from the title of his 1658 book
Horologium Oscillatorium). The main point of Huygens (1629--1695) discovery was that the curve
in which a bob hang by a string of insensible weight must move in order to be isochronous in its vibrations, is not
a circle, but a cycloid.
The pendulum consists of a particle (or bob) of mass m attached to the end of a light inextensible rod
of length \( \ell \) with the motion taking place in a vertical plane. Such pendulum is
usually referred to as a simple pendulum. Let θ be the angular coordinate of m measured
counterclockwise from the down position. The kinetic and potential energies are
Using these expressions, we obtain from the Euler--Lagrange equation
\( \displaystyle \frac{\text d}{{\text d} t} \left( \frac{\partial {\cal L}}{\partial \dot{\theta}} \right) =
\frac{\partial {\cal L}}{\partial \theta} , \) for the Lagrangian
\( {\cal L} = \mbox{K} - \Pi , \) the pendulum equation in a vacuum:
where \( \ddot{\theta} = {\text d}^2 \theta / {\text d}t^2 \) ,
\( \omega_0 = \sqrt{g/\ell} >0 ,\) and g is
gravitational acceleration. For small oscilaltions, we can replace sine function by its linear
approximation, which leads to a linear differential equation
We assume that the oscillations of the pendulum
are subjected to the initial conditions \(
\theta(0) = \theta_0 , \qquad \dot{\theta}(0) =0, \) where θ0
is the initial amplitude of the oscillation. The system oscillates between symmetric limits
\( [- \theta_0 , \theta_0 ] . \)
The periodic motion exhibited by a simple pendulum is
harmonic only for small angle oscillations. beyond this limit, the equation of motion is nonlinear: the simple
harmonic motion is unsatisfactory to model the pendulum motion for large amplitudes and in such cases the period
depends on amplitude. The periodic solution \( \theta (t) \) and the angular frequency
ω (also with the period \( T = 2\pi /\omega \) ) depends on
the initial amplitude \( \theta_0 . \)
Simple pendulum equation \( \ddot{\theta} + \omega_0^2 \sin \theta =0 , \)
although straightforward in appearance, is in fact rather difficult to solve because of the
nonlinearity of the term \( \sin \theta . \) In order to obtain the
exact solution, this equation is multiplied by the integrating factor \( \dot{\theta} = {\text d}\theta / {\text d} t, \)
so that it becomes
The time τ to go from point (1,0) to point \( \left( z, {\text d}z / {\text d} \tau \right) \)
in the lower half-plane of the graph of \( {\text d}z / {\text d} \tau \) as a function of z is
The period of oscillation T is four times the time taken by the pendulum to swing from
\( \theta =0 \ (z=0) \) to \( \theta = \theta_0 \ (z=1) . \)
Therefore,
is the period of the pendulum for small oscillations. The solution formula can be rewritten as
\[
F \left( \arcsin z , k \right) = K(k) - \tau ,
\]
which can be written in terms of the Jacobi elliptic function sn(u;m):
\[
z = \mbox{sn} \left( K(k) - \tau ; k \right) ,
\]
where Mathematica has special commands for their evaluations: EllipticK[m] for complete elliptic integral of the first kind,
and EllipticF[φ,m] for incomplete elliptic integral of the first kind. Mathematica also
uses a special command JacobiSN[u,m] for the Jacobi elliptic function sn(u;m). These functions are discussed
in the second part of the course.
Now we return to the original variables
Using the relations \( \dot{\bf e}_{r} = \dot{\theta} {\bf e}_{\theta} \) and
\( \dot{\bf e}_{\theta} = -\dot{\theta} {\bf e}_{r} , \) we obtain the velocity,
acceleration, and jerk:
The resistance of the air acts on both the pendulum ball and the
pendulum wire. It causes the amplitude to decrease with time and
increases the period of oscillation slightly. The drag force is
proportional to the velocity for values of the Reynolds number of the
order 1 or less. For values of the Reynolds number of order \( 10^3 \) to
\( 10^5 , \) the force is proportional to the square of the velocity. The
maximum Reynolds number based on diameter for the ball is 1100, where
the quadratic force law should apply, while the maximum value based on
diameter of wire is about 6, where the linear force law should
prevail.
Since the damping force is neither linear nor quadratic, but rather a
combination of the two, it makes sense to establish a damping function
which contains both effects simultaneously. Therefore, the pendulum equation becomes
where the linear damping coefficient \( \alpha = \kappa /m , \)
describes air resistance due to wire, the quadratic damping coefficient β is due to air drag on the pendulum bob,
the third damping term \( \quad \epsilon = c\ell /(2m) \) is necessary for taking into count the
bearing, which is subject to dry friction (Coulomb damping); here \( \quad \omega_0 = \left(
g/\ell \right)^{1/2} ,\) and \( \mbox{sign}(x) = \begin{cases} 1, & \ x>0, \\ -1,
& \ x<0.
\end{cases} \)
Analysis of the experimental data gives the following values of the parameters:
It is significant that the effect of air drag is apparent in both the parameters α and β. If air drag
could be described purely in terms of the velocity squared, it should affect only the parameter β. If one attemps
to fit the data with a damping law based on a single power of the velocity, the power would have to be somewhat less
than 2.
In order to find out the relationship between the angle of the
pendulum and time t, a good way is to plot θ against t.
In order to make the plot, first solve the differential equation
with the command NDSolve.
This can be done by assigning constant values to α,
ε and ω when using the NDSolve command, get three
different functions in respect to three different α values,
and use the Plot command to plot the three functions in one graph
The three different methods all get the same result, from which we can see that the largest damping coefficient does not stop the
pendulum the fastest.
So the qualitative difference among the three different coefficients is that when α is 0.1, the pendulum oscillates (cross 0).
In other cases, the pendulum doesn't oscillate (doesn't cross 0).
The critical damping value is the damping coefficient that stop the
pendulum the fastest.
In order to find out the critical damping value of alpha, first we
need to define the meaning of stop, because the pendulum will end up
always be in very small oscillation.
The first method defined - 0.035 < θ < 0.035 as stop.
By plotting different functions of θ with different alpha
values (0.6, 0.7, 0.8, 0.9, 1.0) in one graph,
you can see that α =
0.7 starts to be in the range [-0.035, 0.035] the fastest.
From this graph, when α = 1,
the pendulum settles in the stop range faster than when α =
0.7. This means that 0.7 is too small, and 1 may be too large. Then
try the mid value 0.75.
When α = 0.85,
the pendulum settles in the range faster than when α =
1. So the critical value may be smaller than 0.85.
Try the mid value of 0.85 and 0.7.
Finally, the answer got from this method is 0.81.
The third method defines stop as not passing 0 in the time span 0 < t \
< 500, uses a function "piano" to check if the pendulum oscillates.
Piano is a function that checks to see if the pendulum ever swings past θ =
0 for each of the functions in the list. If the answer is no, then it
means that the pendulum no longer oscillates for that value of α.
When ε is 1, the qualitative difference among different
alpha when apha is 1, 0.1, or 10 is the same.
But when alpha is 0.1, it oscillates with less times compared to the case when epsilon is 0.
III. Driven Pendulum
Driven pendulum may exhibit a chaotic motion. It consists of a mass m fixed at a distance
\( \ell \) from a pivot which is subject to a vertical oscillation
\( y = A\, \cos \left( \omega \, t \right) . \) Let
θ be the angular coordinate of m measured counterclockwise from the down position, and
\( \phi = \pi - \theta \) the complementary displacement measured clockwise from the up orientation.
The kinetic and potential energies are
A rigid pendulum, such as a long rod, has a short cross-bar rigidly attached to it. As it oscillates in vertical plane, it is supported on ends of the cross-bar as they alternately contact a fixed horizontal surface:
Let the mass of pendulum be m, and the length of attached bar be 2 a. Since the construction of rigid pendulum is symmetric, the center of gyration, which we denote by G, is along the main rod. Let k be the radius of gyration of pendulum about G, so that the square of its radius of gyration about P and Q is \( k^2 + \ell^2 . \)
The first half-cycle of the motion
Suppose that the pendulum is set in motion from the central position with initial conditions
Clearly, the time taken for θ to reach zero again will also be \( \frac{1}{2}\,\tau_1 , \) and the angular speed will then be ω1 again. Thus, the first "half period" of oscillation will be \( \tau_1 = 4 \sqrt{\theta_1} /c . \)
Return to the main page (APMA0330)
Return to the Part 1 (Plotting)
Return to the Part 2 (First Order ODEs)
Return to the Part 3 (Numerical Methods)
Return to the Part 4 (Second and Higher Order ODEs)
Return to the Part 5 (Series and Recurrences)
Return to the Part 6 (Laplace Transform)