Pendulum theory and calculations