Skip to content

Commit 97961dd

Browse files
Merge pull request #817 from abhro/patch-1
Fix Hamiltonian form in Kepler problem example
2 parents 72118ca + e77e0ba commit 97961dd

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

docs/src/examples/kepler_problem.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
11
# The Kepler Problem
22

3-
The Hamiltonian $\mathcal {H}$ and the angular momentum $L$ for the Kepler problem are
3+
The (non-dimensional) Hamiltonian $\mathcal {H}$ and the angular momentum $L$ for the Kepler problem are
44

5-
$$\mathcal {H} = \frac{1}{2}(\dot{q}^2_1+\dot{q}^2_2)-\frac{1}{\sqrt{q^2_1+q^2_2}},\quad
6-
L = q_1\dot{q_2} - \dot{q_1}q_2$$
5+
```math
6+
\begin{align*}
7+
\mathcal{H}(q_1, p_1, q_2, p_2) &= \frac{1}{2}(p^2_1+p^2_2)-\frac{1}{\sqrt{q^2_1+q^2_2}}, \\
8+
L &= q_1 p_2 - p_1 q_2
9+
\end{align*}
10+
```
711

812
Also, we know that
913

10-
$${\displaystyle {\frac {\mathrm {d} {\boldsymbol {p}}}{\mathrm {d} t}}=-{\frac {\partial {\mathcal {H}}}{\partial {\boldsymbol {q}}}}\quad ,\quad {\frac {\mathrm {d} {\boldsymbol {q}}}{\mathrm {d} t}}=+{\frac {\partial {\mathcal {H}}}{\partial {\boldsymbol {p}}}}}$$
14+
```math
15+
\begin{align*}
16+
\frac{\mathrm{d} \boldsymbol{p}}{\mathrm{d} t} &= - \frac {\partial \mathcal{H}}{\partial \boldsymbol{q}} , \\
17+
\frac{\mathrm{d} \boldsymbol{q}}{\mathrm{d} t} &= + \frac {\partial \mathcal{H}}{\partial \boldsymbol{p}}
18+
\end{align*}
19+
```
1120

1221
```@example kepler
1322
import OrdinaryDiffEq as ODE, LinearAlgebra, ForwardDiff, NonlinearSolve as NLS, Plots

0 commit comments

Comments
 (0)