Generalized model for a Moho inversion from gravity and vertical gravity-gradient data