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.
|
s1 = scatterer(-1-1i,0.5,'SOFT'); |
|
|
s1.addCoating(1.0,1.5); |
Visualise the configuration
Once created we can visualise our configuration of
two scatterers..
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.
|
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.
|
p = MieSolver(inc); |
|
|
p.transmissionTE() |
|
|
p.addScatterer(s1) |
p.addScatterer(s2) |
|
|
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.
|
|
p.visualiseTotalField([-4-4i,4+4i]) |
|
|
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.
|
s1 = scatterer(-1-1i,0.5,'SOFT'); |
|
|
s1.addCoating(1.0,1.5); |
|
|
s2 = scatterer(1+1i,1,'SOFT'); |
|
|
figure(1) |
|
|
s1.show() |
|
|
s2.show() |
|
|
axis equal
| |
|
direction = pi/2; |
kwave = 5*pi; |
inc = plane_wave(direction,kwave); |
|
|
p = MieSolver(inc); |
|
|
p.transmissionTE() |
|
|
p.addScatterer(s1) |
p.addScatterer(s2) |
|
|
p.solve() |
|
|
figure(2) |
|
|
|
p.visualiseTotalField([-4-4i,4+4i]) |
|
|
view([0 90]) |
shading interp |
axis equal |
colorbar |
colormap jet |
|