  We address the issue of determining an effective two-body interaction for
mean-field calculations of energies of many-body systems. We show that the
effective interaction is proportional to the phase shift, and demonstrate this
result in the quasiclassical approximation when there is a trapping potential
in addition to the short-range interaction between a pair of particles. We
calculate numerically energy levels for the case of an interaction with a
short-range square-well and a harmonic trapping potential and show that the
numerical results agree well with the analytical expression. We derive a
generalized Gross--Pitaevskii equation which includes effective range
corrections and discuss the form of the electron--atom effective interaction to
be used in calculations of Rydberg atoms and molecules.
