Changeset 14207bb in sasmodels


Ignore:
Timestamp:
Apr 7, 2017 4:57:41 AM (8 months ago)
Author:
richardh
Branches:
master, boltzmann, costrafo411, doc_update, generic_integration_loop, ticket-1043, ticket-786
Children:
1916c52
Parents:
15a90c1
Message:

doc changes and 2d test in parallelepipeds so will perhaps build

Location:
sasmodels/models
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/core_shell_parallelepiped.py

    r15a90c1 r14207bb  
    5151 
    5252    F_{a}(Q,\alpha,\beta)= 
    53     \left[\frac{\sin(Q(L_A+2t_A)/2\sin\alpha \sin\beta)}{Q(L_A+2t_A)/2\sin\alpha\sin\beta} 
    54     - \frac{\sin(QL_A/2\sin\alpha \sin\beta)}{QL_A/2\sin\alpha \sin\beta} \right] 
    55     \left[\frac{\sin(QL_B/2\sin\alpha \sin\beta)}{QL_B/2\sin\alpha \sin\beta} \right] 
    56     \left[\frac{\sin(QL_C/2\sin\alpha \sin\beta)}{QL_C/2\sin\alpha \sin\beta} \right] 
     53    \left[\frac{\tfrac{1}{2}\sin(Q(L_A+2t_A)\sin\alpha \sin\beta)}{\tfrac{1}{2}Q(L_A+2t_A)\sin\alpha\sin\beta} 
     54    - \frac{\sin(\tfrac{1}{2}QL_A\sin\alpha \sin\beta)}{\tfrac{1}{2}QL_A\sin\alpha \sin\beta} \right] 
     55    \left[\frac{\sin(\tfrac{1}{2}QL_B\sin\alpha \sin\beta)}{\tfrac{1}{2}QL_B\sin\alpha \sin\beta} \right] 
     56    \left[\frac{\sin(\tfrac{1}{2}QL_C\sin\alpha \sin\beta)}{\tfrac{1}{2}QL_C\sin\alpha \sin\beta} \right] 
    5757 
    5858.. note:: 
     
    120120 
    121121import numpy as np 
    122 from numpy import pi, inf, sqrt 
     122from numpy import pi, inf, sqrt, cos, sin 
    123123 
    124124name = "core_shell_parallelepiped" 
     
    194194            psi_pd=10, psi_pd_n=1) 
    195195 
    196 qx, qy = 0.2 * np.cos(2.5), 0.2 * np.sin(2.5) 
     196# rkh 7/4/17 add random unit test for 2d, note make all params different, 2d values not tested against other codes or models 
     197qx, qy = 0.2 * cos(pi/6.), 0.2 * sin(pi/6.) 
    197198tests = [[{}, 0.2, 0.533149288477], 
    198199         [{}, [0.2], [0.533149288477]], 
    199          [{'theta':10.0, 'phi':10.0}, (qx, qy), 0.032102135569], 
    200          [{'theta':10.0, 'phi':10.0}, [(qx, qy)], [0.032102135569]], 
     200         [{'theta':10.0, 'phi':20.0}, (qx, qy), 0.0853299803222], 
     201         [{'theta':10.0, 'phi':20.0}, [(qx, qy)], [0.0853299803222]], 
    201202        ] 
    202203del qx, qy  # not necessary to delete, but cleaner 
  • sasmodels/models/parallelepiped.py

    r15a90c1 r14207bb  
    174174 
    175175import numpy as np 
    176 from numpy import pi, inf, sqrt 
     176from numpy import pi, inf, sqrt, sin, cos 
    177177 
    178178name = "parallelepiped" 
     
    243243            phi_pd=10, phi_pd_n=1, 
    244244            psi_pd=10, psi_pd_n=10) 
    245  
    246 qx, qy = 0.2 * np.cos(2.5), 0.2 * np.sin(2.5) 
     245# rkh 7/4/17 add random unit test for 2d, note make all params different, 2d values not tested against other codes or models 
     246qx, qy = 0.2 * cos(pi/6.), 0.2 * sin(pi/6.) 
    247247tests = [[{}, 0.2, 0.17758004974], 
    248248         [{}, [0.2], [0.17758004974]], 
    249          [{'theta':10.0, 'phi':10.0}, (qx, qy), 0.00560296014], 
    250          [{'theta':10.0, 'phi':10.0}, [(qx, qy)], [0.00560296014]], 
     249         [{'theta':10.0, 'phi':20.0}, (qx, qy), 0.0089517140475], 
     250         [{'theta':10.0, 'phi':20.0}, [(qx, qy)], [0.0089517140475]], 
    251251        ] 
    252252del qx, qy  # not necessary to delete, but cleaner 
Note: See TracChangeset for help on using the changeset viewer.