1 | /** |
---|
2 | * Scattering model for a oblate core shell |
---|
3 | * @author: Gervaise B Alina/ UTK |
---|
4 | */ |
---|
5 | |
---|
6 | #include "oblate.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 oblate |
---|
16 | * @param q: q-value |
---|
17 | * @return: function value |
---|
18 | */ |
---|
19 | double oblate_analytical_1D(OblateParameters *pars, double q) { |
---|
20 | double dp[8]; |
---|
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 | |
---|
32 | // Call library function to evaluate model |
---|
33 | return OblateForm(dp, q); |
---|
34 | } |
---|
35 | |
---|
36 | /** |
---|
37 | * Function to evaluate 2D scattering function |
---|
38 | * @param pars: parameters of the oblate |
---|
39 | * @param q: q-value |
---|
40 | * @return: function value |
---|
41 | */ |
---|
42 | double oblate_analytical_2DXY(OblateParameters *pars, double qx, double qy) { |
---|
43 | double q; |
---|
44 | q = sqrt(qx*qx+qy*qy); |
---|
45 | return oblate_analytical_1D(pars, q); |
---|
46 | } |
---|
47 | |
---|
48 | |
---|
49 | /** |
---|
50 | * Function to evaluate 2D scattering function |
---|
51 | * @param pars: parameters of the oblate |
---|
52 | * @param q: q-value |
---|
53 | * @param phi: angle phi |
---|
54 | * @return: function value |
---|
55 | */ |
---|
56 | double oblate_analytical_2D(OblateParameters *pars, double q, double phi) { |
---|
57 | return oblate_analytical_1D(pars, q); |
---|
58 | } |
---|
59 | |
---|
60 | /** |
---|
61 | * Function to evaluate 2D scattering function |
---|
62 | * @param pars: parameters of the oblate |
---|
63 | * @param q: q-value |
---|
64 | * @param q_x: q_x / q |
---|
65 | * @param q_y: q_y / q |
---|
66 | * @return: function value |
---|
67 | */ |
---|
68 | /* |
---|
69 | double oblate_analytical_2D_scaled(OblateParameters *pars, double q, double q_x, double q_y) { |
---|
70 | |
---|
71 | return 1.0; |
---|
72 | } |
---|
73 | */ |
---|