Base

Shape

Shape types and functions.

MultipleScattering.iscongruentMethod
iscongruent(p1::Shape, p2::Shape)::Bool
≅(p1::Shape, p2::Shape)::Bool

True if shapes are the same but in different positions (origins), standard mathematical definition.

source
MultipleScattering.RectangleType
Rectangle([origin::AbstractVector{T}=zeros(),] width::T, Height::T)
Rectangle(bottomleft::AbstractVector{T}, topright::AbstractVector{T})

2D Shape with axis aligned sides, defined by width, height and origin (at the center).

source
MultipleScattering.TimeOfFlightFromPointType

A shape where anything inside could cause a disturbance at the listener position from a point source wavefront starting at the listener. Also everything inside has a positive x coordinate. It is equivalent to a segment of a circle.

More precisely, if the listener is at (lx,ly) then the interior of the shape is defined as sqrt((x-lx)^2+(y-ly)^2)<time and x>0

source
MultipleScattering.TimeOfFlightType

A shape where anything inside could cause a disturbance at the listener position from a planar wavefront parallel to the y axis starting at the listener. Also everything inside has a positive x coordinate.

More precisely, if the listener is at (lx,ly) then the interior of the shape is defined as x-lx+sqrt((x-lx)^2+(y-l_y)^2)<time and x>0

source

Physical property

Physical properties types and functions.

MultipleScattering.PhysicalMediumType
PhysicalMedium{T<:AbstractFloat,Dim,FieldDim}

An abstract type used to represent the physical medium, the dimension of the field, and the number of spatial dimensions.

source
MultipleScattering.boundary_dataFunction

A tuples of vectors of the field close to the boundary of the shape. The field is calculated from sim::FrequencySimulation, but the PhysicalMedium inside and outside of the shape are assumed to be given by insidemedium and outsidemedium.

source

Particle

Particle types and functions.

MultipleScattering.ParticleType
Particle(medium::PhysicalMedium, shape::Shape)

Create particle with inner medium and shape (types and dimension must agree).

source
MultipleScattering.iscongruentMethod
iscongruent(p1::AbstractParticle, p2::AbstractParticle)::Bool
≅(p1::AbstractParticle, p2::AbstractParticle)::Bool

Returns true if medium and shape of particles are the same, ignoring origin, false otherwise.

source

Source

Source types and functions.

MultipleScattering.PlaneSourceType
PlaneSource(medium::P, amplitude::SVector, direction::SVector)

Is a struct type which describes a plane-wave source that drives/forces the whole system. It has three fields: a physical medium, an amplitude of the source, and the direction the propagate in direction.

For any given angular frequency ω, the PlaneSource has the value $e^{i ω/c \mathbf v \cdot \mathbf x }$ at the point $\mathbf x$, where $c$ is the medium wavespeed and $\mathbf v$ is the direction.

source
MultipleScattering.SourceType
Source(medium::P, field::Function, coef::Function)

Is a struct type which describes the source field that drives/forces the whole system. It is also described as an incident wave. It has three fields Source.medium, Source.field, and Source.coef.

The source field at the position 'x' and angular frequency 'ω' is given by

x = [1.0,0.0]
ω = 1.0
Source.field(x,ω)

The field Source.coef regularbasisfunction(medium::Acoustic{T,2}, ω::T)

source
MultipleScattering.source_expandMethod
source_expand(Source, centre; basis_order = 4)

Returns a function of (x,ω) which approximates the value of the source at (x,ω). That is, the source is written in terms of a regular basis expansion centred at centre.

source

Impulse

Impulse types and functions.

MultipleScattering.ContinuousImpulseType

See also: DiscreteImpulse, frequency_to_time

ContinuousImpulse{T<:AbstractFloat}

A struct used to represnt analytic impulse functions. Has two fields: in_time a function of time t, and in_freq a function of the angular frequency ω. in_freq should be the Fourier transform of in_time, though this is not enforced.

We use the Fourier transform convention: F(ω) = ∫ f(t)exp(imωt) dt, f(t) = (2π)^(-1) * ∫ F(ω)exp(-imωt) dω.

