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

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

conversion of RaspberryModel? - Andrew should Check the instabilities

  • Property mode set to 100644
File size: 2.9 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 surf_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    rS = radius_sm;
40    aSs = surf_fraction;
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    Np = aSs*4.0*pow(((rL+deltaS)/rS), 2.0);
51    fSs = Np*vfL*VS/vfS/VL;
52   
53    Np2 = aSs*4.0*(rS/(rL+deltaS))*VL/VS; 
54    fSs2 = Np2*vfL*VS/vfS/VL;
55    slT = delrhoL*VL + Np*delrhoS*VS;
56
57    sfLS = sph_j1c(q*rL)*sph_j1c(q*rS)*sinc(q*(rL+deltaS*rS));
58    sfSS = sph_j1c(q*rS)*sph_j1c(q*rS)*sinc(q*(rL+deltaS*rS))*sinc(q*(rL+deltaS*rS));
59       
60    f2 = delrhoL*delrhoL*VL*VL*sph_j1c(q*rL)*sph_j1c(q*rL); 
61    f2 += Np2*delrhoS*delrhoS*VS*VS*sph_j1c(q*rS)*sph_j1c(q*rS); 
62    f2 += Np2*(Np2-1)*delrhoS*delrhoS*VS*VS*sfSS; 
63    f2 += 2*Np2*delrhoL*delrhoS*VL*VS*sfLS;
64    if (f2 != 0.0){
65        f2 = f2/slT/slT;
66        }
67
68    f2 = f2*(vfL*delrhoL*delrhoL*VL + vfS*fSs2*Np2*delrhoS*delrhoS*VS);
69
70    f2+= vfS*(1.0-fSs)*pow(delrhoS, 2)*VS*sph_j1c(q*rS)*sph_j1c(q*rS);
71   
72    // normalize to single particle volume and convert to 1/cm
73    f2 *= 1.0e8;        // [=] 1/cm
74    f2 *= 1.0e-12;      // convert for (1/A^-6)^2 to (1/A)^2
75   
76    return f2;
77}
78
79
80
81double Iqxy(double qx, double qy,
82          double sld_lg, double sld_sm, double sld_solvent,
83          double volfraction_lg, double volfraction_sm, double surf_fraction,
84          double radius_lg, double radius_sm, double penetration)
85         
86{
87    double q = sqrt(qx*qx + qy*qy);
88    return Iq(q,
89          sld_lg, sld_sm, sld_solvent,
90          volfraction_lg, volfraction_sm, surf_fraction,
91          radius_lg, radius_sm, penetration);
92
93}
Note: See TracBrowser for help on using the repository browser.