Nonlinear Schrödinger mechanics and the law of gravity