[5c1d341] | 1 | r""" |
---|
| 2 | Calculates the scattering from fractal-like aggregates based on |
---|
| 3 | the Mildner reference. |
---|
| 4 | |
---|
| 5 | Definition |
---|
| 6 | ---------- |
---|
| 7 | |
---|
| 8 | The scattering intensity $I(q)$ is calculated as |
---|
| 9 | |
---|
| 10 | .. math:: |
---|
| 11 | |
---|
| 12 | I(q) = scale \times P(q)S(q) + background |
---|
| 13 | |
---|
| 14 | .. math:: |
---|
| 15 | |
---|
| 16 | P(q) = F(qR)^2 |
---|
| 17 | |
---|
| 18 | .. math:: |
---|
| 19 | |
---|
| 20 | F(x) = \frac{3\left[sin(x)-xcos(x)\right]}{x^3} |
---|
| 21 | |
---|
| 22 | .. math:: |
---|
| 23 | |
---|
| 24 | S(q) = \frac{\Gamma(D_m-1)\zeta^{D_m-1}}{\left[1+(q\zeta)^2 |
---|
| 25 | \right]^{(D_m-1)/2}} |
---|
| 26 | \frac{sin\left[(D_m - 1) tan^{-1}(q\zeta) \right]}{q} |
---|
| 27 | |
---|
| 28 | .. math:: |
---|
| 29 | |
---|
| 30 | scale = scale\_factor \times NV^2(\rho_{particle} - \rho_{solvent})^2 |
---|
| 31 | |
---|
| 32 | .. math:: |
---|
| 33 | |
---|
| 34 | V = \frac{4}{3}\pi R^3 |
---|
| 35 | |
---|
| 36 | where $R$ is the radius of the building block, $D_m$ is the **mass** fractal |
---|
| 37 | dimension,$\zeta$ is the cut-off length, $\rho_{solvent}$ is the scattering |
---|
| 38 | length density of the solvent, |
---|
| 39 | and $\rho_{particle}$ is the scattering length density of particles. |
---|
| 40 | |
---|
| 41 | .. note:: |
---|
| 42 | |
---|
| 43 | The mass fractal dimension ( $D_m$ ) is only |
---|
| 44 | valid if $0 < mass_dim < 6$. It is also only valid over a limited |
---|
| 45 | $q$ range (see the reference for details). |
---|
| 46 | |
---|
| 47 | .. figure:: img/mass_fractal_1d.jpg |
---|
| 48 | |
---|
| 49 | 1D plot using the default values. |
---|
| 50 | |
---|
| 51 | Reference |
---|
| 52 | --------- |
---|
| 53 | |
---|
| 54 | D Mildner and P Hall, *J. Phys. D: Appl. Phys.*, 19 (1986) 1535-1545 Equation(9) |
---|
| 55 | |
---|
| 56 | |
---|
| 57 | """ |
---|
| 58 | |
---|
| 59 | from numpy import inf |
---|
| 60 | |
---|
| 61 | name = "mass_fractal" |
---|
| 62 | title = "Mass Fractal model" |
---|
| 63 | description = """ |
---|
| 64 | The scattering intensity I(x) = scale*P(x)*S(x) + background, where |
---|
| 65 | scale = scale_factor * V * delta^(2) |
---|
| 66 | p(x)= F(x*radius)^(2) |
---|
| 67 | F(x) = 3*[sin(x)-x cos(x)]/x**3 |
---|
| 68 | S(x) = [(gamma(Dm-1)*colength^(Dm-1)*[1+(x^2*colength^2)]^((1-Dm)/2) |
---|
| 69 | * sin[(Dm-1)*arctan(x*colength)])/x] |
---|
| 70 | where delta = sldParticle -sldSolv. |
---|
| 71 | radius = Particle radius |
---|
| 72 | mass_dim = Mass fractal dimension |
---|
| 73 | cutoff_length = Cut-off length |
---|
| 74 | background = background |
---|
| 75 | Ref.:Mildner, Hall,J Phys D Appl Phys(1986), 9, 1535-1545 |
---|
| 76 | Note I: This model is valid for 1<mass_dim<6. |
---|
| 77 | Note II: This model is not in absolute scale. |
---|
| 78 | """ |
---|
| 79 | category = "shape-independent" |
---|
| 80 | |
---|
| 81 | # ["name", "units", default, [lower, upper], "type","description"], |
---|
| 82 | parameters = [["radius", "Ang", 10.0, [0.0, inf], "", |
---|
| 83 | "Particle radius"], |
---|
| 84 | ["mass_dim", "", 1.9, [1.0, 6.0], "", |
---|
| 85 | "Mass fractal dimension"], |
---|
| 86 | ["cutoff_length", "Ang", 100.0, [0.0, inf], "", |
---|
| 87 | "Cut-off length"], |
---|
| 88 | ] |
---|
| 89 | |
---|
| 90 | |
---|
| 91 | source = ["lib/J1c.c", "lib/lanczos_gamma.c", "mass_fractal.c"] |
---|
| 92 | |
---|
| 93 | demo = dict(scale=1, background=0, |
---|
| 94 | radius=10.0, |
---|
| 95 | mass_dim=1.9, |
---|
| 96 | cutoff_length=2.3) |
---|
| 97 | |
---|
| 98 | oldname = 'MassFractalModel' |
---|
| 99 | oldpars = dict(radius='radius', |
---|
| 100 | mass_dim='mass_dim', |
---|
| 101 | cutoff_length='co_length') |
---|
| 102 | |
---|
| 103 | tests = [[{'radius': 2.0, |
---|
| 104 | 'mass_dim': 3.3, |
---|
| 105 | 'cutoff_length': 1.0, |
---|
[9eaadb3] | 106 | }, 0.001, 2.68342996226], |
---|
[5c1d341] | 107 | |
---|
| 108 | [{'radius': 1.0, |
---|
| 109 | 'mass_dim': 1.3, |
---|
| 110 | 'cutoff_length': 1.0, |
---|
| 111 | 'background': 0.8, |
---|
[9eaadb3] | 112 | }, 0.001, 1.69747015932], |
---|
[5c1d341] | 113 | |
---|
| 114 | [{'radius': 1.0, |
---|
| 115 | 'mass_dim': 2.3, |
---|
| 116 | 'cutoff_length': 1.0, |
---|
| 117 | 'scale': 10.0, |
---|
[9eaadb3] | 118 | }, 0.051, 11.6258202095], |
---|
[5c1d341] | 119 | ] |
---|