A demonstration of the physics behind a rigid-string pendulum. Show the settings to change pendulum and environment settings. Click the green flag to restart the pendulum. Use the right and left arrow keys to give the bob a push. The vectors represent the accelerations from gravity (blue), tension (red), and friction (cyan).
Conservation of energy is not perfect (for a frictionless pendulum), but it's really close. It would be perfect if I used the differential equations for the pendulum.