diff --git a/book/2_potential_fields/.DS_Store b/book/2_potential_fields/.DS_Store index a015d6d..072a02b 100644 Binary files a/book/2_potential_fields/.DS_Store and b/book/2_potential_fields/.DS_Store differ diff --git a/book/2_potential_fields/labs/week4/current_loop_lab.html b/book/2_potential_fields/labs/week4/current_loop_lab.html new file mode 100644 index 0000000..251b363 --- /dev/null +++ b/book/2_potential_fields/labs/week4/current_loop_lab.html @@ -0,0 +1,297 @@ + + + + + + + + +
+
+
+
+
+
+
+
Field lines in the x–z plane: exact loop (solid) and dipole with the same moment (dashed)
+
+
+
|B| on the axis (log–log)
+
+
Dipole formula / exact field on the axis
+
+
+
+

+

The loop lies in the x–y plane and is seen edge-on: ⊗ current into the page, ⊙ current out of the page, so m = IπRL2 ẑ points up. Lengths in the upper panel are in units of RL. Exact axial field: B = μ0IRL2 / [2(RL2+z2)3/2]. Dipole formula on the axis: B = μ0m / (2πz3).

+ + + diff --git a/book/2_potential_fields/labs/week4/earth_dipole_lab.html b/book/2_potential_fields/labs/week4/earth_dipole_lab.html new file mode 100644 index 0000000..bf4fc8a --- /dev/null +++ b/book/2_potential_fields/labs/week4/earth_dipole_lab.html @@ -0,0 +1,251 @@ + + + + + + + + +
+
+
+
+
+ + +
+
+
Dipole field lines and the head-to-tail construction at the probe
+
+
+
|B| along the radial line through the probe
+
+
At the surface: angle below horizontal and |B|/B*
+
+
+
+

+

Drawn as in the lecture slides: m̂ = ẑ points up the page and θ is measured from m̂. For the present Earth, m̂ points to the southern end of the dipole axis, so the southern end (θ = 0) is at the top and the northern end (θ = 180°) at the bottom. Arrows at the probe show the bracket 3(m̂·r̂)r̂ − m̂ (blue: 3(m̂·r̂)r̂, red: −m̂, black: sum); their length does not depend on r. The field itself is B = B*(a/r)3 times this bracket, with B* = 29.7 µT and a = 6371 km.

+ + + diff --git a/book/2_potential_fields/labs/week4/fair_weather_lab.html b/book/2_potential_fields/labs/week4/fair_weather_lab.html new file mode 100644 index 0000000..742a40f --- /dev/null +++ b/book/2_potential_fields/labs/week4/fair_weather_lab.html @@ -0,0 +1,280 @@ + + + + + + + + +
+
+
+
+
+
+
+ + + +
+
+
Field strength |E|/E0, equipotentials (white), field lines (grey)
+
+
Profile along the vertical line through the test charge
+
+
+

+

Equipotentials are drawn every E0·1 m. The arrow on the test charge is the force F = qE, its length proportional to |F|. The grounded hemisphere (a > 0) is a crude model of a person, a tree or a small hill.

+ + + diff --git a/book/2_potential_fields/labs/week4/figures/earth_dipole_setup.png b/book/2_potential_fields/labs/week4/figures/earth_dipole_setup.png new file mode 100644 index 0000000..99224ad Binary files /dev/null and b/book/2_potential_fields/labs/week4/figures/earth_dipole_setup.png differ diff --git a/book/2_potential_fields/labs/week4/figures/earth_dipole_vectors_solution.png b/book/2_potential_fields/labs/week4/figures/earth_dipole_vectors_solution.png new file mode 100644 index 0000000..d8b61f8 Binary files /dev/null and b/book/2_potential_fields/labs/week4/figures/earth_dipole_vectors_solution.png differ diff --git a/book/2_potential_fields/labs/week4/figures/simple_ionosphere.png b/book/2_potential_fields/labs/week4/figures/simple_ionosphere.png new file mode 100644 index 0000000..85559b3 Binary files /dev/null and b/book/2_potential_fields/labs/week4/figures/simple_ionosphere.png differ diff --git a/book/2_potential_fields/labs/week4/figures/spherical_capacitor.png b/book/2_potential_fields/labs/week4/figures/spherical_capacitor.png new file mode 100644 index 0000000..ebd5868 Binary files /dev/null and b/book/2_potential_fields/labs/week4/figures/spherical_capacitor.png differ diff --git a/book/2_potential_fields/labs/week4/spherical_capacitor.py b/book/2_potential_fields/labs/week4/spherical_capacitor.py new file mode 100644 index 0000000..498d323 --- /dev/null +++ b/book/2_potential_fields/labs/week4/spherical_capacitor.py @@ -0,0 +1,66 @@ +"""Simple model of a spherical capacitor: V(r) = A + B/r between the shells. + +Boundary conditions: V(r_inner) = 0 and V(r_outer) = V_outer (user-set). +""" + +from pathlib import Path + +import matplotlib.pyplot as plt +import numpy as np + +FIGURE_DIR = Path(__file__).parent / "figures" +FIGURE_DIR.mkdir(exist_ok=True) + + +def solve_coefficients(r_inner, r_outer, v_outer): + """Solve for A, B given V(r_inner) = 0 and V(r_outer) = v_outer.""" + b = v_outer / (1.0 / r_outer - 1.0 / r_inner) + a = -b / r_inner + return a, b + + +def potential(r, r_inner, r_outer, v_outer): + """Return V(r): 0 inside the inner shell, A + B/r between, v_outer beyond.""" + a, b = solve_coefficients(r_inner, r_outer, v_outer) + v = np.full_like(r, v_outer, dtype=float) + between = (r >= r_inner) & (r <= r_outer) + v[between] = a + b / r[between] + v[r < r_inner] = 0.0 + return v + + +def electric_field(r, r_inner, r_outer, v_outer): + """Return E(r) = -dV/dr = B / r**2 between the shells, else zero.""" + _, b = solve_coefficients(r_inner, r_outer, v_outer) + e = np.zeros_like(r, dtype=float) + between = (r >= r_inner) & (r <= r_outer) + e[between] = b / r[between] ** 2 + return e + + +def plot_spherical_capacitor(r_inner=1.0, r_outer=2.5, v_outer=10.0): + r = np.linspace(0.01, 1.5 * r_outer, 500) + v = potential(r, r_inner, r_outer, v_outer) + e = electric_field(r, r_inner, r_outer, v_outer) + + fig, (ax_v, ax_e) = plt.subplots(2, 1, figsize=(7.5, 7.5), sharex=True, layout="constrained") + + ax_v.plot(r, v, color="#2764ae") + ax_v.axvline(r_inner, color="0.6", linestyle="--", linewidth=1) + ax_v.axvline(r_outer, color="0.6", linestyle="--", linewidth=1) + ax_v.set_ylabel("$V(r)$") + ax_v.set_title("Spherical capacitor: potential and field between shells") + + ax_e.plot(r, e, color="#c43c39") + ax_e.axvline(r_inner, color="0.6", linestyle="--", linewidth=1) + ax_e.axvline(r_outer, color="0.6", linestyle="--", linewidth=1) + ax_e.set_xlabel("$r$") + ax_e.set_ylabel("$E(r)$") + + fig.savefig(FIGURE_DIR / "spherical_capacitor.png", dpi=220, bbox_inches="tight") + plt.close(fig) + + +if __name__ == "__main__": + plot_spherical_capacitor() + diff --git a/book/2_potential_fields/labs/week4/spherical_capacitor_lab.html b/book/2_potential_fields/labs/week4/spherical_capacitor_lab.html new file mode 100644 index 0000000..80f52f8 --- /dev/null +++ b/book/2_potential_fields/labs/week4/spherical_capacitor_lab.html @@ -0,0 +1,188 @@ + + + + + + + + +
+
+
+
+
+ +
+
Potential V(r) (kV)
+
Field E(r) = −dV/dr (V/m)
+
+

