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