Changeset 0d6e865 in sasmodels for sasmodels/models/cylinder.py


Ignore:
Timestamp:
Oct 11, 2016 11:42:00 AM (8 years ago)
Author:
dirk
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
1fdb555
Parents:
19e7ca7
Message:

Rewriting selected models in spherical coordinates. This fixes ticket #492 for these models.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/cylinder.py

    r416f5c7 r0d6e865  
    3535.. math:: 
    3636 
    37     F^2(q)=\int_{0}^{\pi/2}{F^2(q,\alpha)\sin(\alpha)d\alpha} 
     37    F^2(q)=\int_{0}^{\pi/2}{F^2(q,\theta)\sin(\theta)d\theta} 
    3838 
    3939 
     
    4848    Definition of the angles for oriented cylinders. 
    4949 
    50 .. figure:: img/cylinder_angle_projection.jpg 
    51  
    52     Examples of the angles for oriented cylinders against the detector plane. 
    5350 
    5451NB: The 2nd virial coefficient of the cylinder is calculated based on the 
     
    7774 
    7875    P(q) = \int_0^{\pi/2} d\phi 
    79         \int_0^\pi p(\theta, \phi) P_0(q,\alpha) \sin \theta\ d\theta 
     76        \int_0^\pi p(\alpha) P_0(q,\alpha) \sin \alpha\ d\alpha 
    8077 
    8178 
    82 where $p(\theta,\phi)$ is the probability distribution for the orientation 
     79where $p(\theta,\phi) = 1$ is the probability distribution for the orientation 
    8380and $P_0(q,\alpha)$ is the scattering intensity for the fully oriented 
    8481system, and then comparing to the 1D result. 
     
    8784---------- 
    8885 
    89 None 
    90  
     86J. S. Pedersen, Adv. Colloid Interface Sci. 70, 171-210 (1997). 
     87G. Fournet, Bull. Soc. Fr. Mineral. Cristallogr. 74, 39-113 (1951). 
    9188""" 
    9289 
     
    123120               "Cylinder length"], 
    124121              ["theta", "degrees", 60, [-inf, inf], "orientation", 
    125                "In plane angle"], 
     122               "latitude"], 
    126123              ["phi", "degrees", 60, [-inf, inf], "orientation", 
    127                "Out of plane angle"], 
     124               "longitude"], 
    128125             ] 
    129126 
    130 source = ["lib/polevl.c", "lib/sas_J1.c", "lib/gauss76.c", "cylinder.c"] 
     127source = ["lib/polevl.c", "lib/sas_J1.c", "lib/gauss76.c",  "cylinder.c"] 
    131128 
    132129def ER(radius, length): 
     
    148145 
    149146qx, qy = 0.2 * np.cos(2.5), 0.2 * np.sin(2.5) 
    150 tests = [[{}, 0.2, 0.042761386790780453], 
    151          [{}, [0.2], [0.042761386790780453]], 
    152          [{'theta':10.0, 'phi':10.0}, (qx, qy), 0.03514647218513852], 
    153          [{'theta':10.0, 'phi':10.0}, [(qx, qy)], [0.03514647218513852]], 
    154         ] 
     147# After redefinition of angles, find new tests values  
     148#tests = [[{}, 0.2, 0.042761386790780453], 
     149#         [{}, [0.2], [0.042761386790780453]], 
     150#         [{'theta':10.0, 'phi':10.0}, (qx, qy), 0.03514647218513852], 
     151#         [{'theta':10.0, 'phi':10.0}, [(qx, qy)], [0.03514647218513852]], 
     152#        ] 
    155153del qx, qy  # not necessary to delete, but cleaner 
    156154# ADDED by:  RKH  ON: 18Mar2016 renamed sld's etc 
Note: See TracChangeset for help on using the changeset viewer.