1 | static double |
---|
2 | form_volume(double radius, double thickness) |
---|
3 | { |
---|
4 | //note that for the vesicle model, the volume is ONLY the shell volume |
---|
5 | return M_4PI_3*(cube(radius+thickness) - cube(radius)); |
---|
6 | } |
---|
7 | |
---|
8 | static double |
---|
9 | effective_radius(int mode, double radius, double thickness) |
---|
10 | { |
---|
11 | return radius + thickness; |
---|
12 | } |
---|
13 | |
---|
14 | static void |
---|
15 | Fq(double q, |
---|
16 | double *F1, |
---|
17 | double *F2, |
---|
18 | double sld, |
---|
19 | double sld_solvent, |
---|
20 | double volfraction, |
---|
21 | double radius, |
---|
22 | double thickness) |
---|
23 | |
---|
24 | /* |
---|
25 | scattering from a unilamellar vesicle. |
---|
26 | same functional form as the core-shell sphere, but more intuitive for |
---|
27 | a vesicle |
---|
28 | */ |
---|
29 | |
---|
30 | { |
---|
31 | double vol,contrast,f,f2; |
---|
32 | |
---|
33 | // core first, then add in shell |
---|
34 | contrast = sld_solvent-sld; |
---|
35 | vol = M_4PI_3*cube(radius); |
---|
36 | f = vol * sas_3j1x_x(q*radius) * contrast; |
---|
37 | |
---|
38 | //now the shell. No volume normalization as this is done by the caller |
---|
39 | contrast = sld-sld_solvent; |
---|
40 | vol = M_4PI_3*cube(radius+thickness); |
---|
41 | f += vol * sas_3j1x_x(q*(radius+thickness)) * contrast; |
---|
42 | |
---|
43 | //rescale to [cm-1]. |
---|
44 | // With volume fraction as part of the model in the dilute limit need |
---|
45 | // to return F2 = Vf <fq^2>. In order for beta approx. to work correctly |
---|
46 | // need F1^2/F2 equal to <fq>^2 / <fq^2>. By returning F1 = sqrt(Vf) <fq> |
---|
47 | // and F2 = Vf <fq^2> both conditions are satisfied. |
---|
48 | // Since Vf is the volume fraction of vesicles of all radii, it is |
---|
49 | // constant when averaging F1 and F2 over radii and so pops out of the |
---|
50 | // polydispersity loop, so it is safe to apply it inside the model |
---|
51 | // (albeit conceptually ugly). |
---|
52 | *F1 = 1e-2 * sqrt(volfraction) * f; |
---|
53 | *F2 = 1.0e-4 * volfraction * f * f; |
---|
54 | } |
---|