For my bachelor thesis in physics, I investigated FDTD simulations using Python
The finite difference time domain method, in short FDTD, is used to numerically compute the propagation of electromagnetic waves, that is, to solve the Maxwell equations for arbitrary environments.
This is a sample image of a FDTD simulation in 2 dimensions. Features of note:
- a pulsing point source at
(50, 50)
- a luneburg lens with a focal point around
(20, 90)
- a "bar" of low (high?) permittivity from
(25, 40)
to(40, 25)
- an area of perfect conductivity in the bottom right corner
- an absorbing boundary (otherwise, the limits of the simulation act like perfect reflectors, c.f. the following image)
As is custom for scientific code, the usability is sub-optimal. The following steps are required to get a simulation running
Prerequisites:
- install
python
andpip
- install the following Python packages via
pip
: numpy, scipy, matplotlib
Usage:
- change the
action
andpml
values inmain.py
to their desired values python main.py