Changeset 64eecf7 in sasmodels for sasmodels/models/multilayer_vesicle.py


Ignore:
Timestamp:
Sep 5, 2017 11:40:09 AM (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:
30b60d2
Parents:
a53bf6b (diff), 142a8e2 (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.
Message:

Merge branch 'master' into ticket-510

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/multilayer_vesicle.py

    r2e0c0b0 r64eecf7  
    7171  sufficiently fine grained in certain cases. Please report any such occurences 
    7272  to the SasView team. Generally, for the best possible experience: 
    73  * Start with the best possible guess 
    74  * Using a priori knowledge, hold as many parameters fixed as possible 
    75  * if N=1, tw (water thickness) must by definition be zero. Both N and tw should 
     73 
     74 - Start with the best possible guess 
     75 - Using a priori knowledge, hold as many parameters fixed as possible 
     76 - if N=1, tw (water thickness) must by definition be zero. Both N and tw should 
    7677   be fixed during fitting. 
    77  * If N>1, use constraints to keep N > 1 
    78  * Because N only really moves in integer steps, it may get "stuck" if the 
     78 - If N>1, use constraints to keep N > 1 
     79 - Because N only really moves in integer steps, it may get "stuck" if the 
    7980   optimizer step size is too small so care should be taken 
    8081   If you experience problems with this please contact the SasView team and let 
     
    149150    return radius + n_shells * (thick_shell + thick_solvent) - thick_solvent 
    150151 
    151 demo = dict(scale=1, background=0, 
    152             volfraction=0.05, 
    153             radius=60.0, 
    154             thick_shell=10.0, 
    155             thick_solvent=10.0, 
    156             sld_solvent=6.4, 
    157             sld=0.4, 
    158             n_shells=2.0) 
     152def random(): 
     153    import numpy as np 
     154    volfraction = 10**np.random.uniform(-3, -0.5)  # scale from 0.1% to 30% 
     155    radius = 10**np.random.uniform(0, 2.5) # core less than 300 A 
     156    total_thick = 10**np.random.uniform(2, 4) # up to 10000 A of shells 
     157    # random number of shells, with shell+solvent thickness > 10 A 
     158    n_shells = int(10**np.random.uniform(0, np.log10(total_thick)-1)+0.5) 
     159    # split total shell thickness with preference for shell over solvent; 
     160    # make sure that shell thickness is at least 1 A 
     161    one_thick = total_thick/n_shells 
     162    thick_solvent = 10**np.random.uniform(-2, 0)*(one_thick - 1) 
     163    thick_shell = one_thick - thick_solvent 
     164    pars = dict( 
     165        scale=1, 
     166        volfraction=volfraction, 
     167        radius=radius, 
     168        thick_shell=thick_shell, 
     169        thick_solvent=thick_solvent, 
     170        n_shells=n_shells, 
     171    ) 
     172    return pars 
    159173 
    160174tests = [ 
Note: See TracChangeset for help on using the changeset viewer.