Skip to content

Latest commit

 

History

History
68 lines (44 loc) · 2.8 KB

README.md

File metadata and controls

68 lines (44 loc) · 2.8 KB

compatibility

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. The example ImpulseWave.nb uses randomly place scatterers, similar to the gifs below, whereas 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).

Examples

Scattering of a plane wave from two cylinders for one frequency generated by 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

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

OneBigCylinder

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

TwoWalls

Randomly placed cyclinders

The package's focus is on scattering from random media, for example see the notebook ImpulseWave.nb

Dirichlet boundary conditions

dirichlet

Neumann boundary conditions

neumann