Ignore:
Timestamp:
Oct 1, 2016 9:48:49 AM (5 years ago)
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
69ef533
Parents:
a807206
Message:

Updated and re-parameterised Teubner-Strey model.

Closes #472
Closes #530

File:
1 edited

Legend:

Unmodified
 r40a87fa This model calculates the scattered intensity of a two-component system using the Teubner-Strey model. Unlike :ref:dab this function generates a peak. a peak. A two-phase material can be characterised by two length scales - a correlation length and a domain size (periodicity). The original paper by Teubner and Strey defined the function as: .. math:: I(q) = \frac{1}{a_2 + c_1 q^2 + c_2 q^4} + \text{background} I(q) \propto \frac{1}{a_2 + c_1 q^2 + c_2 q^4} + \text{background} The parameters $a_2$, $c_1$ and $c_2$ can be used to determine the characteristic domain size $d$, where the parameters $a_2$, $c_1$ and $c_2$ are defined in terms of the periodicity, $d$, and correlation length $\xi$ as: .. math:: a_2 &= \biggl[1+\bigl(\frac{2\pi\xi}{d}\bigr)^2\biggr]\\ c_1 &= -2\xi^2\bigl(\frac{2\pi\xi}{d}\bigr)^2+2\xi^2\\ c_2 &= \xi^4 and thus, the periodicity, $d$ is given by .. math:: d = 2\pi\left[\frac12\left(\frac{a_2}{c_2}\right)^{1/2} + \frac14\frac{c_1}{c_2}\right]^{-1/2} - \frac14\frac{c_1}{c_2}\right]^{-1/2} and the correlation length $\xi$, and the correlation length, $\xi$, is given by .. math:: \xi = \left[\frac12\left(\frac{a_2}{c_2}\right)^{1/2} - \frac14\frac{c_1}{c_2}\right]^{-1/2} + \frac14\frac{c_1}{c_2}\right]^{-1/2} Here the model is parameterised in terms of  $d$ and $\xi$ and with an explicit volume fraction for one phase, $\phi_a$, and contrast, $\delta\rho^2 = (\rho_a - \rho_b)^2$ : .. math:: I(q) = \frac{8\pi\phi_a(1-\phi_a)(\Delta\rho)^2c_2/\xi} {a_2 + c_1q^2 + c_2q^4} where :math:8\pi\phi_a(1-\phi_a)(\Delta\rho)^2c_2/\xi is the constant of proportionality from the first equation above. In the case of a microemulsion, $a_2 > 0$, $c_1 < 0$, and $c_2 >0$. For 2D data, scattering intensity is calculated in the same way as 1D, q = \sqrt{q_x^2 + q_y^2} References *J. Chem. Phys.*, 101 (1994) 5343 H Endo, M Mihailescu, M. Monkenbusch, J Allgaier, G Gompper, D Richter, B Jakobs, T Sottmann, R Strey, and I Grillo, *J. Chem. Phys.*, 115 (2001), 580 """ import numpy as np from numpy import inf from numpy import inf,power,pi name = "teubner_strey" title = "Teubner-Strey model of microemulsions" description = """\ Scattering model class for the Teubner-Strey model given by Provide F(x) = 1/( a2 + c1 q^2+  c2 q^4 ) + background a2>0, c1<0, c2>0, 4 a2 c2 - c1^2 > 0 Calculates scattering according to the Teubner-Strey model """ category = "shape-independent" #   ["name", "units", default, [lower, upper], "type","description"], parameters = [ ["a2", "", 0.1, [0, inf], "", "a2"], ["c1", "1e-6/Ang^2", -30., [-inf, 0], "", "c1"], ["c2", "Ang", 5000., [0, inf], "volume", "c2"], ["volfraction_a", "", 0.5, [0, 1.0], "", "Volume fraction of phase a"], ["sld_a", "1e-6/Ang^2", 0.3, [-inf, inf], "", "SLD of phase a"], ["sld_b", "1e-6/Ang^2", 6.3, [-inf, inf], "", "SLD of phase b"], ["d", "Ang", 100.0, [0, inf], "", "Domain size (periodicity)"], ["xi", "Ang", 30.0, [0, inf], "", "Correlation length"], ] def Iq(q, a2, c1, c2): def Iq(q, volfraction, sld, sld_solvent,d,xi): """SAS form""" return 1. / np.polyval([c2, c1, a2], q**2) drho2 = (sld-sld_solvent)*(sld-sld_solvent) a2 = power(1.0+power(2.0*pi*xi/d,2.0),2.0) c1 = -2.0*xi*xi*power(2.0*pi*xi/d,2.0)+2*xi*xi c2 = power(xi,4.0) prefactor = 8.0*pi*volfraction*(1.0-volfraction)*drho2*c2/xi #k2 = (2.0*pi/d)*(2.0*pi/d) #xi2 = 1/(xi*xi) #q2 = q*q #result = prefactor/((xi2+k2)*(xi2+k2)+2.0*(xi2-k2)*q2+q2*q2) return 1.0e-4*prefactor / np.polyval([c2, c1, a2], q**2) Iq.vectorized = True  # Iq accepts an array of q values demo = dict(scale=1, background=0, a2=0.1, c1=-30.0, c2=5000.0) tests = [[{}, 0.2, 0.145927536232]] demo = dict(scale=1, background=0, volfraction_a=0.5, sld_a=0.3, sld_b=6.3, d=100.0, xi=30.0) tests = [[{}, 0.06, 41.5918888453]]