Return to computing page for the first course APMA0330
Return to computing page for the second course APMA0340
Return to Mathematica tutorial for the first course APMA0330
Return to Mathematica tutorial for the second course APMA0340
Return to the main page for the first course APMA0330
Return to the main page for the second course APMA0340
Return to Part III of the course APMA0340
Introduction to Linear Algebra with Mathematica

 

Pendulum with support moving vertically


Let us consider a stiff massless rod of length ℓ and mass m, whose suspension point A oscillates vertically according to yA = 𝑎sin(ωt)
rod = Graphics[{LightGray, Polygon[{{-0.05, 1.0}, {0.0, 1.01}, {0.25, 0.05}, {0.2, 0.03}}]}];
ball = Graphics[{Orange, Disk[{0.27, -0.1}, 0.15]}];
ball2 = Graphics[{Black, Disk[{0.08, 0.6}, 0.02]}];
ball3 = Graphics[{Black, Disk[{-0.02, 1.0}, 0.01]}];
ar = Graphics[{Black, Thickness[0.01], Arrowheads[0.08], Arrow[{{-0.02, 1.0}, {-0.02, 0.7}}]}];
ar2 = Graphics[{Black, Thickness[0.01], Arrowheads[0.08], Arrow[{{-0.2, 0.5}, {0.3, 0.5}}]}];
ar3 = Graphics[{Black, Thickness[0.01], Arrowheads[0.08], Arrow[{{-0.16, 0.5}, {-0.16, 1.0}}]}];
tl = Graphics[{Black, Text[Style["\[ScriptL]", 18, FontFamily -> "Mathematica1"], {0.27, 0.1}]}];
tx = Graphics[{Black, Text[Style["x", 18], {0.28, 0.45}]}];
tcm = Graphics[{Black, Text[Style["CM", 18], {0.17, 0.6}]}];
t2 = Graphics[{Black, Text[Style["\[Theta]", 18], {0.05, 0.4}]}];
line = Graphics[{Black, Dashed, Thick, Line[{{-0.02, 1.1}, {-0.02, 0}}]}];
t3 = Graphics[{Black, Text[Style[Subscript[a, A], 18], {-0.08, 0.72}]}];
t4 = Graphics[{Black, Text[Style["a sin(\[Omega]t)", 18], {-0.15, 1.05}]}];
t5 = Graphics[{Black, Text[Style["A", 18], {0.02, 1.0}]}];
Show[rod, ar, ar2, ar3, tl, tx, ball2, ball3, tcm, t2, t3, line, t4, t5]
Pendulum with support moving vertically.
Then the equation of motion becomes
\[ I_A \ddot{\theta} + mg\,\frac{\ell}{2} \,\sin\theta = \frac{m\ell}{2}\, a\,\omega^2 \sin (\omega t)\,\sin\theta . \]
Example 1: Consider a mathematical pendulum whose support moves periodically in a vertical direction (Fig.1(a)). The governing differential equation is
\[ \frac{{\text d}^2 x}{{\text d} t^2} + \left( \frac{g}{\ell} - \frac{A \omega^2}{\ell}\,\cos (\omega t) \right) \sin x (t) = 0 , \]
where x is the generalized coordinate being the angle of deflection, g is the acceleration of gravity, ℓ is the pendulum’s length,while the vertical motion of the support is Acos(ωt). However, by introducing τ = ωt, one can obtain
\[ \frac{{\text d}^2 x}{{\text d} \tau^2} + \left( \frac{g}{\ell \omega^2} - \frac{A}{\ell}\,\cos (\tau ) \right) \sin x (\tau ) = 0 , \]
      This equation includes, besides the torque −mgℓ sin(x) of the gravitational force mg, the instantaneous torque of the force of inertial, which depends explicitly on time t.
