Path: blob/main/latex-templates/templates/astrophysics/neutron_stars.tex
51 views
unlisted
% Neutron Star Physics1\documentclass[11pt,a4paper]{article}2\usepackage[utf8]{inputenc}3\usepackage[T1]{fontenc}4\usepackage{amsmath,amssymb}5\usepackage{graphicx}6\usepackage{booktabs}7\usepackage{siunitx}8\usepackage{geometry}9\geometry{margin=1in}10\usepackage{pythontex}11\usepackage{hyperref}12\usepackage{float}1314\title{Neutron Star Physics\\Equation of State and Structure}15\author{Nuclear Astrophysics Group}16\date{\today}1718\begin{document}19\maketitle2021\begin{abstract}22Analysis of neutron star structure including mass-radius relations, equation of state, and magnetic field properties.23\end{abstract}2425\section{Introduction}2627Neutron stars are ultra-dense remnants of massive stars.2829\begin{pycode}30import numpy as np31import matplotlib.pyplot as plt32from scipy.integrate import odeint33plt.rcParams['text.usetex'] = True34plt.rcParams['font.family'] = 'serif'3536G = 6.674e-1137c = 2.998e838M_sun = 1.989e3039hbar = 1.055e-3440m_n = 1.675e-2741\end{pycode}4243\section{Equation of State}4445\begin{pycode}46# Polytropic EOS47K = 1e11 # Polytropic constant48Gamma = 2.0 # Adiabatic index4950rho = np.logspace(14, 16, 100) # kg/m^351P = K * rho**Gamma5253fig, ax = plt.subplots(figsize=(10, 6))54ax.loglog(rho, P, 'b-', linewidth=2)55ax.set_xlabel('Density (kg/m$^3$)')56ax.set_ylabel('Pressure (Pa)')57ax.set_title('Polytropic Equation of State')58ax.grid(True, alpha=0.3, which='both')59plt.tight_layout()60plt.savefig('eos.pdf', dpi=150, bbox_inches='tight')61plt.close()62\end{pycode}6364\begin{figure}[H]65\centering66\includegraphics[width=0.9\textwidth]{eos.pdf}67\caption{Polytropic equation of state.}68\end{figure}6970\section{TOV Equation}7172\begin{pycode}73def tov(y, r, K, Gamma):74P, m = y75if P <= 0:76return [0, 0]77rho = (P / K)**(1/Gamma)78eps = rho * c**2 + P / (Gamma - 1)79dPdr = -G * (eps + P) * (m + 4*np.pi*r**3*P/c**2) / (r**2 * (1 - 2*G*m/(r*c**2)))80dmdr = 4 * np.pi * r**2 * eps / c**281return [dPdr, dmdr]8283# Solve for different central densities84rho_c_range = np.logspace(14.5, 15.5, 20)85masses = []86radii = []8788for rho_c in rho_c_range:89P_c = K * rho_c**Gamma90r = np.linspace(1, 20000, 10000)91y0 = [P_c, 0]92sol = odeint(tov, y0, r, args=(K, Gamma))93P_sol = sol[:, 0]94m_sol = sol[:, 1]9596idx = np.where(P_sol > 0)[0]97if len(idx) > 0:98R = r[idx[-1]]99M = m_sol[idx[-1]]100masses.append(M / M_sun)101radii.append(R / 1000)102103fig, ax = plt.subplots(figsize=(10, 6))104ax.plot(radii, masses, 'b-o', linewidth=1.5, markersize=4)105ax.set_xlabel('Radius (km)')106ax.set_ylabel('Mass ($M_\\odot$)')107ax.set_title('Mass-Radius Relation')108ax.grid(True, alpha=0.3)109ax.set_xlim([8, 16])110ax.set_ylim([0, 3])111plt.tight_layout()112plt.savefig('mass_radius.pdf', dpi=150, bbox_inches='tight')113plt.close()114\end{pycode}115116\begin{figure}[H]117\centering118\includegraphics[width=0.9\textwidth]{mass_radius.pdf}119\caption{Neutron star mass-radius relation.}120\end{figure}121122\section{Density Profile}123124\begin{pycode}125rho_c = 1e15126P_c = K * rho_c**Gamma127r = np.linspace(1, 12000, 5000)128sol = odeint(tov, [P_c, 0], r, args=(K, Gamma))129P_profile = sol[:, 0]130rho_profile = np.where(P_profile > 0, (P_profile / K)**(1/Gamma), 0)131132fig, ax = plt.subplots(figsize=(10, 6))133ax.plot(r / 1000, rho_profile / 1e15, 'b-', linewidth=2)134ax.set_xlabel('Radius (km)')135ax.set_ylabel('Density ($10^{15}$ kg/m$^3$)')136ax.set_title('Neutron Star Density Profile')137ax.grid(True, alpha=0.3)138plt.tight_layout()139plt.savefig('density_profile.pdf', dpi=150, bbox_inches='tight')140plt.close()141\end{pycode}142143\begin{figure}[H]144\centering145\includegraphics[width=0.9\textwidth]{density_profile.pdf}146\caption{Internal density profile.}147\end{figure}148149\section{Magnetic Field}150151\begin{pycode}152# Pulsar spindown153P = np.logspace(-3, 1, 100) # Period in seconds154P_dot = np.logspace(-20, -10, 100) # Period derivative155156PP, PP_dot = np.meshgrid(P, P_dot)157B_surf = 3.2e19 * np.sqrt(PP * PP_dot) # Surface magnetic field in Gauss158159fig, ax = plt.subplots(figsize=(10, 8))160levels = [1e8, 1e10, 1e12, 1e14, 1e16]161cs = ax.contour(np.log10(PP), np.log10(PP_dot), np.log10(B_surf), levels=np.log10(levels))162ax.clabel(cs, fmt='$10^{%.0f}$ G')163ax.set_xlabel('log$_{10}$ Period (s)')164ax.set_ylabel('log$_{10}$ $\\dot{P}$ (s/s)')165ax.set_title('Pulsar Magnetic Field')166ax.grid(True, alpha=0.3)167plt.tight_layout()168plt.savefig('magnetic_field.pdf', dpi=150, bbox_inches='tight')169plt.close()170\end{pycode}171172\begin{figure}[H]173\centering174\includegraphics[width=0.9\textwidth]{magnetic_field.pdf}175\caption{P-$\dot{P}$ diagram with magnetic field lines.}176\end{figure}177178\section{Spin-down Age}179180\begin{pycode}181P_values = np.array([0.001, 0.01, 0.1, 1.0]) # Periods182P_dot_values = np.array([1e-15, 1e-14, 1e-13, 1e-12]) # Period derivatives183184tau_c = P_values / (2 * P_dot_values) # Characteristic age185186fig, ax = plt.subplots(figsize=(10, 6))187ax.loglog(P_values, tau_c / (365.25 * 24 * 3600), 'b-o', linewidth=1.5, markersize=8)188ax.set_xlabel('Period (s)')189ax.set_ylabel('Characteristic Age (years)')190ax.set_title('Pulsar Spin-down Age')191ax.grid(True, alpha=0.3, which='both')192plt.tight_layout()193plt.savefig('spindown_age.pdf', dpi=150, bbox_inches='tight')194plt.close()195\end{pycode}196197\begin{figure}[H]198\centering199\includegraphics[width=0.9\textwidth]{spindown_age.pdf}200\caption{Characteristic age vs period.}201\end{figure}202203\section{Compactness}204205\begin{pycode}206compactness = np.array(masses) * M_sun * G / (np.array(radii) * 1000 * c**2)207208fig, ax = plt.subplots(figsize=(10, 6))209ax.plot(masses, compactness, 'b-o', linewidth=1.5, markersize=4)210ax.axhline(y=0.5, color='r', linestyle='--', label='Black hole limit')211ax.set_xlabel('Mass ($M_\\odot$)')212ax.set_ylabel('Compactness $GM/Rc^2$')213ax.set_title('Neutron Star Compactness')214ax.legend()215ax.grid(True, alpha=0.3)216plt.tight_layout()217plt.savefig('compactness.pdf', dpi=150, bbox_inches='tight')218plt.close()219\end{pycode}220221\begin{figure}[H]222\centering223\includegraphics[width=0.9\textwidth]{compactness.pdf}224\caption{Compactness parameter.}225\end{figure}226227\section{Results}228229\begin{pycode}230M_max = max(masses)231R_at_max = radii[masses.index(M_max)]232print(r'\begin{table}[H]')233print(r'\centering')234print(r'\caption{Neutron Star Properties}')235print(r'\begin{tabular}{@{}lc@{}}')236print(r'\toprule')237print(r'Property & Value \\')238print(r'\midrule')239print(f'Maximum mass & {M_max:.2f} $M_\\odot$ \\\\')240print(f'Radius at max mass & {R_at_max:.1f} km \\\\')241print(f'Central density & $10^{{15}}$ kg/m$^3$ \\\\')242print(r'\bottomrule')243print(r'\end{tabular}')244print(r'\end{table}')245\end{pycode}246247\section{Conclusions}248249Neutron star structure depends critically on the equation of state of ultra-dense matter.250251\end{document}252253254