Changeset e481a39 in sasmodels for sasmodels/models/binary_hard_sphere.py


Ignore:
Timestamp:
Mar 20, 2016 7:06:10 AM (8 years ago)
Author:
butler
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
3f12f59
Parents:
dff1088
Message:

cleanup of binary hard sphere model - now passes tests and docs works.
also removed some compilser warnings.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/binary_hard_sphere.py

    r115d0f0 re481a39  
    11r""" 
    22 
     3Definition 
     4---------- 
    35The binary hard sphere model provides the scattering intensity, for binary 
    46mixture of hard spheres including hard sphere interaction between those 
    57particles, using rhw Percus-Yevick closure. The calculation is an exact 
    68multi-component solution that properly accounts for the 3 partial structure 
    7 factors. 
    8  
    9 Definition 
    10 ---------- 
     9factors as follows: 
    1110 
    1211.. math:: 
    1312 
    1413    \begin{eqnarray} 
    15     I(q) = (1-x)f_1^2(q) S_{11}(q) + 2[x(1-x)]^{1/2} f_1(q)f_2(q)S_{12}(q) + \\ 
    16     x\,f_2^2(q)S_{22}(q) \\ 
     14    I(q) = (1-x)f_1^2(q) S_{11}(q) + 2[x(1-x)]^{1/2} f_1(q)f_2(q)S_{12}(q) + 
     15    x\,f_2^2(q)S_{22}(q) 
    1716    \end{eqnarray} 
    1817 
     
    2625 
    2726    \begin{eqnarray} 
    28     x &=& \frac{(\phi_2 / \phi)\alpha^3}{(1-(\phi_2/\phi) + (\phi_2/\phi) \\ 
    29     \alpha^3)} \phi &=& \phi_1 + \phi_2 = \text{total volume fraction} \\ 
     27    x &=& \frac{(\phi_2 / \phi)\alpha^3}{(1-(\phi_2/\phi) + (\phi_2/\phi) 
     28    \alpha^3)} \\ 
     29    \phi &=& \phi_1 + \phi_2 = \text{total volume fraction} \\ 
    3030    \alpha &=& R_1/R_2 = \text{size ratio} 
    3131    \end{eqnarray} 
     
    6969**Author:** N/A **on:** 
    7070 
    71 **Modified by:** Paul Butler **on:** March 18, 2016 
     71**Last Modified by:** Paul Butler **on:** March 20, 2016 
    7272 
    73 **Reviewed by:** Paul Butler **on:** March 18, 2016 
     73**Last Reviewed by:** Paul Butler **on:** March 20, 2016 
    7474""" 
    7575 
    76 import numpy as np 
    77 from numpy import pi, inf 
     76from numpy import inf 
     77 
     78category = "shape:sphere" 
     79single = False  # double precision only! 
    7880 
    7981name = "binary_hard_sphere" 
     
    9092        sld_solvent: solvent scattering length density. 
    9193""" 
    92 category = "shape:sphere" 
    93  
    9494#             ["name", "units", default, [lower, upper], "type", "description"], 
    9595parameters = [["radius_lg", "Ang", 100, [0, inf], "", 
     
    112112 
    113113# parameters for demo and documentation 
    114 demo = dict(scale=1, background=0, 
    115             sld_lg=3.5, sld_sm=0.5, sld_solvent=6.36, 
     114demo = dict(sld_lg=3.5, sld_sm=0.5, sld_solvent=6.36, 
    116115            radius_lg=100, radius_sm=20, 
    117116            volfraction_lg=0.1, volfraction_sm=0.2) 
     
    125124 
    126125# NOTE: test results taken from values returned by SasView 3.1.2 
    127 tests = [[{'scale':1.0}, 0.001, 25.8927262013]] 
     126tests = [[{}, 0.001, 25.8927262013]] 
    128127 
Note: See TracChangeset for help on using the changeset viewer.