Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanwweber committed Mar 10, 2024
1 parent 8d390ed commit 6c49656
Show file tree
Hide file tree
Showing 32 changed files with 1,792 additions and 1,651 deletions.
4 changes: 4 additions & 0 deletions chapter-4/7-effects-of-the-earths-oblateness.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Therefore, it is sufficient to define any two of $a$, $b$, or $f$ to define the

The parameters specified in the WGS84 standard are:

<!-- markdownlint-disable MD033 -->
| Parameter | Value |
|----------------|----------------------------------------------------------------------------------|
| $a$ | 6,378,137.0 m |
Expand All @@ -38,14 +39,17 @@ The parameters specified in the WGS84 standard are:
| Zero Longitude | [IERS Reference Meridian](https://en.wikipedia.org/wiki/IERS_Reference_Meridian) |
| $\mu$ | 3986004.418×10<sup>8</sup> m³/s². |
| $\omega_E$ | 72.92115×10<sup>−6</sup> rad/s |
<!-- markdownline-enable MD033 -->

For even more accurate orbit calculations, particularly over longer time scales, it is necessary to map the variations in the earth's gravitational field due to things such as the tides, mountain ranges, oceans, and more. These effects are represented in a model called the [**Earth Gravitational Model**](https://en.wikipedia.org/wiki/Earth_Gravitational_Model) (EGM). The most recent EGM is from 2008 and relies on high accuracy satellite measurements of Earth's gravitational field.

[EGM2008](https://agupubs.onlinelibrary.wiley.com/doi/full/10.1029/2011JB008916) specifies the geoid of the earth to very high accuracy, as low as 10 cm in places. The EGM2008 is a model fit to the available experimental data, using [spherical harmonic equations](https://en.wikipedia.org/wiki/Spherical_harmonics) of extremely high order, resulting in [many millions of coefficients](https://earth-info.nga.mil/GandG/wgs84/gravitymod/new_egm/new_egm.html) in the model.

## Effect of Oblateness on Orbits

<!-- markdownlint-disable MD033 -->
The effect of planetary oblateness on orbits is captured in the dimensionless parameter called $J_2$, the **second zonal harmonic**. The zonal harmonics are values that depend on the particular planet. For Earth, $J_2 =$ 1.08263×10<sup>-3</sup> {cite}`Vallado2013` (Page 1039).
<!-- markdownlint-enable MD033 -->

The effect of oblateness is to cause the right ascension of the ascending node and the argument of the periapsis to change as a function of time. The average rate of change of these variables is:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ Next, we need to calculate the orbital angular momentum. By definition, $\vector
:::
::::

<!-- markdownlint-disable MD033 -->
We find $\vector{h} =$ {glue:text}`orbital-elements-h_vec-I:.0f` $\uvec{I}$ + {glue:text}`orbital-elements-h_vec-J:.0f` $\uvec{J}$ - {glue:text}`orbital-elements-h_vec-K:.0f` $\uvec{K}$ km<sup>2</sup>/s and $h =$ {glue:text}`orbital-elements-h:.3f` km<sup>2</sup>/s. Notice that the $Z$ component of the angular momentum is negative. This means the momentum vector is pointing down and the orbit is retrograde. The magnitude of the orbital angular momentum is the first orbital element.
<!-- markdownlint-enable MD033 -->

### Step 3—Inclination

Expand Down Expand Up @@ -328,8 +330,10 @@ The sequence of rotations to convert from the perifocal frame to the inertial fr

::::{grid} 1
---

gutter: 2
---

:::{grid-item-card} Step 2.1—Rotate Until $\uvec{p}$ is Aligned With the Node Line

By definition, the $\uvec{p}$ vector points towards periapsis. Therefore, it is also aligned with the eccentricity vector. If we rotate the frame around the $\uvec{w}$ axis until $\uvec{p}$ is aligned with the node line, this will align $\vector{e}$ with $\vector{N}$. This rotation is the negative of the argument of periapsis, $\omega$.
Expand All @@ -353,6 +357,7 @@ These three angles ($\omega$, $i$, and $\Omega$) are called [**Euler angles**](h

::::{tab-item} PYTHON
---

sync: PYTHON
---

Expand All @@ -371,8 +376,10 @@ To actually perform the rotation, we need to multiply the position and velocity

::::{tab-item} MATLAB
---

sync: MATLAB
---

:::{literalinclude} scripts/orbital_elements_and_the_state_vector.m
:start-after: "[section-9]"
:end-before: "[section-10]"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
#!/usr/bin/env python
# coding: utf-8

# **The canonical version of this is in `classical-orbital-elements/scripts/definition-of-raan.py`.**
# **The canonical version of this is in
# `classical-orbital-elements/scripts/definition-of-raan.py`.**
#
# This Notebook is here for interactive experimentation.

# In[1]:


import plotly.graph_objects as go
import numpy as np
import plotly.graph_objects as go
from scipy.spatial.transform import Rotation as R


# In[2]:


Expand Down Expand Up @@ -70,9 +69,9 @@ def arrow(start, end, fig=None, **kwargs):

a = 100
e = 0.4
b = a * np.sqrt(1 - e ** 2)
b = a * np.sqrt(1 - e**2)
r_p = a * (1 - e)
p = a * (1 - e ** 2)
p = a * (1 - e**2)

inclination = 30
raan = 30
Expand All @@ -83,7 +82,7 @@ def arrow(start, end, fig=None, **kwargs):
theta = np.arange(0, 2 * np.pi, step=0.01)
phi = 0
# https://math.stackexchange.com/a/819533
r = a * (1 - e ** 2) / (1 - e * np.cos(theta - phi))
r = a * (1 - e**2) / (1 - e * np.cos(theta - phi))
x = r * np.cos(theta)
y = r * np.sin(theta)
z = np.zeros_like(x)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
#!/usr/bin/env python
# coding: utf-8

# In[1]:


import plotly.graph_objects as go
import numpy as np
import plotly.graph_objects as go
from scipy.spatial.transform import Rotation as R


# In[2]:


Expand Down Expand Up @@ -66,7 +64,7 @@ def arrow(start, end, fig=None, **kwargs):

a = 100
e = 0.4
b = a * np.sqrt(1 - e ** 2)
b = a * np.sqrt(1 - e**2)
r_p = a * (1 - e)

inclination = 30
Expand All @@ -77,7 +75,7 @@ def arrow(start, end, fig=None, **kwargs):

theta = np.arange(0, 2 * np.pi, step=0.01)
phi = 0
r = a * (1 - e ** 2) / (1 - e * np.cos(theta - phi))
r = a * (1 - e**2) / (1 - e * np.cos(theta - phi))
x = r * np.cos(theta)
y = r * np.sin(theta)
z = np.zeros_like(x)
Expand Down
13 changes: 6 additions & 7 deletions classical-orbital-elements/scripts/definition_of_raan.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
#!/usr/bin/env python
# coding: utf-8

# **The canonical version of this is in `classical-orbital-elements/scripts/definition-of-raan.py`.**
# **The canonical version of this is in
# `classical-orbital-elements/scripts/definition-of-raan.py`.**
#
# This Notebook is here for interactive experimentation.

# In[1]:


import plotly.graph_objects as go
import numpy as np
import plotly.graph_objects as go
from scipy.spatial.transform import Rotation as R


# In[2]:


Expand Down Expand Up @@ -70,9 +69,9 @@ def arrow(start, end, fig=None, **kwargs):

a = 100
e = 0.4
b = a * np.sqrt(1 - e ** 2)
b = a * np.sqrt(1 - e**2)
r_p = a * (1 - e)
p = a * (1 - e ** 2)
p = a * (1 - e**2)

inclination = 30
raan = 30
Expand All @@ -83,7 +82,7 @@ def arrow(start, end, fig=None, **kwargs):
theta = np.arange(0, 2 * np.pi, step=0.01)
phi = 0
# https://math.stackexchange.com/a/819533
r = a * (1 - e ** 2) / (1 - e * np.cos(theta - phi))
r = a * (1 - e**2) / (1 - e * np.cos(theta - phi))
x = r * np.cos(theta)
y = r * np.sin(theta)
z = np.zeros_like(x)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
r = np.linalg.norm(r_vec)
v = np.linalg.norm(v_vec)
v_r = np.dot(r_vec / r, v_vec)
v_p = np.sqrt(v ** 2 - v_r ** 2)
v_p = np.sqrt(v**2 - v_r**2)

# [section-2]
h_vec = np.cross(r_vec, v_vec)
Expand All @@ -34,7 +34,7 @@
nu = np.arccos(np.dot(r_vec / r, e_vec / e))

# [section-8]
r_w = h ** 2 / mu / (1 + e * np.cos(nu)) * np.array((np.cos(nu), np.sin(nu), 0))
r_w = h**2 / mu / (1 + e * np.cos(nu)) * np.array((np.cos(nu), np.sin(nu), 0))
v_w = mu / h * np.array((-np.sin(nu), e + np.cos(nu), 0))

# [section-9]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
(sec:conservation-of-angular-momentum)=

# Angular Momentum Is Conserved In Orbital Motion

The two masses $m_1$ and $m_2$ in the two-body problem form a _system_, so they must follow all of the conservation laws:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
(sec:conservation-of-energy)=

# Energy Is Conserved In Orbital Motion

The two masses $m_1$ and $m_2$ in the two-body problem form a _system_, so they must follow all of the conservation laws:
Expand Down
5 changes: 3 additions & 2 deletions dodo.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from pathlib import Path
from doit.action import CmdAction
import yaml
from textwrap import dedent

import yaml
from doit.action import CmdAction

from raw_svg import render_math_svg

HERE = Path(__file__).parent
Expand Down
Loading

0 comments on commit 6c49656

Please sign in to comment.