source: sasmodels/sasmodels/models/multilayer_vesicle.c @ 46ed760

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

fix name of old multishell model to multilayer vesicle as agreed. Also
fixed parameters to match new agreements. reran tests

  • Property mode set to 100644
File size: 1.8 KB
Line 
1static
2double multilayer_vesicle_kernel(double q,
3          double volfraction,
4          double radius,
5          double thick_shell,
6          double thick_solvent,
7          double sld_solvent,
8          double sld,
9          double n_pairs)
10{
11    //calculate with a loop, two shells at a time
12    int ii = 0;
13    double fval = 0.0;
14    double voli = 0.0;
15    const double sldi = sld_solvent-sld;
16
17    do {
18        double ri = radius + (double)ii*(thick_shell + thick_solvent);
19
20        // layer 1
21        voli = 4.0*M_PI/3.0*ri*ri*ri;
22        fval += voli*sldi*sph_j1c(ri*q);
23
24        ri += thick_shell;
25
26        // layer 2
27        voli = 4.0*M_PI/3.0*ri*ri*ri;
28        fval -= voli*sldi*sph_j1c(ri*q);
29
30        //do 2 layers at a time
31        ii += 1;
32
33    } while(ii <= n_pairs-1);  //change to make 0 < n_pairs < 2 correspond to
34                               //unilamellar vesicles (C. Glinka, 11/24/03)
35
36    fval *= volfraction*1.0e-4*fval/voli;
37
38    return(fval);
39}
40
41static
42double Iq(double q,
43          double volfraction,
44          double radius,
45          double thick_shell,
46          double thick_solvent,
47          double sld_solvent,
48          double sld,
49          double n_pairs)
50{
51    return multilayer_vesicle_kernel(q,
52           volfraction,
53           radius,
54           thick_shell,
55           thick_solvent,
56           sld_solvent,
57           sld,
58           n_pairs);
59}
60
61static
62double Iqxy(double qx, double qy,
63          double volfraction,
64          double radius,
65          double thick_shell,
66          double thick_solvent,
67          double sld_solvent,
68          double sld,
69          double n_pairs)
70{
71    double q = sqrt(qx*qx + qy*qy);
72
73    return multilayer_vesicle_kernel(q,
74           volfraction,
75           radius,
76           thick_shell,
77           thick_solvent,
78           sld_solvent,
79           sld,
80           n_pairs);
81}
Note: See TracBrowser for help on using the repository browser.