Ignore:
Timestamp:
Aug 1, 2017 4:38:47 PM (7 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
1511c37c
Parents:
d49ca5c
Message:

tuned random model generation for more models

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/core_shell_ellipsoid.py

    r9802ab3 r31df0c9  
    2525ellipsoid. This may have some undesirable effects if the aspect ratio of the 
    2626ellipsoid is large (ie, if $X << 1$ or $X >> 1$ ), when the $S(q)$ 
    27 - which assumes spheres - will not in any case be valid.  Generating a  
    28 custom product model will enable separate effective volume fraction and effective  
     27- which assumes spheres - will not in any case be valid.  Generating a 
     28custom product model will enable separate effective volume fraction and effective 
    2929radius in the $S(q)$. 
    3030 
     
    4444 
    4545.. math:: 
    46     \begin{align}     
     46    \begin{align} 
    4747    F(q,\alpha) = &f(q,radius\_equat\_core,radius\_equat\_core.x\_core,\alpha) \\ 
    4848    &+ f(q,radius\_equat\_core + thick\_shell,radius\_equat\_core.x\_core + thick\_shell.x\_polar\_shell,\alpha) 
    49     \end{align}  
     49    \end{align} 
    5050 
    5151where 
    52   
     52 
    5353.. math:: 
    5454 
     
    7777   F^2(q)=\int_{0}^{\pi/2}{F^2(q,\alpha)\sin(\alpha)d\alpha} 
    7878 
    79 For oriented ellipsoids the *theta*, *phi* and *psi* orientation parameters will appear when fitting 2D data,  
     79For oriented ellipsoids the *theta*, *phi* and *psi* orientation parameters will appear when fitting 2D data, 
    8080see the :ref:`elliptical-cylinder` model for further information. 
    8181 
     
    151151    return ellipsoid_ER(polar_outer, equat_outer) 
    152152 
    153  
    154 demo = dict(scale=0.05, background=0.001, 
    155             radius_equat_core=20.0, 
    156             x_core=3.0, 
    157             thick_shell=30.0, 
    158             x_polar_shell=1.0, 
    159             sld_core=2.0, 
    160             sld_shell=1.0, 
    161             sld_solvent=6.3, 
    162             theta=0, 
    163             phi=0) 
     153def random(): 
     154    import numpy as np 
     155    V = 10**np.random.uniform(5, 12) 
     156    radius_polar = 10**np.random.uniform(1.3, 4) 
     157    radius_equatorial = np.sqrt(V/radius_polar) # ignore 4/3 pi 
     158    thickness_polar = np.random.uniform(0.01, 1)*radius_polar 
     159    thickness_equatorial = np.random.uniform(0.01, 1)*radius_equatorial 
     160    radius_polar -= thickness_polar 
     161    radius_equatorial -= thickness_equatorial 
     162    x_core = radius_polar/radius_equatorial 
     163    x_polar_shell = thickness_polar/thickness_equatorial 
     164    pars = dict( 
     165        #background=0, sld=0, sld_solvent=1, 
     166        radius_equat_core=radius_equatorial, 
     167        x_core=x_core, 
     168        thick_shell=thickness_equatorial, 
     169        x_polar_shell=x_polar_shell, 
     170    ) 
     171    return pars 
    164172 
    165173q = 0.1 
Note: See TracChangeset for help on using the changeset viewer.