core_shell_microgelsmagnetic_modelticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change
on this file since 0159b5e was
71b751d,
checked in by Paul Kienzle <pkienzle@…>, 6 years ago
|
update remaining form factors to use Fq interface
|
-
Property mode set to
100644
|
File size:
1.5 KB
|
Rev | Line | |
---|
[71b751d] | 1 | static double |
---|
| 2 | form_volume(double radius, double thickness) |
---|
[321736f] | 3 | { |
---|
| 4 | //note that for the vesicle model, the volume is ONLY the shell volume |
---|
[3a48772] | 5 | return M_4PI_3*(cube(radius+thickness) - cube(radius)); |
---|
[321736f] | 6 | } |
---|
| 7 | |
---|
[71b751d] | 8 | |
---|
| 9 | static void |
---|
| 10 | Fq(double q, |
---|
| 11 | double *F1, |
---|
| 12 | double *F2, |
---|
[321736f] | 13 | double sld, |
---|
[062db5a] | 14 | double sld_solvent, |
---|
| 15 | double volfraction, |
---|
[321736f] | 16 | double radius, |
---|
| 17 | double thickness) |
---|
| 18 | |
---|
| 19 | /* |
---|
| 20 | scattering from a unilamellar vesicle. |
---|
| 21 | same functional form as the core-shell sphere, but more intuitive for |
---|
| 22 | a vesicle |
---|
| 23 | */ |
---|
| 24 | |
---|
| 25 | { |
---|
[062db5a] | 26 | double vol,contrast,f,f2; |
---|
[321736f] | 27 | |
---|
| 28 | // core first, then add in shell |
---|
[062db5a] | 29 | contrast = sld_solvent-sld; |
---|
[3a48772] | 30 | vol = M_4PI_3*cube(radius); |
---|
[925ad6e] | 31 | f = vol * sas_3j1x_x(q*radius) * contrast; |
---|
[71b751d] | 32 | |
---|
[062db5a] | 33 | //now the shell. No volume normalization as this is done by the caller |
---|
| 34 | contrast = sld-sld_solvent; |
---|
[3a48772] | 35 | vol = M_4PI_3*cube(radius+thickness); |
---|
[925ad6e] | 36 | f += vol * sas_3j1x_x(q*(radius+thickness)) * contrast; |
---|
[321736f] | 37 | |
---|
[71b751d] | 38 | //rescale to [cm-1]. |
---|
| 39 | // With volume fraction as part of the model in the dilute limit need |
---|
| 40 | // to return F2 = Vf <fq^2>. In order for beta approx. to work correctly |
---|
| 41 | // need F1^2/F2 equal to <fq>^2 / <fq^2>. By returning F1 = sqrt(Vf) <fq> |
---|
| 42 | // and F2 = Vf <fq^2> both conditions are satisfied. |
---|
| 43 | // Since Vf is the volume fraction of vesicles of all radii, it is |
---|
| 44 | // constant when averaging F1 and F2 over radii and so pops out of the |
---|
| 45 | // polydispersity loop, so it is safe to apply it inside the model |
---|
| 46 | // (albeit conceptually ugly). |
---|
| 47 | *F1 = 1e-2 * sqrt(volfraction) * f; |
---|
| 48 | *F2 = 1.0e-4 * volfraction * f * f; |
---|
[321736f] | 49 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.