Post · 8 min read· pp. 167–175

Example: Time in Earth’s Shadow

A satellite is in a 500 km by 5000 km orbit with its apse line parallel to the line from the Earth to the Sun, as in Fig. 59. Find the time that the satellite is in the Earth’s shadow if:

  1. the apogee is toward the Sun
  2. the perigee is toward the Sun

Fig. 59 shows the shaded and sunlit regions of the orbit. The satellite will be in shade when its orbit intersects the lines at the edge of the Earth, on the other side from the Sun. When apogee is towards the Sun, the satellite is in the shade from aa to bb, and when perigee is towards the Sun, the satellite is in the shade from cc to dd.

python
from matplotlib.patches import Ellipse, Circle, Arc, Rectangle
import matplotlib.pyplot as plt
import numpy as np

mu = 3.986004418E5  # km**3/s**2
R_E = 6378  # km
r_p = R_E + 500  # km
r_a = R_E + 5000  # km
e = (r_a - r_p) / (r_p + r_a)
a = (r_a + r_p) / 2
T = 2 * np.pi / np.sqrt(mu) * a**(3/2)

fig, (ax_1, ax_2) = plt.subplots(nrows=2, figsize=(9, 12), dpi=200)
b = a * np.sqrt(1 - e**2)
ellipse_focus = np.sqrt(a**2 - b**2)

ax_1.add_patch(Rectangle((-1.5*a, -R_E), 1.5*a + ellipse_focus, 2*R_E, facecolor="yellow", alpha=0.5))
ax_1.add_patch(Rectangle((-1.5*a, R_E), 3*a, 0.5*R_E, facecolor="yellow", alpha=0.5))
ax_1.add_patch(Rectangle((-1.5*a, -R_E), 3*a, -0.5*R_E, facecolor="yellow", alpha=0.5))
ax_1.add_patch(Rectangle((ellipse_focus, -R_E), a + ellipse_focus, 2*R_E, facecolor="gray", alpha=0.5))
ax_2.add_patch(Rectangle((ellipse_focus, -R_E), 1.5*a - ellipse_focus, 2*R_E, facecolor="yellow", alpha=0.5))
ax_2.add_patch(Rectangle((-1.5*a, R_E), 3*a, 0.5*R_E, facecolor="yellow", alpha=0.5))
ax_2.add_patch(Rectangle((-1.5*a, -R_E), 3*a, -0.5*R_E, facecolor="yellow", alpha=0.5))
ax_2.add_patch(Rectangle((-1.5*a, -R_E), 1.5*a + ellipse_focus, 2*R_E, facecolor="gray", alpha=0.5))

for ax in (ax_1, ax_2):
    ax.set_aspect("equal")
    ax.axis("off")
    ax.add_patch(Ellipse((0, 0), 2*a, 2*b, facecolor="None", edgecolor="black"))
    ax.add_patch(Circle((ellipse_focus, 0), R_E, facecolor="skyblue"))
    ax.plot((-a, a), (0, 0), lw=0.5, marker="o", color="black", markersize=3)
    ax.axhline(R_E, lw=0.5, ls="--")
    ax.axhline(-R_E, lw=0.5, ls="--")

x_1 = R_E/np.tan(np.radians(57.423)) + ellipse_focus
ax_1.plot((x_1, ellipse_focus, x_1), (-R_E, 0, R_E), "k-o")
ax_1.annotate("$a$", xy=(x_1, -R_E), ha="left", va="top")
ax_1.annotate("$b$", xy=(x_1, R_E), ha="left", va="bottom")
ax_1.annotate("To the Sun", xy=(-a, 0), xytext=(-1.5*a, 0), ha="right", va="center", arrowprops={"arrowstyle": "<-"})
ax_1.annotate("Shaded", xy=(1.5*a, 0), ha="left", va="center")
ax_1.annotate("$P$", xy=(a, 0), ha="left", va="top")
ax_1.annotate("$A$", xy=(-a, 0), ha="left", va="top")
ax_1.annotate("$O$", xy=(ellipse_focus, 0), ha="right", va="top")
ax_1.plot([ellipse_focus]*2, (0, R_E), "k--", lw=0.5)
ax_1.annotate("$R_E$", xy=(ellipse_focus, R_E/2), ha="right", va="center")
ax_1.add_patch(Arc((ellipse_focus, 0), a, a, theta2=57.423))
ax_1.annotate(r"$\nu$", xy=(a/1.4, 2500), ha="left", va="center")
ax_1.annotate("$r$", xy=(x_1/2, R_E/2), ha="left", va="bottom")

x_2 = R_E/np.tan(np.radians(143.36)) + ellipse_focus
ax_2.plot((x_2, ellipse_focus, x_2), (-R_E, 0, R_E), "k-o")
ax_2.annotate("$d$", xy=(x_2, -R_E), ha="right", va="top")
ax_2.annotate("$c$", xy=(x_2, R_E), ha="right", va="bottom")
ax_2.annotate("To the Sun", xy=(a, 0), xytext=(1.5*a, 0), ha="left", va="center", arrowprops={"arrowstyle": "<-"})
ax_2.annotate("Shaded", xy=(-1.5*a, 0), ha="right", va="center")
ax_2.annotate("$P$", xy=(a, 0), ha="left", va="top")
ax_2.annotate("$A$", xy=(-a, 0), ha="left", va="top")
ax_2.annotate("$O$", xy=(ellipse_focus, 0), ha="left", va="top")
ax_2.plot((ellipse_focus + a/3, ellipse_focus + a/3), (0, R_E), "k--", lw=0.5)
ax_2.annotate("$R_E$", xy=(ellipse_focus + a/3, R_E/2), ha="left", va="center")
ax_2.add_patch(Arc((ellipse_focus, 0), a/2, a/2, theta2=143.36))
ax_2.annotate(r"$\nu$", xy=(ellipse_focus, 2500), ha="center", va="bottom")
ax_2.annotate("$r$", xy=(x_2/2, R_E/2), ha="left", va="top");

