Introduction
Why Astrophysics?
Stars are the engines of the universe. They forge heavy elements in their cores, illuminate galaxies, and end their lives as white dwarfs, neutron stars, or black holes. Understanding stars means understanding physics at its most extreme — temperatures of millions of degrees, pressures beyond anything achievable in a laboratory, and gravity so strong it bends light.
This course implements the core equations of astrophysics in pure Python. No libraries — just the mathematics of stellar physics expressed as functions. Each lesson introduces one concept, explains the physics, and asks you to write the formula as code.
You will implement:
- Stellar luminosity — Stefan-Boltzmann law relating luminosity to radius and temperature
- Wien's displacement law — peak wavelength of stellar blackbody radiation
- Distance modulus — how apparent magnitude depends on distance
- Eddington luminosity — the maximum luminosity a star can sustain
- Nuclear timescale — how long a star can shine on nuclear fuel
- Main sequence scaling — mass-luminosity and mass-radius relations
- Hydrostatic equilibrium — central pressure and freefall timescale
- Chandrasekhar mass — the maximum mass of a white dwarf
- Orbital mechanics — Kepler's third law applied to binary systems
- Escape velocity and Schwarzschild radius — the edge of a black hole
- Accretion luminosity — energy released by infalling matter
- Gravitational lensing — the Einstein radius for a massive lens
- Galactic rotation curves — dark matter inferred from rotation speeds
- Virial theorem — mass estimation from velocity dispersions
- Stellar ages — main sequence lifetime as a function of mass