PDF (letter size)
PDF (legal size)

Finding equations of motion for pendulum on moving cart

Nasser M. Abbasi

May 31, 2018 compiled on — Thursday May 31, 2018 at 04:31 PM [public]


1 Introduction
2 Newton’s Method
 2.1 FBD for cart
 2.2 FBD for pendulum
3 Lagrange method

1 Introduction

This report shows how to determine the equations of motion for a rigid bar pendulum (physical pendulum) on a moving cart as shown in the following diagram using both Newton’s method and the energy (Lagrangian) method. It is useful to solve the same problem when possible using both methods as this will help verify the results.


Figure 1: Pendulum on moving cart

There are two degrees of freedom. The x  coordinate and the θ  coordinate. Hence we need to find two equations of motion, one for each coordinate.

2 Newton’s Method

The first step is to make free body diagram (FBD). One for the cart and one for the physical pendulum and equate each FBD to the kinematics diagrams in order to write down the equations of motion.

2.1 FBD for cart


Figure 2: Pendulum on moving cart

Equation of motion along positive x  is

− kx − c˙x+ F +  Px = M ¨x

Equation of motion along positive y  is not needed since cart does not move in vertical direction.  We see that to find equation for ¨x  we just need to determine Px  , since that is the only unknown in (1). P
  x  will be found from the physical pendulum equation as is shown below.

2.2 FBD for pendulum


Figure 3: Pendulum on moving cart

We see now that the equation of motion along positive x  is

− Px = m ¨x+ m  L¨θ cos θ − m L-˙θ2sinθ
               2           2

This gives us the Px  we wanted to plug in (1). Equation (1) now becomes



|¨x(M  + m )+ cx˙+ kx + mL- θ¨cosθ − ˙θ2sin θ  = F  |

The above is equation of motion for ¨x  .

To find equation of motion for ¨
θ we take moments around C.G. of the rigid pendulum, using counter clock wise as positive. This gives


We know Px  from (2). We know need to just find Py  . This is found from resolving forces in the vertical direction for the pendulum free body diagram giving


Plugging (2) and (5) into (4) to eliminate Px,Py  , then (4) simplifies to



|¨   3 (gsinθ−x¨cosθ) |
|θ = 2      L       |

The above is the required equation of motion for ¨θ . Equations (3,6) are coupled and have to be solved numerically since they are nonlinear or small angle approximation can be used in order to simplify these two equations and to solve them analytically.

3 Lagrange method

The first step in using Lagrange method is to make a velocity diagram to each object. This is shown below


Figure 4: Pendulum on moving cart

From the velocity diagram above we see that the kinetic energy of the system is

T = 1-M ˙x2 + 1mv2 +  1Icg ˙θ2
    2        2       2

Where 1M x˙2
2   is K.E. of cart due to its linear motion, and 1mv2
2   is K.E. of physical pendulum due to its translation motion of its center of mass, and 1   ˙2
2Icgθ   is K.E. of physical pendulum due to its rotational motion. Now we find v


Therefore the K.E. from (7) becomes


Taking zero potential energy V  as the horizontal level where the pendulum is attach to the cart, then P.E. comes from only spring extension and change of vertical position of center of mass of pendulum which is given by

       L-       1-  2
V = mg 2 cosθ + 2kx

Hence the Lagrangian Γ  is


There are two degrees of freedom: x  and θ  . The generalized forces in for x  are given by Qx =  F − c˙x  and the generalized force for θ  is Qθ = 0  . Equation of motions are now found. For x



|                      mL-(¨        ˙2    )         |
|¨x(M  + m )+ c˙x+  kx+   2  θcos θ − θ sinθ = F (t) |

Which is the same result as Newton method found above in (3). Now we find equation of motion for θ

d-∂-Γ   ∂Γ-
dt ∂ ˙θ − ∂θ = 0



Hence  d-∂Γ − ∂Γ = 0
dt∂˙θ   ∂θ  becomes



|¨θ = 32  gsinθ−Lx¨sinθ  |

Which is the same ODE (6) above given by Newton’s method.