Real-Time Acoustic Metamaterial Simulator with Physics-Informed Neural Networks
AcoustoSolver is a Python framework for designing, simulating, and optimizing acoustic metamaterials. It combines rigorous computational physics (Plane Wave Expansion, FDTD) with physics-informed neural surrogates for real-time band structure prediction and interactive design exploration.
Features β’ Quick Start β’ App β’ Architecture β’ Theory β’ Citation
| Feature | Description |
|---|---|
| π Band Structure Solver | Plane Wave Expansion (PWE) method for 2D phononic crystals with automatic bandgap detection |
| π SSH Model | Su-Schrieffer-Heeger chain with Zak phase computation for topological invariant classification |
| π FDTD Simulator | 2D Finite-Difference Time-Domain wave propagation with PML boundaries |
| π§ Neural Surrogate | Residual MLP with physics-informed loss for real-time band prediction (100Γ faster than PWE) |
| π§± Material Database | 12+ built-in materials including GST phase-change materials, piezoelectrics, and polymers |
| π₯οΈ Interactive App | Streamlit-based GUI for real-time design exploration |
| β Test Suite | 35+ unit tests with CI/CD via GitHub Actions |
# Clone the repository
git clone https://github.com/Samarjithbiswas/AcoustoSolver.git
cd AcoustoSolver
# Install with all dependencies
pip install -e ".[all]"
# Or install minimal (core only)
pip install -e .from acoustosolver.core.materials import MaterialDatabase
from acoustosolver.core.unit_cell import SquareCell
from acoustosolver.core.band_structure import BandStructureSolver
# Initialize material database
db = MaterialDatabase()
# Create a phononic crystal unit cell
cell = SquareCell(
lattice_constant=0.01, # 10 mm
host_material=db.get("epoxy"), # Polymer matrix
inclusion_material=db.get("steel"), # Steel inclusions
filling_fraction=0.30, # 30% filling
)
# Compute band structure
solver = BandStructureSolver(cell, n_bands=6, n_kpoints=100)
result = solver.solve()
# Analyze bandgaps
print(f"Found {len(result.bandgaps)} bandgaps:")
for gap in result.bandgaps:
print(f" {gap.lower_freq:.0f} - {gap.upper_freq:.0f} Hz "
f"(relative width: {gap.relative_width:.1%})")# Compute SSH dispersion with topological phase
result = solver.solve_ssh_1d(t1=1.0, t2=1.5, n_kpoints=200)
zak_phase = solver.compute_zak_phase(t1=1.0, t2=1.5)
print(f"Zak phase: {zak_phase:.4f} rad")
print(f"Topological phase: {'YES (Ο)' if zak_phase > 1.5 else 'NO (0)'}")
print(f"Edge states: {'Protected' if zak_phase > 1.5 else 'None'}")from acoustosolver.core.wave_propagation import (
WavePropagationFDTD, SimulationConfig, SourceType
)
config = SimulationConfig(
grid_size=(200, 200),
domain_size=(0.5, 0.5),
total_time=0.003,
source_frequency=5000.0,
source_type=SourceType.POINT,
)
sim = WavePropagationFDTD(config)
sim.create_phononic_crystal(n_cells_x=5, n_cells_y=5)
snapshots = sim.run(save_every=50)from acoustosolver.ml.surrogate_model import BandSurrogate
from acoustosolver.ml.dataset import DatasetGenerator, DatasetConfig
# Generate training data
gen = DatasetGenerator(DatasetConfig(n_samples=1000))
X, y = gen.generate()
# Train surrogate model
surrogate = BandSurrogate(n_bands=6, n_kpoints=50)
print(surrogate.summary())
history = surrogate.train(X, y, epochs=200)
# Real-time inference (100Γ faster than PWE)
predictions = surrogate.predict(X[:5])Launch the Streamlit-powered interactive simulator:
streamlit run app.pyApp Features:
- π§ Unit cell parameter sliders (lattice constant, filling fraction, materials)
- π Real-time band structure computation with interactive Plotly charts
- π SSH model with Zak phase classification (topological vs. trivial)
- π FDTD wave propagation with snapshot slider
- π§± 12+ material presets with full property display
AcoustoSolver/
βββ acoustosolver/
β βββ core/ # Computational engines
β β βββ materials.py # Material database (12+ materials)
β β βββ unit_cell.py # Square & hexagonal lattice cells
β β βββ band_structure.py # PWE solver + SSH model + Zak phase
β β βββ wave_propagation.py # 2D FDTD with PML boundaries
β βββ ml/ # Machine learning
β β βββ surrogate_model.py # Residual MLP + physics-informed loss
β β βββ dataset.py # Synthetic dataset generation
β βββ viz/ # Visualization
β β βββ plotting.py # matplotlib + plotly figures
β βββ utils/
β βββ physics_constants.py # Physical constants & conversions
βββ app.py # Streamlit interactive app
βββ tests/
β βββ test_core.py # 35+ unit tests
βββ examples/
β βββ quick_start.py # End-to-end demonstration
βββ .github/workflows/ci.yml # GitHub Actions CI/CD
βββ pyproject.toml # Modern Python packaging
βββ README.md
The acoustic wave equation in a periodic medium:
is solved by expanding pressure and material properties in Fourier series, yielding an eigenvalue problem at each wave vector k.
The Su-Schrieffer-Heeger (SSH) model with alternating couplings
The Zak phase (Berry phase across the Brillouin zone) is the topological invariant:
-
$\gamma = 0$ β Trivial phase ($t_1 > t_2$ ) -
$\gamma = \pi$ β Topological phase ($t_2 > t_1$ ), supports protected edge states
The neural surrogate is trained with a composite loss:
where:
-
Symmetry:
$\omega(\mathbf{k}) = \omega(-\mathbf{k})$ (time-reversal invariance) -
Ordering:
$\omega_{n+1}(\mathbf{k}) \geq \omega_n(\mathbf{k})$ (no band crossings) - Smoothness: Penalizes discontinuous frequency variations
| Technology | Purpose |
|---|---|
| NumPy / SciPy | Core numerical computation |
| PyTorch | Neural surrogate models |
| Matplotlib / Plotly | Static & interactive visualization |
| Streamlit | Web-based interactive app |
| pytest | Testing framework |
| GitHub Actions | CI/CD pipeline |
If you use AcoustoSolver in your research, please cite:
@software{biswas2026acoustosolver,
author = {Biswas, Samarjith},
title = {AcoustoSolver: Real-Time Acoustic Metamaterial Simulator with Physics-Informed Neural Networks},
year = {2026},
publisher = {GitHub},
url = {https://github.com/Samarjithbiswas/AcoustoSolver}
}- Biswas, S., Krawczyk, Z., & Manimala, J.M. "Multifunctional Characterization of a Thermoacoustic Meta-Structure." Int. J. Thermofluids (2025).
- Biswas, S., Kresl, W., & Manimala, J.M. "On the relationship between acoustic absorption and temperature gradient in a thermoacoustic liner." Int. J. Aeroacoustics, 24(1-2), 42-67 (2025).
- Manimala, J. & Biswas, S. "Thermoacoustic Meta-Structure." US Patent WO 2025/128,348 A1 (2025).
Samarjith Biswas, PhD
Research Scientist III Β· University of Arizona
New Frontiers of Sound (NewFoS) Science & Technology Center
- π samarjithbiswas.com
- π Google Scholar
- πΊ YouTube
- πΌ LinkedIn
This project is licensed under the MIT License β see LICENSE for details.