Table of Contents
Finite-Difference Time-Domain (FDTD) is a numerical analysis technique to approximate the solutions of Maxwell's differential equations at discrete points in space in the time domain.
This repository contains an implementation of this technique in a 2D PEC bounded enclosure through which the scattering of EM waves from dielectric objects can be investigated.
Given the above situation, the discretized update equations are given by:
Where E describes the electric field, H the magnetic field and I the current strength of a point source in the enclosure. These equations are implemented in the FDTD function in space.py.
The work results from a collaborative project by Paul De Smul, Thijs Paelman and Flor Sanders in the context of the Applied Electromagnetism course at Ghent University.
This section should list any major frameworks that you built your project using. Leave any add-ons/plugins for the acknowledgements section. Here are a few examples.
Installation of the Python libraries used in the project.
-
Pip
pip3 install numpy scipy matplotlib
-
Conda
conda install numpy scipy matplotlib
- Clone the repo
git clone https://github.com/FlorSanders/EM_Scattering.git
- Change directory into the project folder
cd EM_Scattering
The code can be used in two ways. The method for starting a simulation in either case is described in the subsections below. At the start of the simulation, a visualization of the space and its parameters is given.
When this figure is closed, the computation starts. If this option is enabled, the script will sporadically give a visualization of the field amplitudes.
When the computations are finished, plots will be generated of the field values at the different measurement points.
![E_zTransmitted field](README.assets/E_zTransmitted field.png)
![H_xyTransmitted field](README.assets/H_xyTransmitted field.png)
All the figures generated during simulation are automatically saved in the plots folder.
The command line interface allows you to quickly run a simulation with a configuration of your choice. The usage is as follows:
-
Launch
python3 main.py
. -
Enter the dimensions of the simulation domain: width, height and duration.
-
Enter the parameters of the dielectrics in the domain, according to the convention below.
-
Indicate whether the dielectric constant should be aliased or not.
-
Pick the position and current profile (Gaussian pulse / Gaussian modulated sinusoidal RF pulse).
-
Choose the space discretization size. A recommended range is offered as indication.
-
Choose the time step size. As an indication, the Courant limit (upper boundary) is given.
-
Set the locations for the points for which plots have to be made of the field values.
-
Indicate whether visualizations have to be made while the script is running.
For more repeatable experiments or more complex setups, a Python script can be written through which the desired configurations can be described. For your convenience, some examples are included in the project files.
- test_simple.py: Simple situation with a half-space filled with a dielectric and the other left vacuum, as visualized at the top of the usage section.
- test_time.py: Time the duration of computation for different values of the speedup factor.
- test_T_coefficients: Investigate the influence of the dielectric contrast between two materials on transmission of the waves.
- test_pec.py: Runs the simulation for a duration that shows the reflected waves as a consequence of the boundaries being made of perfect electrically conducting (PEC) materials.
- test_hankel.py: Compares the results from the simulation to the spectrum theoretically obtained from a line source: the Hankel function.
- test_courant.py: Runs the simulation with a time step size larger than the Courant limit, showing the system becomes unstable when doing so.
For more details, please refer to the project report.
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
Flor Sanders - @FlorPSanders - me@florsanders.be Thijs Paelman Paul De Smul
Project Link: https://github.com/FlorSanders/EM_Scattering