Changeset a151caa in sasmodels for sasmodels/models/be_polyelectrolyte.py


Ignore:
Timestamp:
Jul 28, 2017 10:49:09 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:
404ebbd
Parents:
0bdddc2
Message:

tuned random model generator for be_polyelectrolyte, barbell, core multishell, core-shell bicelle

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/be_polyelectrolyte.py

    r3330bb4 ra151caa  
    1717    r_{0}^2 = \frac{1}{\alpha \sqrt{C_a} \left( b/\sqrt{48\pi L_b}\right)} 
    1818 
    19 where  
     19where 
    2020 
    2121$K$ is the contrast factor for the polymer which is defined differently than in 
     
    2828 
    2929    a = b_p - (v_p/v_s) b_s 
    30      
     30 
    3131where $b_p$ and $b_s$ are sum of the scattering lengths of the atoms 
    3232constituting the monomer of the polymer and the sum of the scattering lengths 
     
    3535 
    3636$L_b$ is the Bjerrum length(|Ang|) - **Note:** This parameter needs to be 
    37 kept constant for a given solvent and temperature!  
     37kept constant for a given solvent and temperature! 
    3838 
    3939$h$ is the virial parameter (|Ang^3|/mol) - **Note:** See [#Borue]_ for the 
     
    6767* **Author:** NIST IGOR/DANSE **Date:** pre 2010 
    6868* **Last Modified by:** Paul Kienzle **Date:** July 24, 2016 
    69 * **Last Reviewed by:** Paul Butler and Richard Heenan **Date:**  
     69* **Last Reviewed by:** Paul Butler and Richard Heenan **Date:** 
    7070  October 07, 2016 
    7171""" 
     
    139139Iq.vectorized = True  # Iq accepts an array of q values 
    140140 
     141def random(): 
     142    import numpy as np 
     143    pars = dict( 
     144        scale=10000, #background=0, 
     145        #polymer_concentration=0.7, 
     146        polymer_concentration=np.random.beta(5, 3), # around 70% 
     147        #salt_concentration=0.0, 
     148        # keep salt concentration extremely low 
     149        # and use explicit molar to match polymer concentration 
     150        salt_concentration=np.random.beta(1, 100)*6.022136e-4, 
     151        #contrast_factor=10.0, 
     152        contrast_fact=np.random.uniform(1, 100), 
     153        #bjerrum_length=7.1, 
     154        bjerrum_length=np.random.uniform(1, 10), 
     155        #virial_param=12.0, 
     156        virial_param=np.random.uniform(-1000, 30), 
     157        #monomer_length=10.0, 
     158        monomer_length=10.0**(4*np.random.beta(1.5, 3)), 
     159        #ionization_degree=0.05, 
     160        ionization_degree=np.random.beta(1.5, 4), 
     161    ) 
     162    return pars 
    141163 
    142164demo = dict(scale=1, background=0.1, 
Note: See TracChangeset for help on using the changeset viewer.