Potential energy surfaces from Kohn-Sham potentials