core_shell_microgelscostrafo411magnetic_modelrelease_v0.94release_v0.95ticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change
on this file since 76a9ffe was
12dbc90,
checked in by butler, 8 years ago
|
fractal model converted and docs checked
|
-
Property mode set to
100644
|
File size:
2.2 KB
|
Line | |
---|
1 | double form_volume(double radius); |
---|
2 | |
---|
3 | double Iq(double q, |
---|
4 | double volfraction, |
---|
5 | double radius, |
---|
6 | double fractal_dim, |
---|
7 | double cor_length, |
---|
8 | double sld_block, |
---|
9 | double sld_solvent); |
---|
10 | |
---|
11 | double Iqxy(double qx, double qy, |
---|
12 | double volfraction, |
---|
13 | double radius, |
---|
14 | double fractal_dim, |
---|
15 | double cor_length, |
---|
16 | double sld_block, |
---|
17 | double sld_solvent); |
---|
18 | |
---|
19 | |
---|
20 | double Iq(double q, |
---|
21 | double volfraction, |
---|
22 | double radius, |
---|
23 | double fractal_dim, |
---|
24 | double cor_length, |
---|
25 | double sld_block, |
---|
26 | double sld_solvent) |
---|
27 | { |
---|
28 | double qr,r0,Df,corr,phi,sldp,sldm; |
---|
29 | double pq,sq,inten; |
---|
30 | |
---|
31 | // Actively check the argument - needed for mass fractal - is it needie |
---|
32 | //here? |
---|
33 | if (fractal_dim <= 0.0){ |
---|
34 | return 0.0; |
---|
35 | } |
---|
36 | |
---|
37 | phi = volfraction; // volume fraction of building block spheres... |
---|
38 | r0 = radius; // radius of building block |
---|
39 | Df = fractal_dim; // fractal dimension |
---|
40 | corr = cor_length; // correlation length of fractal-like aggregates |
---|
41 | sldp = sld_block; // SLD of building block |
---|
42 | sldm = sld_solvent; // SLD of matrix or solution |
---|
43 | |
---|
44 | qr=q*r0; |
---|
45 | |
---|
46 | //calculate P(q) for the spherical subunits |
---|
47 | pq = phi*M_4PI_3*r0*r0*r0*(sldp-sldm)*(sldp-sldm)*sph_j1c(qr)*sph_j1c(qr); |
---|
48 | |
---|
49 | //calculate S(q) |
---|
50 | sq = Df*sas_gamma(Df-1.0)*sin((Df-1.0)*atan(q*corr)); |
---|
51 | sq /= pow(qr,Df) * pow((1.0 + 1.0/(q*corr)/(q*corr)),((Df-1.0)/2.0)); |
---|
52 | sq += 1.0; |
---|
53 | |
---|
54 | //combine, scale to units cm-1 sr-1 (assuming data on absolute scale) |
---|
55 | //and return |
---|
56 | inten = pq*sq; |
---|
57 | // convert I(1/A) to (1/cm) |
---|
58 | inten *= 1.0e8; |
---|
59 | //convert rho^2 in 10^-6 1/A to 1/A |
---|
60 | inten *= 1.0e-12; |
---|
61 | |
---|
62 | |
---|
63 | return(inten); |
---|
64 | } |
---|
65 | |
---|
66 | |
---|
67 | // Iqxy is never called since no orientation or magnetic parameters. |
---|
68 | double Iqxy(double qx, double qy, |
---|
69 | double volfraction, |
---|
70 | double radius, |
---|
71 | double fractal_dim, |
---|
72 | double cor_length, |
---|
73 | double sld_block, |
---|
74 | double sld_solvent) |
---|
75 | { |
---|
76 | double q = sqrt(qx*qx + qy*qy); |
---|
77 | return Iq(q, |
---|
78 | volfraction, radius, |
---|
79 | fractal_dim, cor_length, |
---|
80 | sld_block, sld_solvent); |
---|
81 | |
---|
82 | } |
---|
83 | |
---|
Note: See
TracBrowser
for help on using the repository browser.