source:
sasmodels/sasmodels/models/polymer_micelle_kernel.c
@
3f8584a2
Last change on this file since 3f8584a2 was 2c74c11, checked in by Paul Kienzle <pkienzle@…>, 8 years ago | |
---|---|
|
|
File size: 2.7 KB |
Rev | Line | |
---|---|---|
[0d0aee1] | 1 | double Iq(double q, |
2 | double ndensity, | |
3 | double v_core, | |
4 | double v_corona, | |
5 | double solvent_sld, | |
6 | double core_sld, | |
7 | double corona_sld, | |
8 | double radius_core, | |
9 | double radius_gyr, | |
10 | double d_penetration, | |
11 | double n_aggreg); | |
12 | ||
13 | static double micelle_spherical_kernel(double q, | |
14 | double ndensity, | |
15 | double v_core, | |
16 | double v_corona, | |
17 | double solvent_sld, | |
18 | double core_sld, | |
19 | double corona_sld, | |
20 | double radius_core, | |
21 | double radius_gyr, | |
22 | double d_penetration, | |
23 | double n_aggreg) | |
24 | { | |
25 | const double rho_solv = solvent_sld; // sld of solvent [1/A^2] | |
26 | const double rho_core = core_sld; // sld of core [1/A^2] | |
27 | const double rho_corona = corona_sld; // sld of corona [1/A^2] | |
28 | ||
29 | const double beta_core = v_core * (rho_core - rho_solv); | |
30 | const double beta_corona = v_corona * (rho_corona - rho_solv); | |
31 | ||
32 | // Self-correlation term of the core | |
33 | const double bes_core = sph_j1c(q*radius_core); | |
34 | const double term1 = n_aggreg*n_aggreg*beta_core*beta_core*bes_core*bes_core; | |
35 | ||
36 | // Self-correlation term of the chains | |
37 | const double qrg2 = q*radius_gyr*q*radius_gyr; | |
38 | const double debye_chain = (qrg2 == 0.0) ? 1.0 : 2.0*(exp(-qrg2)-1+qrg2)/(qrg2*qrg2); | |
39 | const double term2 = n_aggreg * beta_corona * beta_corona * debye_chain; | |
40 | ||
41 | // Interference cross-term between core and chains | |
42 | const double chain_ampl = (qrg2 == 0.0) ? 1.0 : (1-exp(-qrg2))/qrg2; | |
43 | const double bes_corona = sinc(q*(radius_core + d_penetration * radius_gyr)); | |
44 | const double term3 = 2 * n_aggreg * n_aggreg * beta_core * beta_corona * | |
45 | bes_core * chain_ampl * bes_corona; | |
46 | ||
47 | // Interference cross-term between chains | |
48 | const double term4 = n_aggreg * (n_aggreg - 1.0) * beta_corona * beta_corona * | |
49 | chain_ampl * chain_ampl * bes_corona * bes_corona; | |
50 | ||
51 | // I(q)_micelle : Sum of 4 terms computed above | |
52 | double i_micelle = term1 + term2 + term3 + term4; | |
53 | ||
54 | // rescale from [A^2] to [cm^2] | |
55 | i_micelle *= 1.0e-13; | |
56 | ||
57 | // "normalize" by number density --> intensity in [cm-1] | |
58 | i_micelle *= ndensity; | |
59 | ||
60 | return(i_micelle); | |
61 | ||
62 | } | |
63 | ||
64 | double Iq(double q, | |
65 | double ndensity, | |
66 | double v_core, | |
67 | double v_corona, | |
68 | double solvent_sld, | |
69 | double core_sld, | |
70 | double corona_sld, | |
71 | double radius_core, | |
72 | double radius_gyr, | |
73 | double d_penetration, | |
74 | double n_aggreg) | |
75 | { | |
76 | return micelle_spherical_kernel(q, | |
77 | ndensity, | |
78 | v_core, | |
79 | v_corona, | |
80 | solvent_sld, | |
81 | core_sld, | |
82 | corona_sld, | |
83 | radius_core, | |
84 | radius_gyr, | |
85 | d_penetration, | |
86 | n_aggreg); | |
87 | } |
Note: See TracBrowser
for help on using the repository browser.