1 | /** |
---|
2 | * Scattering intensity for dispersed CCoreShellCylinderModel |
---|
3 | * |
---|
4 | * WARNING: THIS FILE WAS GENERATED BY IGORGENERATOR.PY |
---|
5 | * DO NOT MODIFY THIS FILE, MODIFY core_shell_cylinder.h |
---|
6 | * AND RE-RUN THE GENERATOR SCRIPT |
---|
7 | * |
---|
8 | * This code was written as part of the DANSE project |
---|
9 | * http://danse.us/trac/sans/ |
---|
10 | * |
---|
11 | * Copyright 2007: University of Tennessee, for the DANSE project |
---|
12 | */ |
---|
13 | |
---|
14 | #include "core_shell_cylinder.h" |
---|
15 | #include <math.h> |
---|
16 | #include "libCylinder.h" |
---|
17 | #include "libSphere.h" |
---|
18 | #include "c_disperser.h" |
---|
19 | |
---|
20 | /** |
---|
21 | * Function to evaluate 2D scattering function |
---|
22 | * |
---|
23 | * @param dp: parameters of the function |
---|
24 | * @param q: q-value |
---|
25 | * @param phi: angle of the q-vector in the plane of the detector, relative to q_x |
---|
26 | * @return: function value |
---|
27 | */ |
---|
28 | double oriented_core_shell_cylinder_2D(double pars[], double q, double phi) { |
---|
29 | CoreShellCylinderParameters danse_pars; |
---|
30 | |
---|
31 | // List of default parameters: |
---|
32 | // pars[0]: scale = 1.0 |
---|
33 | // pars[1]: radius = 20.0 A |
---|
34 | // pars[2]: thickness = 10.0 A |
---|
35 | // pars[3]: length = 400.0 A |
---|
36 | // pars[4]: core_sld = 1e-06 A-2 |
---|
37 | // pars[5]: shell_sld = 4e-06 A-2 |
---|
38 | // pars[6]: solvent_sld = 1e-06 A-2 |
---|
39 | // pars[7]: background = 0.0 cm-1 |
---|
40 | // pars[8]: axis_theta = 1.57 rad |
---|
41 | // pars[9]: axis_phi = 0.0 rad |
---|
42 | danse_pars.scale = pars[0]; |
---|
43 | danse_pars.radius = pars[1]; |
---|
44 | danse_pars.thickness = pars[2]; |
---|
45 | danse_pars.length = pars[3]; |
---|
46 | danse_pars.core_sld = pars[4]; |
---|
47 | danse_pars.shell_sld = pars[5]; |
---|
48 | danse_pars.solvent_sld = pars[6]; |
---|
49 | danse_pars.background = pars[7]; |
---|
50 | danse_pars.axis_theta = pars[8]; |
---|
51 | danse_pars.axis_phi = pars[9]; |
---|
52 | |
---|
53 | return core_shell_cylinder_analytical_2D(&danse_pars, q, phi); |
---|
54 | } |
---|
55 | |
---|
56 | /** |
---|
57 | * Function to evaluate dispersed 2D scattering function |
---|
58 | * |
---|
59 | * @param dp: parameters of the function |
---|
60 | * @param q: q-value |
---|
61 | * @param phi: angle of the q-vector in the plane of the detector, relative to q_x |
---|
62 | * @return: function value |
---|
63 | * |
---|
64 | // List of default parameters: |
---|
65 | // pars[0]: scale = 1.0 |
---|
66 | // pars[1]: radius = 20.0 A |
---|
67 | // pars[2]: thickness = 10.0 A |
---|
68 | // pars[3]: length = 400.0 A |
---|
69 | // pars[4]: core_sld = 1e-06 A-2 |
---|
70 | // pars[5]: shell_sld = 4e-06 A-2 |
---|
71 | // pars[6]: solvent_sld = 1e-06 A-2 |
---|
72 | // pars[7]: background = 0.0 cm-1 |
---|
73 | // pars[8]: axis_theta = 1.57 rad |
---|
74 | // pars[9]: axis_phi = 0.0 rad |
---|
75 | |
---|
76 | // pars[10]: dispersion of radius |
---|
77 | // pars[11]: dispersion of thickness |
---|
78 | // pars[12]: dispersion of axis_theta |
---|
79 | // pars[13]: dispersion of axis_phi |
---|
80 | // pars[14]: number of points in dispersion curve |
---|
81 | |
---|
82 | */ |
---|
83 | double disperse_core_shell_cylinder_analytical_2D(double dp[], double q, double phi) { |
---|
84 | int paramList[4]; |
---|
85 | double sigmaList[4]; |
---|
86 | int npts; |
---|
87 | int i; |
---|
88 | double pars[15]; |
---|
89 | |
---|
90 | // radius |
---|
91 | paramList[0] = 1; |
---|
92 | // thickness |
---|
93 | paramList[1] = 2; |
---|
94 | // axis_theta |
---|
95 | paramList[2] = 8; |
---|
96 | // axis_phi |
---|
97 | paramList[3] = 9; |
---|
98 | |
---|
99 | sigmaList[0] = dp[10]; |
---|
100 | sigmaList[1] = dp[11]; |
---|
101 | sigmaList[2] = dp[12]; |
---|
102 | sigmaList[3] = dp[13]; |
---|
103 | |
---|
104 | npts = (int)(floor(dp[14])); |
---|
105 | |
---|
106 | |
---|
107 | // Internal copy of parameters |
---|
108 | for(i=0; i<15; i++ ) { |
---|
109 | pars[i] = dp[i]; |
---|
110 | } |
---|
111 | |
---|
112 | return c_disperser( &oriented_core_shell_cylinder_2D, pars, 4, |
---|
113 | paramList, sigmaList, npts, q, phi ); |
---|
114 | |
---|
115 | |
---|
116 | } |
---|
117 | |
---|