The calculation of potential energy functions can be done using various computational methods. For empirical and semi-empirical potentials, fitting parameters to experimental data is common. For ab initio potentials, quantum mechanical calculations are performed. These calculations often involve solving the Schrödinger equation for the system, which provides the energy as a function of the positions of the particles.