PDF (letter size)
PDF (legal size)

Finding equations of motion for pendulum on moving cart

Nasser M. Abbasi

January 15, 2017 compiled on — Sunday January 15, 2017 at 12:07 AM


1 Newton method
2 Energy (Lagrangian) method

This note shows how to find equation of motion of 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.


Figure 1: Pendulum on moving cart

Notice that in the above, the angular motion is such that it is positive in counter clock wise, which is the standard.  The first step is always to draw the three basic diagrams. The first diagram is the free body diagrams showing all the forces for all the bodies involved. In this problem, there are two rigid bodies, The cart and the physical pendulum. The second diagram is the velocity diagram, and finally the acceleration diagram. These diagrams are always useful to draw before starting to solve the problem, even if we are just using the energy method to find equation of motion, since drawing these diagrams help give one more physical insight and understanding of the problem.

The cart the external force F  which is controlling the motion of the cart, the spring and the damper forces. There will also be reaction force at the joint where the physical pendulum is attached to the cart. It is assumed that there is no friction on the ground. The following is the free body diagram.


Figure 2: Free body diagram showing all forces on the bodies

The velocity and acceleration diagrams are the following.


Figure 3: Velocity and acceleration diagrams

The following diagram shows more clearly the forces resolved along physical pendulum body axis to make it easier to refer to when writing down the force equations below. Direction of reaction forces at joint where the pendulum is attached to the cart is arbitrary. As long as they are opposite in directions between the cart and the pendulum.


Figure 4: Resolving forces

Now that we have all the diagram completed, we can now apply Newton method.

1 Newton method

For the physical pendulum, resolving forces along arbitrary drawn body axes as shown above (direction of the body positive x  and y  axes is not important), we obtain


The moment equation around the center of mass of the pendulum (we should always take moments around the center of mass of the rotating body, even though the pendulum is hinged at one of its ends. If we take moment around the hinge, we need to then account for the inertia forces due to motion of cart). The moment equation gives


Notice the minus sign. This is because torque is clockwise and positive is counter clockwise. The above three equations give the linear and angular equations of motion for the physical pendulum. We now find the equation of motion for the cart


We do not need to resolve forces in the y  direction for the cart, since the cart does not move in that direction. We ended up with 4 equations, and we have 4 unknowns: ¨x, ¨θ,f1,f2   . We are really interested only in ¨x, ¨θ . Before we continue, we notice one advantage of Newton method over the energy method which will do next, which is that in Newton method, we obtain as a side benefit knowledge of all the internal reaction forces between the bodies. This can be useful depending on the application.  Substituting (1,2) in (4) gives



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

Substituting (2) in (3) gives


Equations (7,8) are the final result. Using these two equations we can now solve these coupled differential equations for x (t)  and θ (t)  .

2 Energy (Lagrangian) method

The kinetic energy of the system is, from the velocity diagram above

    1        1      1
T = -M  ˙x2 + -mv2 + --Ic.g ˙θ2
    2        2      2

Where 1M  ˙x2
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, and 1   ˙2
2Ic.gθ   is K.E. of physical pendulum due to its rotational motion. Therefore


Taking zero potential energy V  as the horizontal level where the pendulum is attach to the cart, then

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

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  . Now equation of motions are found. For x


Which is the same result as Newton method. For θ

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



Hence  ddt∂∂Γ˙θ − ∂∂Γθ = 0  becomes


Which is the same as the result obtained from Newton method.