Localization in wireless sensor networks with gradient descent