Variance of Energy with Displacement in SHM

In this demo, I would like to stress upon the energy consideration about which I talked so much in the last class.The particle executing SHM is supposed to be at the right extreme.In this position the particle has maximum potential energy and minimum kinetic energy.The potential energy has been assumed to be zero at mean position. Worthy to note is that the total energy remains constant because there is no dissipative force.

Clicking on start.The red line indicates the potential energy and blue one the kinetic energy.See how the later increases at the cost of earlier one keeping the net energy constant.The amount of red color in rectangle indicates the amount of kinetic energy that the particle has.Initially it has none but as the particle heads towards the mean the KE increases and becomes maximum at mean and thereafter it decreases.

For visualizing what's happening consider a gravity pendulum left from the right extreme.