Operators

Operators are used to transform size distributions. The operators overload the Base or LinearAlgebra methods. Operators fall into two broad categories: operators changing number concentration and spectral density fields (π•Ÿ.N and π•Ÿ.S) and operators that change the sizing vector (π•Ÿ.Dp). The former include π•Ÿβ‚ + π•Ÿβ‚‚, π•Ÿβ‚ - π•Ÿβ‚‚, π•Ÿβ‚ βˆ— π•Ÿβ‚‚, π•Ÿβ‚ / π•Ÿβ‚‚, a βˆ— π•Ÿ, T .βˆ— π•Ÿ, and A βˆ— π•Ÿ, while the latter include a Β· π•Ÿ and T Β· π•Ÿ.

OperatorDescription
π•Ÿβ‚ + π•Ÿβ‚‚Superposition of the distributions π•Ÿβ‚ and π•Ÿβ‚‚
π•Ÿβ‚ - π•Ÿβ‚‚Superposition of the distributions π•Ÿβ‚ and π•Ÿβ‚‚
a βˆ— π•ŸUniform scaling of the concentration fields by factor a
𝐀 βˆ— π•ŸMatrix multiplication of 𝐀 and concentration
π•Ÿβ‚ * π•Ÿβ‚‚Scaled such that total number concentration equals to N1 βˆ— N2
π•Ÿβ‚ / π•Ÿβ‚‚Ratio of concentration fields of distributions π•Ÿβ‚.N and π•Ÿβ‚‚.N
a Β· π•ŸUniform scaling of the diameter field of the size distribution by factor a
T Β· π•ŸElementwise scaling the diameter field by factor T

Index

Number Operators

Base.:+ β€” Method
+(π•Ÿβ‚::SizeDistribution, π•Ÿβ‚‚::SizeDistribution)

Defines the sum of two size distributions. If diameter grids are not equal, then the diameter grid of n2 is interpolated onto the n1 grid prior to addition.

𝕩 = π•Ÿβ‚ + π•Ÿβ‚‚ 

is defined such that

𝕩.S = π•Ÿβ‚.S + π•Ÿβ‚‚.S 
𝕩.N = 𝕩.S .* π•Ÿ.Ξ”lnD 

Example Usage

π•Ÿβ‚ = lognormal([[120, 90, 1.20]]; d1 = 10.0, d2 = 1000.0, bins = 256)
π•Ÿβ‚‚ = lognormal([[90, 140, 1.15]]; d1 = 20.0, d2 = 800.0, bins = 64)
𝕩 = π•Ÿβ‚ + π•Ÿβ‚‚
source
Base.:- β€” Method
-(π•Ÿβ‚::SizeDistribution, π•Ÿβ‚‚::SizeDistribution)

Defines the sum of two size distributions. If diameter grids are not equal, then the diameter grid of n2 is interpolated onto the n1 grid prior to addition.

𝕩 = π•Ÿβ‚ - π•Ÿβ‚‚ 

is defined such that

𝕩.S = π•Ÿβ‚.S - π•Ÿβ‚‚.S 
𝕩.N = 𝕩.S .* π•Ÿ.Ξ”lnD 

Example Usage

π•Ÿβ‚ = lognormal([[120, 90, 1.20]]; d1 = 10.0, d2 = 1000.0, bins = 256)
π•Ÿβ‚‚ = lognormal([[90, 140, 1.15]]; d1 = 20.0, d2 = 800.0, bins = 64)
𝕩 = π•Ÿβ‚ - π•Ÿβ‚‚
source
Base.:* β€” Method
*(a::Number, π•Ÿ::SizeDistribution)

Multiplication of scalar and size distribution. The net result is a scaling of the number concentration of the spectra by a. The function is symmetric such that a * π•Ÿ == π•Ÿ * a.

Let a denote a number and π•Ÿ denote a size distribution. Then

𝕩 = a * π•Ÿ 

is defined such that

𝕩.N = a * π•Ÿ.N
𝕩.S = a * π•Ÿ.S

Example Usage

π•Ÿ = lognormal([[120, 90, 1.20]]; d1 = 10.0, d2 = 1000.0, bins = 256)
𝕩 = 2.3 * π•Ÿβ‚‚
source
Base.:* β€” Method
*(𝐀::AbstractMatrix, π•Ÿ::SizeDistribution)

Multiplication of matrix and size distribution. The net result is the multiplication of the matrix with number concentration and spectral density fields.

