source: sans/Dev/trunk/NCNR_User_Procedures/SANS_Analysis/Models/EffectiveDiameter_v40.ipf @ 325

Last change on this file since 325 was 325, checked in by ajj, 15 years ago

Adding SANS Analysis Models to new Dev tree

File size: 1.3 KB
Line 
1#pragma rtGlobals=1             // Use modern global access method.
2#pragma IgorVersion = 6.0
3
4// these routines are used to calculate an effective spherical diameter for
5// a non-spherical object, either a cylinder or an  ellipsoid
6//
7// the functions calculate the 2nd virial coefficient for the non-spherical
8// object, then find the diameter of sphere that has this value of virial
9// coefficient
10//
11// - so the calculation at least has some thermodynamic basis, rather than
12// some simplistic volume correction
13//
14
15//prolate OR oblate ellipsoids
16//aa is the axis of rotation
17//if aa>bb, then PROLATE
18//if aa<bb, then OBLATE
19// A. Isihara, J. Chem. Phys. 18, 1446 (1950)
20//returns DIAMETER
21
22Function DiamEllip(aa,bb)
23        Variable aa,bb
24       
25        Variable ee,e1,bd,b1,bL,b2,del,ddd,diam
26       
27        if(aa>bb)
28                ee = (aa^2 - bb^2)/aa^2
29        else
30                ee = (bb^2 - aa^2)/bb^2
31        Endif
32       
33        bd = 1-ee
34        e1 = sqrt(ee)
35        b1 = 1 + asin(e1)/(e1*sqrt(bd))
36        bL = (1+e1)/(1-e1)
37        b2 = 1 + bd/2/e1*ln(bL)
38        del = 0.75*b1*b2
39       
40        ddd = 2*(del+1)*aa*bb*bb                //volume is always calculated correctly
41        diam = ddd^(1/3)
42       
43        return (diam)
44End
45
46//effective DIAMETER of a cylinder of total height hcyl and radius rcyl
47//
48Function DiamCyl(hcyl,rcyl)
49        Variable hcyl,rcyl
50       
51        Variable diam,a,b,t1,t2,ddd
52       
53        a = rcyl
54        b = hcyl/2
55        t1 = a*a*2*b/2
56        t2 = 1 + (b/a)*(1+a/b)*(1+pi*a/b/2)
57        ddd = 3*t1*t2
58        diam = ddd^(1/3)
59       
60        return (diam)
61End
Note: See TracBrowser for help on using the repository browser.