We discussed in the class that the structure of a spherically symmetric star is governed by the following equations, along with an equation of state $P(\rho)$:
\frac{dT}{dr}&=& -\frac{3 \kappa\rho L}{16\pi a c T^3 r^2} ~~~ \mathrm{(Radiative~transport)}\label{eq:rad_eq}
\end{eqnarray}
\subsubsection{Problems}
\begin{enumerate}
\item Derive the equation of hydrostatic equlibrium Eq.~\eqref{eq:hydro_eq}.
\item Derive the radiative transfer equation Eq.~\eqref{eq:rad_eq} assuming radiative equlibrium.
\item Using the above set of equations, construct a numerical model of a spherically symmetric star in hydrostatic and thermal equilibrium, where energy is transported by radiative diffusion. Solve the coupled ODEs numerically using a standard ODE solver, such as scipy's \href{https://docs.scipy.org/doc/scipy/reference/generated/scipy.integrate.solve_ivp.html}{solve\_ivp}. Integrate outward from small $r$ and stop when $P \to0$. Plot $T(r), \rho(r), L(r), M(r)$. You can assume:
\begin{itemize}
\item Ideal gas equation of state: $P ={\rho k_B T}/({\mu m_p})$, with $\mu=0.6$.
\item Kramers opacity: $\kappa=4\times10^4\rho T_6^{-3.5}~ \mathrm{cm^2/g}$. The dimensionless variable $T_6$ is the temperature in units of $10^6$K.
\item Energy Generation by $p-p$ chain: $\epsilon=10^{-5}\rho T_6^4~\mathrm{erg/s/g}$.
\item Boundary Conditions (at $r \to0$):
$M(r)\approx\frac{4}{3}\pi r^3\rho_c$,
$L(r)\approx\frac{4}{3}\pi r^3\rho_c \epsilon_c$,
$P(0)= P_c, \quad T(0)= T_c$.
\item Boundary Conditions (at the surface): $P(R)\approx0, \quad\rho(R)\approx0$
\item Input Parameters:
$T_c =1.5\times10^7\,\text{K},$
$\rho_c =150\,\text{g cm}^{-3}.$
\end{itemize}
\item Repeat the calculation using an equation of state including both gas and radiation pressure: $P =\frac{\rho k_B T}{\mu m_p}+\frac{1}{3} a T^4$.
\item Optional: Compte the mass-radius, mass-luminosity and surface temperature-luminosity relations by varying central density (and obtaining the corresponding central temperature consistently). How do they compare with the analytical relations that we derived in the class?