# Inverted Pendulum on a Cart Problem and Moment of Inertia

In the classic inverted pendulum on a cart problem there is a pendulum represented with a point mass at a fixed distance from a horizontally free cart.

A slight modification is to use a rod instead of a point mass at a distance which introduces moment of inertia into the system as shown in the diagram below.

(The wheels shown below are just simulating a frictionless surface; they have no mass or moment of inertia.) What I am not fully understanding is why the moment of inertia is constant in this example. Often, rotating objects are rotating about a point which makes the moment of inertia a constant. In this example the moment of inertia would seem to vary, as the center of rotation of the rod depends on the state of the system which is not constant.

The moment of inertia is used in the relation:

$$I\ddot\theta=\sum\tau$$

The correct answer would suggest the moment of inertia is taken with respect to wherever you decide to take your sum of torques from, and then you can do some algebra.

Why do we or do we not need to make the moment of inertia a function of the state of the system, since the state of the system has a varying axis of rotation for the rod?

You can easily work in the non-inertial frame where cart is at rest. Then your reference point is not moving, and you just need to include an additional pseudoforce acting at the center the pendulum of $$ma$$ where $$a$$ is the acceleration of the system relative to the ground (similar to how we take the gravity force $$mg$$ to act at the center of a uniform body). See my answer here for more details.

Then if you want to, you can move back to the inertial frame that is at rest relative to the ground, but the treatment above shows that it's not difficult to work in the non-inertial frame. If you are just interested in $$\theta$$ then I think this makes more sense anyway.

This is the Euler equation of motions

$$\Theta\,\vec{\dot{\omega}}+\vec{\omega}\times \Theta\,\vec{\omega}=\vec{\tau}\tag 1$$

where $$\vec{\omega}$$ is the angular velocity vector

$$\Theta$$ Inertia Tensor

$$\vec{\tau}$$ external torque vector

you can use equation (1) with components of the inertial system or with components of a body fixed system.

In case of inertial system you have to transformed the inertia tensor

$$\Theta\mapsto R^T\,\Theta\,R$$

where R is the transformation matrix between body fixed system and inertial system

$$\vec{\omega}=\begin{bmatrix} 0\\ 0\\ \dot\vartheta\\ \end{bmatrix}$$

$$R= \left[ \begin {array}{ccc} \cos \left( \vartheta \right) &-\sin \left( \vartheta \right) &0\\ \sin \left( \vartheta \right) &\cos \left( \vartheta \right) &0 \\ 0&0&1\end {array} \right]$$

$$\Theta= \begin{bmatrix} I_{xx} & 0 & 0 \\ 0 & I_{yy} & 0 \\ 0 & 0 & I_{zz} \\ \end{bmatrix}$$

external froces are given in body fixed coordinate system, index B

$$\vec{\tau}=\begin{bmatrix} 0 \\ 0 \\ \tau_z \\ \end{bmatrix}_B$$

so the result of equation (1) written in components of the inertial components
is:

$$R^T\,\Theta\,R\,\vec{\dot{\omega}}+...=R^T\,\vec{\tau}_B$$

$$\Rightarrow$$

$$I_{zz}\,\ddot{\vartheta}=\tau_z$$

or in components of a body fixed system:

$$\Theta\,\vec{\dot{\omega}}+...=\vec{\tau}_B$$

$$\Rightarrow$$

$$I_{zz}\,\ddot{\vartheta}=\tau_z$$

The object that you are rotating (in this case the rod) has some fixed/constant moment of inertia about its own center of gravity, $$I_{cg}$$. In this case (for a thin rod),

$$I_{cg} = \frac{ml^2}{12}$$

THEN, the moment of inertia for this object about any other point of rotation (other than the cg) can be calculated using the Parallel Axis Theorem (P.A.T.) https://en.wikipedia.org/wiki/Parallel_axis_theorem which states that the moment of inertia about some arbitrary point $$O$$, can be calculated as:

$$I_o = I_{cg} + md^2$$

where $$d$$ is the distance from the $$cg$$ to point $$O$$.

Either the $$I$$ (moment of inertia for the rod) that you have been given is about the rod's own $$cg$$ ($$I_{cg}$$) - in which case you need to use the P.A.T. or the $$I$$ you have been given is about the end of the rod at the location of the hinge ($$I_o$$) - in which case the P.A.T. has been applied for you. They should have been clarified this is the problem statement.

Either way it can assumed that $$I$$ is constant for this problem because the axis of rotation of the rod is not changing.