# Solving the Kepler problem with the Hamiltonian

1. Jul 23, 2011

### fluidistic

1. The problem statement, all variables and given/known data
Write down the Hamiltonian and its corresponding Hamilton equations for a particle in a central potential. Find the solution to the Kepler problem in this description.

2. Relevant equations
Hamiltonian.
The Hamilton equations or motion equations are $\dot q _i = \frac{\partial H}{\partial p_i}$ and $\dot p_i =-\frac{\partial H}{\partial q_i}$.

3. The attempt at a solution
I've found as Hamiltonian of the central potential: $H=\frac{1}{2m} \left ( p_r ^2 + \frac{p_ \theta ^2 }{r^2} \right ) +U(r)$.
I know that for the Kepler problem, U(r) becomes k/r.
So that $H=\frac{1}{2m} \left ( p_r ^2 +\frac{p_ \theta ^2 }{r^2} \right ) +\frac{k}{r}$.
Now I'm stuck at finding and solving the equations of motion.
Here is my attempt:
$\dot r = \frac{p _r}{m}$.
And $\dot p_r= mr \dot \theta ^2 -\frac{k}{r^2}$.
I don't know if this is good so far. Nor how to continue.

2. Jul 23, 2011

### jambaugh

Note by the way that you have two more Hamilton's equations for the angular components: $\dot{\theta} = \cdots$ and $\dot{p}_\theta = \cdots$

$q_1 = r, q_2 = \theta$, $p_1 = p_r, p_2 = p_\theta$

Next apply definitions of momenta:
$p_r = m\dot{r}$, $p_\theta = mr\dot{\theta}$.

3. Jul 23, 2011

### fluidistic