+ + + diff --git a/book/2_potential_fields/labs/week4/week4_exercises.md b/book/2_potential_fields/labs/week4/week4_exercises.md new file mode 100644 index 0000000..8a555ad --- /dev/null +++ b/book/2_potential_fields/labs/week4/week4_exercises.md @@ -0,0 +1,389 @@ +--- +jupytext: + text_representation: + extension: .md + format_name: myst + format_version: 0.13 +kernelspec: + display_name: Python 3 (ipykernel) + language: python + name: python3 +--- + +# Lab 4: Electrostatic and Magnetic Fields + +## 1. Explore a spherical capacitor + +Two concentric conducting shells with free space between them, an **inner shell** of radius $R_E=6370\ \text{km}$ (the Earth) held at $V=0$, and an **outer shell** of radius $R_I$ (the ionosphere) held at $V=V_o$, is the same setup as the Earth-ionosphere model in the {doc}`week 4 quiz `. Between the shells, the potential takes the form + +```{math} +V(r) = A + \frac{B}{r}, \qquad R_E \le r \le R_I, +``` + +with $A$ and $B$ fixed entirely by the two boundary conditions $V(R_E)=0$ and $V(R_I)=V_o$. Inside the inner shell $V=0$ (it is a conductor), and outside the outer shell $V=V_o$ with $\vec E = 0$ (the shells enclose zero net charge together). + +Use the sliders below to change the outer radius $R_I$ (km) and the outer voltage $V_o$ (kV, 0 to 200), and watch $V(r)$ and $E(r)=-dV/dr$ update. **The radial axis in the plots is not to scale**: the gap between the shells (tens to thousands of km) is stretched for readability against Earth's 6370 km radius. + +```{code-cell} ipython3 +:tags: [remove-input, remove-output] + +import numpy as np + +def solve_coefficients(r_inner, r_outer, v_outer): + """Solve A, B given V(r_inner) = 0 and V(r_outer) = v_outer.""" + b = v_outer / (1.0 / r_outer - 1.0 / r_inner) + a = -b / r_inner + return a, b + +def potential(r, r_inner, r_outer, v_outer): + a, b = solve_coefficients(r_inner, r_outer, v_outer) + r = np.asarray(r, float) + v = np.full_like(r, v_outer, dtype=float) + between = (r >= r_inner) & (r <= r_outer) + v[between] = a + b / r[between] + v[r < r_inner] = 0.0 + return v + +def field(r, r_inner, r_outer, v_outer): + """E(r) = -dV/dr = B / r**2 between the shells, else zero.""" + _, b = solve_coefficients(r_inner, r_outer, v_outer) + r = np.asarray(r, float) + e = np.zeros_like(r, dtype=float) + between = (r >= r_inner) & (r <= r_outer) + e[between] = b / r[between] ** 2 + return e + +# Boundary conditions and the field-potential relation, checked at an example (r_i, r_o, V_o). +r_i, r_o, v_o = 6370.0, 6470.0, 1.0e5 +np.testing.assert_allclose(potential(r_i, r_i, r_o, v_o), 0.0, atol=1e-9) +np.testing.assert_allclose(potential(r_o, r_i, r_o, v_o), v_o) +r_mid = 0.5 * (r_i + r_o) +eps = 1e-3 +numeric_e = -(potential(r_mid + eps, r_i, r_o, v_o) - potential(r_mid - eps, r_i, r_o, v_o)) / (2 * eps) +np.testing.assert_allclose(numeric_e, field(r_mid, r_i, r_o, v_o), rtol=1e-6) +print("Boundary conditions and E = -dV/dr checks passed.") +``` + +```{code-cell} ipython3 +:tags: [remove-input] + +# The HTML contains all controls and drawing code, with no external dependencies. +# An iframe keeps the explorer independent of the page styles. +import html as html_module +from pathlib import Path +from IPython.display import display + +for _candidate in ( + Path("spherical_capacitor_lab.html"), + Path("book/2_potential_fields/labs/week4/spherical_capacitor_lab.html"), +): + if _candidate.exists(): + explorer_html = _candidate.read_text() + break +else: + from pyodide.http import pyfetch + _r = await pyfetch("spherical_capacitor_lab.html") + explorer_html = (await _r.bytes()).decode() + +display({"text/html": ''}, raw=True) +``` + +### Explore, predict, explain + +1. **Reproduce the quiz numbers.** Set $R_I = 6470$ km (100 km altitude) and $V_o = 100$ kV, matching the week 4 quiz. Read off $A$ and $B$, and compare them to the closed-form expressions you derived by hand. Then check the field at 50 km altitude (probe $r=6420$ km) against your answer to part (e). +2. **Move the outer shell farther away.** Keep $V_o$ fixed and increase $R_I$. Does $|B|$ grow or shrink? Explain why the field between the shells changes even though $V_o$ has not. +3. **Increase $V_o$ toward 200 kV.** What happens to the field magnitude at a fixed altitude? Is the relationship linear? +4. **Move the probe outside $R_I$ and inside $R_E$.** Confirm that $V$ is constant and $E=0$ in both regions, consistent with each shell being an equipotential conductor. + +## 2. Charges in the fair-weather field + +On a clear day, the air above flat, open ground carries a downward electric field (W4L1, slides 16–17): +```{math} +\vec{E} \approx -E_0\,\hat{z}, \qquad E_0 \approx 100\ \mathrm{V/m}, \qquad V(z) = E_0 z \quad \text{with } V(0) = 0. +``` +Cosmic rays continuously ionise the air, producing free electrons and positive ions such as $\mathrm{N_2^+}$. Wind also lifts charged mineral dust from deserts into the atmosphere. Use $e = 1.602\cdot 10^{-19}\ \mathrm{C}$, $g = 9.81\ \mathrm{m/s^2}$ and $1\ \mathrm{eV} = 1.602\cdot 10^{-19}\ \mathrm{J}$ (the energy an elementary charge gains across $1\ \mathrm{V}$). + +Parts (a)–(d) of this exercise are question 2 of the {doc}`week 4 quiz `. Work through them first; the Python cell and the explorer below let you check those answers and extend them to part (e). + +(e) In the undisturbed fair-weather field, the potential difference between $z=0$ and $z=2\ \mathrm{m}$ is $200\ \mathrm{V}$ (quiz part (a)). You are standing on the ground and are about $2\ \mathrm{m}$ tall. Is there a $200\ \mathrm{V}$ potential difference between your head and your feet? Sketch how the equipotentials change around you and explain your reasoning. *Hint:* you are a conductor connected to the ground (W4L1, slide 14). + +### Check your answers with Python + +Fill in the blanks (`___`) and run the cell to check your numbers for parts (a), (b) and (d) of the quiz. + +```{code-cell} ipython3 +:tags: [skip-execution] + +import numpy as np + +e = 1.602e-19 # elementary charge [C] +E0 = 100.0 # fair-weather field strength [V/m] +g = 9.81 # gravitational acceleration [m/s^2] + +def V_fair(z): + """Fair-weather potential above flat ground, V(0) = 0.""" + return ___ + +# (b), (c): move each particle from z = 0 to z = 10 m +dV = V_fair(10.0) - V_fair(0.0) +for name, q in [("electron", -e), ("N2+ ion ", +e)]: + dU = ___ # change in potential energy [J] + W = ___ # work done by the field [J] + Fz = ___ # z-component of F = qE, with E = -E0 z_hat [N] + print(f"{name}: dV = {dV:.0f} V, dU = {dU:+.2e} J = {dU/e:+.0f} eV, " + f"W_field = {W:+.2e} J, F_z = {Fz:+.1e} N") + +# (d): dust grain levitated by the fair-weather field +a_d, rho_d = 1e-6, 2650.0 # radius [m], density [kg/m^3] +m_d = ___ # mass of the grain [kg] +q_d = ___ # charge magnitude for |qE| = mg [C] +print(f"m = {m_d:.2e} kg, |q| = {q_d:.2e} C = {q_d/e:.0f} excess electrons") + +# self-check +assert np.isclose(V_fair(2.0), 200.0), "V(2 m) should be 200 V" +assert np.isclose(q_d / e, 6.8e3, rtol=0.02), "check the mass or the force balance" +print("Self-check passed.") +``` + +The explorer below shows the fair-weather field over flat ground. You can add a grounded conducting hemisphere of radius $a$, a crude model of a person, a tree or a small hill. Its potential is +```{math} +V(\vec{r}) = E_0 z\left(1 - \frac{a^3}{r^3}\right), \qquad z \geq 0,\ r \geq a. +``` +The upper panel shows the field strength $|\vec{E}|/E_0$ in colour, the equipotentials in white (every $E_0\cdot 1\ \mathrm{m}$), the field lines in grey, and the force $\vec{F} = q\vec{E}$ on the test charge as an arrow. The lower panel shows $V(z)$ and $U(z)/e$ along the vertical line through the test charge. + +1. With $a = 0$, move the test charge up and down. Check your answers to quiz parts (a) and (b). +2. Switch between the electron and the ion. Which quantities change, and which stay the same? (W4L1, slide 9) +3. Set $a = 1\ \mathrm{m}$. Where do the equipotentials crowd together? Read $|\vec{E}|$ just above the top of the object and near its base. Use this to check your sketch for (e). + +```{code-cell} ipython3 +:tags: [remove-input] + +# The HTML contains all controls and drawing code, with no external dependencies. +# An iframe keeps the explorer independent of the page styles. +import html as html_module +from pathlib import Path +from IPython.display import display + +for _candidate in ( + Path("fair_weather_lab.html"), + Path("book/2_potential_fields/labs/week4/fair_weather_lab.html"), +): + if _candidate.exists(): + explorer_html = _candidate.read_text() + break +else: + from pyodide.http import pyfetch + _r = await pyfetch("fair_weather_lab.html") + explorer_html = (await _r.bytes()).decode() + +display({"text/html": ''}, raw=True) +``` + + +## 3. Explore Earth's dipole field + +Far from a compact current system, its magnetic field is that of a dipole (W4L2, slides 14–15). Earth's main field is modelled as a dipole at Earth's centre. As in the lecture, let $\hat m=\hat z$, let $\theta$ be the angle measured from $\hat m$, and work in the $x$–$z$ plane with $\hat r=\sin\theta\,\hat x+\cos\theta\,\hat z$ (slide 22). The field is +```{math} +\vec B = B_*\left(\frac{R}{r}\right)^3\left[3(\hat m\cdot\hat r)\,\hat r-\hat m\right], +\qquad B_*=\frac{\mu_0|\vec m|}{4\pi R^3}. +``` +For Earth, take $R=a=6371\ \mathrm{km}$ and $B_*\approx 29.7\ \mu\mathrm{T}$ (called $B_0$ in the teachbook section *Earth as a Magnetic Dipole*). For the present polarity, $\hat m$ points toward the **southern** end of the dipole axis: $\theta=0$ is the southern end, $\theta=\pi$ the northern end, and $\theta=\pi/2$ the dipole equator. + +Parts (a)–(d) of this exercise are question 3 of the {doc}`week 4 quiz `. Work through them first; the Python cell and the explorer below let you check those answers and extend them to part (e). + +(e) The quiz quotes the component form of the dipole field; here you derive it. Repeat part (b) of the quiz for a general $\theta$ at $r=a$. +1. Write $\hat z=\cos\theta\,\hat r-\sin\theta\,\hat\theta$, with $\hat\theta=\cos\theta\,\hat x-\sin\theta\,\hat z$ pointing along the ground toward the northern end of the axis. Show that the field has a radial component $B_r=2B_*\cos\theta$ and a horizontal component $B_\theta=B_*\sin\theta$. +2. Use the dipole latitude $\lambda_m=\theta-\pi/2$ (positive in the northern hemisphere) to show that the angle $I$ below the horizontal satisfies $\tan I=2\tan\lambda_m$. Check it against quiz part (b). +3. A navigator measures $I=70^\circ$. What is the dipole latitude? Near which latitudes does a small error in $I$ matter least? +### Check your answers with Python + +Fill in the blanks (`___`) and run the cell to check your numbers for parts (a)–(d) of the quiz and part (e). + +```{code-cell} ipython3 +:tags: [skip-execution] + +import numpy as np + +B_star = 29.7e-6 # B_* for Earth [T] +a = 6371e3 # R = a, Earth's reference radius [m] +m_hat = np.array([0.0, 1.0]) # (x, z): m_hat = z_hat, toward the SOUTHERN end of the axis + +def B_dipole(theta, r): + """Dipole field (Bx, Bz) [T] at polar angle theta (from m_hat) and distance r [m].""" + r_hat = np.array([np.sin(theta), np.cos(theta)]) + return ___ # B_* (a/r)^3 [3 (m.r) r - m] + +def below_horizontal(theta, r): + """Angle [deg] between B and the local horizontal, positive when B points into the ground.""" + r_hat = np.array([np.sin(theta), np.cos(theta)]) + B = B_dipole(theta, r) + B_radial = ___ # component of B along r_hat (positive = out of the ground) + return np.degrees(np.arcsin(-B_radial / np.linalg.norm(B))) + +# (a), (b): at the surface +for name, th in [("southern end", 0.0), ("dipole equator", np.pi/2), + ("northern end", np.pi), ("45 deg N", 3*np.pi/4)]: + B = B_dipole(th, a) + Bx, Bz = np.round(B / B_star, 2) + 0.0 # + 0.0 avoids printing -0.00 + I = round(below_horizontal(th, a), 1) + 0.0 + print(f"{name:15s} B/B* = ({Bx:+.2f}, {Bz:+.2f}), " + f"|B| = {np.linalg.norm(B)*1e6:5.1f} uT, below horizontal = {I:+6.1f} deg") + +# (c): Swarm at 450 km altitude above 45 deg N +r_swarm = ___ +print(f"(c) |B| at Swarm altitude = {np.linalg.norm(B_dipole(3*np.pi/4, r_swarm))*1e6:.1f} uT," + f" below horizontal = {below_horizontal(3*np.pi/4, r_swarm):.1f} deg") + +# (d): distance at which the field has dropped to 1% of its surface value +r_1pct = ___ +print(f"(d) r = {r_1pct/a:.2f} a = {r_1pct/1e3:.0f} km") + +# (e): dipole latitude for a measured angle I = 70 deg, from tan I = 2 tan(lambda_m) +lam_nav = ___ # [rad] +print(f"(e) I = 70 deg -> lambda_m = {np.degrees(lam_nav):.1f} deg N") + +# self-check +assert np.isclose(np.linalg.norm(B_dipole(np.pi/2, a)), B_star) +assert np.isclose(np.linalg.norm(B_dipole(3*np.pi/4, a)), 47.0e-6, rtol=1e-3) +assert np.isclose(below_horizontal(3*np.pi/4, a), 63.43, atol=0.01) +assert np.isclose(np.linalg.norm(B_dipole(3*np.pi/4, r_swarm)), 38.3e-6, rtol=2e-3) +assert np.isclose(np.linalg.norm(B_dipole(np.pi, r_1pct)) / np.linalg.norm(B_dipole(np.pi, a)), 0.01) +assert np.isclose(np.degrees(lam_nav), 53.95, atol=0.01) +print("Self-check passed.") +``` + +The explorer below draws the dipole field lines in the $x$–$z$ plane, oriented as in the lecture ($\hat m=\hat z$ up the page, so the southern end of Earth's axis is at the top). Choose a probe point with $\theta$ and $r/a$. At the probe, the blue, red and black arrows show the head-to-tail construction of the bracket $3(\hat m\cdot\hat r)\hat r-\hat m$. The dashed line is the local horizontal. The lower-left panel shows $|\vec B|$ along the radial line through the probe on log–log axes. The lower-right panel shows the angle below the horizontal and $|\vec B|/B_*$ at the surface as functions of $\theta$. + +1. At $r/a=1$, set $\theta=0^\circ$, $90^\circ$ and $135^\circ$ to check your answers to quiz parts (a) and (b), then $180^\circ$ to see the northern end. +2. Press *Swarm altitude*. Which numbers change, and which stay the same? Do the arrows at the probe change? (W4L2, slide 15) +3. In the lower-left panel, why is the curve a straight line? Read off where it crosses the $1\%$ line and compare with quiz part (d). By what factor does $|\vec B|$ drop between $r/a=1$ and $2$? (W4L2, slide 18) +4. In the lower-right panel, where is the field vertical, where is it horizontal, and where is $|\vec B|$ largest and smallest? Where does the angle change fastest with $\theta$? Relate this to part (e). +```{code-cell} ipython3 +:tags: [remove-input] + +# The HTML contains all controls and drawing code, with no external dependencies. +# An iframe keeps the explorer independent of the page styles. +import html as html_module +from pathlib import Path +from IPython.display import display + +for _candidate in ( + Path("earth_dipole_lab.html"), + Path("book/2_potential_fields/labs/week4/earth_dipole_lab.html"), +): + if _candidate.exists(): + explorer_html = _candidate.read_text() + break +else: + from pyodide.http import pyfetch + _r = await pyfetch("earth_dipole_lab.html") + explorer_html = (await _r.bytes()).decode() + +display({"text/html": ''}, raw=True) +``` + + +## 4. Explore a current loop and its dipole field + +Far from a compact current loop, its magnetic field is that of a dipole (W4L2, slide 14). A circular loop carrying current $I$ around an area $A$ has the magnetic moment +```{math} +\vec m = IA\,\hat n, +``` +where $\hat n$ is the normal to the loop given by the right-hand rule: curl the fingers along the current, and the thumb gives $\hat n$. Use $\mu_0 = 4\pi\cdot10^{-7}\ \mathrm{T\,m/A}$. + +Parts (a)–(d) of this exercise are question 4 of the {doc}`week 4 quiz `. Work through them first; the Python cell and the explorer below let you check those answers and extend them to part (e). + +(e) Return to the core loop of quiz part (b). An observer stands on Earth's surface above the northern end of the axis, at distance $z = a$ from the centre of the loop. How large is the error of the dipole formula there? How far from Earth's centre, in units of $a$, would the observer have to be for the dipole formula to be accurate to within $10\%$? What does this tell you about the single-loop picture of the geodynamo? + +### Check your answers with Python + +Fill in the blanks (`___`) and run the cell to check your numbers for parts (a)–(d) of the quiz and part (e). The last blank, `z_10`, is the height where the dipole formula becomes accurate to within $10\%$; compare it with explorer question 4. + +```{code-cell} ipython3 +:tags: [skip-execution] + +import numpy as np + +mu0 = 4e-7 * np.pi # [T m/A] +a, B_star, R_c = 6371e3, 29.7e-6, 3480e3 # Earth radius [m], B_* [T], outer-core radius [m] + +# (a), (b): Earth's moment and the equivalent core current +m_earth = ___ # from B_* = mu0 m / (4 pi a^3) [A m^2] +I_core = ___ # from m = I * pi R_c^2 [A] +print(f"(a) m = {m_earth:.2e} A m^2 (b) I = {I_core:.2e} A") + +def B_loop_axis(z, I, R): + """Exact field on the axis of a circular loop of radius R [T].""" + return mu0 * I * R**2 / (2 * (R**2 + z**2)**1.5) + +def B_dip_axis(z, m): + """Dipole formula on the axis [T].""" + return ___ + +# (c), (d): the survey loop +R_L, I_L = 50.0, 10.0 +m_L = ___ # moment of the survey loop [A m^2] +print(f"(c) m = {m_L:.3g} A m^2") +for z in (100.0, 250.0): # (d): z = 2 R_L and z = 5 R_L + B_ex, B_dp = B_loop_axis(z, I_L, R_L), B_dip_axis(z, m_L) + print(f"(d) at z = {z:.0f} m: exact {B_ex*1e9:.2f} nT, dipole {B_dp*1e9:.2f} nT, " + f"ratio {B_dp/B_ex:.2f}") +z_10 = ___ # height where B_dip / B_loop = 1.1 [m] +print(f" dipole formula within 10% beyond z = {z_10:.0f} m = {z_10/R_L:.1f} R_L") + +# (e): the core loop seen from Earth's surface on the axis +ratio_core = B_dip_axis(a, m_earth) / B_loop_axis(a, I_core, R_c) +print(f"(e) z/R_c = {a/R_c:.2f}: dipole / exact = {ratio_core:.2f}; " + f"10% needs r = {z_10/R_L * R_c / a:.2f} a") + +# self-check +assert np.isclose(m_earth, 7.68e22, rtol=2e-3) and np.isclose(I_core, 2.02e9, rtol=5e-3) +assert np.isclose(m_L, 7.854e4, rtol=1e-3) +assert np.isclose(B_dip_axis(100.0, m_L) / B_loop_axis(100.0, I_L, R_L), 1.398, atol=1e-3) +assert np.isclose(B_dp / B_ex, 1.061, atol=1e-3) # last loop value: z = 250 m +assert np.isclose(z_10, 195.2, atol=0.5) +assert np.isclose(ratio_core, 1.48, atol=0.01) +print("Self-check passed.") +``` + +The explorer below shows a circular loop seen edge-on, with its axis vertical. The upper panel compares the exact field lines of the loop (solid) with those of a point dipole with the same moment (dashed), in units of the loop radius $R_L$. The lower-left panel shows $|\vec B|$ on the axis on log–log axes, for the loop radius and current you choose. The lower-right panel shows the ratio of the dipole formula to the exact field, with a line at $10\%$. + +1. Keep $R_L = 50\ \mathrm{m}$ and $I = 10\ \mathrm{A}$ and set $z/R_L = 2$. Check your answers to quiz part (d). +2. In the upper panel, where do the solid and dashed field lines agree, and where do they differ most? What does "far from a compact loop" (W4L2, slide 14) mean in this picture? +3. Change $R_L$ and $I$. Does the curve in the lower-right panel change? Explain why. What does change in the lower-left panel? +4. Find the value of $z/R_L$ where the ratio drops to $1.1$, so that the dipole formula is accurate to within $10\%$. Compare it with your results at $2R_L$ and $5R_L$ in quiz part (d). Then set $z/R_L \approx 1.85$ to check part (e). +```{code-cell} ipython3 +:tags: [remove-input] + +# The HTML contains all controls and drawing code, with no external dependencies. +# An iframe keeps the explorer independent of the page styles. +import html as html_module +from pathlib import Path +from IPython.display import display + +for _candidate in ( + Path("current_loop_lab.html"), + Path("book/2_potential_fields/labs/week4/current_loop_lab.html"), +): + if _candidate.exists(): + explorer_html = _candidate.read_text() + break +else: + from pyodide.http import pyfetch + _r = await pyfetch("current_loop_lab.html") + explorer_html = (await _r.bytes()).decode() + +display({"text/html": ''}, raw=True) +``` \ No newline at end of file diff --git a/book/2_potential_fields/labs/week4/week4_exercises_solutions.md b/book/2_potential_fields/labs/week4/week4_exercises_solutions.md new file mode 100644 index 0000000..f822af3 --- /dev/null +++ b/book/2_potential_fields/labs/week4/week4_exercises_solutions.md @@ -0,0 +1,424 @@ +--- +jupytext: + text_representation: + extension: .md + format_name: myst + format_version: 0.13 +kernelspec: + display_name: Python 3 (ipykernel) + language: python + name: python3 +--- +# Lab 4: Electrostatic and Magnetic Fields (Solutions) +## 1. Explore a spherical capacitor + +Between the shells the region is free space, so the potential obeys Laplace's equation. With spherical symmetry this reduces to the radial form used in the {doc}`week 4 quiz `, whose solution is $V(r) = A + B/r$. The two constants follow from the boundary conditions $V(R_E)=0$ and $V(R_I)=V_o$: +```{math} +\boxed{B = \frac{V_o}{1/R_I - 1/R_E}}, \qquad \boxed{A = -\frac{B}{R_E}}, +\qquad +V(r) = V_o\,\frac{1/R_E - 1/r}{1/R_I - 1/R_E}. +``` +The field between the shells is radial, +```{math} +\vec{E} = -\vec{\nabla}V = -\frac{\partial V}{\partial r}\hat{r} = \boxed{\frac{B}{r^2}\,\hat{r}}. +``` +Because the outer shell is at the higher potential, $B<0$: the field points radially **inward**, i.e. downward at the ground, in agreement with the fair-weather field of Exercise 2. + +**1. Reproduce the quiz numbers.** With $R_E = 6370\ \mathrm{km}$, $R_I = 6470\ \mathrm{km}$ and $V_o = 100\ \mathrm{kV}$, +```{math} +\frac{1}{R_I}-\frac{1}{R_E} = \frac{R_E-R_I}{R_I R_E} = -2.427\cdot 10^{-9}\ \mathrm{m^{-1}}, +``` +```{math} +B = \frac{10^{5}}{-2.427\cdot 10^{-9}} = \boxed{-4.12\cdot 10^{13}\ \mathrm{V\,m}}, +\qquad +A = -\frac{B}{R_E} = \boxed{6.47\cdot 10^{6}\ \mathrm{V}}, +``` +matching parts (b) and (d) of the quiz. At $50\ \mathrm{km}$ altitude, $r = 6420\ \mathrm{km}$: +```{math} +\vec{E} = \frac{B}{r^2}\hat{r} = \frac{-4.12\cdot 10^{13}}{(6.42\cdot 10^6)^2}\hat{r} += \boxed{-1.00\ \mathrm{V/m}\ \hat{r}}, +``` +a field of $1.00\ \mathrm{V/m}$ pointing towards the Earth, as in part (e). + +```{note} +The explorer reports $B$ in $\mathrm{V\,km}$, because it works with radii in kilometres: it shows $-4.12\cdot 10^{10}\ \mathrm{V\,km}$, which is the same number as $-4.12\cdot 10^{13}\ \mathrm{V\,m}$. +``` + +**2. Move the outer shell farther away.** Writing the gap as $d = R_I - R_E$, +```{math} +B = \frac{V_o}{1/R_I - 1/R_E} = -\,\frac{V_o R_E R_I}{d}, +``` +so $|B|$ **shrinks** as $R_I$ grows at fixed $V_o$, and with it the field at any fixed radius. Numerically, at the Earth's surface: $1.02\ \mathrm{V/m}$ for $d = 100\ \mathrm{km}$, $0.52\ \mathrm{V/m}$ for $200\ \mathrm{km}$, $0.12\ \mathrm{V/m}$ for $1000\ \mathrm{km}$. The field is not fixed by $V_o$ alone because the field is the *rate* at which the potential changes with distance, and the same $100\ \mathrm{kV}$ is now spread over a thicker gap. For a thin gap, $d \ll R_E$, the shells are almost parallel plates and +```{math} +|\vec{E}| \approx \frac{V_o}{d} = \frac{10^5\ \mathrm{V}}{10^5\ \mathrm{m}} = 1\ \mathrm{V/m}, +``` +which is why the answer to question 1 came out so close to $1\ \mathrm{V/m}$. As $R_I\to\infty$ the field does not vanish but tends to that of an isolated charged sphere, $|B| \to V_o R_E$. + +**3. Increase $V_o$ toward 200 kV.** Both $A$ and $B$ are proportional to $V_o$, so at every radius +```{math} +|\vec{E}| = \frac{|B|}{r^2} \propto V_o . +``` +The relationship is **linear**: doubling $V_o$ from $100$ to $200\ \mathrm{kV}$ doubles the field at $50\ \mathrm{km}$ altitude from $1.00$ to $2.00\ \mathrm{V/m}$. This is a direct consequence of Laplace's equation being linear, so scaling the boundary values scales the whole solution. + +**4. Move the probe outside $R_I$ and inside $R_E$.** Outside the outer shell the explorer shows $V = V_o$ and $E = 0$: the two shells carry equal and opposite charges, so any sphere enclosing both contains zero net charge and Gauss's law gives no flux, hence no field. Inside the inner shell $V = 0$ and $E = 0$, as in the interior of any conductor in electrostatic equilibrium. In both regions the potential is constant, consistent with each shell being an equipotential surface: the entire field lives in the gap between them. + +```{code-cell} ipython3 +import numpy as np + +R_E, R_I, V_o = 6370e3, 6470e3, 100e3 # m, m, V + +B = V_o / (1 / R_I - 1 / R_E) +A = -B / R_E +r = 6420e3 # 50 km altitude +print(f"A = {A:.3e} V, B = {B:.3e} V m, E(50 km) = {B / r**2:+.2f} V/m") +print(f"thin-gap estimate V_o/d = {V_o / (R_I - R_E):.2f} V/m") + +for R in (6470e3, 6570e3, 7370e3): # question 2: a thicker gap + b = V_o / (1 / R - 1 / R_E) + print(f" d = {(R - R_E)/1e3:6.0f} km -> |E| at the ground = {abs(b)/R_E**2:.3f} V/m") + +# self-check against the quiz +assert np.isclose(B, -4.12e13, rtol=1e-3) and np.isclose(A, 6.47e6, rtol=1e-3) +assert np.isclose(B / r**2, -1.00, atol=5e-3) +print("Matches the quiz values for A, B and E(50 km).") +``` + +## 2. Charges in the fair-weather field + +On a clear day, the air above flat, open ground carries a downward electric field (W4L1, slides 16–17): +```{math} +\vec{E} \approx -E_0\,\hat{z}, \qquad E_0 \approx 100\ \mathrm{V/m}, \qquad V(z) = E_0 z \quad \text{with } V(0) = 0. +``` +Cosmic rays continuously ionise the air, producing free electrons and positive ions such as $\mathrm{N_2^+}$. Wind also lifts charged mineral dust from deserts into the atmosphere. Use $e = 1.602\cdot 10^{-19}\ \mathrm{C}$, $g = 9.81\ \mathrm{m/s^2}$ and $1\ \mathrm{eV} = 1.602\cdot 10^{-19}\ \mathrm{J}$ (the energy an elementary charge gains across $1\ \mathrm{V}$). + +Parts (a)–(d) of this exercise are question 2 of the {doc}`week 4 quiz `. Work through them first; the Python cell and the explorer below let you check those answers and extend them to part (e). + +(e) In the undisturbed fair-weather field, the potential difference between $z=0$ and $z=2\ \mathrm{m}$ is $200\ \mathrm{V}$ (quiz part (a)). You are standing on the ground and are about $2\ \mathrm{m}$ tall. Is there a $200\ \mathrm{V}$ potential difference between your head and your feet? Sketch how the equipotentials change around you and explain your reasoning. *Hint:* you are a conductor connected to the ground (W4L1, slide 14). + +**(e)** No. Your body is a conductor connected to the ground, so in electrostatic equilibrium it is an equipotential with $V = 0$ (W4L1, slides 14–15). Charge redistributes (negative charge gathers near your head) until the field inside you vanishes. That is why you feel nothing. + +The equipotentials that would have crossed your body are pushed up and over it. They crowd together above your head and spread apart near your feet. The field is therefore **stronger above you** and weaker close to your feet. For the grounded hemisphere in the explorer, the field at the top is +```{math} +\vec{E}(0,0,a) = -E_0\left[1 - 1 + 3\right]\hat{z} = -3E_0\,\hat{z}, +``` +three times the fair-weather value, whatever the size of the object. With the outward normal $\hat{z}$ at the top and $E_{\perp,\mathrm{outside}}=\sigma_q/\epsilon_0$ (W4L1, slide 15), the induced surface charge there is +```{math} +\sigma_q = \epsilon_0 E_{\perp,\mathrm{outside}} = -3\epsilon_0E_0 \approx -2.7\cdot 10^{-9}\ \mathrm{C/m^2}, +``` +three times the fair-weather ground value $\sigma_q=-\epsilon_0E_0\approx-8.9\cdot 10^{-10}\ \mathrm{C/m^2}$. The same effect concentrates the field on trees, masts and mountain tops. It is why lightning rods are placed on the highest point, and why St Elmo's fire glows at mast tips during thunderstorms. + +The potential of the hemisphere is the uniform field plus a dipole term $-E_0 a^3 z/r^3$. The hemisphere and its mirror image below the ground together form a full sphere, which is the same kind of dipole construction as the image charge in W4L1, slide 24. + +### Check your answers with Python + +```{code-cell} ipython3 +import numpy as np + +e = 1.602e-19 # elementary charge [C] +E0 = 100.0 # fair-weather field strength [V/m] +g = 9.81 # gravitational acceleration [m/s^2] + +def V_fair(z): + """Fair-weather potential above flat ground, V(0) = 0.""" + return E0 * z + +# (b), (c): move each particle from z = 0 to z = 10 m +dV = V_fair(10.0) - V_fair(0.0) +for name, q in [("electron", -e), ("N2+ ion ", +e)]: + dU = q * dV # change in potential energy [J] + W = -dU # work done by the field [J] + Fz = q * (-E0) # z-component of F = qE, with E = -E0 z_hat [N] + print(f"{name}: dV = {dV:.0f} V, dU = {dU:+.2e} J = {dU/e:+.0f} eV, " + f"W_field = {W:+.2e} J, F_z = {Fz:+.1e} N") + +# (d): dust grain levitated by the fair-weather field +a_d, rho_d = 1e-6, 2650.0 # radius [m], density [kg/m^3] +m_d = 4/3 * np.pi * a_d**3 * rho_d +q_d = m_d * g / E0 +print(f"m = {m_d:.2e} kg, |q| = {q_d:.2e} C = {q_d/e:.0f} excess electrons") + +# self-check +assert np.isclose(V_fair(2.0), 200.0), "V(2 m) should be 200 V" +assert np.isclose(q_d / e, 6.8e3, rtol=0.02), "check the mass or the force balance" +print("Self-check passed.") +``` + +The explorer below shows the fair-weather field over flat ground. You can add a grounded conducting hemisphere of radius $a$, a crude model of a person, a tree or a small hill. Its potential is +```{math} +V(\vec{r}) = E_0 z\left(1 - \frac{a^3}{r^3}\right), \qquad z \geq 0,\ r \geq a. +``` +The upper panel shows the field strength $|\vec{E}|/E_0$ in colour, the equipotentials in white (every $E_0\cdot 1\ \mathrm{m}$), the field lines in grey, and the force $\vec{F} = q\vec{E}$ on the test charge as an arrow. The lower panel shows $V(z)$ and $U(z)/e$ along the vertical line through the test charge. + +1. With $a = 0$, move the test charge up and down. Check your answers to (a) and (b). +2. Switch between the electron and the ion. Which quantities change, and which stay the same? (W4L1, slide 9) +3. Set $a = 1\ \mathrm{m}$. Where do the equipotentials crowd together? Read $|\vec{E}|$ just above the top of the object and near its base. Use this to check your sketch for (e). + +```{code-cell} ipython3 +:tags: [remove-input] + +# The HTML contains all controls and drawing code, with no external dependencies. +# An iframe keeps the explorer independent of the page styles. +import html as html_module +from pathlib import Path +from IPython.display import display + +for _candidate in ( + Path("fair_weather_lab.html"), + Path("book/2_potential_fields/labs/week4/fair_weather_lab.html"), +): + if _candidate.exists(): + explorer_html = _candidate.read_text() + break +else: + from pyodide.http import pyfetch + _r = await pyfetch("fair_weather_lab.html") + explorer_html = (await _r.bytes()).decode() + +display({"text/html": ''}, raw=True) +``` + +## 3. Explore Earth's dipole field + +Far from a compact current system, its magnetic field is that of a dipole (W4L2, slides 14–15). Earth's main field is modelled as a dipole at Earth's centre. As in the lecture, let $\hat m=\hat z$, let $\theta$ be the angle measured from $\hat m$, and work in the $x$–$z$ plane with $\hat r=\sin\theta\,\hat x+\cos\theta\,\hat z$ (slide 22). The field is +```{math} +\vec B = B_*\left(\frac{R}{r}\right)^3\left[3(\hat m\cdot\hat r)\,\hat r-\hat m\right], +\qquad B_*=\frac{\mu_0|\vec m|}{4\pi R^3}. +``` +For Earth, take $R=a=6371\ \mathrm{km}$ and $B_*\approx 29.7\ \mu\mathrm{T}$ (called $B_0$ in the teachbook section *Earth as a Magnetic Dipole*). For the present polarity, $\hat m$ points toward the **southern** end of the dipole axis: $\theta=0$ is the southern end, $\theta=\pi$ the northern end, and $\theta=\pi/2$ the dipole equator. + +Parts (a)–(d) of this exercise are question 3 of the {doc}`week 4 quiz `. Work through them first; the Python cell and the explorer below let you check those answers and extend them to part (e). + +(e) The quiz quotes the component form of the dipole field; here you derive it. Repeat part (b) of the quiz for a general $\theta$ at $r=a$. +1. Write $\hat z=\cos\theta\,\hat r-\sin\theta\,\hat\theta$, with $\hat\theta=\cos\theta\,\hat x-\sin\theta\,\hat z$ pointing along the ground toward the northern end of the axis. Show that the field has a radial component $B_r=2B_*\cos\theta$ and a horizontal component $B_\theta=B_*\sin\theta$. +2. Use the dipole latitude $\lambda_m=\theta-\pi/2$ (positive in the northern hemisphere) to show that the angle $I$ below the horizontal satisfies $\tan I=2\tan\lambda_m$. Check it against quiz part (b). +3. A navigator measures $I=70^\circ$. What is the dipole latitude? Near which latitudes does a small error in $I$ matter least? + + +**(e) 1.** From slide 17, at $r=a$: $\vec B/B_*=3\cos\theta\,\hat r-\hat z$. Check the given decomposition: +```{math} +\cos\theta\,\hat r-\sin\theta\,\hat\theta +=\cos\theta(\sin\theta\,\hat x+\cos\theta\,\hat z)-\sin\theta(\cos\theta\,\hat x-\sin\theta\,\hat z)=\hat z. +``` +Substituting it gives +```{math} +\frac{\vec B}{B_*}=3\cos\theta\,\hat r-\cos\theta\,\hat r+\sin\theta\,\hat\theta +=2\cos\theta\,\hat r+\sin\theta\,\hat\theta, +``` +so $\boxed{B_r=2B_*\cos\theta}$ and $\boxed{B_\theta=B_*\sin\theta}$. These are the components given in the teachbook section *Earth as a Magnetic Dipole* (with $B_0=B_*$). + +**(e) 2.** With $\theta=\lambda_m+\pi/2$: $\cos\theta=-\sin\lambda_m$ and $\sin\theta=\cos\lambda_m$. The downward and northward components are +```{math} +B_\mathrm{down}=-B_r=2B_*\sin\lambda_m,\qquad B_\theta=B_*\cos\lambda_m, +``` +so +```{math} +\tan I=\frac{B_\mathrm{down}}{B_\theta}=\boxed{2\tan\lambda_m}. +``` +This relation appears in the optional teachbook box *Connect to magnetic inclination*. At $\lambda_m=45^\circ$: $\tan I=2$, so $I=63.4^\circ$, as in quiz part (b). + +**(e) 3.** $\lambda_m=\arctan\left(\tfrac12\tan70^\circ\right)=\arctan(1.37)=\boxed{53.9^\circ\ \mathrm{N}}$. This is a dipole latitude. The real axis is tilted and the real field has non-dipole parts, so it is not the geographic latitude (teachbook). In the lower-right panel of the explorer, the angle changes fastest with $\theta$ near the equator, where its slope is 2. There a $1^\circ$ error in $I$ shifts the latitude by only $0.5^\circ$. Near the poles the slope drops to $0.5$, and the same error shifts the latitude by $2^\circ$. + +### Check your answers with Python + +```{code-cell} ipython3 +import numpy as np + +B_star = 29.7e-6 # B_* for Earth [T] +a = 6371e3 # R = a, Earth's reference radius [m] +m_hat = np.array([0.0, 1.0]) # (x, z): m_hat = z_hat, toward the SOUTHERN end of the axis + +def B_dipole(theta, r): + """Dipole field (Bx, Bz) [T] at polar angle theta (from m_hat) and distance r [m].""" + r_hat = np.array([np.sin(theta), np.cos(theta)]) + return B_star * (a / r)**3 * (3 * np.dot(m_hat, r_hat) * r_hat - m_hat) + +def below_horizontal(theta, r): + """Angle [deg] between B and the local horizontal, positive when B points into the ground.""" + r_hat = np.array([np.sin(theta), np.cos(theta)]) + B = B_dipole(theta, r) + B_radial = np.dot(B, r_hat) # component of B along r_hat (positive = out of the ground) + return np.degrees(np.arcsin(-B_radial / np.linalg.norm(B))) + +# (a), (b): at the surface +for name, th in [("southern end", 0.0), ("dipole equator", np.pi/2), + ("northern end", np.pi), ("45 deg N", 3*np.pi/4)]: + B = B_dipole(th, a) + Bx, Bz = np.round(B / B_star, 2) + 0.0 # + 0.0 avoids printing -0.00 + I = round(below_horizontal(th, a), 1) + 0.0 + print(f"{name:15s} B/B* = ({Bx:+.2f}, {Bz:+.2f}), " + f"|B| = {np.linalg.norm(B)*1e6:5.1f} uT, below horizontal = {I:+6.1f} deg") + +# (c): Swarm at 450 km altitude above 45 deg N +r_swarm = a + 450e3 +print(f"(c) |B| at Swarm altitude = {np.linalg.norm(B_dipole(3*np.pi/4, r_swarm))*1e6:.1f} uT," + f" below horizontal = {below_horizontal(3*np.pi/4, r_swarm):.1f} deg") + +# (d): distance at which the field has dropped to 1% of its surface value +r_1pct = a * 100**(1/3) +print(f"(d) r = {r_1pct/a:.2f} a = {r_1pct/1e3:.0f} km") + +# (e): dipole latitude for a measured angle I = 70 deg, from tan I = 2 tan(lambda_m) +lam_nav = np.arctan(np.tan(np.radians(70)) / 2) # [rad] +print(f"(e) I = 70 deg -> lambda_m = {np.degrees(lam_nav):.1f} deg N") + +# self-check +assert np.isclose(np.linalg.norm(B_dipole(np.pi/2, a)), B_star) +assert np.isclose(np.linalg.norm(B_dipole(3*np.pi/4, a)), 47.0e-6, rtol=1e-3) +assert np.isclose(below_horizontal(3*np.pi/4, a), 63.43, atol=0.01) +assert np.isclose(np.linalg.norm(B_dipole(3*np.pi/4, r_swarm)), 38.3e-6, rtol=2e-3) +assert np.isclose(np.linalg.norm(B_dipole(np.pi, r_1pct)) / np.linalg.norm(B_dipole(np.pi, a)), 0.01) +assert np.isclose(np.degrees(lam_nav), 53.95, atol=0.01) +print("Self-check passed.") +``` + +The explorer below draws the dipole field lines in the $x$–$z$ plane, oriented as in the lecture ($\hat m=\hat z$ up the page, so the southern end of Earth's axis is at the top). Choose a probe point with $\theta$ and $r/a$. At the probe, the blue, red and black arrows show the head-to-tail construction of the bracket $3(\hat m\cdot\hat r)\hat r-\hat m$. The dashed line is the local horizontal. The lower-left panel shows $|\vec B|$ along the radial line through the probe on log–log axes. The lower-right panel shows the angle below the horizontal and $|\vec B|/B_*$ at the surface as functions of $\theta$. + +1. At $r/a=1$, set $\theta=0^\circ$, $90^\circ$ and $135^\circ$ to check your answers to quiz parts (a) and (b), then $180^\circ$ to see the northern end. +2. Press *Swarm altitude*. Which numbers change, and which stay the same? Do the arrows at the probe change? (W4L2, slide 15) +3. In the lower-left panel, why is the curve a straight line? Read off where it crosses the $1\%$ line and compare with quiz part (d). By what factor does $|\vec B|$ drop between $r/a=1$ and $2$? (W4L2, slide 18) +4. In the lower-right panel, where is the field vertical, where is it horizontal, and where is $|\vec B|$ largest and smallest? Where does the angle change fastest with $\theta$? Relate this to part (e). + +**Answers** + +1. The status line shows the quiz values: bracket $(0,2)$ and $59.4\ \mu\mathrm{T}$ out of the ground at $0^\circ$; $(0,-1)$ and $29.7\ \mu\mathrm{T}$ horizontal at $90^\circ$; $(0,2)$ and $59.4\ \mu\mathrm{T}$ into the ground at $180^\circ$; $(-1.50,0.50)$, $47.0\ \mu\mathrm{T}$ and $63.4^\circ$ below the horizontal at $135^\circ$. +2. At Swarm altitude, $(a/r)^3$ drops to $0.816$, so $|\vec B|$ and $B_r$ fall to $38.3\ \mu\mathrm{T}$ and $-34.3\ \mu\mathrm{T}$. The bracket, the arrows and the angle below the horizontal ($63.4^\circ$) do not change: the bracket depends only on directions (W4L2, slide 15). +3. $|\vec B|\propto r^{-3}$, so $\log|\vec B|=\text{const}-3\log r$: a straight line with slope $-3$. It crosses the $1\%$ line at $r/a\approx4.6$, as in quiz part (d). From $r/a=1$ to $2$, $|\vec B|$ drops by a factor of $8$ (W4L2, slide 18). +4. The field is vertical at $\theta=0^\circ$ and $180^\circ$ (angle $\mp90^\circ$) and horizontal at $\theta=90^\circ$. $|\vec B|$ is largest at the poles ($2B_*$) and smallest at the equator ($B_*$). The angle changes fastest near $\theta=90^\circ$, which is why the dip is the most sensitive latitude indicator near the dipole equator (part (e) 3). + +```{code-cell} ipython3 +:tags: [remove-input] + +# The HTML contains all controls and drawing code, with no external dependencies. +# An iframe keeps the explorer independent of the page styles. +import html as html_module +from pathlib import Path +from IPython.display import display + +for _candidate in ( + Path("earth_dipole_lab.html"), + Path("book/2_potential_fields/labs/week4/earth_dipole_lab.html"), +): + if _candidate.exists(): + explorer_html = _candidate.read_text() + break +else: + from pyodide.http import pyfetch + _r = await pyfetch("earth_dipole_lab.html") + explorer_html = (await _r.bytes()).decode() + +display({"text/html": ''}, raw=True) +``` + +## 4. Explore a current loop and its dipole field + +Far from a compact current loop, its magnetic field is that of a dipole (W4L2, slide 14). A circular loop carrying current $I$ around an area $A$ has the magnetic moment +```{math} +\vec m = IA\,\hat n, +``` +where $\hat n$ is the normal to the loop given by the right-hand rule: curl the fingers along the current, and the thumb gives $\hat n$. Use $\mu_0 = 4\pi\cdot10^{-7}\ \mathrm{T\,m/A}$. + +Parts (a)–(d) of this exercise are question 4 of the {doc}`week 4 quiz `. Work through them first; the Python cell and the explorer below let you check those answers and extend them to part (e). + +(e) Return to the core loop of quiz part (b). An observer stands on Earth's surface above the northern end of the axis, at distance $z = a$ from the centre of the loop. How large is the error of the dipole formula there? How far from Earth's centre, in units of $a$, would the observer have to be for the dipole formula to be accurate to within $10\%$? What does this tell you about the single-loop picture of the geodynamo? + +**(e)** With $z = a$ and $R_c = 3480\ \mathrm{km}$, $z/R_c = 1.83$ and +```{math} +\frac{B_\mathrm{dip}}{B_\mathrm{loop}} = \left(1+\frac{R_c^2}{a^2}\right)^{3/2} = (1+0.298)^{3/2} = \boxed{1.48}. +``` +At Earth's surface, the dipole formula would be **48% too large** for a single loop the size of the core. From explorer question 4, $10\%$ accuracy needs $z = 3.9\,R_c = 1.36\cdot10^{4}\ \mathrm{km} \approx \boxed{2.1\,a}$. + +So a single loop as large as the core would *not* look like a centred dipole at Earth's surface, yet the observed main field is dominated by its dipole part (teachbook, *Earth as a Magnetic Dipole*). The real geodynamo currents are spread through the core rather than concentrated in one loop at its edge. The single loop in quiz part (b) is therefore only an order-of-magnitude estimate of the current, not a model of its geometry. This is why the teachbook calls the dipole an *equivalent* description of the core currents. + +### Check your answers with Python + +```{code-cell} ipython3 +import numpy as np + +mu0 = 4e-7 * np.pi # [T m/A] +a, B_star, R_c = 6371e3, 29.7e-6, 3480e3 # Earth radius [m], B_* [T], outer-core radius [m] + +# (a), (b): Earth's moment and the equivalent core current +m_earth = 4 * np.pi * a**3 * B_star / mu0 # from B_* = mu0 m / (4 pi a^3) [A m^2] +I_core = m_earth / (np.pi * R_c**2) # from m = I * pi R_c^2 [A] +print(f"(a) m = {m_earth:.2e} A m^2 (b) I = {I_core:.2e} A") + +def B_loop_axis(z, I, R): + """Exact field on the axis of a circular loop of radius R [T].""" + return mu0 * I * R**2 / (2 * (R**2 + z**2)**1.5) + +def B_dip_axis(z, m): + """Dipole formula on the axis [T].""" + return mu0 * m / (2 * np.pi * z**3) + +# (c), (d): the survey loop +R_L, I_L = 50.0, 10.0 +m_L = I_L * np.pi * R_L**2 # moment of the survey loop [A m^2] +print(f"(c) m = {m_L:.3g} A m^2") +for z in (100.0, 250.0): # (d): z = 2 R_L and z = 5 R_L + B_ex, B_dp = B_loop_axis(z, I_L, R_L), B_dip_axis(z, m_L) + print(f"(d) at z = {z:.0f} m: exact {B_ex*1e9:.2f} nT, dipole {B_dp*1e9:.2f} nT, " + f"ratio {B_dp/B_ex:.2f}") +z_10 = R_L / np.sqrt(1.1**(2/3) - 1) # height where B_dip / B_loop = 1.1 [m] +print(f" dipole formula within 10% beyond z = {z_10:.0f} m = {z_10/R_L:.1f} R_L") + +# (e): the core loop seen from Earth's surface on the axis +ratio_core = B_dip_axis(a, m_earth) / B_loop_axis(a, I_core, R_c) +print(f"(e) z/R_c = {a/R_c:.2f}: dipole / exact = {ratio_core:.2f}; " + f"10% needs r = {z_10/R_L * R_c / a:.2f} a") + +# self-check +assert np.isclose(m_earth, 7.68e22, rtol=2e-3) and np.isclose(I_core, 2.02e9, rtol=5e-3) +assert np.isclose(m_L, 7.854e4, rtol=1e-3) +assert np.isclose(B_dip_axis(100.0, m_L) / B_loop_axis(100.0, I_L, R_L), 1.398, atol=1e-3) +assert np.isclose(B_dp / B_ex, 1.061, atol=1e-3) # last loop value: z = 250 m +assert np.isclose(z_10, 195.2, atol=0.5) +assert np.isclose(ratio_core, 1.48, atol=0.01) +print("Self-check passed.") +``` + +The explorer below shows a circular loop seen edge-on, with its axis vertical. The upper panel compares the exact field lines of the loop (solid) with those of a point dipole with the same moment (dashed), in units of the loop radius $R_L$. The lower-left panel shows $|\vec B|$ on the axis on log–log axes, for the loop radius and current you choose. The lower-right panel shows the ratio of the dipole formula to the exact field, with a line at $10\%$. + +1. Keep $R_L = 50\ \mathrm{m}$ and $I = 10\ \mathrm{A}$ and set $z/R_L = 2$. Check your answers to quiz part (d). +2. In the upper panel, where do the solid and dashed field lines agree, and where do they differ most? What does "far from a compact loop" (W4L2, slide 14) mean in this picture? +3. Change $R_L$ and $I$. Does the curve in the lower-right panel change? Explain why. What does change in the lower-left panel? +4. Find the value of $z/R_L$ where the ratio drops to $1.1$, so that the dipole formula is accurate to within $10\%$. Compare it with your results at $2R_L$ and $5R_L$ in quiz part (d). Then set $z/R_L \approx 1.85$ to check part (e). + +**Answers** + +1. With $R_L=50\ \mathrm{m}$, $I=10\ \mathrm{A}$ and $z/R_L=2$, the status line gives $B_\mathrm{loop}=11.2\ \mathrm{nT}$, $B_\mathrm{dip}=15.7\ \mathrm{nT}$ and a ratio of $1.40$, as in quiz part (d). +2. A few loop radii away, the solid and dashed lines almost coincide: there the loop is "compact" compared with the distance. They differ most near the wire. The loop's field lines close around the wire, while every dipole line passes through the single point at the centre. Near the loop, its size matters; far away, only its moment $I\pi R_L^2$ does. +3. The ratio curve does not change: $B_\mathrm{dip}/B_\mathrm{loop} = (1+R_L^2/z^2)^{3/2}$ depends only on $z/R_L$. In the lower-left panel both curves shift: at a fixed $z/R_L$ the field scales as $I/R_L$, so a larger current raises the curves and a larger loop lowers them. +4. The ratio drops to $1.1$ at $z/R_L\approx3.9$ (195 m for the survey loop), between the $40\%$ error at $2R_L$ and the $6\%$ error at $5R_L$ found in quiz part (d). Solving $(1+R_L^2/z^2)^{3/2}=1.1$ gives the same value: $z = R_L/\sqrt{1.1^{2/3}-1} = 3.9\,R_L$. At $z/R_L=1.85$ it is about $1.47$, close to the $1.48$ found in part (e) for $z/R_c = 1.83$. +```{code-cell} ipython3 +:tags: [remove-input] + +# The HTML contains all controls and drawing code, with no external dependencies. +# An iframe keeps the explorer independent of the page styles. +import html as html_module +from pathlib import Path +from IPython.display import display + +for _candidate in ( + Path("current_loop_lab.html"), + Path("book/2_potential_fields/labs/week4/current_loop_lab.html"), +): + if _candidate.exists(): + explorer_html = _candidate.read_text() + break +else: + from pyodide.http import pyfetch + _r = await pyfetch("current_loop_lab.html") + explorer_html = (await _r.bytes()).decode() + +display({"text/html": ''}, raw=True) +``` + \ No newline at end of file diff --git a/book/2_potential_fields/labs/week4/week4_quiz.md b/book/2_potential_fields/labs/week4/week4_quiz.md new file mode 100644 index 0000000..8939fc6 --- /dev/null +++ b/book/2_potential_fields/labs/week4/week4_quiz.md @@ -0,0 +1,93 @@ +# Quiz Week 4 + + +## 1. Earth-ionosphere system +The Earth-ionosphere system can be modeled in a simple way by assuming the Earth to be a perfectly conducting sphere of radius $R_E$, surrounded by a thin, perfectly conducting spherical shell with radius $R_I = R_E + 100\ \text{km}$, with free space between them. The surface of the Earth has a potential $\Phi(r=R_E)=0\ \text{V}$, and the ionosphere has potential $\Phi(r=R_I)=V_I$. + +```{figure} figures/simple_ionosphere.png +:width: 35% +``` + +(a) Write the equation you would use to determine the potential in the region $R_E < r < R_I$ in the simplest form possible given the information provided. + +(b) Assume the solution for the potential has the form +```{math} +\Phi(r) = A + \frac{B}{r}. +``` +Find expressions for $A$ and $B$, and write the expression for the potential in these terms. + +(c) Find the expression for the electric field, $\vec{E}$, in the region $R_E < r < R_I$. + + +(d) Find the numerical values of $A$ and $B$ assuming $R_E=6370\ \text{km}$ and $V_I=100\ \text{kV}$. + + +(e) What is the strength of the field at 50 km altitude, and in which direction is it pointing? + + +## 2. The fair-weather field +On a clear day, the air above flat, open ground carries a downward electric field (W4L1, slides 16–17): +```{math} +\vec{E} \approx -E_0\,\hat{z}, \qquad E_0 \approx 100\ \mathrm{V/m}, \qquad V(z) = E_0 z \quad \text{with } V(0) = 0. +``` +Cosmic rays continuously ionise the air, producing free electrons and positive ions such as $\mathrm{N_2^+}$. Wind also lifts charged mineral dust from deserts into the atmosphere. Use $e = 1.602\cdot 10^{-19}\ \mathrm{C}$, $g = 9.81\ \mathrm{m/s^2}$ and $1\ \mathrm{eV} = 1.602\cdot 10^{-19}\ \mathrm{J}$ (the energy an elementary charge gains across $1\ \mathrm{V}$). + +(a) Sketch the equipotentials and field lines for $0 \leq z \leq 10\ \mathrm{m}$. What is the electric potential $V$ at $z = 2\ \mathrm{m}$, given the reference $V(0) = 0$ ? + +(b) An electron ($q=-e$) and an $\mathrm{N_2^+}$ ion ($q=+e$) are each moved from the ground to $z = 10\ \mathrm{m}$. For each, find $\Delta V$, $\Delta U$ (in J and in eV) and the work done by the field, $W_\mathrm{field}$. + +(c) Both particles are released from rest. Which one accelerates upward? In which direction does the resulting current flow? + +(d) A Saharan dust grain (radius $1\ \mu\mathrm{m}$, density $2650\ \mathrm{kg/m^3}$) carries a negative charge. How many excess electrons does it need for the electric force to balance gravity? Does the answer depend on its height in this model? + +## 3. Earth's magnetic field +Far from a compact current system, its magnetic field is that of a dipole (W4L2, slides 14–15). Earth's main field is modelled as a dipole at Earth's centre. As in the lecture, let $\hat m=\hat z$, let $\theta$ be the angle measured from $\hat m$, and work in the $x$–$z$ plane with $\hat r=\sin\theta\,\hat x+\cos\theta\,\hat z$ (slide 22). The field is +```{math} +\vec B = B_*\left(\frac{R}{r}\right)^3\left[3(\hat m\cdot\hat r)\,\hat r-\hat m\right], +\qquad B_*=\frac{\mu_0|\vec m|}{4\pi R^3}. +``` +For Earth, take $R=a=6371\ \mathrm{km}$ and $B_*\approx 29.7\ \mu\mathrm{T}$ (called $B_0$ in the teachbook section *Earth as a Magnetic Dipole*). For the present polarity, $\hat m$ points toward the **southern** end of the dipole axis: $\theta=0$ is the southern end, $\theta=\pi$ the northern end, and $\theta=\pi/2$ the dipole equator. + +Written in the local directions $\hat r$ (outward) and $\hat\theta$ (tangent to the surface, in the direction of increasing $\theta$), the same field is +```{math} +\frac{\vec B}{B_*} = \left(\frac{R}{r}\right)^3\left(2\cos\theta\,\hat r + \sin\theta\,\hat\theta\right), +\qquad\text{that is}\qquad +B_r = 2B_*\left(\frac{R}{r}\right)^3\cos\theta, +\quad +B_\theta = B_*\left(\frac{R}{r}\right)^3\sin\theta . +``` +You may use either form. + +```{figure} figures/earth_dipole_setup.png +:width: 45% + +Geometry of the dipole model, as in W4L2, slides 17 and 22: $\hat m=\hat z$ points up the page, $\theta$ is measured from $\hat m$, and the grey arrows show $\hat r$ at the points used in (a) and (b). The dashed circle is Earth's surface, $r=a$. +``` + +(a) At the surface, $r=a$, find $\vec B/B_*$ at $\theta=0$ and $\pi/2$, and give $|\vec B|$ in $\mu\mathrm{T}$. At each point, determine whether $\vec B$ points into the Earth, out of the Earth or is tangent to the Earth's surface. Using $B_r\propto\cos\theta$, in which hemisphere does the field enter Earth? + +(b) At $r=a$ and $\theta=3\pi/4$ (dipole latitude $45^\circ$ N), construct $\vec B/B_*$ head to tail from $3(\hat m\cdot\hat r)\hat r$ and $-\hat m$ (W4L2, slide 16). Find $|\vec B|$ in $\mu\mathrm{T}$ and the angle between $\vec B$ and the local horizontal. *Hint:* use $\vec B\cdot\hat r=|\vec B|\cos\alpha$, where $\alpha$ is the angle between $\vec B$ and $\hat r$. The local horizontal is perpendicular to $\hat r$, so the angle between $\vec B$ and the horizontal is $|90^\circ-\alpha|$. + +(c) ESA's Swarm satellites measure the Earth's magnetic field at about $450\ \mathrm{km}$ altitude. Consider a point directly above the location in (b), i.e. at the same dipole latitude. What happens to the magnitude $|\vec B|$ and direction of $\vec B$? + +(d) Above the northern end of the dipole axis, at what distance from Earth's centre has the magnetic field magnitude $|\vec B|$ decreased to $1\%$ of its value at Earth's surface ? + +## 4. A current loop as a magnetic dipole +Far from a compact current loop, its magnetic field is that of a dipole (W4L2, slide 14). A circular loop carrying current $I$ around an area $A$ has the magnetic moment +```{math} +\vec m = IA\,\hat n, +``` +where $\hat n$ is the normal to the loop given by the right-hand rule: curl the fingers along the current, and the thumb gives $\hat n$. Use $\mu_0 = 4\pi\cdot10^{-7}\ \mathrm{T\,m/A}$. + +(a) In question 3, the magnetic field at Earth's dipole equator and surface was described by $B_*=\mu_0|\vec m|/(4\pi a^3)\approx 29.7\ \mu\mathrm{T}$, with $a=6371\ \mathrm{km}$. Find Earth's dipole moment $|\vec m|$. + +(b) Earth's field is generated by electric currents in the liquid outer core (the geodynamo). As a size estimate, replace these currents by a single circular loop in the dipole's equatorial plane, with the radius of the outer core, $R_c = 3480\ \mathrm{km}$. What current $I$ is needed? Seen from above the northern end of the dipole axis, does the current circulate clockwise or counterclockwise? *Hint:* Use the right-hand rule: point your right thumb in the direction of $\hat m$, toward the southern end of Earth's dipole axis. Your curled fingers show the direction of the current. + +(c) A geophysicist lays out a circular wire loop of radius $R_L = 50\ \mathrm{m}$ on flat ground and drives a current $I = 10\ \mathrm{A}$ through it. Find its magnetic moment. On the axis of the loop, at height $z$ above its centre, the exact field is (you do not need to derive it) +```{math} +B_\mathrm{loop}(z) = \frac{\mu_0 I R_L^2}{2\left(R_L^2+z^2\right)^{3/2}}. +``` +Starting from the exact loop field, show that when $z \gg R_L$, the field reduces to the dipole field on the axis $B_\mathrm{dip}(z)=\dfrac{\mu_0|\vec m|}{2\pi z^3}$ (corresponding to $\theta=0$ case of question 3). + +(d) Find $B_\mathrm{loop}$ and $B_\mathrm{dip}$ in nT at $z = 100\ \mathrm{m}$ $(=2R_L)$ and at $z = 250\ \mathrm{m}$ $(=5R_L)$. By how many percent does the dipole formula overestimate the field at each height? Based on these results, for what approximate values of $ z/R_L $ does the dipole approximation become reasonably accurate? *Hint:* $B_\mathrm{dip}/B_\mathrm{loop} = \left(1+R_L^2/z^2\right)^{3/2}$. + \ No newline at end of file diff --git a/book/2_potential_fields/labs/week4/week4_quiz_solutions.md b/book/2_potential_fields/labs/week4/week4_quiz_solutions.md new file mode 100644 index 0000000..a854b6f --- /dev/null +++ b/book/2_potential_fields/labs/week4/week4_quiz_solutions.md @@ -0,0 +1,279 @@ +# Quiz Week 4 (Solutions) + + +## 1. Earth-ionosphere system +The Earth-ionosphere system can be modeled in a simple way by assuming the Earth to be a perfectly conducting sphere of radius $R_E$, surrounded by a thin, perfectly conducting spherical shell with radius $R_I = R_E + 100\ \text{km}$, with free space between them. The surface of the Earth has a potential $\Phi(r=R_E)=0\ \text{V}$, and the ionosphere has potential $\Phi(r=R_I)=V_I$. + +```{figure} figures/simple_ionosphere.png +:width: 35% +``` + +(a) Write the equation you would use to determine the potential in the region $R_E < r < R_I$ in the simplest form possible given the information provided. + +Since the region between the Earth and ionosphere is modeled as free space, we use Laplace's equation: +```{math} +\nabla^2\Phi = 0. +``` +The problem has spherical symmetry (there is no dependance on $\phi$ or $\theta$). Thus the equation reduces to +```{math} +\boxed{\frac{\partial}{\partial r} \left( r^2 \frac{\partial \Phi}{\partial r} \right) = 0} +``` + +(b) Assume the solution for the potential has the form +```{math} +\Phi(r) = A + \frac{B}{r}. +``` +Find expressions for $A$ and $B$, and write the expression for the potential in these terms. + +Applying the boundary conditions $\Phi(r=R_E)=0$ and $\Phi(r=R_I)=V_I$, we get +```{math} +A = \frac{-B}{R_E} +``` +and +```{math} +\boxed{B = \frac{V_I}{1/R_I - 1/R_E}} +``` +This gives us +```{math} +\boxed{A = \frac{V_I}{R_E(1/R_I - 1/R_E)}} +``` +and +```{math} +\boxed{\Phi(r) = V_I\frac{1/R_E - 1/r}{1/R_I - 1/R_E}} +``` + +(c) Find the expression for the electric field, $\vec{E}$, in the region $R_E < r < R_I$. + +```{math} +\begin{aligned} +\vec{E} &= -\vec{\nabla}\Phi \\ + &= -\frac{\partial}{\partial r} \Phi(r)\ \hat{r} \\ + &= -\left(\frac{-B}{r^2}\right)\ \hat{r} \\ + &= \boxed{\frac{B}{r^2}\ \hat{r}} +\end{aligned} +``` + +(d) Find the numerical values of $A$ and $B$ assuming $R_E=6370\ \text{km}$ and $V_I=100\ \text{kV}$. + +```{math} +\begin{aligned} +B &= \frac{(100\cdot 10^3)}{1/(6470\cdot 10^3) - 1/(6370\cdot 10^3)} \\ + &= \boxed{-4.12 \cdot 10^{13}\ \mathrm{V \cdot m}} +\end{aligned} +``` + +```{math} +\begin{aligned} +A &= \frac{-(-4.12 \cdot 10^{13})}{(6370\cdot 10^3)} \\ + &= \boxed{6.47 \cdot 10^6\ \mathrm{V}} +\end{aligned} +``` + +(e) What is the strength of the field at 50 km altitude, and in which direction is it pointing? + +```{math} +\begin{aligned} +\vec{E} &= \frac{B}{r^2} \hat{r} \\ + &= \frac{(-4.12 \cdot 10^{13})}{(6420\cdot 10^3)^2} \hat{r} \\ + &= \boxed{-1.00\ \mathrm{V/m}\ \hat{r}} +\end{aligned} +``` +The field points radially inward (ie. down), from high potential to low. + + +## 2. The fair-weather field +On a clear day, the air above flat, open ground carries a downward electric field (W4L1, slides 16–17): +```{math} +\vec{E} \approx -E_0\,\hat{z}, \qquad E_0 \approx 100\ \mathrm{V/m}, \qquad V(z) = E_0 z \quad \text{with } V(0) = 0. +``` +Cosmic rays continuously ionise the air, producing free electrons and positive ions such as $\mathrm{N_2^+}$. Wind also lifts charged mineral dust from deserts into the atmosphere. Use $e = 1.602\cdot 10^{-19}\ \mathrm{C}$, $g = 9.81\ \mathrm{m/s^2}$ and $1\ \mathrm{eV} = 1.602\cdot 10^{-19}\ \mathrm{J}$ (the energy an elementary charge gains across $1\ \mathrm{V}$). + +(a) Sketch the equipotentials and field lines for $0 \leq z \leq 10\ \mathrm{m}$. What is the electric potential $V$ at $z = 2\ \mathrm{m}$, given the reference $V(0) = 0$ ? + +**(a)** The equipotentials are horizontal planes spaced evenly: every metre up adds $100\ \mathrm{V}$. The field lines are vertical, point downward and are equally spaced, so the field is uniform. At head height, +```{math} +V(2\ \mathrm{m}) = E_0 z = (100)(2) = \boxed{200\ \mathrm{V}}. +``` +The potential increases upward, while $\vec{E}$ points down, from high to low potential. + +(b) An electron ($q=-e$) and an $\mathrm{N_2^+}$ ion ($q=+e$) are each moved from the ground to $z = 10\ \mathrm{m}$. For each, find $\Delta V$, $\Delta U$ (in J and in eV) and the work done by the field, $W_\mathrm{field}$. + +**(b)** The potential difference does not depend on the test charge: +```{math} +\Delta V = V(10\ \mathrm{m}) - V(0) = \boxed{1000\ \mathrm{V}}. +``` +Using $\Delta U = q\Delta V$ and $W_\mathrm{field} = -\Delta U$ (W4L1, slide 13): + +| | $q$ | $\Delta U$ | $W_\mathrm{field}$ | +|---|---|---|---| +| electron | $-e$ | $-1.60\cdot 10^{-16}\ \mathrm{J} = -1000\ \mathrm{eV}$ | $+1.60\cdot 10^{-16}\ \mathrm{J}$ | +| $\mathrm{N_2^+}$ ion | $+e$ | $+1.60\cdot 10^{-16}\ \mathrm{J} = +1000\ \mathrm{eV}$ | $-1.60\cdot 10^{-16}\ \mathrm{J}$ | + +Moving up the electron *loses* potential energy, because the field does positive work on it. The ion *gains* potential energy, because the field works against the motion. Same $\Delta V$, opposite energies. + +(c) Both particles are released from rest. Which one accelerates upward? In which direction does the resulting current flow? + +**(c)** The force is $\vec{F} = q\vec{E} = q(-E_0\hat{z})$. +- Electron: $\vec{F} = (-e)(-E_0\hat{z}) = +eE_0\hat{z} = +1.6\cdot 10^{-17}\ \mathrm{N}\,\hat{z}$. It **accelerates upward**, toward lower potential energy. +- Ion: $\vec{F} = -eE_0\hat{z}$. It accelerates downward. +Positive charge moving down and negative charge moving up both give a **downward** current. This is the small fair-weather current of the global atmospheric electrical circuit, which flows downward through fair-weather regions because air is a poor, but not perfect, insulator. Thunderstorms help maintain the potential difference between the upper atmosphere and the ground that drives it (W4L1, slide 16). + +(d) A Saharan dust grain (radius $1\ \mu\mathrm{m}$, density $2650\ \mathrm{kg/m^3}$) carries a negative charge. How many excess electrons does it need for the electric force to balance gravity? Does the answer depend on its height in this model? + +**(d)** The mass of the grain is +```{math} +m = \tfrac{4}{3}\pi a^3 \rho = \tfrac{4}{3}\pi (10^{-6})^3 (2650) = 1.11\cdot 10^{-14}\ \mathrm{kg}. +``` +A negative charge feels an upward force (see (c)), so it can balance gravity when $|q|E_0 = mg$: +```{math} +|q| = \frac{mg}{E_0} = \frac{(1.11\cdot 10^{-14})(9.81)}{100} = 1.09\cdot 10^{-15}\ \mathrm{C}, +\qquad N = \frac{|q|}{e} \approx \boxed{6.8\cdot 10^{3}\ \text{electrons}}. +``` +In this model, $\vec{E}$ is uniform, so the answer **does not depend on height**. The linear potential is only valid near the ground (W4L1, slide 17). In real dust storms, the field near the ground can be much stronger than $E_0$, so far less charge is needed. +## 3. Earth's magnetic field +Far from a compact current system, its magnetic field is that of a dipole (W4L2, slides 14–15). Earth's main field is modelled as a dipole at Earth's centre. As in the lecture, let $\hat m=\hat z$, let $\theta$ be the angle measured from $\hat m$, and work in the $x$–$z$ plane with $\hat r=\sin\theta\,\hat x+\cos\theta\,\hat z$ (slide 22). The field is +```{math} +\vec B = B_*\left(\frac{R}{r}\right)^3\left[3(\hat m\cdot\hat r)\,\hat r-\hat m\right], +\qquad B_*=\frac{\mu_0|\vec m|}{4\pi R^3}. +``` +For Earth, take $R=a=6371\ \mathrm{km}$ and $B_*\approx 29.7\ \mu\mathrm{T}$ (called $B_0$ in the teachbook section *Earth as a Magnetic Dipole*). For the present polarity, $\hat m$ points toward the **southern** end of the dipole axis: $\theta=0$ is the southern end, $\theta=\pi$ the northern end, and $\theta=\pi/2$ the dipole equator. + +Written in the local directions $\hat r$ (outward) and $\hat\theta$ (tangent to the surface, in the direction of increasing $\theta$), the same field is +```{math} +\frac{\vec B}{B_*} = \left(\frac{R}{r}\right)^3\left(2\cos\theta\,\hat r + \sin\theta\,\hat\theta\right), +\qquad\text{that is}\qquad +B_r = 2B_*\left(\frac{R}{r}\right)^3\cos\theta, +\quad +B_\theta = B_*\left(\frac{R}{r}\right)^3\sin\theta . +``` +You may use either form. + +```{figure} figures/earth_dipole_setup.png +:width: 45% + +Geometry of the dipole model, as in W4L2, slides 17 and 22: $\hat m=\hat z$ points up the page, $\theta$ is measured from $\hat m$, and the grey arrows show $\hat r$ at the points used in (a) and (b). The dashed circle is Earth's surface, $r=a$. +``` + +(a) At the surface, $r=a$, find $\vec B/B_*$ at $\theta=0$ and $\pi/2$, and give $|\vec B|$ in $\mu\mathrm{T}$. At each point, determine whether $\vec B$ points into the Earth, out of the Earth or is tangent to the Earth's surface. Using $B_r\propto\cos\theta$, in which hemisphere does the field enter Earth? + +**(a)** At $r=a$ the factor $(R/r)^3$ equals 1. +- $\theta=0$: $\hat r=\hat z$, $\hat m\cdot\hat r=1$, so $\vec B/B_*=3\hat z-\hat z=2\hat z=2\hat r$. The field points **out of the ground**, with $|\vec B|=2B_*=\boxed{59.4\ \mu\mathrm{T}}$. +- $\theta=\pi/2$: $\hat r=\hat x$, $\hat m\cdot\hat r=0$, so $\vec B/B_*=-\hat z$. The field is **along the ground** (horizontal), pointing from the southern toward the northern end of the axis, with $|\vec B|=B_*=\boxed{29.7\ \mu\mathrm{T}}$. +Since $B_r=2B_*\cos\theta$, the radial component is positive (outward) for $\theta<\pi/2$ and negative (inward) for $\theta>\pi/2$. The field therefore leaves Earth in the southern hemisphere and **enters Earth in the northern hemisphere**; at $\theta=\pi$ it is $2\hat z=-2\hat r$, the mirror image of $\theta=0$. The field at the poles is twice as strong as at the equator (W4L2, slide 17). + +(b) At $r=a$ and $\theta=3\pi/4$ (dipole latitude $45^\circ$ N), construct $\vec B/B_*$ head to tail from $3(\hat m\cdot\hat r)\hat r$ and $-\hat m$ (W4L2, slide 16). Find $|\vec B|$ in $\mu\mathrm{T}$ and the angle between $\vec B$ and the local horizontal. *Hint:* use $\vec B\cdot\hat r=|\vec B|\cos\alpha$, where $\alpha$ is the angle between $\vec B$ and $\hat r$. The local horizontal is perpendicular to $\hat r$, so the angle between $\vec B$ and the horizontal is $|90^\circ-\alpha|$. + +**(b)** At $\theta=3\pi/4$: $\hat r=\tfrac{1}{\sqrt2}(\hat x-\hat z)$ and $\hat m\cdot\hat r=\cos\tfrac{3\pi}{4}=-\tfrac{1}{\sqrt2}$. Then +```{math} +3(\hat m\cdot\hat r)\hat r=-\tfrac32(\hat x-\hat z)=-\tfrac32\hat x+\tfrac32\hat z, +\qquad +\frac{\vec B}{B_*}=-\tfrac32\hat x+\tfrac32\hat z-\hat z=\boxed{-\tfrac32\hat x+\tfrac12\hat z}. +``` +This is the $\theta=3\pi/4$ arrow of the slide 22 practice. Its magnitude equals that of the slide 16 example: +```{math} +|\vec B|=B_*\sqrt{\tfrac94+\tfrac14}=1.58\,B_*=\boxed{47.0\ \mu\mathrm{T}}. +``` +For the direction, $\vec B\cdot\hat r=B_*\tfrac{1}{\sqrt2}\left(-\tfrac32-\tfrac12\right)=-\sqrt2\,B_*$, so +```{math} +\cos\alpha=\frac{-\sqrt2}{1.58}=-0.894,\qquad \alpha=153.4^\circ. +``` +Because $\hat r$ points outward, $\alpha>90^\circ$ already tells us that the radial component is inward: the field points **into the ground**, as it must in the northern hemisphere by part (a). + +$\hat r$ is the local vertical, so an angle measured from $\hat r$ and an angle measured from the local horizontal are complements. The field therefore lies +```{math} +|90^\circ-153.4^\circ|=\boxed{63.4^\circ} +``` +below the horizontal. Note that $\tan I=|B_r|/B_\theta=2\tan\lambda_m$: at dipole latitude $45^\circ$ it is the *tangent* of the inclination that is doubled, not the angle. That relation is derived in lab exercise 3(e). + +The component form gives the same result in one step: $B_r/B_*=2\cos\tfrac{3\pi}{4}=-\sqrt2$ and $B_\theta/B_*=\sin\tfrac{3\pi}{4}=\tfrac{1}{\sqrt2}$, so $|\vec B|=B_*\sqrt{2+\tfrac12}=1.58\,B_*$ and $\tan I=|B_r|/B_\theta=2$, i.e. $I=63.4^\circ$ below the horizontal. + +```{figure} figures/earth_dipole_vectors_solution.png +:width: 95% + +Left: $\vec B/B_*$ at the points of (a) and (b), together with the northern end, drawn with one arrow scale (compare W4L2, slide 17). Right: the head-to-tail construction at $\theta=3\pi/4$ (compare slide 16). The field points into the ground, $63.4^\circ$ below the local horizontal. +``` + +(c) ESA's Swarm satellites measure the Earth's magnetic field at about $450\ \mathrm{km}$ altitude. Consider a point directly above the location in (b), i.e. at the same dipole latitude. What happens to the magnitude $|\vec B|$ and direction of $\vec B$? + +**(c)** The bracket depends only on directions; the distance enters only through $(R/r)^3$ (W4L2, slide 15). With $r=6371+450=6821\ \mathrm{km}$, +```{math} +|\vec B|=47.0\ \mu\mathrm{T}\times\left(\frac{6371}{6821}\right)^3=47.0\times0.815=\boxed{38.3\ \mu\mathrm{T}}. +``` +The **direction does not change**: at the same $\theta$, $\hat r$ and the bracket are the same. + +(d) Above the northern end of the dipole axis, at what distance from Earth's centre has the magnetic field magnitude $|\vec B|$ decreased to $1\%$ of its value at Earth's surface ? + +**(d)** Along the axis, $|\vec B|=2B_*(a/r)^3$, so the ratio to the surface value is $(a/r)^3$: +```{math} +\left(\frac{a}{r}\right)^3=0.01 +\quad\Longrightarrow\quad +r=100^{1/3}a=4.64\,a\approx\boxed{2.96\cdot10^{4}\ \mathrm{km}}. +``` +Each doubling of the distance reduces the field by a factor of 8 (W4L2, slide 18), and $2^{2.2}\approx4.6$. The same distance holds at every $\theta$, because the ratio depends only on $r$. + + +## 4. A current loop as a magnetic dipole + +Far from a compact current loop, its magnetic field is that of a dipole (W4L2, slide 14). A circular loop carrying current $I$ around an area $A$ has the magnetic moment +```{math} +\vec m = IA\,\hat n, +``` +where $\hat n$ is the normal to the loop given by the right-hand rule: curl the fingers along the current, and the thumb gives $\hat n$. Use $\mu_0 = 4\pi\cdot10^{-7}\ \mathrm{T\,m/A}$. + +(a) In question 3, the magnetic field at Earth's dipole equator and surface was described by $B_*=\mu_0|\vec m|/(4\pi a^3)\approx 29.7\ \mu\mathrm{T}$, with $a=6371\ \mathrm{km}$. Find Earth's dipole moment $|\vec m|$. + +**(a)** Rearranging $B_*=\mu_0|\vec m|/(4\pi a^3)$, +```{math} +|\vec m| = \frac{4\pi a^3 B_*}{\mu_0} += \frac{4\pi (6.371\cdot 10^{6})^3 (29.7\cdot 10^{-6})}{4\pi\cdot 10^{-7}} += \boxed{7.7\cdot 10^{22}\ \mathrm{A\,m^2}}, +``` +which is the accepted value for Earth's dipole moment. + +(b) Earth's field is generated by electric currents in the liquid outer core (the geodynamo). As a size estimate, replace these currents by a single circular loop in the dipole's equatorial plane, with the radius of the outer core, $R_c = 3480\ \mathrm{km}$. What current $I$ is needed? Seen from above the northern end of the dipole axis, does the current circulate clockwise or counterclockwise? *Hint:* Use the right-hand rule: point your right thumb in the direction of $\hat m$, toward the southern end of Earth's dipole axis. Your curled fingers show the direction of the current. + +**(b)** The loop area is $A=\pi R_c^2=\pi(3.48\cdot 10^{6})^2=3.81\cdot 10^{13}\ \mathrm{m^2}$, so +```{math} +I = \frac{|\vec m|}{A} = \frac{7.68\cdot 10^{22}}{3.81\cdot 10^{13}} += \boxed{2.0\cdot 10^{9}\ \mathrm{A}} \approx 2\ \mathrm{GA}. +``` +$\hat m$ points toward the **southern** end of the dipole axis (question 3). Pointing the right thumb that way, the fingers curl so that the current runs **clockwise seen from above the northern end** of the axis. + +Two billion amperes is enormous for a single wire, but the geodynamo is a broad, distributed flow of conducting liquid iron, not one loop. The estimate gives the right order of magnitude for the total circulating current. + +(c) A geophysicist lays out a circular wire loop of radius $R_L = 50\ \mathrm{m}$ on flat ground and drives a current $I = 10\ \mathrm{A}$ through it. Find its magnetic moment. On the axis of the loop, at height $z$ above its centre, the exact field is (you do not need to derive it) +```{math} +B_\mathrm{loop}(z) = \frac{\mu_0 I R_L^2}{2\left(R_L^2+z^2\right)^{3/2}}. +``` +Starting from the exact loop field, show that when $z \gg R_L$, the field reduces to the dipole field on the axis $B_\mathrm{dip}(z)=\dfrac{\mu_0|\vec m|}{2\pi z^3}$ (corresponding to $\theta=0$ case of question 3). + +**(c)** The moment of the field loop is +```{math} +|\vec m| = IA = I\pi R_L^2 = (10)\pi(50)^2 = \boxed{7.9\cdot 10^{4}\ \mathrm{A\,m^2}}. +``` +Factor $z^3$ out of the exact expression: +```{math} +B_\mathrm{loop}(z) = \frac{\mu_0 I R_L^2}{2\left(R_L^2+z^2\right)^{3/2}} += \frac{\mu_0 I R_L^2}{2z^3\left(1+R_L^2/z^2\right)^{3/2}}. +``` +For $z \gg R_L$ the bracket tends to 1, and writing $I R_L^2 = |\vec m|/\pi$, +```{math} +B_\mathrm{loop} \to \frac{\mu_0 I R_L^2}{2z^3} = \boxed{\frac{\mu_0|\vec m|}{2\pi z^3} = B_\mathrm{dip}(z)}, +``` +the on-axis dipole field, which is the $\theta=0$ case of question 3. The loop only looks like a dipole from far enough away that its size no longer matters. + +(d) Find $B_\mathrm{loop}$ and $B_\mathrm{dip}$ in nT at $z = 100\ \mathrm{m}$ $(=2R_L)$ and at $z = 250\ \mathrm{m}$ $(=5R_L)$. By how many percent does the dipole formula overestimate the field at each height? Based on these results, for what approximate values of $ z/R_L $ does the dipole approximation become reasonably accurate? *Hint:* $B_\mathrm{dip}/B_\mathrm{loop} = \left(1+R_L^2/z^2\right)^{3/2}$. + +**(d)** Using the two expressions directly: + +| $z$ | $z/R_L$ | $B_\mathrm{loop}$ | $B_\mathrm{dip}$ | overestimate | +|---|---|---|---|---| +| $100\ \mathrm{m}$ | 2 | $11.2\ \mathrm{nT}$ | $15.7\ \mathrm{nT}$ | $40\%$ | +| $250\ \mathrm{m}$ | 5 | $0.95\ \mathrm{nT}$ | $1.01\ \mathrm{nT}$ | $6\%$ | + +The hint gives the error directly, since +```{math} +\frac{B_\mathrm{dip}}{B_\mathrm{loop}} = \left(1+\frac{R_L^2}{z^2}\right)^{3/2} +\approx 1 + \frac{3}{2}\frac{R_L^2}{z^2} \quad (z \gg R_L), +``` +so the overestimate falls off as $(R_L/z)^2$: $40\%$ at $z/R_L=2$, $6\%$ at $5$, $1.5\%$ at $10$ and $0.4\%$ at $20$. The dipole formula is therefore **reasonably accurate for $z/R_L \gtrsim 5$**, and good to about a percent for $z/R_L \gtrsim 10$. The same rule of thumb is why Earth's field is well described by a dipole at satellite altitude, but not close to the core. diff --git a/book/_toc.yml b/book/_toc.yml index c509667..8dd8c38 100644 --- a/book/_toc.yml +++ b/book/_toc.yml @@ -65,6 +65,10 @@ parts: - file: 2_potential_fields/magnetic_field/exercises.md - file: 2_potential_fields/labs/week3_gravity_and_potential/week3_exersizes.md - file: 2_potential_fields/labs/week3_gravity_and_potential/week3_exersizes_solutions.md + - file: 2_potential_fields/labs/week4/week4_quiz.md + # - file: 2_potential_fields/labs/week4/week4_quiz_solutions.md + - file: 2_potential_fields/labs/week4/week4_exercises.md + # - file: 2_potential_fields/labs/week4/week4_exercises_solutions.md # - file: 2_potential_fields/gradient_fields.md # - file: 2_potential_fields/divergence_free_fields.md # - file: 2_potential_fields/curl_free_fields.md diff --git a/book/credits.md b/book/credits.md index 924bdc7..e774042 100644 --- a/book/credits.md +++ b/book/credits.md @@ -21,31 +21,6 @@ To recreate the website you have two options (more information in the [TeachBook ## License This book is [CC BY 4.0 licensed](https://creativecommons.org/licenses/by/4.0/) allowing you to share and adapt the material, as long as the source is named. External resources that are reused in this book are listed below. -(external_resources)= -### External resources - -Parts of this book are taken from other external resources and reused in various ways. If an author is not listed on a particular page, it is by the Authors, except as follows: - -The following pages are included directly from an external resource and are not edited by the course team: -- The following pages includes text from {cite:t}`template`. Original content licensed under CC BY 4.0 License: - - [](./exercises.md) - - [](./exercises/002.md) - - [](./exercises/003.md) - - [](./exercises/004.md) - - [](./exercises/005.md) - - [](./exercises/006.md) - - [](./syntax_exercises.md) - - [](./syntax_exercises/007.md) - - [](./syntax_exercises/008.md) - - [](./syntax_exercises/009.md) - - [](./syntax_exercises/010.md) - - [](./syntax_exercises/011.md) - - [](./exercises/summary.md) - -The following pages contain content written by others, part of which has been reused and/or modified by the course team: -- Page [](./exercises/001.md) includes text from {cite:t}`template` and is edited to be made TU Delft-specific. Original content licensed under CC BY 4.0 License. -- Page [](./syntax_exercises/012.md) includes text from {cite:t}`template` and is edited to be made TU Delft-specific. Original content licensed under CC BY 4.0 License. - (editor)= ## About the Editors