[ee60aa7] | 1 | static double |
---|
[e44432d] | 2 | shell_volume(double radius, double thickness) |
---|
[ee60aa7] | 3 | { |
---|
[e44432d] | 4 | return M_4PI_3 * (cube(radius+thickness) - cube(radius)); |
---|
[ee60aa7] | 5 | } |
---|
| 6 | |
---|
[71b751d] | 7 | static double |
---|
| 8 | form_volume(double radius, double thickness) |
---|
[321736f] | 9 | { |
---|
[e44432d] | 10 | return M_4PI_3 * cube(radius+thickness); |
---|
[321736f] | 11 | } |
---|
| 12 | |
---|
[e44432d] | 13 | |
---|
[d277229] | 14 | static double |
---|
[a34b811] | 15 | radius_effective(int mode, double radius, double thickness) |
---|
[d277229] | 16 | { |
---|
[ee60aa7] | 17 | // case 1: outer radius |
---|
[d277229] | 18 | return radius + thickness; |
---|
| 19 | } |
---|
[71b751d] | 20 | |
---|
| 21 | static void |
---|
| 22 | Fq(double q, |
---|
| 23 | double *F1, |
---|
| 24 | double *F2, |
---|
[321736f] | 25 | double sld, |
---|
[062db5a] | 26 | double sld_solvent, |
---|
| 27 | double volfraction, |
---|
[321736f] | 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 | { |
---|
[12f4c19] | 38 | double vol,contrast,f; |
---|
[321736f] | 39 | |
---|
| 40 | // core first, then add in shell |
---|
[062db5a] | 41 | contrast = sld_solvent-sld; |
---|
[3a48772] | 42 | vol = M_4PI_3*cube(radius); |
---|
[925ad6e] | 43 | f = vol * sas_3j1x_x(q*radius) * contrast; |
---|
[71b751d] | 44 | |
---|
[062db5a] | 45 | //now the shell. No volume normalization as this is done by the caller |
---|
| 46 | contrast = sld-sld_solvent; |
---|
[3a48772] | 47 | vol = M_4PI_3*cube(radius+thickness); |
---|
[925ad6e] | 48 | f += vol * sas_3j1x_x(q*(radius+thickness)) * contrast; |
---|
[321736f] | 49 | |
---|
[71b751d] | 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; |
---|
[321736f] | 61 | } |
---|