Binary Blend - binary_blend.py

    r"""

Two-component RPA model with a flat background.

Definition
----------
This model calculates the scattering from a two component polymer
blend using the Random Phase Approximation (RPA).

.. note:: The two polymers are assumed to be monodisperse.

The scattered intensity $I(q)$ is calculated as[1]

.. math::

     frac {(rho_A - 
ho_B)^2}{N_A I(q)} = 	ext{scale} cdot
     [frac {1}{phi_A M_A v_A P_A(q)} + frac {1}{phi_B M_B v_B P_B(q)} -
     frac {2 chi}{N_A V_0}] + 	ext{background}

where

.. math::

     P_i(q) = 2 [exp(-Z) + Z - 1] / Z^2 \
     Z = (q Rg_i)^2 \

Here, $phi_i$, is the volume fraction of polymer i (and $phi_A + phi_B = 1)$,
$M_i$ is the molecular weight of polymer i, $v_i$ is the specific volume of
monomer i, $Rg_i$ is the radius of gyration of polymer i, $
ho_i$ is the sld
of polymer i, $N_A$ is Avogadro's Number, and $V_0$ is the reference volume
(taken to be 1 cm^3). $P_i(q)$ is the Debye Gaussian coil form factor.

$chi$ is the Flory-Huggins interaction parameter expressed *per unit volume*
and not per monomer as is more usual. However, the influence of the third term
on the RHS of the first equation is small.

.. note:: This model works best when as few parameters as possible are allowed
           to optimise such as, for example, when the actual blend composition
           is well-known and $M_i$, $phi_i$, and $
ho_i$ can be fixed.

References
----------

#.  Lapp, Picot & Benoit, Macromolecules, (1985), 18, 2437-2441 (Appendix) 

Authorship and Verification
---------------------------

* **Author:** Steve King **Date:** 07/05/2020
* **Last Modified by:** **Date:**
* **Last Reviewed by:** **Date:**

"""
import numpy as np
from numpy import inf

name = "binary_blend"
title = "Two-component RPA model"
description = """
    Evaluates a two-
    component RPA model
"""
category = "shape-independent"
structure_factor = False
single = False

#   ["name", "units", default, [lower, upper], "type","description"],
parameters = [
    ["chi", "", 0.001, [0, 100], "", "Flory interaction parameter"],
    ["density_A", "g/cm^3", 1.05, [0.1, 3], "", "Mass density of Component A"],
    ["density_B", "g/cm^3", 0.90, [0.1, 3], "", "Mass density of Component B"],
    ["mol_weight_A", "g/mol", 52190, [28, inf], "", "Molecular weight of Component A"],
    ["mol_weight_B", "g/mol", 52190, [28, inf], "", "Molecular weight of Component B"],
    ["rg_A", "Ang", 59.3, [1.5, inf], "", "Radius of gyration of Component A"],
    ["rg_B", "Ang", 59.3, [1.5, inf], "", "Radius of gyration of Component B"],
    ["sld_A", "1e-6/Ang^2", 6.55, [-1, 7], "sld", "SLD of Component A"],
    ["sld_B", "1e-6/Ang^2", 1.44, [-1, 7], "sld", "SLD of Component B"],
    ["volfrac_A", "", 0.48, [0, 1], "", "Volume fraction of Component A"],
]

def Iq(q, chi, density_A, density_B, mol_weight_A, mol_weight_B, rg_A,
    rg_B, sld_A, sld_B, volfrac_A):
    N_Av = 6.023E+23              # Avagadros number
    V_ref = 1.0                   # Reference volume (cm^3)
    U_A = (q * rg_A) * (q * rg_A)
    U_B = (q * rg_B) * (q * rg_B)
    Pq_A = 2.0 * (np.exp(-1.0 * U_A) - 1.0 + U_A) / (U_A * U_A)
    Pq_B = 2.0 * (np.exp(-1.0 * U_B) - 1.0 + U_B) / (U_B * U_B)
    Z_A = volfrac_A * mol_weight_A * (1.0 / density_A) * Pq_A
    Z_B = (1.0 - volfrac_A) * mol_weight_B * (1.0 / density_B) * Pq_B
    chiterm = (2.0 * chi) / (N_Av * V_ref)
    prefactor = 1.0E+20 * (sld_A - sld_B) * (sld_A - sld_B) / N_Av
    Inverse_Iq = (1.0 / prefactor) * ((1.0 / Z_A) + (1.0 / Z_B) - chiterm)
    result = 1.0 / Inverse_Iq
    return result
	
Iq.vectorized = True  # Iq accepts an array of q values

tests = [
   [{'scale': 1.0, 'background' : 0.3, 'chi': 0.001, 'density_A': 1.13,
     'density_B': 1.05, 'mol_weight_A': 54180, 'mol_weight_B': 49000, 'rg_A': 57.6,
     'rg_B': 56.8, 'sld_A': 6.47, 'sld_B': 1.41, 'volfrac_A': 0.518},
     [0.002, 0.249], [50.2581173587, 0.792570738525]],
	]

Back to Model Download