source: sasmodels/sasmodels/models/lib/gfn.c @ 81dd619

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

Converted CoreShellEllipsoid?

  • Property mode set to 100644
File size: 1.0 KB
Line 
1//
2//     FUNCTION gfn4:    CONTAINS F(Q,A,B,MU)**2  AS GIVEN
3//                       BY (53) & (58-59) IN CHEN AND
4//                       KOTLARCHYK REFERENCE
5//
6//       <OBLATE ELLIPSOID>
7// function gfn4 for oblate ellipsoids
8double
9gfn4(double xx, double crmaj, double crmin, double trmaj, double trmin, double delpc, double delps, double qq)
10{
11        // local variables
12        double aa,bb,u2,ut2,uq,ut,vc,vt,siq,sit,gfnc,gfnt,tgfn,gfn4,pi43,Pi;
13
14        Pi = 4.0*atan(1.0);
15        pi43=4.0/3.0*Pi;
16        aa = crmaj;
17        bb = crmin;
18        u2 = (bb*bb*xx*xx + aa*aa*(1.0-xx*xx));
19        ut2 = (trmin*trmin*xx*xx + trmaj*trmaj*(1.0-xx*xx));
20        uq = sqrt(u2)*qq;
21        ut= sqrt(ut2)*qq;
22        vc = pi43*aa*aa*bb;
23        vt = pi43*trmaj*trmaj*trmin;
24        if (uq == 0.0){
25                siq = 1.0/3.0;
26        }else{
27                siq = (sin(uq)/uq/uq - cos(uq)/uq)/uq;
28        }
29        if (ut == 0.0){
30                sit = 1.0/3.0;
31        }else{
32                sit = (sin(ut)/ut/ut - cos(ut)/ut)/ut;
33        }
34        gfnc = 3.0*siq*vc*delpc;
35        gfnt = 3.0*sit*vt*delps;
36        tgfn = gfnc+gfnt;
37        gfn4 = tgfn*tgfn;
38
39        return (gfn4);
40}
Note: See TracBrowser for help on using the repository browser.