Changeset 4050e6a in sasmodels


Ignore:
Timestamp:
Mar 20, 2017 7:20:24 PM (7 years ago)
Author:
GitHub <noreply@…>
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
8267e0b, 1aa7990, 3a45c2c
Parents:
9f12fbe (diff), df89d77 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Paul Butler <butlerpd@…> (03/20/17 19:20:24)
git-committer:
GitHub <noreply@…> (03/20/17 19:20:24)
Message:

Merge pull request #36 from SasView?/ticket-877

added polydispersity back to fractal (as it used to be, as the

Location:
sasmodels/models
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/fractal.c

    r925ad6e r4788822  
    11#define INVALID(p) (p.fractal_dim < 0.0) 
     2 
     3 static double 
     4 form_volume(double radius) 
     5 { 
     6     return M_4PI_3 * cube(radius); 
     7 } 
    28 
    39static double 
     
    1319 
    1420    //calculate P(q) for the spherical subunits 
    15     const double V = M_4PI_3*cube(radius); 
    16     const double pq = V * square((sld_block-sld_solvent)*sas_3j1x_x(q*radius)); 
     21    const double pq = square(form_volume(radius) * (sld_block-sld_solvent) 
     22                      *sas_3j1x_x(q*radius)); 
    1723 
    1824    // scale to units cm-1 sr-1 (assuming data on absolute scale) 
  • sasmodels/models/fractal.py

    r925ad6e rdf89d77  
    2020.. math:: 
    2121 
    22     P(q)&= F(qR_0)^2 
    23  
    24     F(q)&= \frac{3 (\sin x - x \cos x)}{x^3} 
    25  
    26     V_\text{particle} &= \frac{4}{3}\ \pi R_0 
    27  
     22    P(q)&= F(qR_0)^2 \\ 
     23    F(q)&= \frac{3 (\sin x - x \cos x)}{x^3} \\ 
     24    V_\text{particle} &= \frac{4}{3}\ \pi R_0 \\ 
    2825    S(q) &= 1 + \frac{D_f\  \Gamma\!(D_f-1)}{[1+1/(q \xi)^2\  ]^{(D_f -1)/2}} 
    2926    \frac{\sin[(D_f-1) \tan^{-1}(q \xi) ]}{(q R_0)^{D_f}} 
     
    3229is the fractal dimension, representing the self similarity of the structure.  
    3330Note that S(q) here goes negative if $D_f$ is too large, and the Gamma function  
    34 diverges at $D_f$=0 and $D_f$=1.   
     31diverges at $D_f=0$ and $D_f=1$. 
    3532 
    3633**Polydispersity on the radius is provided for.** 
     
    4744---------- 
    4845 
    49 J Teixeira, *J. Appl. Cryst.*, 21 (1988) 781-785 
     46.. [#] J Teixeira, *J. Appl. Cryst.*, 21 (1988) 781-785 
    5047 
    51 **Author:** NIST IGOR/DANSE **on:** pre 2010 
     48Authorship and Verification 
     49---------------------------- 
    5250 
    53 **Last Modified by:** Paul Butler **on:** March 20, 2016 
    54  
    55 **Last Reviewed by:** Paul Butler **on:** March 20, 2016 
     51* **Author:** NIST IGOR/DANSE **Date:** pre 2010 
     52* **Converted to sasmodels by:** Paul Butler **Date:** March 19, 2016 
     53* **Last Modified by:** Paul Butler **Date:** March 12, 2017 
     54* **Last Reviewed by:** Paul Butler **Date:** March 12, 2017 
    5655 
    5756""" 
     
    8483parameters = [["volfraction", "", 0.05, [0.0, 1], "", 
    8584               "volume fraction of blocks"], 
    86               ["radius",    "Ang",  5.0, [0.0, inf], "", 
     85              ["radius",    "Ang",  5.0, [0.0, inf], "volume", 
    8786               "radius of particles"], 
    8887              ["fractal_dim",      "",  2.0, [0.0, 6.0], "", 
Note: See TracChangeset for help on using the changeset viewer.