1 | /** |
---|
2 | * Scattering model for a prolate |
---|
3 | * @author: Gervaise B Alina/ UTK |
---|
4 | */ |
---|
5 | |
---|
6 | #include "prolate.h" |
---|
7 | #include <math.h> |
---|
8 | #include "libCylinder.h" |
---|
9 | #include <stdio.h> |
---|
10 | #include <stdlib.h> |
---|
11 | |
---|
12 | |
---|
13 | /** |
---|
14 | * Function to evaluate 1D scattering function |
---|
15 | * @param pars: parameters of the prolate |
---|
16 | * @param q: q-value |
---|
17 | * @return: function value |
---|
18 | */ |
---|
19 | double prolate_analytical_1D(ProlateParameters *pars, double q) { |
---|
20 | double dp[10]; |
---|
21 | |
---|
22 | // Fill paramater array |
---|
23 | dp[0] = pars->scale; |
---|
24 | dp[1] = pars->major_core; |
---|
25 | dp[2] = pars->minor_core; |
---|
26 | dp[3] = pars->major_shell; |
---|
27 | dp[4] = pars->minor_shell; |
---|
28 | dp[5] = pars->contrast; |
---|
29 | dp[6] = pars->sld_solvent; |
---|
30 | dp[7] = pars->background; |
---|
31 | dp[8] = pars->axis_theta; |
---|
32 | dp[9] = pars->axis_phi; |
---|
33 | |
---|
34 | // Call library function to evaluate model |
---|
35 | return ProlateForm(dp, q); |
---|
36 | } |
---|
37 | |
---|
38 | /** |
---|
39 | * Function to evaluate 2D scattering function |
---|
40 | * @param pars: parameters of the prolate |
---|
41 | * @param q: q-value |
---|
42 | * @return: function value |
---|
43 | */ |
---|
44 | double prolate_analytical_2DXY(ProlateParameters *pars, double qx, double qy) { |
---|
45 | double q; |
---|
46 | q = sqrt(qx*qx+qy*qy); |
---|
47 | return prolate_analytical_2D_scaled(pars, q, qx/q, qy/q); |
---|
48 | } |
---|
49 | |
---|
50 | |
---|
51 | /** |
---|
52 | * Function to evaluate 2D scattering function |
---|
53 | * @param pars: parameters of the prolate |
---|
54 | * @param q: q-value |
---|
55 | * @param phi: angle phi |
---|
56 | * @return: function value |
---|
57 | */ |
---|
58 | double prolate_analytical_2D(ProlateParameters *pars, double q, double phi) { |
---|
59 | return prolate_analytical_2D_scaled(pars, q, cos(phi), sin(phi)); |
---|
60 | } |
---|
61 | |
---|
62 | /** |
---|
63 | * Function to evaluate 2D scattering function |
---|
64 | * @param pars: parameters of the prolate |
---|
65 | * @param q: q-value |
---|
66 | * @param q_x: q_x / q |
---|
67 | * @param q_y: q_y / q |
---|
68 | * @return: function value |
---|
69 | */ |
---|
70 | double prolate_analytical_2D_scaled(ProlateParameters *pars, double q, double q_x, double q_y) { |
---|
71 | |
---|
72 | return 1.0; |
---|
73 | } |
---|
74 | |
---|