So, for the past few years it's been my goal to create an equation that would give me the position of an object in a gravitational field at time $t$, given it's initial position and velocity. At first the problem was that I didn't know enough to do the math. Now that I can do multivariable calculus I thought that problem would be solved, but I've just ended up running into a new problem. Please don't tell me how to solve it, but if you can give me a hint that would be great. Here's the set up for the problem:

A planet of mass $M$ (and radius = 0) is situated at the origin. I know that the magnitude of acceleration due to gravity is $$\frac{GM}{r^2}$$ so an object at $(x,y)$ will have acceleration $$a(x,y)= \frac{GM}{x^2+y^2},$$ or, as a vector, $$\overrightarrow{a}(x,y)= \left\langle \frac{GM}{x^2+y^2}\cos\theta, \frac{GM}{x^2+y^2}\sin\theta\right\rangle$$

$$= \left\langle \frac{GM}{x^2+y^2}\frac{x}{\sqrt{x^2+y^2}}, \frac{GM}{x^2+y^2}\frac{y}{\sqrt{x^2+y^2}}\right\rangle$$ $$= \left\langle \frac{GMx}{(x^2+y^2)^{3/2}}, \frac{GMy}{(x^2+y^2)^{3/2}}\right\rangle$$

So, here's where I'm stuck. I can integrate with respect to distance and get

$$ W(x,y) = \left\langle -\frac{GM}{\sqrt{x^2+y^2}}, -\frac{GM}{\sqrt {x^2+y^2}}\right\rangle$$

which I think is a vector who's magnitude is the work done, but that doesn't tell me anything about time. I can integrate with respect to time, but that would give

$$f(x,y)= \left\langle \frac{GMx}{(x^2+y^2)^{3/2}}t, \frac{GMy}{(x^2+y^2)^{3/2}}t\right\rangle$$

which... I mean is naïve at best. It doesn't take into account the change in position that happens over time. The only thing that I can think of to do is somehow find parametric equations where $x$ and $y$ are functions of $t$, but that's basically what I'm trying to do anyway.

Any ideas? I want to find an equation such that I can put in a location and velocity and the equation will tell me what path the object will take. Is that even possible?

  • $\begingroup$ The orbit of an object in a gravitational field is a "conic". That is, it can be an ellipse (closed orbit), parabola, or hyperbola (depending on the initial conditions of the motion). It is definitely possible. Google "vis viva equation" for more help. $\endgroup$ – Floris Feb 8 '15 at 19:43
  • $\begingroup$ Well, take your gravitational force $F(\vec r)$ and solve the differential equation $F(\vec r) = m \ddot{\vec r}$. There's really nothing more to finding trajectories in Newtonian mechanics except the computational challenge of solving the equation. $\endgroup$ – ACuriousMind Feb 8 '15 at 19:44
  • $\begingroup$ So, r⃗ in this case would be GM/r^2? $\endgroup$ – Zachary F Feb 8 '15 at 19:51
  • 1
    $\begingroup$ @ZacharyF - no, $\ddot{\vec{r}} = \frac{GM\vec{r}}{r^3}$ $\endgroup$ – Floris Feb 8 '15 at 20:09
  • $\begingroup$ Where does that come from? $\endgroup$ – Zachary F Feb 8 '15 at 20:13

but if you can give me a hint that would be great.

Since the force depends on the radial distance only and points towards the origin, the angular momentum (assumed to point along the $z$ axis) is conserved. This suggests that the appropriate coordinates are the spherical polar coordinates $(r, \phi)$ where

$$x = r \cos \phi$$ $$y = r \sin \phi$$

In these coordinates, the angular momentum is

$$l = mr^2\dot \phi = \mathrm{constant}$$

The radial equation of motion is

$$m\ddot r = mr\dot \phi^2 - \frac{GMm}{r^2}$$

Can you take it from here?

  • $\begingroup$ Much better than my (wordy) answer! $\endgroup$ – user12029 Feb 9 '15 at 0:40

I can integrate with respect to time, but that would give $$f(x,y)= \left\langle \frac{GMx}{(x^2+y^2)^{3/2}}t, \frac{GMy}{(x^2+y^2)^{3/2}}t\right\rangle$$

No it doesn't because both $x$ and $y$ are functions of time, so you cannot use this "simple integration" method. What you need to do is go back to the differential equation, $$ m\ddot{\mathbf r}=-\frac{GMm}{r^2}\hat{\mathbf r},\tag{1} $$ and solve it for $r(t)$. Here we are using notation that means $\ddot{z}=d^2z/dt^2$ and $\dot z=dz/dt$ for some generic function $z$. When using vectors in non-Cartesian coordinates (e.g., cylindrical coordinates), it becomes a bit more complicated as the unit vectors themselves are time-varying. Solving (1) will require knowing some tricks (e.g., multiplying both sides by $\dot{r}$ and then integrating with respect to time), but it can be done.

