source: sasmodels/sasmodels/models/vesicle.c @ d277229

core_shell_microgelsmagnetic_modelticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since d277229 was d277229, checked in by grethevj, 6 years ago

Models updated to include choices for effective interaction radii

  • Property mode set to 100644
File size: 1.6 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
8static double
9effective_radius(int mode, double radius, double thickness)
10{
11    return radius + thickness;
12}
13
14static void
15Fq(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}
Note: See TracBrowser for help on using the repository browser.