core_shell_microgelscostrafo411magnetic_modelrelease_v0.94release_v0.95ticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change
on this file since 2c74c11 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.2 KB
|
Rev | Line | |
---|
[321736f] | 1 | double form_volume(double radius, double thickness); |
---|
| 2 | |
---|
| 3 | double Iq(double q, |
---|
[062db5a] | 4 | double sld, double sld_solvent, double volfraction, |
---|
[321736f] | 5 | double radius, double thickness); |
---|
| 6 | |
---|
| 7 | double form_volume(double radius, double thickness) |
---|
| 8 | { |
---|
| 9 | //note that for the vesicle model, the volume is ONLY the shell volume |
---|
| 10 | double volume; |
---|
| 11 | volume =4.*M_PI*(radius+thickness)*(radius+thickness)*(radius+thickness)/3; |
---|
| 12 | volume -=4.*M_PI*radius*radius*radius/3.; |
---|
| 13 | return volume; |
---|
| 14 | } |
---|
| 15 | |
---|
| 16 | double Iq(double q, |
---|
| 17 | double sld, |
---|
[062db5a] | 18 | double sld_solvent, |
---|
| 19 | double volfraction, |
---|
[321736f] | 20 | double radius, |
---|
| 21 | double thickness) |
---|
| 22 | |
---|
| 23 | /* |
---|
| 24 | scattering from a unilamellar vesicle. |
---|
| 25 | same functional form as the core-shell sphere, but more intuitive for |
---|
| 26 | a vesicle |
---|
| 27 | */ |
---|
| 28 | |
---|
| 29 | { |
---|
[062db5a] | 30 | double vol,contrast,f,f2; |
---|
[321736f] | 31 | |
---|
| 32 | // core first, then add in shell |
---|
[062db5a] | 33 | contrast = sld_solvent-sld; |
---|
[321736f] | 34 | vol = 4.0*M_PI/3.0*radius*radius*radius; |
---|
[062db5a] | 35 | f = vol*sph_j1c(q*radius)*contrast; |
---|
[321736f] | 36 | |
---|
[062db5a] | 37 | //now the shell. No volume normalization as this is done by the caller |
---|
| 38 | contrast = sld-sld_solvent; |
---|
[321736f] | 39 | vol = 4.0*M_PI/3.0*(radius+thickness)*(radius+thickness)*(radius+thickness); |
---|
[062db5a] | 40 | f += vol*sph_j1c(q*(radius+thickness))*contrast; |
---|
[321736f] | 41 | |
---|
[062db5a] | 42 | //rescale to [cm-1]. |
---|
| 43 | f2 = volfraction*f*f*1.0e-4; |
---|
[321736f] | 44 | |
---|
| 45 | return(f2); |
---|
| 46 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.