Skip to content

Commit 014f2c2

Browse files
Merge pull request #811 from abhro/patch-1
Update bullet list in table in outer_solar_system.md
2 parents 07c6872 + 2ae7382 commit 014f2c2

File tree

1 file changed

+20
-11
lines changed

1 file changed

+20
-11
lines changed

docs/src/examples/outer_solar_system.md

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55
The chosen units are masses relative to the sun, meaning the sun has mass $1$. We have taken $m_0 = 1.00000597682$ to take account of the inner planets. Distances are in astronomical units, times in earth days, and the gravitational constant is thus $G = 2.95912208286 \cdot 10^{-4}$.
66

7-
| planet | mass | initial position | initial velocity |
8-
|:------- |:---------------------------- |:-------------------------------------------------------------------- |:-------------------------------------------------------------------- |
9-
| Jupiter | $m_1 = 0.000954786104043$ | <ul><li>-3.5023653</li><li>-3.8169847</li><li>-1.5507963</li></ul> | <ul><li>0.00565429</li><li>-0.00412490</li><li>-0.00190589</li></ul> |
10-
| Saturn | $m_2 = 0.000285583733151$ | <ul><li>9.0755314</li><li>-3.0458353</li><li>-1.6483708</li></ul> | <ul><li>0.00168318</li><li>0.00483525</li><li>0.00192462</li></ul> |
11-
| Uranus | $m_3 = 0.0000437273164546$ | <ul><li>8.3101420</li><li>-16.2901086</li><li>-7.2521278</li></ul> | <ul><li>0.00354178</li><li>0.00137102</li><li>0.00055029</li></ul> |
12-
| Neptune | $m_4 = 0.0000517759138449$ | <ul><li>11.4707666</li><li>-25.7294829</li><li>-10.8169456</li></ul> | <ul><li>0.00288930</li><li>0.00114527</li><li>0.00039677</li></ul> |
13-
| Pluto | $ m_5 = 1/(1.3 \cdot 10^8 )$ | <ul><li>-15.5387357</li><li>-25.2225594</li><li>-3.1902382</li></ul> | <ul><li>0.00276725</li><li>-0.00170702</li><li>-0.00136504</li></ul> |
7+
| planet | mass | initial position | initial velocity |
8+
|:------- |:--------------------------- |:--------------------------------------- |:-------------------------------------- |
9+
| Jupiter | $m_1 = 0.000954786104043$ | [-3.5023653, -3.8169847, -1.5507963] | [0.00565429, -0.00412490, -0.00190589] |
10+
| Saturn | $m_2 = 0.000285583733151$ | [9.0755314, -3.0458353, -1.6483708] | [0.00168318, 0.00483525, 0.00192462] |
11+
| Uranus | $m_3 = 0.0000437273164546$ | [8.3101420, -16.2901086, -7.2521278] | [0.00354178, 0.00137102, 0.00055029] |
12+
| Neptune | $m_4 = 0.0000517759138449$ | [11.4707666, -25.7294829, -10.8169456] | [0.00288930, 0.00114527, 0.00039677] |
13+
| Pluto | $m_5 = 1/(1.3 \cdot 10^8 )$ | [-15.5387357, -25.2225594, -3.1902382] | [0.00276725, -0.00170702, -0.00136504] |
1414

1515
The data is taken from the book “Geometric Numerical Integration” by E. Hairer, C. Lubich and G. Wanner.
1616

@@ -42,7 +42,11 @@ tspan = (0.0, 200_000.0)
4242

4343
The N-body problem's Hamiltonian is
4444

45-
$$H(p,q) = \frac{1}{2}\sum_{i=0}^{N}\frac{p_{i}^{T}p_{i}}{m_{i}} - G\sum_{i=1}^{N}\sum_{j=0}^{i-1}\frac{m_{i}m_{j}}{\left\lVert q_{i}-q_{j} \right\rVert}$$
45+
```math
46+
H(p,q) = \frac{1}{2}\sum_{i=0}^{N}\frac{p_i^T p_i}{m_i} - G\sum_{i=1}^N \sum_{j=0}^{i-1}\frac{m_i m_j}{\left\lVert q_i - q_j \right\rVert}
47+
```
48+
49+
where each ``p_i`` and ``q_i`` is a 3-dimensional vector describing the planet's position and momentum, respectively.
4650

4751
Here, we want to solve for the motion of the five outer planets relative to the sun, namely, Jupiter, Saturn, Uranus, Neptune, and Pluto.
4852

@@ -61,11 +65,15 @@ potential = -G *
6165

6266
`NBodyProblem` constructs a second order ODE problem under the hood. We know that a Hamiltonian system has the form of
6367

64-
$$\dot{p} = -H_{q}(p,q)\quad \dot{q}=H_{p}(p,q)$$
68+
```math
69+
\dot{p} = -H_{q}(p,q), \quad \dot{q} = H_{p}(p,q)
70+
```
6571

66-
For an N-body system, we can symplify this as:
72+
For an N-body system, we can simplify this as:
6773

68-
$$\dot{p} = -\nabla{V}(q)\quad \dot{q}=M^{-1}p.$$
74+
```math
75+
\dot{p} = -\nabla V(q), \quad \dot{q} = M^{-1} p.
76+
```
6977

7078
Thus, $\dot{q}$ is defined by the masses. We only need to define $\dot{p}$, and this is done internally by taking the gradient of $V$. Therefore, we only need to pass the potential function and the rest is taken care of.
7179

@@ -84,3 +92,4 @@ for i in 1:N
8492
end
8593
Plots.plot!(plt; xlab = "x", ylab = "y", zlab = "z", title = "Outer solar system")
8694
```
95+

0 commit comments

Comments
 (0)