source: sasmodels/sasmodels/models/raspberry.c @ a2d8a67

core_shell_microgelscostrafo411magnetic_modelrelease_v0.94release_v0.95ticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since a2d8a67 was a2d8a67, checked in by ajj, 8 years ago

Raspberry model documentation

  • Property mode set to 100644
File size: 3.2 KB
Line 
1double form_volume(double radius_lg);
2
3double Iq(double q, 
4          double sld_lg, double sld_sm, double sld_solvent,
5          double volfraction_lg, double volfraction_sm, double surf_fraction,
6          double radius_lg, double radius_sm, double penetration);
7
8double Iqxy(double qx, double qy,
9          double sld_lg, double sld_sm, double sld_solvent,
10          double volfraction_lg, double volfraction_sm, double surf_fraction,
11          double radius_lg, double radius_sm, double penetration);
12
13double form_volume(double radius_lg)
14{
15    //Because of the complex structure, volume normalization must
16    //happen in the Iq code below.  Thus the form volume is set to 1.0 here
17    double volume=1.0;
18    return volume;
19}
20
21double Iq(double q,
22          double sld_lg, double sld_sm, double sld_solvent,
23          double volfraction_lg, double volfraction_sm, double surface_fraction,
24          double radius_lg, double radius_sm, double penetration)
25{
26    // Ref: J. coll. inter. sci. (2010) vol. 343 (1) pp. 36-41.
27
28
29    double vfL, rL, sldL, vfS, rS, sldS, deltaS, delrhoL, delrhoS, sldSolv, aSs;
30    double VL, VS, Np, f2, fSs;
31    double psiL,psiS;
32    double sfLS,sfSS,Np2,fSs2;
33    double slT;
34 
35    vfL = volfraction_lg;
36    rL = radius_lg;
37    sldL = sld_lg;
38    vfS = volfraction_sm;
39    fSs = surface_fraction;
40    rS = radius_sm;
41    sldS = sld_sm;
42    deltaS = penetration;
43    sldSolv = sld_solvent;
44   
45    delrhoL = fabs(sldL - sldSolv);
46    delrhoS = fabs(sldS - sldSolv); 
47     
48    VL = M_4PI_3*rL*rL*rL;
49    VS = M_4PI_3*rS*rS*rS;
50
51    //Number of small particles per large particle
52    Np = vfS*fSs*VL/vfL/VS;
53
54    //Total scattering length difference
55    slT = delrhoL*VL + Np*delrhoS*VS;
56
57    //Form factors for each particle
58    psiL = sph_j1c(q*rL);
59    psiS = sph_j1c(q*rS);
60
61    //Cross term between large and small particles
62    sfLS = psiL*psiS*sinc(q*(rL+deltaS*rS));
63    //Cross term between small particles at the surface
64    sfSS = psiS*psiS*sinc(q*(rL+deltaS*rS))*sinc(q*(rL+deltaS*rS));
65
66    //Large sphere form factor term
67    f2 = delrhoL*delrhoL*VL*VL*psiL*psiL;
68    //Small sphere form factor term
69    f2 += Np*delrhoS*delrhoS*VS*VS*psiS*psiS;
70    //Small particle - small particle cross term
71    f2 += Np*(Np-1)*delrhoS*delrhoS*VS*VS*sfSS;
72    //Large-small particle cross term
73    f2 += 2*Np*delrhoL*delrhoS*VL*VS*sfLS;
74    //Normalise by total scattering length difference
75    if (f2 != 0.0){
76        f2 = f2/slT/slT;
77        }
78
79    //I(q) for large-small composite particles
80    f2 = f2*(vfL*delrhoL*delrhoL*VL + vfS*fSs*Np*delrhoS*delrhoS*VS);
81    //I(q) for free small particles
82    f2+= vfS*(1.0-fSs)*delrhoS*delrhoS*VS*psiS*psiS;
83   
84    // normalize to single particle volume and convert to 1/cm
85    f2 *= 1.0e8;        // [=] 1/cm
86    f2 *= 1.0e-12;      // convert for (1/A^-6)^2 to (1/A)^2
87   
88    return f2;
89}
90
91
92
93double Iqxy(double qx, double qy,
94          double sld_lg, double sld_sm, double sld_solvent,
95          double volfraction_lg, double volfraction_sm, double surf_fraction,
96          double radius_lg, double radius_sm, double penetration)
97         
98{
99    double q = sqrt(qx*qx + qy*qy);
100    return Iq(q,
101          sld_lg, sld_sm, sld_solvent,
102          volfraction_lg, volfraction_sm, surf_fraction,
103          radius_lg, radius_sm, penetration);
104
105}
Note: See TracBrowser for help on using the repository browser.