source: sasmodels/sasmodels/models/bcc.py @ c95dc908

core_shell_microgelscostrafo411magnetic_modelrelease_v0.94release_v0.95ticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since c95dc908 was c95dc908, checked in by ajj, 9 years ago

Fixes to bcc paracrystal model

Note - this model requires calculation using double precision

  • Property mode set to 100644
File size: 4.8 KB
Line 
1#bcc paracrystal model
2#note model title and parameter table are automatically inserted
3#note - calculation requires double precision
4"""
5Calculates the scattering from a **body-centered cubic lattice** with paracrystalline distortion. Thermal vibrations
6are considered to be negligible, and the size of the paracrystal is infinitely large. Paracrystalline distortion is
7assumed to be isotropic and characterized by a Gaussian distribution.
8
9The returned value is scaled to units of |cm^-1|\ |sr^-1|, absolute scale.
10
11Definition
12----------
13
14The scattering intensity *I(q)* is calculated as
15
16.. image:: img/image167.jpg
17
18where *scale* is the volume fraction of spheres, *Vp* is the volume of the primary particle, *V(lattice)* is a volume
19correction for the crystal structure, *P(q)* is the form factor of the sphere (normalized), and *Z(q)* is the
20paracrystalline structure factor for a body-centered cubic structure.
21
22Equation (1) of the 1990 reference is used to calculate *Z(q)*, using equations (29)-(31) from the 1987 paper for
23*Z1*\ , *Z2*\ , and *Z3*\ .
24
25The lattice correction (the occupied volume of the lattice) for a body-centered cubic structure of particles of radius
26*R* and nearest neighbor separation *D* is
27
28.. image:: img/image159.jpg
29
30The distortion factor (one standard deviation) of the paracrystal is included in the calculation of *Z(q)*
31
32.. image:: img/image160.jpg
33
34where *g* is a fractional distortion based on the nearest neighbor distance.
35
36The body-centered cubic lattice is
37
38.. image:: img/image168.jpg
39
40For a crystal, diffraction peaks appear at reduced q-values given by
41
42.. image:: img/image162.jpg
43
44where for a body-centered cubic lattice, only reflections where (\ *h* + *k* + *l*\ ) = even are allowed and
45reflections where (\ *h* + *k* + *l*\ ) = odd are forbidden. Thus the peak positions correspond to (just the first 5)
46
47.. image:: img/image169.jpg
48
49**NB: The calculation of** *Z(q)* **is a double numerical integral that must be carried out with a high density of**
50**points to properly capture the sharp peaks of the paracrystalline scattering.** So be warned that the calculation is
51SLOW. Go get some coffee. Fitting of any experimental data must be resolution smeared for any meaningful fit. This
52makes a triple integral. Very, very slow. Go get lunch!
53
54This example dataset is produced using 200 data points, *qmin* = 0.001 |Ang^-1|, *qmax* = 0.1 |Ang^-1| and the above
55default values.
56
57.. image:: img/image170.jpg
58
59*Figure. 1D plot in the linear scale using the default values (w/200 data point).*
60
61The 2D (Anisotropic model) is based on the reference below where *I(q)* is approximated for 1d scattering. Thus the
62scattering pattern for 2D may not be accurate. Note that we are not responsible for any incorrectness of the 2D model
63computation.
64
65.. image:: img/image165.gif
66
67.. image:: img/image171.jpg
68
69*Figure. 2D plot using the default values (w/200X200 pixels).*
70
71REFERENCE
72
73Hideki Matsuoka et. al. *Physical Review B*, 36 (1987) 1754-1765
74(Original Paper)
75
76Hideki Matsuoka et. al. *Physical Review B*, 41 (1990) 3854 -3856
77(Corrections to FCC and BCC lattice structure calculation)
78"""
79
80from numpy import pi, inf
81
82name = "BCCparacrystal"
83title = "Body-centred cubic lattic with paracrystalline distortion"
84description = """
85    Calculates the scattering from a **body-centered cubic lattice** with paracrystalline distortion. Thermal vibrations
86    are considered to be negligible, and the size of the paracrystal is infinitely large. Paracrystalline distortion is
87    assumed to be isotropic and characterized by a Gaussian distribution.
88    """
89
90parameters = [
91#   [ "name", "units", default, [lower, upper], "type","description" ],
92    [ "dnn", "Ang", 220, [-inf,inf],"","Nearest neighbour distance"],
93    [ "d_factor", "", 0.06,[-inf,inf],"","Paracrystal distortion factor" ],
94    [ "radius", "Ang",  40, [0, inf], "volume","Particle radius" ],
95    [ "sld", "1e-6/Ang^2", 4, [-inf,inf], "", "Particle scattering length density" ],
96    [ "solvent_sld", "1e-6/Ang^2", 1, [-inf,inf], "","Solvent scattering length density" ],
97    [ "theta", "degrees", 60, [-inf, inf], "orientation","In plane angle" ],
98    [ "phi", "degrees", 60, [-inf, inf], "orientation","Out of plane angle" ],
99    [ "psi", "degrees", 60, [-inf,inf], "orientation","Out of plane angle"]
100    ]
101
102source = [ "lib/J1.c", "lib/gauss150.c", "bcc.c" ]
103
104def ER(radius, length):
105    return 0
106
107# parameters for demo
108demo = dict(
109    scale=1, background=0,
110    dnn=220, d_factor=0.06, sld=4, solvent_sld=1,
111    radius=40,
112    theta=60, phi=60, psi=60,
113    radius_pd=.2, radius_pd_n=0.2,
114    theta_pd=15, theta_pd_n=0,
115    phi_pd=15, phi_pd_n=0,
116    psi_pd=15, psi_pd_n=0,
117    )
118
119# For testing against the old sasview models, include the converted parameter
120# names and the target sasview model name.
121oldname='BCCrystalModel'
122oldpars=dict(sld='sldSph',
123             solvent_sld='sldSolv')
Note: See TracBrowser for help on using the repository browser.