Project
FDTD Electromagnetic Simulation
Interactive 2D Finite-Difference Time-Domain simulation with Convolutional Perfectly Matched Layer (CPML) boundary conditions. Explore electromagnetic wave propagation in real time.
Live Field Intensity
About
Project Details
Overview
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.
Features
- · CPML (Convolutional Perfectly Matched Layer) boundary conditions
- · Real-time 2D field visualization
- · Interactive parameter controls
- · Gaussian pulse source injection
- · Performance-optimized Web Worker architecture
- · Multiple field visualization modes
Technology Stack
Ported from Python (NumPy, SciPy, Matplotlib) to TypeScript for web deployment
Original Implementation
The original Python implementation includes additional features such as multiple PML types (BPML, CPML), comprehensive benchmarking tools, and extensive visualization capabilities.
View on GitHub →Background
Understanding FDTD
What is FDTD?
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, FDTD discretizes both space and time, approximating derivatives with finite differences.
This allows simulation of how electromagnetic waves propagate through arbitrary materials and structures, making it invaluable for antenna design, optical device simulation, and understanding wave interactions with matter.
Maxwell's Equations
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.
How FDTD Works
- 1. Discretization: The simulation space is divided into a grid of cells. Each cell stores the electric and magnetic field values.
- 2. Time-stepping: Fields are updated in alternating steps. First electric, then magnetic fields.
- 3. Source injection: A source (like a Gaussian pulse) is injected at a specific location, creating waves.
- 4. Boundary conditions: Perfectly Matched Layers (PML) absorb waves at the boundaries, preventing reflections.
CPML Boundary Conditions
This simulation uses Convolutional Perfectly Matched Layer (CPML) boundary conditions. CPML provides better absorption of waves at oblique angles compared to standard PML.
CPML introduces artificial conductivity that increases gradually from the interior to the boundary, creating a "sponge" that absorbs incoming waves without reflection.
Applications
- · Antenna design and optimization
- · Optical device simulation (waveguides, filters, resonators)
- · Electromagnetic compatibility analysis
- · Radar cross-section calculations
- · Metamaterial and photonic crystal research