Changes in / [4840bec:5959da2] in sasmodels


Ignore:
Location:
sasmodels/models
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/HayterMSAsq.py

    rb7d432f rab87a12  
    9090oldname = 'HayterMSAStructure' 
    9191oldpars = dict() 
    92 demo = dict(effect_radius=20.75, charge=19.0, volfraction=0.0192, temperature=318.16, saltconc=0.0, dielectconst=71.08, effect_radius_pd=0.1, effect_radius_pd_n=40) 
     92# default parameter set,  use  compare.sh -midQ -linear 
     93# note the calculation varies in different limiting cases so a wide range of parameters will be required for a thorough test! 
     94# odd that the default st has saltconc zero 
     95demo = dict(effect_radius = 20.75,charge=19.0,volfraction = 0.0192,temperature=318.16,saltconc=0.05,dielectconst=71.08,effect_radius_pd = 0.1,effect_radius_pd_n = 40) 
    9396 
  • sasmodels/models/HayterMSAsq_kernel.c

    rd60b433 rab87a12  
    1212double 
    1313sqhcal(double qq, double gMSAWave[]); 
    14  
    15            
     14   
    1615double Iq(double QQ, 
    1716      double effect_radius, double zz, double VolFrac, double Temp, double csalt, double dialec)   
     
    487486} 
    488487 
    489 // called as DiamCyl(hcyl,rcyl) 
    490 double 
    491 DiamCyl(double hcyl, double rcyl) 
    492 { 
    493          
    494         double diam,a,b,t1,t2,ddd; 
    495         double pi; 
    496          
    497         pi = 4.0*atan(1.0); 
    498         if (rcyl == 0 || hcyl == 0) { 
    499                 return 0.0; 
    500         } 
    501         a = rcyl; 
    502         b = hcyl/2.0; 
    503         t1 = a*a*2.0*b/2.0; 
    504         t2 = 1.0 + (b/a)*(1.0+a/b/2.0)*(1.0+pi*a/b/2.0); 
    505         ddd = 3.0*t1*t2; 
    506         diam = pow(ddd,(1.0/3.0)); 
    507          
    508         return(diam); 
    509 } 
    510  
    511 //prolate OR oblate ellipsoids                     THIS ROUTINE CURRENTLY UNUSED AS SASVIEW ONLY ALLOWS SPHERES 
    512 //aa is the axis of rotation 
    513 //if aa>bb, then PROLATE 
    514 //if aa<bb, then OBLATE 
    515 // A. Isihara, J. Chem. Phys. 18, 1446 (1950) 
    516 //returns DIAMETER 
    517 // called as DiamEllip(aa,bb) 
    518 double 
    519 DiamEllip(double aa, double bb) 
    520 { 
    521          
    522         double ee,e1,bd,b1,bL,b2,del,ddd,diam; 
    523  
    524         if (aa == 0 || bb == 0) { 
    525                 return 0.0; 
    526         } 
    527         if (aa == bb) { 
    528                 return 2.0*aa; 
    529         } 
    530         if(aa>bb) { 
    531                 ee = (aa*aa - bb*bb)/(aa*aa); 
    532         }else{ 
    533                 ee = (bb*bb - aa*aa)/(bb*bb); 
    534         } 
    535          
    536         bd = 1.0-ee; 
    537         e1 = sqrt(ee); 
    538         b1 = 1.0 + asin(e1)/(e1*sqrt(bd)); 
    539         bL = (1.0+e1)/(1.0-e1); 
    540         b2 = 1.0 + bd/2/e1*log(bL); 
    541         del = 0.75*b1*b2; 
    542          
    543         ddd = 2.0*(del+1.0)*aa*bb*bb;           //volume is always calculated correctly 
    544         diam = pow(ddd,(1.0/3.0)); 
    545          
    546         return(diam); 
    547 } 
    548  
    549488double 
    550489sqhcal(double qq, double gMSAWave[]) 
Note: See TracChangeset for help on using the changeset viewer.