Calculation of Potential Energy and Kinetic Energy