rec = Graphics[{Pink, Rectangle[{-0.5, -1}, {0.5, 1}]}];
rod = Graphics[{Thickness[0.05], Blue, Line[{{0, 0}, {1, -3}}]}];
line = Graphics[{Dashed, Line[{{0, 0}, {0, -2}}]}];
mass = Graphics[{Gray, Disk[{1, -3}, 0.15]}];
ell = Graphics[{Text[ Style[ToExpression["\ell", TeXForm], FontSize -> 20], {0.7, -1.5}]}];
m = Graphics[Text[Style["m", FontSize -> 20], {1.3, -3}]];
line2 = Graphics[{Dashed, Line[{{0, 0}, {1, 0}}]}];
a = Graphics[{Thickness[0.01], Arrowheads[0.1], Arrow[{{0.8, 0}, {0.8, 1.0}}]}];
txt = Graphics[ Text[Style["A cos(\[Omega]t)", FontSize -> 20], {1.3, 0.6}]];
x = Graphics[Text[Style["x", FontSize -> 20], {0.2, -1.6}]];
Show[rec, rod, m, line, line2, ell, mass, a, txt, x]
       Periodicly excited pivot            Mathematica code

Upon including the frictional torque, which is assumed in this model to be proportional to the momentary value of the angular velocity, with the damping constant γ, we get
\[ \frac{{\text d}^2 x}{{\text d} t^2} + \gamma\,\frac{{\text d} x}{{\text d} t} + \left( \frac{g}{\ell} - \frac{A \omega^2}{\ell}\,\cos (\omega t) \right) \sin x (t) = 0 , \]
   ■
Example 2: Let us consider a solid massless rod of length ℓ and mass m2 suspended on a spring damper system with mass m1 and stiffness k and damping factor d. Mass m1 can move only in the depicted y direction and pendulum only in the x-y plane. The mechanical system has two degrees of freedom because the slab can move only vertically and the pendulum position is identified by angle θ.
string = Graphics[{Black, Thick, Line[{{0.0, 0.0}, {0.0, 0.2}, {-0.25, 0.4}, {0.25, 0.6}, {-0.25, 0.8}, {0.25, 1}, {-0.25, 1.2}, {0.25, 1.4}, {0, 1.6}, {0, 2}}]}];
rod = Graphics[{Gray, Rectangle[{0.55, 0.65}, {1.05, 0.85}]}];
rod2 = Graphics[{Orange, Rectangle[{-0.4, 2.0}, {1.1, 2.25}]}];
rod3 = Graphics[{Gray, Rectangle[{-0.4, 0.0}, {1.1, -0.1}]}];
rod0 = Graphics[{Blue, Thickness[0.01], Line[{{0.45, 2.0}, {1.5, 0.5}}]}];
ball = Graphics[{Orange, Disk[{1.5, 0.5}, 0.15]}];
damp = Graphics[{Black, Thickness[0.01], Line[{{0.8, 0.0}, {0.8, 0.6}}]}];
damp2 = Graphics[{Black, Thick, Line[{{0.5, 0.9}, {0.5, 0.6}, {1.1, 0.6}, {1.1, 0.9}}]}];
line = Graphics[{Black, Dashed, Thick, Line[{{0.4, 2.1}, {0.4, 2.5}}]}];
line2 = Graphics[{Black, Dashed, Thick, Line[{{0.4, 2.1}, {0.1, 2.5}}]}];
line3 = Graphics[{Black, Dashed, Thick, Line[{{-0.4, -0.05}, {-0.8, -0.05}}]}];
line4 = Graphics[{Black, Dashed, Thick, Line[{{-0.4, 2.1}, {-0.8, 2.1}}]}];
ar = Graphics[{Black, Thickness[0.005], Arrowheads[0.08], Arrow[{{-0.7, -0.05}, {-0.7, 2.1}}]}];
ty = Graphics[{Black, Text[Style["y(t)", 18], {-0.5, 1.0}]}];
tl = Graphics[{Black, Text[Style["\[ScriptL]", 18, FontFamily -> "Mathematica1"], {1.1, 1.3}]}];
t2 = Graphics[{Black, Text[Style["\[Theta]", 18], {0.3, 2.4}]}];
tm1 = Graphics[{Black, Text[Style[Subscript[m, 1], 18], {1.35, 2.1}]}];
tm2 = Graphics[{Black, Text[Style[Subscript[m, 2], 18], {1.5, 0.25}]}];
Show[damp, damp2, damp3, string, ball, rod, rod0, rod2, rod3, line, line2, line3, line4, ar, tl, t2, ty, tm1, tm2]
Pendulum attached to moving slab.

Governing equations are derived using the Lagrange formalism. Considering the frame of reference at the origin placed on the slab and defining in Cartesian coordinates two vectors ry and rθ