Oh right, thanks. I totally forgot about theta.
I reach $\dot p _\theta=0$ (I think this implies the conservation of angular momentum) and $\dot \theta = \frac{p _\theta}{mr^2}$.
I think that $p_ \theta =mr^2 \dot \theta$ (that's what I reached) instead of $p_ \theta =mr \dot \theta$. What do you say?
Ok, I'm going to tackle the rest after I eat.

4. Jul 24, 2011

### fluidistic

Using the relations you told me, I get $m \dot r =mr \dot \theta ^2 - \frac{k}{r^2}$ and $mr^2 \dot \theta =0$. These are the equations of motion.
Now I tried to solve them (I likely made some algebra error somewhere) and reached $r(t)=\sqrt[3]{- \frac{3kt}{m} }$. And $\theta (t)=C$, a constant, which I know is wrong.

5. Jul 24, 2011

### mathfeel

When you are doing Hamiltonian mechanics, you want to work with $p_j$ instead of $\dot{q}_j$. In this case, you shouldn't work with $\dot{\theta}$.

That said, write the Hamiltonian EoM for $\theta$: $\dot{p}_{\theta} = - \frac{\partial H}{\partial \theta}$, from which you can conclude an important property for $p_{\theta}$.
Once you done that, you can rewrite the original Hamiltonian in terms of $r$ and $p_r$ only with certain effective potential and reduce the two dimensional problem to a one-dimensional mechanics problem.

6. Jul 24, 2011

### fluidistic

Hmm ok.

My Hamiltonian does not depend on theta so that I get that the generalized momentum of theta is worth 0.
I have $H=\frac{1}{2m} \left ( p_r ^2 + \frac{p_ \theta ^2 }{r^2} \right ) +U(r)$ with $p_r=m \dot r$ and $p _\theta =m r^2 \dot \theta$. I assume I'm already wrong on this?
Ok, I'll try this. Thanks for helping me once again.

7. Jul 24, 2011

### capandbells

Are you sure that's what you get? What is the theta derivative of the Hamiltonian supposed to give you?

8. Jul 25, 2011

### mathfeel

No, you get that the time derivative of generalized momentum of theta is 0.
Looks okay except your misinterpretation above.

9. Jul 25, 2011

### jambaugh

You set $p_\theta = 0$ when you should set $p_\theta = const.$.
(And yes I forgot to square the radius).

$p_\theta = mr^2 \dot{\theta} = L$ as constant. Solve this for $\dot{\theta}$ and eliminate from your other equations: $\dot{\theta} = \frac{L}{m r^2}$.

So $\dot{p}_r = m\ddot{r} = mr\dot{\theta}^2 - \frac{k}{r^2} = m r \left( \frac{L}{m r^2}\right)^2 - \frac{k}{r^2}$.

You have a single 2nd order differential equation in r alone.
I think then a substitution $z = 1/r$ will make this differential equation easier to solve (but it's been a while so play with it and see).

Once you have $r(t)$ you go back to the constant angular momentum equation and solve for theta.

 Oh, yea you can't solve for $r(t)$ explicitly. But you can find $r(\theta)$. Use $\dot{r} = \dot{\theta}\frac{dr}{d\theta}$.

Last edited: Jul 25, 2011
10. Jul 25, 2011

### fluidistic

I have no idea at all about what the theta derivative of the Hamiltonian is supposed to give me.
I've been corrected by others and now see my error of concluding that the generalized momentum of theta is worth 0, it's its time derivative that is worth 0.

Thanks, I see it now.

Ok thanks a lot.
So you say I can't solve explicitly for r(t) the differential equation $\ddot r - \frac{L^2}{m^2 r^3}+\frac{k}{r^2}=0$. Instead I have to find $r (\theta )$ (how will this help?).
Also, how did you find $\dot{r} = \dot{\theta}\frac{dr}{d\theta}$?
Edit: nevermind my last question. $\dot r =\frac{dr}{dt}= \dot \theta \frac{dr}{d\theta }=\frac{d \theta }{dt} \frac{dr}{d\theta }$ and the relation is obvious.
Ok I will try to use this.

Edit2: I would love any further tip. I'm heading to bed right now and hopefully I'll try harder when I wake up. I have no success as of now. I don't see in which equation I could replace $\dot r by \dot \theta \frac{dr}{d\theta }$.

Last edited: Jul 25, 2011
11. Jul 26, 2011

### mathfeel

Second derivative is hard to integrate. Find from the Hamiltonian equations $\frac{dr}{dt}$ as function of $r$. Use the chain rule and the definition of $p_{\theta}$ to make $\frac{d}{dt}$ into $\frac{d}{d\theta}$, then integrate that to find $r(\theta)$.

Remember that in addition to angular momentum $P_{\theta}$, the energy, which in this case is equal to the Hamiltonian is also a constant of motion. In order to specify the orbit, one must supply both information.

Last edited: Jul 26, 2011
12. Jul 26, 2011

### fluidistic

Ok for your last suggest, I'll try to do it. But right now I'm totally lost in the equations when looking for $r(\theta )$. I've "played" with 3 of the 4 Hamiltonian equations and I don't see how to get $\dot r (r)$. Could you tell me which ones I should work with please?

13. Jul 26, 2011

### mathfeel

The only term that contains $\dot{r}$ is $\dot{p}_r$. Invert the definition of Hamiltonian for it.

Don't you have a textbook on Hamiltonian mechanics? This should be a standard example.

14. Jul 27, 2011

### jambaugh

Note you can integrate the 2nd order equation once:
$\ddot{r} = f(r)$ by multiplying through by $\dot{r}=v$

$\dot{r}\ddot{r} = \dot{r}f(r)$

$v \frac{dv}{dt} = f(r) \frac{dr}{dt}$
$v dv = f(r)dr$
$\int v dv = \int f(r)dr$
However this (I think) should just recover your Hamiltonian (over m) as the constant of integration.

 This is the point of using the Hamiltonian format to solve the problem. It avoids the 2nd order equation and the need to apply the above "trick".

So taking the Hamiltonian set equal to E the constant energy and substituting $\dot{\theta}$ as a function of the constant angular momentum L you should be able to solve for $\dot{r}$ as a function of r alone. You must integrate this equation. Here is where going to $r(\theta)$ and/or r = 1/z might be helpful.

Note that I do not have the solution readily in mind. You need to work through the details and possible dead ends.

Last edited: Jul 27, 2011
15. Jul 27, 2011

### fluidistic

Then I probably made an error. My $\dot p _r$ term doesn't contain $\dot r$. That would explain my great confusion. I'll redo the algebra to see what I get for $\dot p _r$.
I don't really understand what you mean by "invert the def. of the Hamiltonian".
About the textbooks, I have the first ed. of Goldstein's book, and Landau's book on classical mechanics. I've searched this problem over the internet and the best I could find was exactly where I'm stuck (the equations of motions), but they are not solved in any book I've sneaked into nor on the Internet.
Thanks a lot jambaught, I'm going to check this out, but I'd rather try your first suggestion and then find the solution with your new approach.

16. Jul 27, 2011

### fluidistic

Refering to post #5, I have $H=\frac{1}{2m} \left ( p _r ^2+\frac{L^2}{r^2} \right ) -\frac{k}{r}=E$. I know I can conclude that the total energy is constant and worth the Hamiltonian because it does not depend explicitly on time. Now I'm thinking how to identify the "effective potential energy".

Edit: Checked up in internet and I'm almost sure that the term $\frac{L^2}{2mr^2}-\frac{k}{r}$ is the effective potential energy.

17. Jul 27, 2011

### jambaugh

You have an equation involving only $r$ and $p_r = m\dot{r}$. In short you have a 1st order ODE. Can you integrate it?

18. Jul 27, 2011

### fluidistic

I didn't take any course on ODE yet. I've however self studied first order and second order ones, when they are linear if I remember well. I think the one I'm getting isn't linear.
I've Boas's book and Boyce di Prima's book that I could use in order to tackle my differential equation.
Just to be sure, I have $E-\frac{m^2 \dot r ^2}{2m}-\frac{L^2}{2mr^2}+\frac{k}{r}=0$.
To use a mathematician notation, I could write that my ODE is $c_1+c_2 y ' ^2 + \frac{c_3}{y^2}+\frac{c_4}{y}=0$. I don't think I've studied these kind of ODE, unless it's of a Bernoulli's type?
Hmm I'll think about integration... let's see what will pop up. (Currently almost 2am, I guess type to sleep for me. Will come back to this tomorrow).

Edit: By the way, I have a question regarding theory of the Hamiltonian "formalism" or approach to classical mechanics. I think I'm only supposed to get first order differential equations for the equations of motion, instead of second order ones like the Lagrangian approach. Am I right on this? Then why did I get a second order differential equation in post #10?!

Last edited: Jul 27, 2011
19. Jul 28, 2011

### jambaugh

Try a little algebra! Solve for $\dot{r}$.
You get $\dot{r} = f(r)$ or
$$\frac{dr}{dt} = f(r)$$
$$\frac{dr}{f(r)} = dt$$
$$\int \frac{1}{f(r)} dr = t+C$$
an implicit form.... if you can integrate the mess.

The integration becomes tractable if you use the two "tricks" I mentioned and you can solve for $r$ as a function of $\theta$ to get the classic polar forms of the conic sections.

With Hamilton's equations you end up with a system of 1st order ODE's in twice as many variables. $r,\theta, p_r, p_\theta$. It is in the substitution for solution that you end up back with the 2nd order equations of the Lagrangian method (in half as many variables $r,\theta$.)

20. Jul 28, 2011

### fluidistic

Thank you, that's encouraging :)
Ah I see, now this becomes clearer to me.
I reach $\dot r = \pm \sqrt {\frac{2}{m}[E-U(r)_{\text{effective}}]}=f(r)$.
Here I have a little confusion, in post #14, your $f(r)= \ddot r$ and now it's $f(r)=\dot r$. I don't think that changes things much, but I'll investigate.
Anyway, I reach$\pm \int \frac{dr}{\sqrt {\frac{2}{m}[E-U(r)_{\text{effective}}]}}=t+C$. I recognize integrals of these kinds, I think I've seen this in Landau's chapter on central forces. But yeah, I'd rather solve it at least once myself instead of just taking the solution for granted.
Am I right also if instead of my last integral, I set up $\pm \int _{r_0} ^{r_1}\frac{dr}{\sqrt {\frac{2}{m}[E-U(r)_{\text{effective}}]}}=\int _{t_0}^{t_1}dt=t$. I'm almost sure that's a yes thanks to calculus 2, but I prefer to be sure. I actually prefer the latter form: definite integrals.
Oh I didn't know this. Thank you so much for clearing this to me.

Edit: I reach $\pm \int \frac{d\theta }{\dot \theta }=t+C$. Not sure this helps nor if I'm on the right direction. I'm still trying to figure out $r(\theta )$.

Last edited: Jul 28, 2011