[d60b433] | 1 | # Note: model title and parameter table are inserted automatically |
---|
| 2 | r""" |
---|
[eb69cce] | 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. |
---|
[d60b433] | 9 | |
---|
[eb69cce] | 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. |
---|
[d60b433] | 13 | |
---|
[eb69cce] | 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. |
---|
[d60b433] | 18 | |
---|
[eb69cce] | 19 | For 2D data, the scattering intensity is calculated in the same way as 1D, |
---|
| 20 | where the $q$ vector is defined as |
---|
[d60b433] | 21 | |
---|
| 22 | .. math:: |
---|
| 23 | |
---|
[eb69cce] | 24 | q = \sqrt{q_x^2 + q_y^2} |
---|
[d60b433] | 25 | |
---|
[eb69cce] | 26 | .. figure:: img/HayterMSAsq_227.jpg |
---|
[d60b433] | 27 | |
---|
[eb69cce] | 28 | 1D plot using the default values (in linear scale). |
---|
[d60b433] | 29 | |
---|
[eb69cce] | 30 | References |
---|
| 31 | ---------- |
---|
[d60b433] | 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 | |
---|
[63b32bb] | 45 | from numpy import inf |
---|
[d60b433] | 46 | |
---|
[b7d432f] | 47 | source = ["HayterMSAsq_kernel.c"] |
---|
[d60b433] | 48 | |
---|
| 49 | name = "HayterMSAsq" |
---|
| 50 | title = "Hayter-Penfold MSA charged sphere interparticle S(Q) structure factor" |
---|
| 51 | description = """\ |
---|
[b7d432f] | 52 | [Hayter-Penfold MSA charged sphere interparticle S(Q) structure factor] |
---|
[d60b433] | 53 | Interparticle structure factor S(Q)for a charged hard spheres. |
---|
[ec2ca99] | 54 | Routine takes absolute value of charge, use HardSphere if charge |
---|
| 55 | goes to zero. |
---|
[b7d432f] | 56 | In sasview the effective radius will be calculated from the |
---|
| 57 | parameters used in P(Q). |
---|
[d60b433] | 58 | """ |
---|
[13ed84c] | 59 | single = False # double precision only for now |
---|
[ec2ca99] | 60 | |
---|
| 61 | # pylint: disable=bad-whitespace, line-too-long |
---|
[b7d432f] | 62 | # [ "name", "units", default, [lower, upper], "type", "description" ], |
---|
[ec2ca99] | 63 | parameters = [ |
---|
| 64 | ["effect_radius", "Ang", 20.75, [0, inf], "volume", "effective radius of hard sphere"], |
---|
| 65 | ["charge", "e", 19.0, [0, inf], "", "charge on sphere (in electrons)"], |
---|
| 66 | ["volfraction", "", 0.0192, [0, 0.74], "", "volume fraction of spheres"], |
---|
| 67 | ["temperature", "K", 318.16, [0, inf], "", "temperature, in Kelvin, for Debye length calculation"], |
---|
| 68 | ["saltconc", "M", 0.0, [-inf, inf], "", "conc of salt, 1:1 electolyte, for Debye length"], |
---|
| 69 | ["dielectconst", "", 71.08, [-inf, inf], "", "dielectric constant of solvent (default water), for Debye length"], |
---|
| 70 | ] |
---|
| 71 | # pylint: enable=bad-whitespace, line-too-long |
---|
[cd3dba0] | 72 | category = "structure-factor" |
---|
[d60b433] | 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. |
---|
[9f6f2f8] | 81 | return Iq(sqrt(qx*qx+qy*qy), IQ_PARAMETERS); |
---|
[d60b433] | 82 | """ |
---|
| 83 | # ER defaults to 0.0 |
---|
| 84 | # VR defaults to 1.0 |
---|
| 85 | |
---|
| 86 | oldname = 'HayterMSAStructure' |
---|
| 87 | oldpars = dict() |
---|
[ab87a12] | 88 | # default parameter set, use compare.sh -midQ -linear |
---|
[ec2ca99] | 89 | # note the calculation varies in different limiting cases so a wide range of |
---|
| 90 | # parameters will be required for a thorough test! |
---|
[ab87a12] | 91 | # odd that the default st has saltconc zero |
---|
[ec2ca99] | 92 | demo = dict(effect_radius=20.75, |
---|
| 93 | charge=19.0, |
---|
| 94 | volfraction=0.0192, |
---|
| 95 | temperature=318.16, |
---|
| 96 | saltconc=0.05, |
---|
| 97 | dielectconst=71.08, |
---|
| 98 | effect_radius_pd=0.1, |
---|
| 99 | effect_radius_pd_n=40) |
---|
[7f47777] | 100 | # |
---|
| 101 | # attempt to use same values as old sasview unit test |
---|
| 102 | tests = [ |
---|
[ec2ca99] | 103 | [{'scale': 1.0, |
---|
| 104 | 'background': 0.0, |
---|
| 105 | 'effect_radius': 20.75, |
---|
| 106 | 'charge': 19.0, |
---|
| 107 | 'volfraction': 0.0192, |
---|
| 108 | 'temperature': 298.0, |
---|
| 109 | 'saltconc': 0, |
---|
| 110 | 'dielectconst': 78.0, |
---|
| 111 | 'effect_radius_pd': 0}, |
---|
| 112 | [0.0010], [0.0712928]] |
---|
| 113 | ] |
---|
[d60b433] | 114 | |
---|