Changeset d49ca5c in sasmodels


Ignore:
Timestamp:
Jul 31, 2017 6:00:13 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:
31df0c9
Parents:
109d963
Message:

tuned random model generation for core_shell_sphere

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/core_shell_sphere.py

    r925ad6e rd49ca5c  
    5757title = "Form factor for a monodisperse spherical particle with particle with a core-shell structure." 
    5858description = """ 
    59     F^2(q) = 3/V_s [V_c (sld_core-sld_shell) (sin(q*radius)-q*radius*cos(q*radius))/(q*radius)^3  
     59    F^2(q) = 3/V_s [V_c (sld_core-sld_shell) (sin(q*radius)-q*radius*cos(q*radius))/(q*radius)^3 
    6060                   + V_s (sld_shell-sld_solvent) (sin(q*r_s)-q*r_s*cos(q*r_s))/(q*r_s)^3] 
    6161 
     
    9999    return whole, whole - core 
    100100 
     101def random(): 
     102    import numpy as np 
     103    total_radius = 10**np.random.uniform(1.3, 4.3) 
     104    radius = np.random.uniform(0, 1)*total_radius 
     105    thickness = total_radius - radius 
     106    Vf = 10**np.random.uniform(4, 6)/total_radius**3 
     107    pars = dict( 
     108        scale=Vf, 
     109        radius=radius, 
     110        thickness=thickness, 
     111    ) 
     112    return pars 
     113 
    101114tests = [ 
    102115    [{'radius': 20.0, 'thickness': 10.0}, 'ER', 30.0], 
Note: See TracChangeset for help on using the changeset viewer.