core_shell_microgelscostrafo411magnetic_modelrelease_v0.94release_v0.95ticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change
on this file since 6cefbc9 was
2c74c11,
checked in by Paul Kienzle <pkienzle@…>, 8 years ago
|
implicit Iqxy; fix divide by 0 for q=0
|
-
Property mode set to
100644
|
File size:
1.0 KB
|
Rev | Line | |
---|
[da84551] | 1 | double form_volume(double radius); |
---|
| 2 | |
---|
[513efc5] | 3 | double Iq(double q, |
---|
| 4 | double radius, |
---|
| 5 | double surface_dim, |
---|
| 6 | double cutoff_length); |
---|
| 7 | |
---|
| 8 | static double _surface_fractal_kernel(double q, |
---|
[da84551] | 9 | double radius, |
---|
| 10 | double surface_dim, |
---|
| 11 | double cutoff_length) |
---|
| 12 | { |
---|
| 13 | double pq, sq, mmo, result; |
---|
| 14 | |
---|
[513efc5] | 15 | //Replaced the original formula with Taylor expansion near zero. |
---|
| 16 | //pq = pow((3.0*(sin(q*radius) - q*radius*cos(q*radius))/pow((q*radius),3)),2); |
---|
| 17 | |
---|
[9c461c7] | 18 | pq = sph_j1c(q*radius); |
---|
[513efc5] | 19 | pq = pq*pq; |
---|
[da84551] | 20 | |
---|
| 21 | //calculate S(q) |
---|
| 22 | mmo = 5.0 - surface_dim; |
---|
[6794301] | 23 | sq = sas_gamma(mmo)*sin(-(mmo)*atan(q*cutoff_length)); |
---|
[da84551] | 24 | sq *= pow(cutoff_length, mmo); |
---|
| 25 | sq /= pow((1.0 + (q*cutoff_length)*(q*cutoff_length)),(mmo/2.0)); |
---|
| 26 | sq /= q; |
---|
| 27 | |
---|
| 28 | //combine and return |
---|
| 29 | result = pq * sq; |
---|
| 30 | |
---|
| 31 | return result; |
---|
| 32 | } |
---|
| 33 | double form_volume(double radius){ |
---|
| 34 | |
---|
| 35 | return 1.333333333333333*M_PI*radius*radius*radius; |
---|
| 36 | } |
---|
| 37 | |
---|
| 38 | double Iq(double q, |
---|
| 39 | double radius, |
---|
| 40 | double surface_dim, |
---|
| 41 | double cutoff_length |
---|
| 42 | ) |
---|
| 43 | { |
---|
[513efc5] | 44 | return _surface_fractal_kernel(q, radius, surface_dim, cutoff_length); |
---|
[da84551] | 45 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.