MieSolver

An Object Oriented Mie Series Software

About

License

Publications

Download

Contact

Example

About

Wave Scattering by Cylinders

MieSolver is a simple and easy to use Matlab program for simulating acoustic and electromagnetic wave propagation through a configuration of one or more non-identical circular cylinders. Multiple scattering effects are fully simulated.

MieSolver is based on the Mie Series solution of the wave propagation model. For full details see the accompanying paper.

MieSolver supports

  • acoustic waves
  • Transverse Electric (TE) waves
  • Transverse Magnetic (TM) waves

The object-oriented structure of the software allows mixed configurations of cylinders with the following material properties:

  • sound soft/TE
  • sound hard/TM
  • impedence
  • layered

MieSolver implements the following incident waves:

  • plane waves... any incident direction (with perpendicular incidence)
  • point sources... any source location
  • cylindrical wave functions

License

MieSolver is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

If you use this code, please cite the accompanying paper:

Stuart C. Hawkins.
Algorithm 1009: MieSolver-An Object-Oriented Mie Series Software for Wave Scattering by Cylinders
ACM Transactions on Mathematical Software. Volume 46. Pages 19:1-19:28, 2020.

Download

Download user manual miesolver_manual.pdf

Download all files (including documentation and examples):

Contact

Example

We use MieSolver to simulate scattering of an incident plane wave by two cylinders. The first cylinder has a metal core and a dielectric coating. The second cylinder is metal. (full code).

Create the scatterers

In MieSolver all scatterers have a core, to which layers can be added.

We setup the first scatterer by first creating a metal core with radius 0.5 and then adding a dielectric layer. The position of the centre of the core is specified using a complex number -1-i to represent (-1,-1).

For this example we will use a transverse electric (TE) incident wave so that the metal core has a sound-soft type boundary condition.

% create the core of the first scatterer
s1 = scatterer(-1-1i,0.5,'SOFT');
 
% add a dielectric layer with refractive index 1.5 around the core
s1.addCoating(1.0,1.5);

Visualise the configuration

Once created we can visualise our configuration of two scatterers..

% visualise the first scatterer
s1.show()
 
% visualise the second scatterer
s2.show()

The result looks like this:

Setup the incident wave

We will use an incident plane wave travelling in the direction (0,1) i.e. with angle pi/2 and wavenumber 5 pi.

% setup an incident plane wave
direction = pi/2;
kwave = 5*pi;
inc = plane_wave(direction,kwave);

Setup and solve the scattering problem

Next we setup the MieSolver object that we use to solve the scattering problem.

This is where we specify what kind of transmission conditions are to be applied. In this example we use transverse electric (TE) type transmission conditions.

% setup the solver using the incident wave
p = MieSolver(inc);
 
% configure for TE transmission conditions
p.transmissionTE()
 
% add the scatterers to the solver
p.addScatterer(s1)
p.addScatterer(s2)
 
% solve the scattering problem
p.solve()

Visualise the total field

MieSolver has built in methods for quickly visualising the scattered/induced and total fields.

The plot region is specified by its bottom left and top right corners.

% plot the total field (specifying the bottom left and top right corners
% of the region plotted)
p.visualiseTotalField([-4-4i,4+4i])
 
% adjust how the figure looks
view([0 90])
shading interp
axis equal
colorbar
colormap jet

The result looks like this:

Full code

You can paste the full code into your Matlab command window.

% create the core of the first scatterer
s1 = scatterer(-1-1i,0.5,'SOFT');
 
% add a dielectric layer with refractive index 1.5 around the core
s1.addCoating(1.0,1.5);
 
% create the second scatterer
s2 = scatterer(1+1i,1,'SOFT');
 
% setup a figure to visualise the scatterers
figure(1)
 
% visualise the first scatterer
s1.show()
 
% visualise the second scatterer
s2.show()
 
% make the scale the same in the x- and y-axes
axis equal
 
% setup an incident plane wave
direction = pi/2;
kwave = 5*pi;
inc = plane_wave(direction,kwave);
 
% setup the solver using the incident wave
p = MieSolver(inc);
 
% configure for TE transmission conditions
p.transmissionTE()
 
% add the scatterers to the solver
p.addScatterer(s1)
p.addScatterer(s2)
 
% solve the scattering problem
p.solve()
 
% setup a figure to plot the total field
figure(2)
 
% plot the total field (specifying the bottom left and top right corners
% of the region plotted)
p.visualiseTotalField([-4-4i,4+4i])
 
% adjust how the figure looks
view([0 90])
shading interp
axis equal
colorbar
colormap jet