Changeset 232bb12 in sasmodels


Ignore:
Timestamp:
Aug 4, 2017 1:21:11 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:
bb39b4a
Parents:
9f6823b
Message:

tuned random model generation for models

Location:
sasmodels
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/compare.py

    r9f6823b r232bb12  
    346346            pd_oriented.append(p.name) 
    347347        elif p.length_control is not None: 
    348             n = pars.get(p.length_control, 1) 
     348            n = int(pars.get(p.length_control, 1) + 0.5) 
    349349            pd_volume.extend(p.name+str(k+1) for k in range(n)) 
    350350        elif p.length > 1: 
  • sasmodels/models/mass_fractal.py

    r404ebbd r232bb12  
    2828.. math:: 
    2929 
    30     scale = scale\_factor \times NV^2(\rho_{particle} - \rho_{solvent})^2 
     30    scale = scale\_factor \times NV^2(\rho_\text{particle} - \rho_\text{solvent})^2 
    3131 
    3232.. math:: 
     
    3535 
    3636where $R$ is the radius of the building block, $D_m$ is the **mass** fractal 
    37 dimension, | \zeta\|  is the cut-off length, $\rho_{solvent}$ is the scattering 
    38 length density of the solvent, 
    39 and $\rho_{particle}$ is the scattering length density of particles. 
     37dimension, $\zeta$  is the cut-off length, $\rho_\text{solvent}$ is the scattering 
     38length density of the solvent, and $\rho_\text{particle}$ is the scattering 
     39length density of particles. 
    4040 
    4141.. note:: 
    4242 
    4343    The mass fractal dimension ( $D_m$ ) is only 
    44     valid if $0 < mass\_dim < 6$. It is also only valid over a limited 
     44    valid if $1 < mass\_dim < 6$. It is also only valid over a limited 
    4545    $q$ range (see the reference for details). 
    4646 
     
    9292    radius = 10**np.random.uniform(0.7, 4) 
    9393    cutoff_length = 10**np.random.uniform(0.7, 2)*radius 
     94    # TODO: fractal dimension should range from 1 to 5 
    9495    fractal_dim_mass = 2*np.random.beta(3, 4) + 1 
    9596    Vf = 10**np.random.uniform(-4, -1) 
  • sasmodels/models/mass_surface_fractal.py

    r404ebbd r232bb12  
    9191def random(): 
    9292    import numpy as np 
    93     fractal_dim = np.random.uniform(1, 6) 
     93    fractal_dim = np.random.uniform(0, 6) 
    9494    surface_portion = np.random.uniform(0, 1) 
    9595    fractal_dim_surf = fractal_dim*surface_portion 
  • sasmodels/models/porod.py

    r4962519 r232bb12  
    4545Iq.vectorized = True  # Iq accepts an array of q values 
    4646 
     47def random(): 
     48    import numpy as np 
     49    sld, solvent = np.random.uniform(-0.5, 12, size=2) 
     50    radius = 10**np.random.uniform(1, 4.7) 
     51    Vf = 10**np.random.uniform(-3, -1) 
     52    scale = 1e-4 * Vf * 2*np.pi*(sld-solvent)**2/(3*radius) 
     53    pars = dict( 
     54        scale=scale, 
     55    ) 
     56    return pars 
     57 
    4758demo = dict(scale=1.5, background=0.5) 
    4859 
Note: See TracChangeset for help on using the changeset viewer.