Spherical harmonics interpolation method that minimizes an energy function