\[ {\bf r}_y = \begin{pmatrix} 0 \\ y(t) \end{pmatrix} , \qquad {\bf r}_{\theta} = \begin{pmatrix} \ell\,\sin\theta \\ y(t) - \ell\,\cos\theta \end{pmatrix} . \tag{2.1} \]
The kinetic energy is the sum of corresponding energies for the slab
\[ \mbox{K}_y = \frac{1}{2}\, m_1 \dot{y}^2 , \]
and for the pendulum
\[ \mbox{K}_{\theta} = \frac{1}{2}\, m_2 \left[ \dot{\theta}^2 \ell^2 \cos^2 + \left( \dot{y}+\ell\,\dot{\theta}\,\sin\theta \right)^2 \theta \right] \]
Both elements of the system (slab and pendulum) contribute to the potential energy
\[ \Pi_y = m_1 g\,y + \frac{k}{2}\,y^2 \]
and
\[ \Pi_{\theta} = m_2 g\left( y - \ell\,\cos\theta \right) . \]
Then the Laprangian for the system becomes
\[ {\cal L} = \mbox{K}_y +\mbox{K}_{\theta} - \Pi_y - \Pi_{\theta} \]
We need to take into account the viscous friction for both elements
\[ T_y = d\,\dot{y} \qquad\mbox{and} \qquad T_{\theta} = D\,\dot{\theta} . \]
If there exists an oscillated driving force, we model it as
\[ F_0 = - \left( m_1 + m_2 \right) \frac{{\text d}^2}{{\text d} t^2} \left( A\,\cos \omega t \right) = \left( m_1 + m_2 \right) A\omega^2 \cos\omega t . \]
Application of the Lagrange formalism
\[ \frac{\partial {\cal L}}{\partial q_i} - \frac{\text d}{{\text d}t} \,\frac{\partial {\cal L}}{\partial \dot{q}_i} + \sum_{k=1}^2 \lambda_k \frac{\partial f_i}{\partial q_k} = 0 \]
to the system with two degrees of freedom yields the system of non-linear differential equations
\begin{align*} \left( m_1 + m_2 \right) \ddot{y} + g \left( m_1 + m_2 \right) + ky + \ell m_2 \left( \dot{\theta}^2 \cos\theta + \ddot{\theta} \sin\theta \right) &= -d\,\dot{y} + F_0 , \\ m_2 \ell^2 \ddot{\theta} + g\ell m_2 \sin\theta + \ell m_2 \ddot{y} \sin\theta &= -D\dot{\theta} . \end{align*}
   ■

 

Pendulum with support moving horizontally


Let us consider a pendulumof length ℓ and mass m whose suspension point A oscilates horisontally according to xA = 𝑎 sin ωt. Then its motion is modeled by
\[ I_A \ddot{\theta} + mg\,\frac{\ell}{2}\,\sin\theta = mg\,\frac{\ell}{2}\,a \omega^2 \sin\omega t\,\cos\theta . \]

rod = Graphics[{LightGray, Polygon[{{-0.05, 1.0}, {0.0, 1.01}, {0.25, 0.05}, {0.2, 0.03}}]}];
ball2 = Graphics[{Black, Disk[{0.08, 0.6}, 0.02]}];
ball3 = Graphics[{Black, Disk[{-0.02, 1.0}, 0.01]}];
ar = Graphics[{Black, Thickness[0.01], Arrowheads[0.08], Arrow[{{-0.02, 1.0}, {-0.22, 1.0}}]}];
tl = Graphics[{Black, Text[Style["\[ScriptL]", 18, FontFamily -> "Mathematica1"], {0.27, 0.1}]}];
tx = Graphics[{Black, Text[Style["x", 18], {0.27, 1.04}]}];
tcm = Graphics[{Black, Text[Style["CM", 18], {0.17, 0.6}]}];
t2 = Graphics[{Black, Text[Style["\[Theta]", 18], {0.05, 0.4}]}];
t3 = Graphics[{Black, Text[Style[Subscript[a, A], 18], {-0.12, 0.95}]}];
t4 = Graphics[{Black, Text[Style["a sin(\[Omega]t)", 18], {-0.15, 1.05}]}]; t5 = Graphics[{Black, Text[Style["A", 18], {0.02, 1.05}]}];
ty = Graphics[{Black, Text[Style["y", 18], {-0.27, 1.18}]}];
line = Graphics[{Black, Dashed, Thick, Line[{{-0.02, 1.1}, {-0.02, 0}}]}];
line2 = Graphics[{Black, Thick, Line[{{-0.35, 1.0}, {0.28, 1.0}}]}];
line3 = Graphics[{Black, Thick, Line[{{-0.3, 0.0}, {-0.3, 1.2}}]}];
Show[rod, ar, tl, tx, ty, ball2, ball3, tcm, t2, t3, line, t4, t5, line2, line3]
Pendulum with support moving horizontally.

