source: sasmodels/sasmodels/models/vesicle.c @ 71b751d

core_shell_microgelsmagnetic_modelticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since 71b751d 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
Line 
1static double
2form_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
9static void
10Fq(double q,
11    double *F1,
12    double *F2,
13    double sld,
14    double sld_solvent,
15    double volfraction,
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{
26    double vol,contrast,f,f2;
27
28    // core first, then add in shell
29    contrast = sld_solvent-sld;
30    vol = M_4PI_3*cube(radius);
31    f = vol * sas_3j1x_x(q*radius) * contrast;
32
33    //now the shell. No volume normalization as this is done by the caller
34    contrast = sld-sld_solvent;
35    vol = M_4PI_3*cube(radius+thickness);
36    f += vol * sas_3j1x_x(q*(radius+thickness)) * contrast;
37
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;
49}
Note: See TracBrowser for help on using the repository browser.