source: sasmodels/sasmodels/models/fcc.py @ 3e428ec

core_shell_microgelscostrafo411magnetic_modelrelease_v0.94release_v0.95ticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since 3e428ec was 3e428ec, checked in by Doucet, Mathieu <doucetm@…>, 9 years ago

Cleaning up

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