Calculation of Potential Energy and Electric Potential