source: sasmodels/sasmodels/models/bcc.py @ 754c454

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

Adding BCC paracrystal model

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