+++
title = "Size-distribution models"
weight = 50
+++

## Size-distribution models

### Local monodisperse approximation

The LMA approach implies that the layer is laterally divided into domains
containing particles of the same size and shape and organized into a certain
structure. In this approximation the domains are spatially separated and thus
completely independent from each other.

The scattering intensity is incoherently summed over the domains with the
corresponding weights.

```python
structure_1 = ba.RadialParacrystal(particle_1, 16.8*nm, 1000*nm)
structure_2 = ba.RadialParacrystal(particle_2, 22.8*nm, 1000*nm)
structure_1.setProbabilityDistribution(profile)
structure_2.setProbabilityDistribution(profile)

layer.addDeposit2D(0.5, structure_1)
layer.addDeposit2D(0.5, structure_2)
```

### Decoupling approximation

The DA approach implies that the particles share the common structure but
present there with their individual weights. There is still no coherence
between different types of particles.

For ordered structures with multiple particle types, use a `Mixture`:

```python
mix = ba.Mixture()
mix.addParticle(particle_1, 0.8)
mix.addParticle(particle_2, 0.2)

structure = ba.RadialParacrystal(mix, 18*nm, 1000*nm)
structure.setProbabilityDistribution(profile)
layer.deposit2D(structure)
```

For a disordered case, use independent dilute structures:

```python
layer.deposit2D(ba.Dilute2D(density_1, particle_1))
layer.deposit2D(ba.Dilute2D(density_2, particle_2))
```

### Size space coupling approximation

Applicable only to [radial paracrystal](radial_paracryst).

The SSCA approach introduces phase shift between different fractions with the
common structure. This is done by setting parameter `kappa` to 1 (it is 0 by
default).

```python
mix = ba.Mixture()
mix.addParticle(particle_1, 0.8)
mix.addParticle(particle_2, 0.2)

structure = ba.RadialParacrystal(mix, 18*nm, 1000*nm)
structure.setProbabilityDistribution(profile)
structure.setKappa(1)  # Enable SSCA
layer.deposit2D(structure)
```

## Example

Scattering from a distribution of cylinders of two different sizes,
positioned according to the radial paracrystal model.

* The sample is made of cylinders deposited on a substrate.
* The distribution of particles is made of:
  * 80% of cylinders with radii and heights equal to $5$ nm
  * 20% of cylinders with radii and heights equal to $8$ nm.
* The structure is [radial paracrystal](radial_paracryst) with a peak distance
  of $18$ nm and a damping length of $1$ $\mu$m.
* LMA uses two radial paracrystals with peak distances of $16.8$ and
  $22.8$ nm.
* The wavelength is equal to 0.1 nm.
* The incident angles are $\alpha\_i = 0.2 ^{\circ}$ and
  $\varphi\_i = 0^{\circ}$.

The example below compares the scattering patterns of all three
approximations.

{{< galleryscg >}}
{{< figscg src="/img/auto/scatter2d/Approximations.png" width="350px" caption="Scattering intensity">}}
{{< /galleryscg >}}

{{< show-ex file="scatter2d/Approximations.py" >}}
