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