---
title: Problem Set 2
number-sections: true
---
```{python}
import numpy as np
from astropy.constants import c, G, M_sun, m_p
import astropy.units as u
def bondi_gamma_factor(gamma):
"""
Calculate the factor involving gamma in the Bondi accretion rate.
"""
factor = (2 / (5 - 3 * gamma)) ** ((5 - 3 * gamma) / (2 * (gamma - 1)))
return factor
def bondi_accretion_rate(M_star, rho_inf, c_inf, gamma=1.4):
"""
Calculate the Bondi accretion rate.
Parameters:
- M_star: Mass of the star in grams
- rho_inf: Density of ISM in g/cm^3
- c_inf: Sound speed in ISM in cm/s
- gamma: Adiabatic index (default is 1.4 for ISM)
Returns:
- accretion rate in g/s
"""
# First part of the equation
factor1 = np.pi * (G**2) * (M_star**2) * rho_inf / (c_inf**3)
# Second part: The factor involving gamma
factor2 = bondi_gamma_factor(gamma)
print(f"Factor 1: {factor1}")
print(f"Factor 2: {factor2}")
# Bondi accretion rate in grams per second
accretion_rate = factor1 * factor2
return accretion_rate
def time_to_double_mass(M_star, rho_inf, c_inf, gamma=1.4):
"""
Estimate the time for a star to double its mass via accretion.
Parameters:
- M_star: Initial mass of the star in grams
- rho_inf: Density of ISM in g/cm^3
- c_inf: Sound speed in ISM in cm/s
- gamma: Adiabatic index (default is 1.4 for ISM)
Returns:
- Time to double the mass in seconds
"""
accretion_rate = bondi_accretion_rate(M_star, rho_inf, c_inf, gamma)
print(f"Bondi accretion rate: {accretion_rate.to(u.M_sun/u.yr)}")
# Time to double the mass (in seconds)
time_double = M_star / accretion_rate
return time_double
```
```{python}
# Example: Solar mass star in typical ISM conditions
M_star = M_sun # Solar mass in grams
rho_inf = 1e-24 * u.g / u.cm**3 # ISM density
c_inf = 10 * u.km / u.s # Sound speed
# Calculate time to double mass
time_double = time_to_double_mass(M_star, rho_inf, c_inf).to(u.yr)
# Print result
print(f"Time to double the mass of a solar-mass star: {time_double:.2e}")
```
## The Eddington Luminosity
```{python}
print(G, c, m_p, M_sun)
```
## Bondi Accretion onto Black Holes?
```{python}
M_bh = 1e6 * M_sun # SMBH mass
rho_inf = 1.67e-24 * u.g / u.cm**3 # galactic medium density
c_inf = 200 * u.km / u.s # sound speed
gamma = 4/3 # adiabatic index
```
### Estimate the sonic radius
```{python}
# import package related to the current problem
from astr145 import schwarzschild_radius
def sonic_radius(M_bh, c_inf, gamma):
factor = (5 - 3 * gamma) / 4
r_s = G * M_bh / (c_inf**2) * factor
return r_s
# Calculate the sonic radius
r_s = sonic_radius(M_bh, c_inf, gamma).to(u.km)
accretion_rate = bondi_accretion_rate(M_bh, rho_inf, c_inf, gamma).to(u.M_sun/u.yr)
R_sch = schwarzschild_radius(M_bh).to(u.km)
# Output the results
print(f"Sonic radius: {r_s:.2e}")
print(f"Schwarzschild radius: {R_sch:.2e}")
print(f"Sonic radius in Schwarzschild units: {r_s/R_sch:.2e}")
print(f"Bondi accretion rate: {accretion_rate:.2e}")
```
```{python}
epsilon = 0.1 # Efficiency factor
# Function to calculate Eddington luminosity
def eddington_luminosity(M):
L_edd = 4 * np.pi * G * M_bh * c
return L_edd
def eddington_luminosity(M_bh):
L_edd = 1.25e38 * (M_bh / M_sun) * u.erg / u.s # Eddington luminosity in erg/s
return L_edd
# Function to calculate Eddington accretion rate
def eddington_accretion_rate(M_bh, epsilon=epsilon):
L_edd = eddington_luminosity(M_bh)
Mdot_edd = L_edd / (epsilon * c**2) # Eddington accretion rate
return Mdot_edd.to(u.M_sun/u.yr)
```
```{python}
# Example: For a SMBH with 1e6 solar masses
M_bh = 1e6 * M_sun
# Calculate the Eddington accretion rate
edd_accretion_rate = eddington_accretion_rate(M_bh)
# Output the result
print(f"Eddington accretion rate: {edd_accretion_rate:.2e}")
print(f"Bondi accretion rate in Eddington units: {accretion_rate/edd_accretion_rate:.2e}")
```
```{python}
σT = 6.65e-25 * u.cm**2 # Thomson cross-section
f1 = 4 * m_p * c_inf**3 / (epsilon * c * σT * M_sun * G * rho_inf)
f1 = f1.to(u.dimensionless_unscaled)
f2 = bondi_gamma_factor(gamma) **(-1)
print(f"Factor: {f1 * f2}")
```
{{< pagebreak >}}
## Rotating Black Holes
<!--
The video explores the properties of spinning black holes, focusing on the Kerr metric and its implications in general relativity. It discusses the unique event horizons, frame dragging, and the ergosphere surrounding rotating black holes. The concept of naked singularities and their theoretical existence is also introduced, emphasizing the complexities of black hole physics.
Highlights:
00:04 Spinning black holes differ significantly from stationary ones, primarily in the structure of their event horizons. Understanding these differences is crucial for grasping the nature of black holes in our universe.
-The Kerr metric provides a mathematical framework for understanding rotating black holes, illustrating their unique properties compared to stationary black holes. It's essential for describing their event horizons.
-Einstein's field equations are fundamental in describing the universe's structure, with various metrics explaining different cosmic scenarios, including stationary and rotating black holes.
-The event horizon of a rotating black hole is not spherical, which introduces complexities in its properties and behavior, further distinguishing it from non-rotating black holes.
02:18 The structure of a rotating black hole differs from a stationary one, showcasing an event horizon that resembles a squished sphere. Additionally, there exists an inner horizon that is more of a mathematical concept than a physical entity.
-The event horizon of a rotating black hole, described by the kermetric, illustrates how its shape varies based on rotation. This highlights the complexities involved in understanding black hole geometries.
-The existence of an inner horizon presents challenges in comprehending black holes, as this area is unreachable and lacks observational evidence. This reinforces the limitations of current black hole theories.
-Frame dragging is a phenomenon occurring beyond the outer stationary limit surface of a rotating black hole, influencing the movement of particles and even light. This effect complicates our understanding of gravitational interactions.
04:35 The concept of frame dragging explains how the rotation of a black hole influences the movement of objects and light around it. As photons adapt to the black hole's rotation, massive objects are similarly affected, illustrating the nature of space-time distortion.
-The stationary limit surface is crucial in understanding how light behaves near a black hole. Photons must align with the black hole's rotation when crossing this boundary.
-The ergosphere is the region between the event horizon and the stationary limit surface. Here, particles are compelled to rotate with the black hole but can still escape its gravitational pull.
-Energy extraction from a black hole is possible through the Penrose process. This offers intriguing implications for theoretical physics regarding energy resources in extreme environments.
06:53 The nature of black holes reveals complex singularities, with stationary black holes having a point singularity while rotating black holes possess a ring-shaped singularity. This distinction leads to the intriguing concept of naked singularities that could theoretically be observed.
-The event horizon is critical for defining black holes, as it marks the boundary beyond which nothing, not even light, can escape. Its existence diminishes for rapidly spinning black holes.
-The concept of naked singularities presents a paradox in physics since they lack an event horizon, allowing for potential observation, although none have been detected so far.
-Roger Penrose's cosmic censorship hypothesis suggests that naked singularities may never be observed, emphasizing the mystery surrounding black hole physics and their implications in the universe. -->
Stationary black holes have a point singularity while rotating black holes possess a ring-shaped singularity. This distinction leads to the intriguing concept of naked singularities that could theoretically be observed. The concept of naked singularities presents a paradox in physics since they lack an event horizon, allowing for potential observation, although none have been detected so far.