fix the centered force compute function to support repulsive forces