Energy dependent nucleus-nucleus potential in heavy ion collisions