core_shell_microgelscostrafo411magnetic_modelticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change
on this file since 63a7fe8 was
c3ccaec,
checked in by GitHub <noreply@…>, 7 years ago
|
Merge branch 'master' into ticket-815
|
-
Property mode set to
100644
|
File size:
881 bytes
|
Line | |
---|
1 | |
---|
2 | static double |
---|
3 | f_constant(double q, double r, double sld) |
---|
4 | { |
---|
5 | const double bes = sas_3j1x_x(q * r); |
---|
6 | const double vol = M_4PI_3 * cube(r); |
---|
7 | return sld * vol * bes; |
---|
8 | } |
---|
9 | |
---|
10 | static double |
---|
11 | form_volume(double core_radius, double fp_n, double thickness[]) |
---|
12 | { |
---|
13 | double r = core_radius; |
---|
14 | int n = (int)(fp_n+0.5); |
---|
15 | for (int i=0; i < n; i++) { |
---|
16 | r += thickness[i]; |
---|
17 | } |
---|
18 | return M_4PI_3 * cube(r); |
---|
19 | } |
---|
20 | |
---|
21 | static double |
---|
22 | Iq(double q, double core_sld, double core_radius, |
---|
23 | double solvent_sld, double fp_n, double sld[], double thickness[]) |
---|
24 | { |
---|
25 | const int n = (int)(fp_n+0.5); |
---|
26 | double f, r, last_sld; |
---|
27 | r = core_radius; |
---|
28 | last_sld = core_sld; |
---|
29 | f = 0.; |
---|
30 | for (int i=0; i<n; i++) { |
---|
31 | f += M_4PI_3 * cube(r) * (sld[i] - last_sld) * sas_3j1x_x(q*r); |
---|
32 | last_sld = sld[i]; |
---|
33 | r += thickness[i]; |
---|
34 | } |
---|
35 | f += M_4PI_3 * cube(r) * (solvent_sld - last_sld) * sas_3j1x_x(q*r); |
---|
36 | return f * f * 1.0e-4; |
---|
37 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.