An impluse f(t) is convoluted in time with the field u(t), however we avoid the convlution by working with the fourier transform F(ω) of the impulse f(t), which results in

frequency to time: (2π)^(-1) * ∫ F(ω)U(ω)exp(-imωt) dω

source
MultipleScattering.FreqDiracImpulseMethod

Dirac Delta function of unit area in the frequency domain centred at ω=ω0.

Warning: in frequency space this is a singuarity and so may lead to unexpected behaviour.

source
MultipleScattering.TimeDiracImpulseMethod
TimeDiracImpulse(t0::T)

Dirac Delta function of unit area in the time domain centred at t=t0.

Warning: in the time domain this is a singuarity and so may lead to unexpected behaviour.

source
MultipleScattering.frequency_to_timeMethod

Convert a FrequencySimulationResult into a TimeSimulationResult by using the inverse fourier transform. Assumes only positive frequencies and a real time signal

source
MultipleScattering.frequency_to_timeMethod

See also: DiscreteImpulse, ContinuousImpulse

Calculates the time response from the frequency response by approximating an inverse Fourier transform. The time signal is assumed to be real and the frequenices ω_vec are assumed to be positive (can include zero) and sorted. The result is convoluted in time ωith the user specified impulse.

We use the Fourier transform convention: F(ω) = ∫ f(t)exp(imωt) dt f(t) = (2π)^(-1) * ∫ F(ω)exp(-imωt) dt

To easily sample any time, the default is not FFT, but a discrete version of the transform above.

source
MultipleScattering.time_to_frequencyMethod

The inverse of the function frequencytotime (only an exact inverse when using :dft integration). We use the Fourier transform convention: F(ω) = ∫ f(t)exp(imω*t) dt

source
MultipleScattering.ω_to_tMethod

returns an array of time from the frequency array ωvec. Uses the same convention for sampling the time as the discrete Fourier transfrom. Assumes ωvec is ordered and non-negative.

source

Simulation

Simulation types and functions.

Base.runMethod
run(sim::FrequencySimulation, x, ω; basis_order=5)

Run the simulation sim for the position x and angular frequency ω.

Position can be an SVector or Vector{SVector} and frequency can be a float or vector of floats.

source
Base.runMethod
run(sim::FrequencySimulation, rectangle;
    res=20, xres=res, yres=res, basis_order=5)

Run the simulation sim for a grid of positions in rectangle and for angular frequency ω.

Frequency can be a float or vector of floats. The resolution of the grid points is defined by xres and yres.

source
MultipleScattering.basis_coefficientsFunction
basis_coefficients(sim::FrequencySimulation, ω::AbstractFloat; basis_order::Int=5)::Matrix{Complex}

Return coefficients for bases around each particle for a given simulation and angular frequency (ω).

source
MultipleScattering.fieldFunction
field(result::SimulationResult, [i::Integer, j::Integer])

Get field from result, optionally specifying indices.

Returns single value of/matrix of complex SVectors() if vector field, and complex float if scalar field.

source
MultipleScattering.t_matrixFunction
t_matrix(particle, medium, ω, order)

Returns a finite T-matrix, with size depending on order, for a specific particle within a medium with specific physical properties.

source
t_matrix(Particle{T,2,Acoustic{T,2},Circle{T}}, Acoustic{T,2}, ω, order)

The T-matrix for a 2D circlular acoustic particle in a 2D acoustic medium.

source
t_matrix(CapsuleParticle{T,2,Acoustic{T,2},Circle{T}}, Acoustic{T,2}, ω, order)

The T-matrix for a 2D circlular capsule particle in an acoustic medium.

source
t_matrix(Particle{T,3,Acoustic{T,3},Sphere{T}}, Acoustic{T,3}, ω, order)

The T-matrix for a 3D spherical acoustic particle in a 3D acoustic medium.

source
MultipleScattering.get_t_matricesFunction
get_t_matrices(PhysicalMedium, Vector{Particles}, ω, basis_order::Integer)

Returns vector of T-matrices from a vector of particles in a specific domain. Can save computation if multiple of the same kind of particle are present in the vector.

source