Giter Site home page Giter Site logo

coucou2016 / multiplescattering-mathematica Goto Github PK

View Code? Open in Web Editor NEW

This project forked from arturgower/multiplescattering-mathematica

0.0 0.0 0.0 5.97 MB

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

License: MIT License

TeX 12.49% Mathematica 87.51%

multiplescattering-mathematica's Introduction

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

multiplescattering-mathematica's People

Contributors

arturgower avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.