potential energy calculations