Path: blob/main/latex-templates/templates/acoustics/sound_propagation.tex
51 views
unlisted
% Sound Propagation Analysis1\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{Sound Propagation Analysis\\Wave Equations and Transmission Loss}15\author{Acoustic Engineering Department}16\date{\today}1718\begin{document}19\maketitle2021\begin{abstract}22Analysis of sound wave propagation through various media, including acoustic impedance, transmission coefficients, and transmission loss calculations.23\end{abstract}2425\section{Introduction}2627Sound propagation is governed by the acoustic wave equation and boundary conditions at material interfaces.2829\begin{pycode}30import numpy as np31import matplotlib.pyplot as plt32plt.rcParams['text.usetex'] = True33plt.rcParams['font.family'] = 'serif'3435c_air, rho_air = 343, 1.2136Z_air = rho_air * c_air3738media = {39'Air': {'c': 343, 'rho': 1.21},40'Water': {'c': 1480, 'rho': 1000},41'Steel': {'c': 5960, 'rho': 7850},42'Concrete': {'c': 3400, 'rho': 2400},43'Glass': {'c': 5200, 'rho': 2500},44}45for props in media.values():46props['Z'] = props['rho'] * props['c']47\end{pycode}4849\section{Acoustic Impedance}5051$Z = \rho c$5253\begin{pycode}54fig, ax = plt.subplots(figsize=(10, 5))55names = list(media.keys())56impedances = [media[n]['Z'] for n in names]57ax.bar(names, impedances, color=plt.cm.viridis(np.linspace(0, 0.8, len(names))))58ax.set_ylabel('Acoustic Impedance (Pa$\\cdot$s/m)')59ax.set_title('Characteristic Acoustic Impedance')60ax.set_yscale('log')61ax.grid(True, alpha=0.3, axis='y')62plt.tight_layout()63plt.savefig('impedance_comparison.pdf', dpi=150, bbox_inches='tight')64plt.close()65\end{pycode}6667\begin{figure}[H]68\centering69\includegraphics[width=0.9\textwidth]{impedance_comparison.pdf}70\caption{Acoustic impedance comparison.}71\end{figure}7273\section{Reflection and Transmission}7475$R = \frac{Z_2 - Z_1}{Z_2 + Z_1}$7677\begin{pycode}78materials = ['Water', 'Steel', 'Concrete', 'Glass']79Z1 = media['Air']['Z']80R_coeffs = [(media[m]['Z'] - Z1) / (media[m]['Z'] + Z1) for m in materials]81T_intensity = [1 - r**2 for r in R_coeffs]8283fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(12, 5))84ax1.bar(materials, R_coeffs, color='steelblue')85ax1.set_ylabel('Reflection Coefficient $R$')86ax1.set_title('Reflection at Air-Material Interface')87ax1.grid(True, alpha=0.3, axis='y')8889ax2.bar(materials, T_intensity, color='coral')90ax2.set_ylabel('Intensity Transmission $T_I$')91ax2.set_title('Transmission')92ax2.grid(True, alpha=0.3, axis='y')93plt.tight_layout()94plt.savefig('reflection_transmission.pdf', dpi=150, bbox_inches='tight')95plt.close()96\end{pycode}9798\begin{figure}[H]99\centering100\includegraphics[width=0.95\textwidth]{reflection_transmission.pdf}101\caption{Reflection and transmission coefficients.}102\end{figure}103104\section{Mass Law Transmission Loss}105106$TL = 20 \log_{10}(\pi f m / \rho c)$107108\begin{pycode}109freq = np.logspace(1, 4, 200)110surface_masses = {'Gypsum (12mm)': 10, 'Concrete (100mm)': 240, 'Steel (3mm)': 24, 'Glass (6mm)': 15}111112fig, ax = plt.subplots(figsize=(10, 6))113for name, m in surface_masses.items():114TL = 20 * np.log10(np.pi * freq * m / (rho_air * c_air))115ax.semilogx(freq, TL, linewidth=1.5, label=f'{name}')116ax.set_xlabel('Frequency (Hz)')117ax.set_ylabel('Transmission Loss (dB)')118ax.set_title('Mass Law Transmission Loss')119ax.legend(loc='lower right')120ax.grid(True, alpha=0.3, which='both')121ax.set_xlim([10, 10000])122plt.tight_layout()123plt.savefig('mass_law_tl.pdf', dpi=150, bbox_inches='tight')124plt.close()125\end{pycode}126127\begin{figure}[H]128\centering129\includegraphics[width=0.9\textwidth]{mass_law_tl.pdf}130\caption{Mass law transmission loss predictions.}131\end{figure}132133\section{Coincidence Effect}134135\begin{pycode}136panels = {137'Steel (3mm)': {'E': 200e9, 'rho': 7850, 'nu': 0.3, 'h': 0.003},138'Aluminum (2mm)': {'E': 70e9, 'rho': 2700, 'nu': 0.33, 'h': 0.002},139'Glass (6mm)': {'E': 70e9, 'rho': 2500, 'nu': 0.22, 'h': 0.006},140}141142f_coincidence = {}143for name, p in panels.items():144fc = (c_air**2 / (2 * np.pi)) * np.sqrt(12 * p['rho'] * (1 - p['nu']**2) / (p['E'] * p['h']**2))145f_coincidence[name] = fc146147fig, ax = plt.subplots(figsize=(10, 6))148for name, p in panels.items():149m = p['rho'] * p['h']150fc = f_coincidence[name]151TL_mass = 20 * np.log10(np.pi * freq * m / (rho_air * c_air))152dip = 15 * np.exp(-(freq - fc)**2 / (2 * (fc * 0.5)**2))153TL = np.maximum(TL_mass - dip, 0)154ax.semilogx(freq, TL, linewidth=1.5, label=name)155ax.set_xlabel('Frequency (Hz)')156ax.set_ylabel('Transmission Loss (dB)')157ax.set_title('TL with Coincidence Effect')158ax.legend(loc='lower right')159ax.grid(True, alpha=0.3, which='both')160ax.set_xlim([100, 10000])161plt.tight_layout()162plt.savefig('coincidence_tl.pdf', dpi=150, bbox_inches='tight')163plt.close()164\end{pycode}165166\begin{figure}[H]167\centering168\includegraphics[width=0.9\textwidth]{coincidence_tl.pdf}169\caption{Transmission loss with coincidence dips.}170\end{figure}171172\section{Double Wall TL}173174\begin{pycode}175m1, m2 = 12, 12176air_gaps = [50, 100, 200]177178fig, ax = plt.subplots(figsize=(10, 6))179for gap in air_gaps:180ell = gap / 1000181f0 = (1 / (2 * np.pi)) * np.sqrt((rho_air * c_air**2 / ell) * (1/m1 + 1/m2))182TL_double = np.zeros_like(freq)183for i, f in enumerate(freq):184if f < f0:185TL_double[i] = 20 * np.log10(np.pi * f * (m1 + m2) / (rho_air * c_air))186else:187TL_single = 20 * np.log10(np.pi * f * m1 / (rho_air * c_air))188TL_double[i] = 2 * TL_single + 20 * np.log10(f / f0)189ax.semilogx(freq, np.maximum(TL_double, 0), linewidth=1.5, label=f'Gap = {gap} mm')190ax.set_xlabel('Frequency (Hz)')191ax.set_ylabel('Transmission Loss (dB)')192ax.set_title('Double Wall Transmission Loss')193ax.legend(loc='lower right')194ax.grid(True, alpha=0.3, which='both')195ax.set_xlim([50, 5000])196plt.tight_layout()197plt.savefig('double_wall_tl.pdf', dpi=150, bbox_inches='tight')198plt.close()199\end{pycode}200201\begin{figure}[H]202\centering203\includegraphics[width=0.9\textwidth]{double_wall_tl.pdf}204\caption{Double wall transmission loss.}205\end{figure}206207\section{Atmospheric Absorption}208209\begin{pycode}210def atm_absorption(f, T=20, h=50, p=101.325):211T_K = T + 273.15212C = -6.8346 * (273.16/T_K)**1.261 + 4.6151213h_mol = h * (101.325/p) * 10**C214f_rO = (p/101.325) * (24 + 4.04e4 * h_mol * (0.02 + h_mol)/(0.391 + h_mol))215f_rN = (p/101.325) * (T_K/293.15)**(-0.5) * (9 + 280 * h_mol * np.exp(-4.170 * ((T_K/293.15)**(-1/3) - 1)))216alpha = 8.686 * f**2 * ((1.84e-11 * (101.325/p) * (T_K/293.15)**0.5) +217(T_K/293.15)**(-2.5) * (0.01275 * np.exp(-2239.1/T_K) / (f_rO + f**2/f_rO) +2180.1068 * np.exp(-3352.0/T_K) / (f_rN + f**2/f_rN)))219return alpha220221freq_atm = np.logspace(2, 4.5, 100)222fig, ax = plt.subplots(figsize=(10, 6))223for T, h, label in [(20, 50, '20C, 50\\% RH'), (20, 20, '20C, 20\\% RH'), (0, 50, '0C, 50\\% RH')]:224ax.loglog(freq_atm, atm_absorption(freq_atm, T, h) * 1000, linewidth=1.5, label=label)225ax.set_xlabel('Frequency (Hz)')226ax.set_ylabel('Absorption (dB/km)')227ax.set_title('Atmospheric Absorption')228ax.legend()229ax.grid(True, alpha=0.3, which='both')230plt.tight_layout()231plt.savefig('atmospheric_absorption.pdf', dpi=150, bbox_inches='tight')232plt.close()233\end{pycode}234235\begin{figure}[H]236\centering237\includegraphics[width=0.9\textwidth]{atmospheric_absorption.pdf}238\caption{Atmospheric sound absorption.}239\end{figure}240241\section{Spreading Loss}242243\begin{pycode}244L_W = 100245distances = np.linspace(1, 100, 100)246freq_cases = [500, 2000, 8000]247248fig, ax = plt.subplots(figsize=(10, 6))249for f in freq_cases:250alpha = atm_absorption(f)251L_p = L_W - 20 * np.log10(distances) - 11 - alpha * distances252ax.plot(distances, L_p, linewidth=1.5, label=f'{f} Hz')253ax.set_xlabel('Distance (m)')254ax.set_ylabel('SPL (dB)')255ax.set_title('Sound Level vs Distance')256ax.legend()257ax.grid(True, alpha=0.3)258plt.tight_layout()259plt.savefig('spreading_loss.pdf', dpi=150, bbox_inches='tight')260plt.close()261\end{pycode}262263\begin{figure}[H]264\centering265\includegraphics[width=0.9\textwidth]{spreading_loss.pdf}266\caption{Sound level decay with distance.}267\end{figure}268269\section{Results}270271\begin{pycode}272print(r'\begin{table}[H]')273print(r'\centering')274print(r'\caption{Acoustic Properties}')275print(r'\begin{tabular}{@{}lccc@{}}')276print(r'\toprule')277print(r'Material & $c$ (m/s) & $\rho$ (kg/m$^3$) & $Z$ (Pa$\cdot$s/m) \\')278print(r'\midrule')279for name, props in media.items():280print(f"{name} & {props['c']} & {props['rho']} & {props['Z']:.0f} \\\\")281print(r'\bottomrule')282print(r'\end{tabular}')283print(r'\end{table}')284\end{pycode}285286\section{Conclusions}287288This analysis demonstrates key principles of sound propagation and transmission loss including mass law, coincidence effects, and atmospheric absorption.289290\end{document}291292293