Say we are given an inverted point mass on a cart as shown above.
The mass of the cart is .
The mass of the point at the end of the rod is .
The rod is length , rigid, and massless.
And external force is applied in the positive direction.
The system coordinates are shown.
We wish to find the equations of motion describing this system.
There are two commonly used approaches: Newtonian Mechanics and Lagrangian Mechanics.
Note: This problem is different from an inverted pendulum in that it does not consider the mass or moment of inertia of the rod.
The approach for an inverted pendulum is very similar.
Newtonian mechanics is all about summing the forces acting on an object.
Therefore we need to make two free body diagrams (FBDs).
One for the point mass and one for the cart.
Now we can apply Newton's second law to the point mass.
Here is the pendulum acceleration.
First we look in horizontal direction.
Now we can look at the vertical direction on the pendulum.
We can also do an analysis on the cart.
Because the cart is constrained to move in the horizontal direction, no useful information is gained from summing the vertical forces.
Therefore we will only do an analysis on the horizontal forces.
Now we have equations describing the motion of the cart and pendulum.
However the equations are not written in terms of the system states, and .
Recall from physics that the acceleration of a point can be written in terms of relative acceleration.
That is, the acceleration of the pendulum can be written as the acceleration of the cart plus the acceleration of the pendulum relative to the cart.
Now recall that the pendulum is fixed to the cart by a rigid rod.
Therefore the pendulum can only move in a perfect circle around the cart as shown below.
Now we can write the acceleration of the pendulum relative to the cart in terms of the tangential and centripetal accelerations.
Here is a link to the Wikipedia page showing how the this relates to normal coordinates.
This centripetal acceleration can be easily changed back to the coordinates with simple trigonometry.
These new coordinates can be transformed in terms of through the use of some simple trigonometry.
If you are confused recall that is the same as the with the line drawn from the pivot on the cart to the point mass and that unit vectors have length 1.
The above equation can be rewritten as the following.
We can take this new expression for and substitute it into our equations for the horizontal and vertical forces on the pendulum.
Note that we only add the to the horizontal equations and only add the terms to the vertical equations.
First look at the horizontal.
Now look at the vertical.
Now we have everything written in terms of and .
However we have two system states and three unknown quantities: , , and .
This means we can reduce the number of equations we have.
We will eliminate T because it isn't a system state.
Eliminating from the two pendulum equations is done with an addition trick.
See the steps below.
And we have our first equation of motion.
Now we have to eliminate from the cart equation.
Luckily we already have an expression for that we found while rewriting Newton's second law for the pendulum.
This can be substituted into the cart equation to eliminate .
Which after some rearranging can be made to look like the following.
So our two equation of motion for this system are as follows.
Similar to the Newtonian , the fundamental equations in Lagrangian mechanics are the Lagrange equations.
Each is a coordinate of the system which in this case corresponds with and .
The Lagrangian, , is given by the following.
Where is the kinetic energy of the system and is the potential energy of the system.
Because the cart is constrained to move only in the x direction there is no potential energy in the system due to the cart.
The potential energy is given by the location of the point mass at the end of the rod.
The kinetic energy is a little more complicated because the cart does contribute to the total kinetic energy.
Therefore the kinetic energy is given by the following.
Therefore the total Lagrangian can be expressed as follows.
Now we only need to solve the Lagrange equations for each of the two coordinates, and .
We will end up with two equations of motion, which is what we should expect for a system with two degrees of freedom.
The first is the equation for the coordinate.
Now we can do it again with the coordinate.
So our two equations of motion are written below.
You can see the match the ones found for the Newtonian formulation exactly.
This is what we should expect as they describe the same system.