Lagrangian For Inverted Compound Pendulum