Lerts, you will not create energy this way, only transfer potential energy into kinetic energy and back.
The formula for calculating the potential energy is at the end of this section (ignore the constant gravity discussion at the beginning): http://en.wikipedia.org/wiki/P ... tational_potential_energy
The formula for calculating the potential energy is at the end of this section (ignore the constant gravity discussion at the beginning): http://en.wikipedia.org/wiki/P ... tational_potential_energy