Modelling dispersive materials with gprMax software during Google Summer of Code

Sylwia Majchrowska
4 min readJul 20, 2021

On May 17, I received a message that my proposal Modelling complex materials electromagnetic properties in gprMax software has been accepted, and thus I will take part in the Google Summer of Code 2021 (GSoC). A week later, I attended a first meeting with three other students and the gprMax team. Recently I passed my first evaluations where my mentor praised my work and motivated me. That’s why I thought it was a very good time to share the subject of my project. So let’s start with some basics.

What is Google Summer of Code?

According to the official page, GSoC is an annual global program organized by Google to support various open-source solutions. As part of it, students carry out 10 week programming projects to get some experience in open-source development (and receive a scholarship for it).

The GSoC initiative helps various organizations connect with students and get them started with their open-source projects (sometimes it is their first connection with this type of activity).

Every year Google first announces the open-source organizations, to whom students can apply (you can only send up to three proposals). I decided to send my proposal to gprMax, which is open-source software that simulates electromagnetic wave propagation. The topics proposed by the organization are the closest to my interest — the common base for the organization and my studies is Physics.

First meeting with the selected GSoC students and the whole gprMax team.

gprMax software

All electromagnetic phenomena are governed by Maxwell’s equations, which describe how electric and magnetic fields are distributed due to charges and currents, and how they are changing in time. gprMax is open-source software that simulates electromagnetic wave propagation by using Yee’s algorithm to solve (3+1)D Maxwell’s equations with Finite-Difference Time-Domain (FDTD) method. gprMax is command-line-driven, written in Python with performance-critical parts written in Cython.

The behavior of the electromagnetic wave is closely dependent on the material in which it propagates. Some dispersive media have quite complex electromagnetic properties depending on the wavelength. This, for example, means that for different frequencies the wave can propagate with a different speed in different materials. This significantly affects the solver’s output.

The main goal of my project is to enhance a series of scripts, which model electromagnetic properties of the variety types of materials. Initial series of scripts have been prepared, however, they need technical improvement and coupling with main software.

Modelling complex media

As I mentioned before the dielectric properties of some materials (i.e. biological tissues) are highly frequency dependent. To model the materials accurately the frequency dependent nature of their dielectric properties must be accounted. These properties consist of complex permittivity and conductivity. In the case of electric permittivity, we can simply say that the real part dictates the velocity of the medium while the imaginary part is related to the electromagnetic losses.

FDTD method is limited regarding modelling dispersive materials. Due to its time-domain nature, arbitrary dispersive materials cannot be directly implemented in a straightforward manner. To overcome this, the given dielectric spectrum is approximated by functions compatible with FDTD. The most common function employed for this task is the multi-pole Debye expansion.

Currently I am working on a few common approaches to fit a multi-pole Debye expansion to dielectric data, including Havriliak-Negami (the model is the most general and can also take the commonly known form of the Cole-Cole and Cole-Davidson functions), Johnsher and Complex Refractive Index Mixing (CRIM) models. Additionally it is possible to fit arbitrary dielectric data derived experimentally or calculated using some other function.

Approximation of CRIM function using five-poles Debye model.

Optimization procedure

However, accurately fitting Debye coefficients to a set of dielectric measurements across a very large frequency-range is problematic. In the literature various fitting methods have been investigated, for example genetic algorithms and particle swarm least squares optimization. The last one with some modifications is implemented in gprMax software.

The exact technique employed here is a variation of a hybrid linear-nonlinear optimisation proposed by Kelley et. al. The main modification for the method is based on some slight adjustments to overcome instability issues. The real part to the cost action was added to avoid possible instabilities to arbitrary given functions that do not follow the Kramers–Kronig relation. Thus makes the process more robust and faster.

The gprMax software has the ability to model dielectric properties obtained experimentally by fitting multi-pole Debye functions to data given from a file.

Summing up

Working for gprMax is a great learning experience. It did take a few weeks to get a grasp on physics and optimization methods, but it is worth it and finally, I passed my first evaluations!

I believe that by contribiuting to gprMax software I improve it, and also improve my existing programming skils — more practise=more experience. It is empowering to be able to make changes, even small ones.

I am looking forward to finishing my project with my best efforts!

--

--