FDTD Simulation
Interactive 2D Finite-Difference Time-Domain simulation with Convolutional Perfectly Matched Layer (CPML) boundary conditions. Explore electromagnetic wave propagation in real time with an updated, high-contrast palette.
Project
This is an interactive web-based implementation of a Finite-Difference Time-Domain (FDTD) electromagnetic simulation. Originally developed in Python for a bachelor's thesis in physics, this TypeScript port brings the simulation to the browser with real-time visualization and interactive controls.
The simulation uses Convolutional Perfectly Matched Layer (CPML) boundary conditions to accurately model wave propagation without unwanted reflections, making it suitable for studying electromagnetic phenomena in various materials and geometries.
The original Python implementation includes additional features such as multiple PML types (BPML, CPML), comprehensive benchmarking tools, and extensive visualization capabilities using matplotlib. It was designed as a complete research tool for electromagnetic simulation.
View on GitHubPorted from Python (NumPy, SciPy, Matplotlib) to TypeScript for web deployment
Education
The Finite-Difference Time-Domain (FDTD) method is a numerical technique for solving Maxwell's equations, which govern electromagnetic wave propagation. Instead of solving these equations analytically (which is often impossible for complex geometries), FDTD discretizes both space and time, approximating derivatives with finite differences.
This allows us to simulate how electromagnetic waves propagate through arbitrary materials and structures, making it invaluable for antenna design, optical device simulation, and understanding wave interactions with matter.
FDTD solves the time-dependent form of Maxwell's equations:
Where E is the electric field, H is the magnetic field, D is the electric displacement, and B is the magnetic flux density.
This simulation uses Convolutional Perfectly Matched Layer (CPML) boundary conditions. CPML is an advanced form of PML that provides better absorption of waves at oblique angles compared to the original Berenger PML.
CPML works by introducing artificial conductivity that increases gradually from the interior to the boundary. This creates a "sponge" that absorbs incoming waves without reflecting them back into the simulation domain. The convolutional approach uses auxiliary fields to handle the frequency-dependent nature of the absorption, making it more effective than simpler PML implementations.
This interactive simulation is a TypeScript/JavaScript port of a Python FDTD implementation originally developed for a bachelor's thesis in physics. The original implementation featured multiple PML types (BPML, CPML), comprehensive benchmarking, and extensive visualization capabilities. This web version brings the simulation to the browser, allowing real-time interaction and exploration of electromagnetic wave propagation.