1 | # Note: model title and parameter table are inserted automatically |
---|
2 | r""" |
---|
3 | This calculates the structure factor (the Fourier transform of the pair |
---|
4 | correlation function $g(r)$) for a system of charged, spheroidal objects |
---|
5 | in a dielectric medium. When combined with an appropriate form factor |
---|
6 | (such as sphere, core+shell, ellipsoid, etc), this allows for inclusion |
---|
7 | of the interparticle interference effects due to screened coulomb repulsion |
---|
8 | between charged particles. |
---|
9 | |
---|
10 | **This routine only works for charged particles**. If the charge is set to |
---|
11 | zero the routine will self-destruct! For non-charged particles use a hard |
---|
12 | sphere potential. |
---|
13 | |
---|
14 | The salt concentration is used to compute the ionic strength of the solution |
---|
15 | which in turn is used to compute the Debye screening length. At present |
---|
16 | there is no provision for entering the ionic strength directly nor for use |
---|
17 | of any multivalent salts. The counterions are also assumed to be monovalent. |
---|
18 | |
---|
19 | For 2D data, the scattering intensity is calculated in the same way as 1D, |
---|
20 | where the $q$ vector is defined as |
---|
21 | |
---|
22 | .. math:: |
---|
23 | |
---|
24 | q = \sqrt{q_x^2 + q_y^2} |
---|
25 | |
---|
26 | .. figure:: img/HayterMSAsq_227.jpg |
---|
27 | |
---|
28 | 1D plot using the default values (in linear scale). |
---|
29 | |
---|
30 | References |
---|
31 | ---------- |
---|
32 | |
---|
33 | J B Hayter and J Penfold, *Molecular Physics*, 42 (1981) 109-118 |
---|
34 | |
---|
35 | J P Hansen and J B Hayter, *Molecular Physics*, 46 (1982) 651-656 |
---|
36 | """ |
---|
37 | |
---|
38 | # dp[0] = 2.0*effect_radius(); |
---|
39 | # dp[1] = fabs(charge()); |
---|
40 | # dp[2] = volfraction(); |
---|
41 | # dp[3] = temperature(); |
---|
42 | # dp[4] = saltconc(); |
---|
43 | # dp[5] = dielectconst(); |
---|
44 | |
---|
45 | from numpy import inf |
---|
46 | |
---|
47 | source = ["HayterMSAsq_kernel.c"] |
---|
48 | |
---|
49 | name = "HayterMSAsq" |
---|
50 | title = "Hayter-Penfold MSA charged sphere interparticle S(Q) structure factor" |
---|
51 | description = """\ |
---|
52 | [Hayter-Penfold MSA charged sphere interparticle S(Q) structure factor] |
---|
53 | Interparticle structure factor S(Q)for a charged hard spheres. |
---|
54 | Routine takes absolute value of charge, use HardSphere if charge goes to zero. |
---|
55 | In sasview the effective radius will be calculated from the |
---|
56 | parameters used in P(Q). |
---|
57 | """ |
---|
58 | # [ "name", "units", default, [lower, upper], "type", "description" ], |
---|
59 | parameters = [["effect_radius", "Ang", 20.75, [0, inf], "volume", |
---|
60 | "effective radius of hard sphere"], |
---|
61 | ["charge", "e", 19.0, [0, inf], "", |
---|
62 | "charge on sphere (in electrons)"], |
---|
63 | ["volfraction", "", 0.0192, [0, 0.74], "", |
---|
64 | "volume fraction of spheres"], |
---|
65 | ["temperature", "K", 318.16, [0, inf], "", |
---|
66 | "temperature, in Kelvin, for Debye length calculation"], |
---|
67 | ["saltconc", "M", 0.0, [-inf, inf], "", |
---|
68 | "conc of salt, 1:1 electolyte, for Debye length"], |
---|
69 | ["dielectconst", "", 71.08, [-inf, inf], "", |
---|
70 | "dielectric constant of solvent (default water), for Debye length"], |
---|
71 | ] |
---|
72 | category = "structure-factor" |
---|
73 | |
---|
74 | # No volume normalization despite having a volume parameter |
---|
75 | # This should perhaps be volume normalized? |
---|
76 | form_volume = """ |
---|
77 | return 1.0; |
---|
78 | """ |
---|
79 | Iqxy = """ |
---|
80 | // never called since no orientation or magnetic parameters. |
---|
81 | return Iq(sqrt(qx*qx+qy*qy), IQ_PARAMETERS); |
---|
82 | """ |
---|
83 | # ER defaults to 0.0 |
---|
84 | # VR defaults to 1.0 |
---|
85 | |
---|
86 | oldname = 'HayterMSAStructure' |
---|
87 | oldpars = dict() |
---|
88 | # default parameter set, use compare.sh -midQ -linear |
---|
89 | # note the calculation varies in different limiting cases so a wide range of parameters will be required for a thorough test! |
---|
90 | # odd that the default st has saltconc zero |
---|
91 | demo = dict(effect_radius = 20.75,charge=19.0,volfraction = 0.0192,temperature=318.16,saltconc=0.05,dielectconst=71.08,effect_radius_pd = 0.1,effect_radius_pd_n = 40) |
---|
92 | |
---|