I suggest solving this in one direction before trying it in two-dimensions first (e.g., in the $r$ direction before the $x,\,y$ directions). Solving it this way will show you the method (which is kinda complicated), doing it with the 2nd dimension will be a bit more straight-forward (since you have the experience)--but is also still pretty complicated.

Note also that right-hand side of (1) is the definition of $\mathbf g$, the gravitational acceleration: $$ \mathbf g=-\frac{GM}{r^2}\hat{\mathbf r}. $$ So (1) is really $m\mathbf a\equiv m\ddot{\mathbf r}\equiv\mathbf F=m\mathbf g$.

  • $\begingroup$ A few small problems here. This approach will work if the motion is one-dimensional, i.e. the object moves in a straight line. Even then you need a minus sign. Better (perhaps): $\ddot{\vec{r}} = -\left(GMm/|\vec{r}|^2\right)\hat{r}$. In any event, this is a hard problem for a novice. $\endgroup$ – garyp Feb 8 '15 at 20:50
  • $\begingroup$ @garyp: Oops! I did neglect the minus sign. I think solving it in 1D first is a better approach than doing it in 2D straight-off (much as timaeus suggests). $\endgroup$ – Kyle Kanos Feb 8 '15 at 20:55
  • $\begingroup$ Agreed. The OP would then have to be careful to note that $r$ is simply a distance or coordinate despite the fact that we usually use the variable "$r$" in two or three dimensions ... no angles, no vectors at all in one dimension. $\endgroup$ – garyp Feb 8 '15 at 21:00
  • $\begingroup$ Nice edit. I would warn Zachary that the two-dimensional problem is more than twice as hard as the one-dimensional problem. In my opinion. $\endgroup$ – garyp Feb 8 '15 at 21:09
  • 1
    $\begingroup$ facepalm Right! I forgot that x and y are functions of t. Like I said, naïve at best. $\endgroup$ – Zachary F Feb 9 '15 at 1:17

You have acceleration, which is a time derivative of velocity. Integrating acceleration with respect to distance doesn't produce a work vector. You can find the potential energy $U(x,y)=GMm/r$ which has the property that its gradient is the force field. But the potential energy is a scalar, not a vector.

Your integral with respect to time is not correct, $x=x(t)$ and $y=y(t)$ are not constants in time, and you treated them like they were.

If you've studied multivariable calculus but haven't yet studied differential equations then study differential equations.

Also, start with motion in one dimension first (i.e. do a 1d problem), just because it is easier. After you can do that easily, then go to higher dimensions.


Unfortunately, multivariable calculus isn't quite enough! Your goal is to solve a nonlinear system of ordinary differential equations, and that's a high goal.

Anyways, there are solutions to this. See an example of an implementation (disclaimer: It's mine) here: http://mathandcode.com/kepler/

The most useful references I found for it were the books Mathematical Methods of Classical Mechanics by Arnold, Mechanics by Landau and Lifshitz, and Classical Mechanics by Goldstein. Each of them have a solution of this problem - called "the Kepler problem". The solution outline goes something like this:

  1. Go from a differential equation in two variables $(x(t),y(t))$ to a differential equation in $r=\sqrt{x^2+y^2}$ only using the concept of an "Effective Potential".
  2. "Solve" this differential equation by abusing conservation of angular momentum (with which you know $\dot{\varphi}$), conservation of energy (with which you can find the quantity $\dot{r}^2+r^2 \dot{\varphi}^2$), and doing a clever change of variables so that you find $r$ as a function of $\varphi$ instead of as a function of time.
  3. Plug the equation for $r(\varphi)$ (which turns out to be the equation of an ellipse - of the form $\frac{p}{1+e \cos \varphi}$ for constants $p$ and $e$ called the parameter and eccentricity resp.) into the definition of angular momentum, which states $r^2 \dot{\varphi}$ is conserved and therefore gives you $\dot{\varphi}$
  4. Use the trick of separation of variables (which is the easiest ODE trick!) to find $\varphi(t)$ in terms of an integral. MAYBE then this integral can be evaluated in terms of special functions.

If this is all Greek to you, my advice is to pick up a book on mechanics (My favorites are Mathematical Methods of Classical Mechanics by Arnold, supplemented by The Theoretical Minimum [non-quantum] by Sussking and Hrabovsky).


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.