source: sasmodels/sasmodels/models/flexible_cylinder_ex.c @ d507c3a

core_shell_microgelscostrafo411magnetic_modelrelease_v0.94release_v0.95ticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since d507c3a was 504abee, checked in by piotr, 8 years ago

converted FlexibleCylinderEx?

  • Property mode set to 100644
File size: 2.6 KB
Line 
1double form_volume(double length, double kuhn_length, double radius);
2double Iq(double q, double length, double kuhn_length, double radius,
3          double axis_ratio, double sld, double solvent_sld);
4double Iqxy(double qx, double qy, double length, double kuhn_length,
5            double radius, double axis_ratio, double sld, double solvent_sld);
6double flexible_cylinder_ex_kernel(double q, double length, double kuhn_length,
7                                double radius, double axis_ratio, double sld,
8                                double solvent_sld);
9double elliptical_crosssection(double q, double a, double b);
10
11double form_volume(double length, double kuhn_length, double radius)
12{
13    return 1.0;
14}
15
16double
17elliptical_crosssection(double q, double a, double b)
18{
19    double uplim,lolim,Pi,summ,arg,zi,yyy,answer;
20    int i,nord=76;
21
22    Pi = 4.0*atan(1.0);
23    lolim=0.0;
24    uplim=Pi/2.0;
25    summ=0.0;
26
27    for(i=0;i<nord;i++) {
28                zi = ( Gauss76Z[i]*(uplim-lolim) + uplim + lolim )/2.0;
29                arg = q*sqrt(a*a*sin(zi)*sin(zi)+b*b*cos(zi)*cos(zi));
30                yyy = pow((2.0 * J1(arg) / arg),2);
31                yyy *= Gauss76Wt[i];
32                summ += yyy;
33    }
34    answer = (uplim-lolim)/2.0*summ;
35    answer *= 2.0/Pi;
36    return(answer);
37
38}
39
40double flexible_cylinder_ex_kernel(double q,
41          double length,
42          double kuhn_length,
43          double radius,
44          double axis_ratio,
45          double sld,
46          double solvent_sld)
47{
48
49        double Pi,flex,crossSect, cont;
50
51        Pi = 4.0*atan(1.0);
52        cont = sld - solvent_sld;
53        crossSect = elliptical_crosssection(q,radius,(radius*axis_ratio));
54
55        flex = Sk_WR(q,length,kuhn_length);
56        flex *= crossSect;
57        flex *= Pi*radius*radius*axis_ratio*axis_ratio*length;
58        flex *= cont*cont;
59        flex *= 1.0e-4;
60
61        return flex;
62}
63
64double Iq(double q,
65          double length,
66          double kuhn_length,
67          double radius,
68          double axis_ratio,
69          double sld,
70          double solvent_sld)
71{
72
73        double result = flexible_cylinder_ex_kernel(q,
74                        length,
75                        kuhn_length,
76                        radius,
77                        axis_ratio,
78                        sld,
79                        solvent_sld);
80
81        return result;
82}
83
84double Iqxy(double qx, double qy,
85            double length,
86            double kuhn_length,
87            double radius,
88            double axis_ratio,
89            double sld,
90            double solvent_sld)
91{
92        double q;
93        q = sqrt(qx*qx+qy*qy);
94        double result = flexible_cylinder_ex_kernel(q,
95                        length,
96                        kuhn_length,
97                        radius,
98                        axis_ratio,
99                        sld,
100                        solvent_sld);
101
102        return result;
103}
Note: See TracBrowser for help on using the repository browser.