The length of the pendulum is increasing by the stretching of the wire due to the weight of the bob. The effective spring constant for a wire of rest length \( \ell_0 \) is

\[ k = ES/ \ell_0 , \]
where the elastic modulus (Young's modulus) for steel is about \( E \approx 2.0 \times 10^{11} \) Pa and S is the cross-sectional area. With pendulum 3 m long, the static increase in elongation is about \( \Delta \ell = 1.6 \) mm, which is clearly not negligible. There is also dynamic stretching of the wire from the apparent centrifugal and Coriolis forces acting on the bob during motion. We can evaluate this effect by adapting a spring-pendulum system analysis. We go from rectangular to polar coordinates:
\[ x= \ell \,\sin \theta = z_0 \left( 1 + \xi \right) \sin \theta , \qquad z= z_0 - \ell\,\cos \theta = z_0 \left[ 1 - \left( 1 + \xi \right) \cos \theta \right] , , \]
where \( z_0 = \ell_0 + mg/k \) is the static pendulum length, \( \ell = z_0 \left( 1 + \xi \right) \) is the dynamic length, ξ is the fractional string extension, and θ is the deflection angle. The equations of motion for small deflections are
\begin{eqnarray*} \left( 1 + \xi \right)\ddot{\theta} + 2\dot{\theta}\,\dot{\xi} + \omega_p^2 \theta &=& 0 , \\ \ddot{\xi} + \omega_s^2 \xi - \dot{\theta} + \frac{1}{2}\,\omega_p^2 \theta^2 &=& 0, \end{eqnarray*}
where the overdots denote differentiation with respect to time t, \( \omega_p^2 = g/z_0 \) is the square of the pendulum frequency, and \( \omega_s^2 = k/m \) is the spring (string) frequency, squared.

To get a feeling for how rigid and massive the pendulum support must be, we model the support as mass M kept in place by a spring of constant K, as shown in the picture below.

p = Rectangle[{-Pi/6 - 1.2, 2}, {-5, -5}]
a = Graphics[{Gray, p}]
coil = ParametricPlot[{t + 1.2*Sin[3*t], 1.2*Cos[3*t] - 1.2}, {t, -Pi/6 , 5*Pi - Pi/6}, FrameTicks -> None, PlotStyle -> Black]
line = Graphics[{Thick, Line[{{16.3843645, -1.2}, {20, -1.2}}]}]
r = Graphics[{EdgeForm[{Thick, Blue}], FaceForm[], Rectangle[{20, -5}, {26, 2}]}]
back = RegionPlot[-5 < x < 28 || -7 < y < -5, {x, -5, 28}, {y, -7, -5}, PlotStyle -> LightOrange]
line2 = Graphics[{Thick, Dashed, Line[{{23, -1}, {23, -14}}]}]
line3 = Graphics[{Thick, Line[{{23, -1}, {29, -11.5}}]}]
disk = Graphics[{Pink, Disk[{29.5, -12}, 1]}]
text = Graphics[Text["\[Theta]" , {25.1, -9.5}]]
Show[a, coil, line, r, back, line2, line3, disk, text]
Pendulum with support moving horizontally.

The natural frequency of the support is

\[ \Omega = \left( K/M \right)^{1/2} . \] The coupled equations for the system are
\begin{eqnarray*} \ddot{\theta} + \omega_0^2 \theta + \ddot{x}/\ell &=& 0 , \\ \left( 1 + m/M \right) \ddot{x} + \left( m/M \right) \ell \,\ddot{\theta} + \Omega^2 x &=& 0, \end{eqnarray*}
where x is the displacement of the rigid support. The former equation says that the effect of sway is to impart an additional angular acceleration \( - \ddot{x}/\ell \) to the pendulum for small angles of oscillation (otherwise, we have to use \( \omega_0^2 \sin \theta \) instead of \( \omega_0^2 \theta \) ).

 

Pendulum with moving support


Let us consider a pendulum of length ℓ and mass m whose suspension point A moves with a constant angular frequency ω on a vertical circumference of radius R. In this case, the governing differential equation becomes
\[ I_A \ddot{\theta} + mg\,\frac{\ell}{2}\,\sin\theta = m\,\frac{\ell}{2}\,a\omega^2 \cos \left( \omega t - \theta \right) . \]
rod = Graphics[{LightGray, Polygon[{{-0.05, 1.0}, {0.0, 1.01}, {0.25, 0.05}, {0.2, 0.03}}]}];
ball2 = Graphics[{Black, Disk[{0.105, 0.5}, 0.02]}];
ball3 = Graphics[{Black, Disk[{-0.02, 1.0}, 0.01]}];
ar = Graphics[{Black, Thickness[0.01], Arrowheads[0.08], Arrow[{{-0.02, 1.0}, {-0.138, 0.74}}]}];
line = Graphics[{Black, Dashed, Thick, Line[{{-0.02, 1.1}, {-0.02, 0}}]}];
line2 = Graphics[{Black, Thick, Line[{{-0.2, 0.6}, {0.3, 0.6}}]}];
line3 = Graphics[{Black, Thick, Line[{{-0.2, 0.0}, {-0.2, 1.2}}]}];
line4 = Graphics[{Black, Thick, Line[{{-0.2, 0.6}, {-0.02, 1.0}}]}];
ty = Graphics[{Black, Text[Style["y", 18], {-0.24, 1.18}]}];
tl = Graphics[{Black, Text[Style["\[ScriptL]", 18, FontFamily -> "Mathematica1"], {0.27, 0.1}]}];
tx = Graphics[{Black, Text[Style["x", 18], {0.3, 0.65}]}];
tcm = Graphics[{Black, Text[Style["CM", 18], {0.17, 0.55}]}];
t2 = Graphics[{Black, Text[Style["\[Theta]", 18], {0.05, 0.4}]}];
t3 = Graphics[{Black, Text[Style[Subscript[a, A], 18], {-0.12, 0.95}]}];
t4 = Graphics[{Black, Text[Style["\[Omega]t", 18], {-0.1, 0.65}]}];
t5 = Graphics[{Black, Text[Style["A", 18], {0.02, 1.05}]}];
circle = Graphics[{Blue, Thickness[0.01], Circle[{-0.2, 0.6}, 0.44]}];
Show[circle, rod, ar, tl, tx, ty, ball2, ball3, tcm, t2, t3, t4, t5, line, line2, line3, line4]
Pendulum with support moving along the circle.

When the pivot is moving on a fixed vertical plane according to xA(t), yA(t), the governing equation reads as

\[ I_A \ddot{\theta} + mg\,\frac{\ell}{2}\,\sin\theta = - mh \left( \ddot{x}_A \cos\theta + \ddot{y}_A \sin\theta \right) , \]
where \( h = \left\vert {\bf r}_{CM} - {\bf r}_A \right\vert . \) Note that all previous examples are particular cases of this one.
  1. Kovacic, I., Rand, R., Sah, S.M., Mathieu’s equation and its generalizations: Overview of stability charts and their features, Applied Mechanics Reviews, 2018, Vol. 70, No. 3, 020802-1.
  2. Rodriguez, L., Torque and the rate of change of angular momentum at an arbitrary point, American Journal of Physics, 2003, Vol. 71, Issue 11, pp. 1201--1203. https://doi.org/10.1119/1.1579498

 

Return to Mathematica page
Return to the main page (APMA0340)
Return to the Part 1 Matrix Algebra
Return to the Part 2 Linear Systems of Ordinary Differential Equations
Return to the Part 3 Non-linear Systems of Ordinary Differential Equations
Return to the Part 4 Numerical Methods
Return to the Part 5 Fourier Series
Return to the Part 6 Partial Differential Equations
Return to the Part 7 Special Functions