Lesson 12 of 15

Gravitational Lensing

Gravitational Lensing

Einstein's general relativity predicts that mass bends the path of light. A massive object — a star, galaxy, or cluster — acts as a gravitational lens, distorting and magnifying the images of background sources.

The Einstein Radius

When a source, lens, and observer are perfectly aligned, the source appears as a ring (an Einstein ring) with angular radius θE\theta_E:

θE=4GMc2DLSDLDS\theta_E = \sqrt{\frac{4GM}{c^2} \cdot \frac{D_{LS}}{D_L D_S}}

where:

  • DLD_L = angular diameter distance to the lens
  • DSD_S = angular diameter distance to the source
  • DLSD_{LS} = angular diameter distance from lens to source

Point-Source Magnification

For a point source at angular position β\beta from the lens axis, the total magnification is:

μ=u2+2uu2+4,u=βθE\mu = \frac{u^2 + 2}{u \sqrt{u^2 + 4}}, \quad u = \frac{\beta}{\theta_E}

At perfect alignment (β=0\beta = 0, u=0u = 0), μ\mu \to \infty. At u=1u = 1, μ1.34\mu \approx 1.34.

Scales

SystemθE\theta_E
Galaxy (1e11 MM_\odot, 500 Mpc)1\sim 1^{\prime\prime}
Microlensing (1M1\,M_\odot, 1 kpc)1\sim 1 mas

Your Task

Implement three functions. All constants must be defined inside each function.

  • einstein_radius_rad(M_kg, D_L_m, D_S_m, D_LS_m) — returns θE\theta_E in radians
  • einstein_radius_arcsec(M_kg, D_L_m, D_S_m, D_LS_m) — returns θE\theta_E in arcseconds
  • lensing_magnification(beta_rad, theta_E_rad) — returns μ\mu

Use G=6.674×1011G = 6.674 \times 10^{-11} N m² kg⁻², c=2.998×108c = 2.998 \times 10^8 m/s. For arcseconds: multiply radians by 180/π×3600180/\pi \times 3600.

Python runtime loading...
Loading...
Click "Run" to execute your code.