Skip to content

Commit

Permalink
deploy: bb1d8a5
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanwweber committed Mar 12, 2024
1 parent 2626b97 commit 1d65c2a
Show file tree
Hide file tree
Showing 161 changed files with 3,063 additions and 3,573 deletions.
2 changes: 1 addition & 1 deletion .buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 872b768ca72aa162fa98caa2ca5da611
config: eb783ae0f49d501bdcceefc61597e519
tags: 645f666f9bcd5a90fca523b33c5a78b7
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,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
1 change: 1 addition & 0 deletions _sources/intro/reference-frames.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ The two types of reference frames are:
Profound.

(sec:inertial-reference-frame)=

### Inertial Reference Frame

An **inertial** reference frame is one that is not _accelerating_. It may be moving at constant velocity, but there can be absolutely no acceleration, _including rotation!_
Expand Down
46 changes: 25 additions & 21 deletions _sources/orbital-maneuvers/nonimpulsive-maneuver-example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
"from scipy.integrate import solve_ivp\n",
"# %matplotlib notebook\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"from matplotlib.patches import Circle\n",
"from scipy.integrate import solve_ivp\n",
"\n",
"R_E = 6378 # km\n",
"mu = 3.986E5 # km**3/s**2\n",
"mu = 3.986e5 # km**3/s**2\n",
"\n",
"r_LEO = R_E + 300 # km\n",
"v_LEO = np.sqrt(mu / r_LEO) # km/s\n",
Expand All @@ -52,12 +52,12 @@
"\n",
"r_0 = np.array((r_LEO, 0, 0)) # km\n",
"v_0 = np.array((0, v_LEO, 0)) # km/s\n",
"m_0 = np.array((1000)) # kg\n",
"m_0 = np.array(1000) # kg\n",
"Y_0 = np.hstack((r_0, v_0, m_0))\n",
"\n",
"T = 2.5E-3 # kN\n",
"T = 2.5e-3 # kN\n",
"I_sp = 10_000 # s\n",
"g_0 = 9.807E-3 # km/s**2"
"g_0 = 9.807e-3 # km/s**2"
]
},
{
Expand All @@ -75,7 +75,7 @@
"source": [
"def nonimpulsive_maneuver(t, Y, mu, T, I_sp, g_0, r_2):\n",
" \"\"\"Residual function for non-impulsive maneuvers.\n",
" \n",
"\n",
" t: Current simulation time\n",
" Y: State vector [x y z xdot ydot zdot m], km, km/s, kg\n",
" mu: Gravitational parameter, km**3/s**2\n",
Expand All @@ -89,7 +89,7 @@
" dY_dt = np.zeros(len(Y))\n",
" dY_dt[0:3] = Y[3:6]\n",
" dY_dt[3:6] = -mu * Y[0:3] / r**3 + T * Y[3:6] / (m * v)\n",
" dY_dt[-1] = - T / (I_sp * g_0)\n",
" dY_dt[-1] = -T / (I_sp * g_0)\n",
" return dY_dt"
]
},
Expand All @@ -112,7 +112,7 @@
"source": [
"def reached_destination(t, Y, mu, T, I_sp, g_0, r_2):\n",
" \"\"\"Determine if the spacecraft reaches the destination radius.\n",
" \n",
"\n",
" Returns the difference between the current orbital radius and the\n",
" destination radius.\n",
" \"\"\"\n",
Expand Down Expand Up @@ -152,12 +152,13 @@
"source": [
"def mass(t, Y, mu, T, I_sp, g_0, r_2):\n",
" \"\"\"Return the current mass of the spacecraft.\n",
" \n",
"\n",
" The mass is stored in the last element of the solution vector.\n",
" If this becomes zero, the integration should terminate.\n",
" \"\"\"\n",
" return Y[-1]\n",
"\n",
"\n",
"mass.terminal = True"
]
},
Expand All @@ -180,10 +181,11 @@
"source": [
"def orbit(t, Y, mu, T, I_sp, g_0, r_2):\n",
" \"\"\"Trigger when the y-component of the position crosses zero.\n",
" \n",
"\n",
" Useful to count the number of orbits.\"\"\"\n",
" return Y[1]\n",
"\n",
"\n",
"# Only trigger when going from negative to positive\n",
"orbit.direction = 1"
]
Expand Down Expand Up @@ -222,17 +224,17 @@
],
"source": [
"t_end = 2_000_000 # s\n",
"t_eval = np.linspace(0, t_end, int(1E6))\n",
"t_eval = np.linspace(0, t_end, int(1e6))\n",
"sol = solve_ivp(\n",
" nonimpulsive_maneuver,\n",
" t_span=(0, t_end),\n",
" y0=Y_0,\n",
" t_eval=t_eval,\n",
" events=(reached_destination, mass, orbit),\n",
" rtol=1E-12,\n",
" atol=1E-15,\n",
" rtol=1e-12,\n",
" atol=1e-15,\n",
" method=\"DOP853\",\n",
" args=(mu, T, I_sp, g_0, r_2)\n",
" args=(mu, T, I_sp, g_0, r_2),\n",
")\n",
"print(sol.status)"
]
Expand Down Expand Up @@ -281,9 +283,9 @@
"outputs": [],
"source": [
"r_vec = sol.y[0:3].T\n",
"r = np.sqrt(r_vec[:, 0]**2 + r_vec[:, 1]**2 + r_vec[:, 2]**2)\n",
"r = np.sqrt(r_vec[:, 0] ** 2 + r_vec[:, 1] ** 2 + r_vec[:, 2] ** 2)\n",
"v_vec = sol.y[3:6].T\n",
"v = np.sqrt(v_vec[:, 0]**2 + v_vec[:, 1]**2 + v_vec[:, 2]**2)\n",
"v = np.sqrt(v_vec[:, 0] ** 2 + v_vec[:, 1] ** 2 + v_vec[:, 2] ** 2)\n",
"m = sol.y[-1]"
]
},
Expand Down Expand Up @@ -325,7 +327,7 @@
"ax.add_patch(Circle((0, 0), r_2, ec=\"C1\", fc=\"none\", lw=2, ls=\"--\"))\n",
"ax.plot(r_vec[:, 0], r_vec[:, 1], color=\"C2\")\n",
"orbit_crossings = sol.y_events[2][:, 0]\n",
"ax.plot(orbit_crossings, np.zeros(orbit_crossings.shape), 'ko', fillstyle='none')"
"ax.plot(orbit_crossings, np.zeros(orbit_crossings.shape), \"ko\", fillstyle=\"none\")"
]
},
{
Expand Down Expand Up @@ -425,7 +427,7 @@
}
],
"source": [
"h_t = np.sqrt(2 * mu * r_LEO*r_2/(r_LEO + r_2))\n",
"h_t = np.sqrt(2 * mu * r_LEO * r_2 / (r_LEO + r_2))\n",
"delta_v_1 = h_t / r_LEO - v_LEO\n",
"delta_v_2 = np.sqrt(mu / r_2) - h_t / r_2\n",
"delta_v_t = delta_v_1 + delta_v_2\n",
Expand All @@ -434,8 +436,10 @@
"delta_m = m_0 * (1 - np.exp(-delta_v_t / (300 * g_0)))\n",
"print(f\"The Δm for a Hohmann transfer is: {delta_m:.4F} kg\")\n",
"\n",
"transit_t = np.pi / np.sqrt(mu) * ((r_LEO + r_2) / 2)**(3/2)\n",
"print(f\"The time of flight for a Hohmann transfer is: {transit_t / (3600 * 24):.4F} days\")"
"transit_t = np.pi / np.sqrt(mu) * ((r_LEO + r_2) / 2) ** (3 / 2)\n",
"print(\n",
" f\"The time of flight for a Hohmann transfer is: {transit_t / (3600 * 24):.4F} days\"\n",
")"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion _sources/orbital-maneuvers/plane-change-maneuvers.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ glue("plane-change-pure-rotation", fig, display=False)
The required velocity increment as a function of dihedral angle for pure rotation maneuvers.
:::

As we can see from {numref}`fig:plane-change-pure-rotation`, plane change of about 24° requires the same $\Delta v$ as is needed to increase the speed to the escape velocity from a circular orbit, $\Delta v / v \approx$ 0.414.
As we can see from {numref}`fig:plane-change-pure-rotation`, plane change of about 24° requires the same $\Delta v$ as is needed to increase the speed to the escape velocity from a circular orbit, $\Delta v / v \approx$ 0.414.

Similarly, a plane change of 60° requires a $\Delta v$ equal to the current spacecraft velocity! In LEO, the velocity is approximately 7.5 km/s. A plane change of 60°, with an $I_{sp}$ of 300, would require over 90% of the spacecraft mass to be propellant.

Expand Down
4 changes: 2 additions & 2 deletions _sources/reference/planetary-ephemeris.md
Original file line number Diff line number Diff line change
Expand Up @@ -359,10 +359,10 @@ The default interface of HORIZONS is shown in {numref}`fig:horizons-default`
The default web interface for HORIZONS.
:::

Each of the options can be changed by clicking the *Edit* buttons. For our purposes, we can change the following:
Each of the options can be changed by clicking the _Edit_ buttons. For our purposes, we can change the following:

1. _Ephemeris Type_: Either _Vector Table_ or _Osculating Orbital Elements_ is suitable, although the latter is more direct for this example
2. _Target Body_: This option opens a pop-up where we can search for the body of interest. In the drop-down menu under *Choose a method for specifying the target body*, you can choose *Select from a list of major bodies*, then choose *Mercury*
2. _Target Body_: This option opens a pop-up where we can search for the body of interest. In the drop-down menu under _Choose a method for specifying the target body_, you can choose _Select from a list of major bodies_, then choose *Mercury*
3. _Center_: The default selection here is _Solar System Barycenter_, the center of gravity of the entire solar system. This is usually a little bit outside the sun, depending on the relative locations of the planets, especially Jupiter. In our case, we want the center of the Sun as the focus of the orbit, so click _Edit_ and then type `@sun` into the search box.
4. _Time Span_: This can be used to generate a range of dates, or to input specific dates. We will choose _Specify a list of times_ for this example, and then input the date of interest, in JDT, {glue:text}`planetary-ephemeris-JDT`.
5. _Table Settings_: Here, we want to change the units to _km and seconds_. Another useful option is the _Reference plane_. The default of _ecliptic x-y plane derived from reference plane_ is appropriate for this example. You may also want to set the CSV output option, depending on how you will use the data.
Expand Down
1 change: 1 addition & 0 deletions _sources/reference/planetary-parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ kernelspec:
---

(sec:planetary-parameters)=

# Planetary Parameters

## Planetary Mass Parameters
Expand Down
Loading

0 comments on commit 1d65c2a

Please sign in to comment.