Changeset 754e27b in sasmodels for sasmodels/models/stickyhardsphere.py


Ignore:
Timestamp:
Mar 15, 2016 10:47:22 AM (8 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
35b4c47
Parents:
17bbadd (diff), 034e19a (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' of github.com:sasview/sasmodels

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/stickyhardsphere.py

    r13ed84c r034e19a  
    122122    //C  SOLVE QUADRATIC FOR LAMBDA 
    123123    //C 
    124     qa = eta/12.0; 
    125     qb = -1.0*(stickiness + eta/etam1); 
     124    qa = eta/6.0; 
     125    qb = stickiness + eta/etam1; 
    126126    qc = (1.0 + eta/2.0)/etam1sq; 
    127     radic = qb*qb - 4.0*qa*qc; 
     127    radic = qb*qb - 2.0*qa*qc; 
    128128    if(radic<0) { 
    129129        //if(x>0.01 && x<0.015) 
     
    133133    } 
    134134    //C   KEEP THE SMALLER ROOT, THE LARGER ONE IS UNPHYSICAL 
    135     lam = (-1.0*qb-sqrt(radic))/(2.0*qa); 
    136     lam2 = (-1.0*qb+sqrt(radic))/(2.0*qa); 
     135    radic = sqrt(radic); 
     136    lam = (qb-radic)/qa; 
     137    lam2 = (qb+radic)/qa; 
    137138    if(lam2<lam) { 
    138139        lam = lam2; 
     
    186187tests = [ 
    187188        [ {'scale': 1.0, 'background' : 0.0, 'effect_radius' : 50.0, 'perturb' : 0.05, 'stickiness' : 0.2, 'volfraction' : 0.1, 
    188            'effect_radius_pd' : 0}, [0.001], [1.09718]] 
     189           'effect_radius_pd' : 0}, [0.001, 0.003], [1.09718, 1.087830]] 
    189190        ] 
    190191 
Note: See TracChangeset for help on using the changeset viewer.