<Figure size 1800x2400 with 2 Axes>

python
fig

<Figure size 1800x2400 with 2 Axes>

<Figure size 1800x2400 with 2 Axes>

Figure 59:The orientation of the Sun relative to the Earth in this example.

Solution

In this problem, we are looking for the time the satellite spends between two points in the orbit. We can find the true anomaly of the Sun/shadow crossing points geometrically, so this problem is the type where ν\nu is given and we are finding tt.

We start by finding ee, aa, and TT.

python
import numpy as np
from scipy.optimize import newton

mu = 3.986004418E5  # km**3/s**2

R_E = 6378 # km
r_p = R_E + 500  # km
r_a = R_E + 5000  # km
e = (r_a - r_p) / (r_p + r_a)
a = (r_a + r_p) / 2
T = 2 * np.pi / np.sqrt(mu) * a**(3/2)

The eccentricity of the orbit is e=e = 0.2465, the semimajor axis distance is a=a = 9128 km, and the period is T=T = 2.41 hr. Then, we need to solve for the value of ν\nu at bb and cc. With this value of ν\nu, we can find the time to fly between the two points. This will tell us the time the satellite is in the shade.

From Fig. 59, we can draw a right triangle from the center of Earth vertically up, then over to the spacecraft, then back down the \vectorr\vector{r} vector to the center of the Earth. This gives:

r=REsin⁡νr = \frac{R_E}{\sin\nu}

(231)

However, we don’t know rar_a or rbr_b to be able to find ν\nu. We need another equation, and the orbit equation Eq. 123 will serve.

Now, we can set Eq. 123 and Eq. 231 equal to each other and solve for ν\nu. We end up with a complicated equation for ν\nu:

ecos⁡ν−(1−e2)aREsin⁡ν+1=0e\cos\nu - \left(1 - e^2\right)\frac{a}{R_E}\sin\nu + 1 = 0

(232)

It is possible to solve this equation analytically for ν\nu, but frankly, I don’t know that much trigonometry. So we will solve this numerically.

We need to find out how many roots to expect in this equation. One way to do that is to plot the equation over a suitable range and see how many times it crosses zero. The suitable range for this problem is [0,2π][0, 2\pi].

python
def shadow(nu, e, a, R_E):
    """This function computes the angle 𝜈 in the shadow example problem.

    The arguments are the angle, the eccentricity, the semimajor axis, and
    the radius of the Earth.
    """
    return e * np.cos(nu) - (1 - e**2) * a / R_E * np.sin(nu) + 1

nu_range = np.linspace(0, 2 * np.pi)
shadow_result = shadow(nu_range, e, a, R_E)
python
fig, ax_shadow = plt.subplots(dpi=200, figsize=(6, 4))
ax_shadow.plot(nu_range, shadow_result)
ax_shadow.axhline(0);
ax_shadow.set_xlabel(r"$\nu$");

<Figure size 1200x800 with 1 Axes>

python
fig

<Figure size 1200x800 with 1 Axes>

<Figure size 1200x800 with 1 Axes>

Figure 60:The solution of Eq. 232.

From Fig. 60, we can see there are two roots, one near ν=\nu = 1 and one near ν=\nu = 2.5, both in radians. Now we can use scipy.optimize.newton() to solve the equation. Since we know the approximate roots from Fig. 60, we can use those as initial guesses for the result. Examining Fig. 59, we see that ν≈\nu \approx 1 radians, or approximately 60°, corresponds to point b. ν≈\nu \approx 2.5, or approximately 140°, corresponds to point c.

python
nu_b = newton(func=shadow, x0=1, args=(e, a, R_E))  # rad
nu_c = newton(func=shadow, x0=2.5, args=(e, a, R_E))  # rad

The true anomaly at point b is νb=\nu_b = 57.42° and at point c is νc=\nu_c = 143.36°. Now we can use these values of ν\nu to solve for EE, then for the mean anomaly, and then for the time since perigee.

python
E_b = (2 * np.arctan(np.sqrt((1 - e) / (1 + e)) * np.tan(nu_b / 2)))
M_eb = E_b - e * np.sin(E_b)
t_b = M_eb * T / (2 * np.pi)  # s
time_in_shadow_ab = 2 * t_b  # s

The time to fly from perigee to point bb, 14.45 min, is the same as the time to fly from point aa to perigee, because the orbit is symmetrical around the apse line. Therefore, the time the satellite is in shadow when apogee is towards the Sun is a little less than half an hour, 28.9 min.

When perigee is towards the Sun, then the satellite will be in shadow from point cc to point dd. The time the satellite spends in the Sun, going from perigee to apogee, is the time flying from perigee to point c. The total time in the Sun is twice this time, and the time in shadow is the total period minus the time in the Sun.

python
E_c = (2 * np.arctan(np.sqrt((1 - e) / (1 + e)) * np.tan(nu_c / 2)))
M_ec = E_c - e * np.sin(E_c)
t_c = M_ec * T / (2 * np.pi)
time_in_shadow_cd = T - 2 * t_c

The total time in shadow is 45.3 min when perigee points towards the Sun. This result is intuitively correct because the satellite is traveling slower near apogee, due to Kepler’s second law (equal areas in equal times).