Let 𝐀 denote an nxn matrix where n equals the number of size bins of π•Ÿ. Then

𝕩 = 𝐀 * π•Ÿ 

is defined such that

𝕩.N = 𝐀 * π•Ÿ.N
𝕩.S = 𝐀 * π•Ÿ.S
π•Ÿ = lognormal([[100, 100, 1.1]]; d1 = 10.0, d2 = 1000.0, bins = 256)
𝐀 = rand(256,256)
𝕩 = 𝐀 * π•Ÿ                                        
source
Base.:* β€” Method
*(π•Ÿβ‚::SizeDistribution, π•Ÿβ‚‚::SizeDistribution)

Multiplication of size distribution and a size distribution. The net result is a size distribution that has total number concentration square. For a probability distributions that by definition integrate to unity, this operation corresponds to the product of two random variates with distribution 1 and 2.

Let π•Ÿβ‚ and π•Ÿβ‚‚ denote a two size distribution defined on the same diameter grid. Then

𝕩 = π•Ÿβ‚ * π•Ÿβ‚‚ 

is defined such that

Nsq = π•Ÿβ‚.N * π•Ÿβ‚‚.N
𝕩.N = sum(π•Ÿβ‚.N) * sum(π•Ÿβ‚‚.N) * Nsq./sum(Nsq)
𝕩.S = N ./ π•Ÿβ‚.Ξ”dlnD

Example Usage

π•Ÿβ‚ = lognormal([[120, 90, 1.20]]; d1 = 10.0, d2 = 1000.0, bins = 256)
π•Ÿβ‚‚ = lognormal([[90, 140, 1.15]]; d1 = 20.0, d2 = 800.0, bins = 64)
𝕩 = π•Ÿβ‚ * π•Ÿβ‚‚
source
Base.:/ β€” Method
/(π•Ÿβ‚::SizeDistribution, π•Ÿβ‚‚::SizeDistribution)

Division of size distribution and size distribution. The net result is a size distribution that is the ratio of the concentration vectors.

Let π•Ÿβ‚ and π•Ÿβ‚‚ denote a two size distribution defined on the same diameter grid. Then

𝕩 = π•Ÿβ‚ / π•Ÿβ‚‚

is defined such that

N = π•Ÿβ‚.N ./ π•Ÿβ‚‚.N
S = π•Ÿβ‚.S ./ π•Ÿβ‚‚.S

Example Usage

π•Ÿβ‚ = lognormal([[120, 90, 1.20]]; d1 = 10.0, d2 = 1000.0, bins = 256)
π•Ÿβ‚‚ = lognormal([[90, 140, 1.15]]; d1 = 20.0, d2 = 800.0, bins = 64)
𝕩 = π•Ÿβ‚ / π•Ÿβ‚‚
source

Size Operators

LinearAlgebra.:β‹… β€” Method
β‹…(a::Number, π•Ÿ::SizeDistribution)

Multiplication of a scalar and a size distribution. The net result is a uniform diameter shift of the size distribution. The function is symmetric such that a β‹… π•Ÿ == π•Ÿ β‹… a.

Let a denote a floating point scalar and π•Ÿ denote a size distribution. Then

𝕩 = a β‹… π•Ÿ

is defined such that

𝕩.Dp = a * π•Ÿ.Dp 

Example Usage

a = 2.0 
π•Ÿ = lognormal([[300, 100, 1.3]]; d1 = 10.0, d2 = 1000.0, bins = 256)
𝕩 = a β‹… π•Ÿ 
source
LinearAlgebra.:β‹… β€” Method
LinearAlgebra.:β‹…(A::Vector{<:AbstractFloat}, π•Ÿ::SizeDistribution)

Dot product of vector and size distribution. The net result is diameter dependent shift of the size distribution. The function is symmetric such that A β‹… π•Ÿ == π•Ÿ β‹… A.

Let T denote a floating point vector with the same number of elements as the size distribution π•Ÿ. Then

𝕩 = T β‹… π•Ÿ 

is defined such that

𝕩.Dp = T .* π•Ÿ.dp 

Example Usage

π•Ÿ = lognormal([[100, 100, 1.1]]; d1 = 10.0, d2 = 1000.0, bins = 256)  
ΞΌ,Οƒ = 80.0, 2000.0
T = (1.0 .+ erf.((π•Ÿ.Dp .- ΞΌ)./(sqrt(2Οƒ)))) 
𝕩 = T β‹… π•Ÿ  
source