Custom formfactor

Scattering from a monodisperse distribution of particles, whose form factor is defined by the user.

  • This example shows how users can simulate their own particle shape by implementing the analytical expression of its form factor.
  • The particular shape used here is a polyhedron, whose planar cross section is a “plus” shape with a side length of $20$ nm and a height of $15$ nm.
  • These particles are distributed on a substrate.
  • There is no interference between the scattered waves.
  • The wavelength is equal to 0.1 nm.
  • The incident angles are $\alpha_i = 0.2 ^{\circ}$ and $\varphi_i = 0^{\circ}$.

Complex momentum transfer

The form-factor function receives a C3 vector q with complex components in nm⁻¹. Read them with q.x(), q.y(), and q.z().

For the expression qx*qx + qy*qy + qz*qz, use q.analytic_square(). q.mag2() instead sums absolute squares and gives a different result for complex components:

import bornagain as ba

q = ba.C3(1 + 1j, 0, 0)
q.analytic_square()  # 2j
q.mag2()             # 2.0

Use q.analytic_square_xy() for qx*qx + qy*qy. These expressions preserve the analytic form of formulas evaluated at complex momentum transfer.

Example

Real-space model

Scattering intensity

Open the complete example.