In [1]:
import escape as esc

esc.require("0.9.8")
import numpy as np
Loading material database from /home/dkor/Data/Development/workspace_escape/escape-core/python/src/escape/scattering/../data/mdb/materials.db

SAXS. Modeling of branched polymers¶

In this notebook we continue to demonstrate the capabilities of ESCAPE to simulate small-angle scattering data with custom model functions.

The following example implements a single polymer form-factor for branched polymers formulated by B. Hammouda et al. ( https://doi.org/10.1002/mats.201100111)

Full article is available here: http://www.sciencetopics.net/5.recent_scientific_publications/4.publications_4/2012_hammouda_macromol_theory_and_simul.pdf

Without going into details of the (mass)fractal model, the form-factor of branched polymer is given by:

$P_B(Q)=\frac{1}{Norm}\left[\frac{1}{\nu U_B^{c/2\nu}}\gamma\left(c/2\nu, U_B\right)-\frac{1}{\nu U_B^{(c+1)/2\nu}}\gamma\left((c+1)/2\nu, U_B\right)\right]$

where $Norm = \frac{2}{c(c+1)}$ - the normalization factor,

$U_B=Q^2R_g^2(2\nu+c)(2\nu+c+1)/6$ - scattering variable which expressed in terms of the radii of gyration.

$\nu$ - excluded volume, $c$ - scaling factor and raddi of gyration are the model fit parameters.

The implementation of this model in terms of ESCAPE entities is straightforward.

In [2]:
# Q variable
q = esc.var("Q")

# Radii of gyration
RG = esc.par("RG", 150, units="nm")

# excluded volume
VM = esc.par("VM", 0.6, units="arbitr")

# scaling factor
C = esc.par("C", 1, units="arbitr", fixed=True, userlim=[1, 2])


f = 2 * VM + C
Ub = q * q * RG * RG * f * (f + 1) / 6
norm_inv = 0.5 * (C * C + C)

# we need normalized lower gamma function
gamma = esc.gamma_p
pow = esc.pow

# intensity
P = (
    gamma(0.5 * C / VM, Ub) / (VM * pow(Ub, 0.5 * C / VM))
    - gamma(0.5 * (C + 1) / VM, Ub) / (VM * pow(Ub, 0.5 * (C + 1) / VM))
) * norm_inv;
In [3]:
P.show(coordinates=np.linspace(0, 1, 1000)).config(ylog=True)
Out[3]:
In [ ]:
 
In [ ]: