An open API service indexing awesome lists of open source software.

https://github.com/arturgower/multiplescattering-mathematica

A Mathematica package to calculate exact multiple scattering, in time and frequency, according to the 2D wave equation.
https://github.com/arturgower/multiplescattering-mathematica

diffraction mathematica multiple-scattering wave-equation wave-propagation wave-scattering

Last synced: 3 days ago
JSON representation

A Mathematica package to calculate exact multiple scattering, in time and frequency, according to the 2D wave equation.

Awesome Lists containing this project

README

          

![compatibility](https://img.shields.io/badge/Mathematica-8.x_9.x_10.x_11.x-brightgreen.svg)

## MultipleScattering2D.wl - exact multiple scattering in 2D for Mathematica

A package to calculate multiple scattering according to the 2D wave equation. The best place to get started is the notebook [TwoBodyScattering.nb](examples/TwoBodyScattering.nb). The example [ImpulseWave.nb](examples/ImpulseWave.nb) uses randomly place scatterers, similar to the gifs below, whereas [Source.nb](examples/Source.nb) shows how to change source function.

At present all scatterers need to be cylinders of the same size, but can be placed anywhere. The incident wave can be anything, but the default for the package is the 2D green's function. There are functions to calculate the total wave in frequency and time, together with examples on how to plot them. For details on the maths see [Martin (1995)](https://pdfs.semanticscholar.org/8bd3/38ec62affc5c89592a9d6d13f1ee6a7d7e53.pdf).

## Examples

Scattering of a plane wave from two cylinders for one frequency generated by [TwoBodyScattering.nb](examples/TwoBodyScattering.nb)

```
Get[NotebookDirectory[] <> "/src/MultipleScattering2D.wl"]

(*radius of the scatterers*)
radius = 0.1;
(*max number of hankel functions per scatterer*)
N0 = 2;
(*angular frequency*)
ws = {6.};

options = {
"SourceWave" -> (Exp[I #2 #1[[1]]] &),(*chose a plane wave*)
"BoundaryCondition" -> "Dirchlett"(*"BoundaryCondition"->"Neumann"*)
};

(*Position of the scatterers*)
Xs = {{-.3, .4}, {0.5, .4}};

(*reciever mesh*)
rngX = Range[-8 radius, 8 radius, radius/4];
rngY = Range[0., 8 radius, radius/4];
listeners = ListenersOutsideScatterers[radius, Xs, rngX, rngY];

(*Calculate response at every mesh point *)
responses = FrequencyFromScatterers[listeners, Xs, radius, N0, ws];

(*plot the absolute value of the result*)
data = Flatten@{listeners[[#]], Abs@responses[[#, 1, 2]]} & /@
Range[Length@responses];
p1 = ListDensityPlot[data, InterpolationOrder -> 1, PlotLegends -> Automatic ];
p2 = DrawScatterers[Xs, radius];
Show[p1, p2, AspectRatio -> Automatic]

```

![TwoBodyScattering](media/TwoBodyFrequency.jpg)

Diffraction of a point source (2D Green's function), from one big cylinder for one frequency generated by [BigCylinderDiffraction.nb](examples/BigCylinderDiffraction.nb)

![OneBigCylinder](media/BigCylinderDiffraction.jpg)

By lining up cylinders above and below the source, we effectively create two walls:

![TwoWalls](media/TwoWallsBodyScattering.gif)

## Randomly placed cyclinders
The package's focus is on scattering from random media, for example see the notebook [ImpulseWave.nb](examples/ImpulseWave.nb)
#### Dirichlet boundary conditions

![dirichlet](media/45-Wave_10-Scatterers.GIF)

#### Neumann boundary conditions

![neumann](media/45-Wave_12-Scatterers-Neuman.GIF)