Changeset 2de9a5e in sasmodels for Kernel-CoreShellCylinder.cpp


Ignore:
Timestamp:
Jul 11, 2014 2:47:47 PM (10 years ago)
Author:
HMP1 <helen.park@…>
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:
be5d7df
Parents:
8faffcd
Message:

Update for Aaron

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Kernel-CoreShellCylinder.cpp

    r8faffcd r2de9a5e  
    1111        float pi = 4.0*atan(1.0); 
    1212        float theta = axis_theta*pi/180.0; 
    13         float phi = axis_phi*pi/180.0; 
    14         float cyl_x = cos(theta)*cos(phi); 
     13        float cyl_x = cos(theta)*cos(axis_phi*pi/180.0); 
    1514        float cyl_y = sin(theta); 
    16         float cos_val = cyl_x*qx[i]/q + cyl_y*qx[i]/q; 
    17         float alpha = acos(cos_val); 
     15        float alpha = acos(cyl_x*qx[i]/q + cyl_y*qx[i]/q); 
    1816 
    1917        if (alpha == 0.0){ 
     
    2321        float si1=0; float si2=0; float be1=0; float be2=0; 
    2422 
    25         float dr1 = core_sld-shell_sld; 
    26         float dr2 = shell_sld-solvent_sld; 
    27         float vol1 = pi*radius*radius*(length); 
    2823        float vol2 = pi*(radius+thickness)*(radius+thickness)*(length+2.0*thickness); 
    2924 
     
    5449            si2 = sin(sinarg2)/sinarg2; 
    5550        } 
     51        float tt = 2.0*vol2*(shell_sld-solvent_sld)*si2*be2 + 2.0*(pi*radius*radius*(length))*(core_sld-shell_sld)*si1*be1; 
    5652 
    57         float t1 = 2.0*vol1*dr1*si1*be1; 
    58         float t2 = 2.0*vol2*dr2*si2*be2; 
    59  
    60         float answer = ((t1+t2)*(t1+t2))*sin(alpha)/fabs(sin(alpha)); 
     53        float answer = (tt*tt)*sin(alpha)/fabs(sin(alpha)); 
    6154        float vol=pi*(radius+thickness)*(radius+thickness)*(length+2.0*thickness); 
    6255        answer = answer/vol*1.0e8*scale; 
Note: See TracChangeset for help on using the changeset viewer.