1 | // header for TwoPhaseFit.c |
---|
2 | |
---|
3 | //function prototypes |
---|
4 | /* IGOR Fit Functions */ |
---|
5 | double TeubnerStreyModel(double dp[], double q); |
---|
6 | double Power_Law_Model(double dp[], double q); |
---|
7 | double Peak_Lorentz_Model(double dp[], double q); |
---|
8 | double Peak_Gauss_Model(double dp[], double q); |
---|
9 | double Lorentz_Model(double dp[], double q); |
---|
10 | double Fractal(double dp[], double q); |
---|
11 | double DAB_Model(double dp[], double q); |
---|
12 | double OneLevel(double dp[], double q); |
---|
13 | double TwoLevel(double dp[], double q); |
---|
14 | double ThreeLevel(double dp[], double q); |
---|
15 | double FourLevel(double dp[], double q); |
---|
16 | double BroadPeak(double dp[], double q); |
---|
17 | double CorrLength(double dp[], double q); |
---|
18 | double TwoLorentzian(double dp[], double q); |
---|
19 | double TwoPowerLaw(double dp[], double q); |
---|
20 | double PolyGaussCoil(double dp[], double q); |
---|
21 | double GaussLorentzGel(double dp[], double q); |
---|
22 | double GaussianShell(double dp[], double q); |
---|
23 | |
---|
24 | |
---|
25 | /* internal functions */ |
---|
26 | static double |
---|
27 | gammln(double xx) { |
---|
28 | |
---|
29 | double x,y,tmp,ser; |
---|
30 | static double cof[6]={76.18009172947146,-86.50532032941677, |
---|
31 | 24.01409824083091,-1.231739572450155, |
---|
32 | 0.1208650973866179e-2,-0.5395239384953e-5}; |
---|
33 | int j; |
---|
34 | |
---|
35 | y=x=xx; |
---|
36 | tmp=x+5.5; |
---|
37 | tmp -= (x+0.5)*log(tmp); |
---|
38 | ser=1.000000000190015; |
---|
39 | for (j=0;j<=5;j++) ser += cof[j]/++y; |
---|
40 | return -tmp+log(2.5066282746310005*ser/x); |
---|
41 | } |
---|
42 | |
---|
43 | |
---|