source: sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00/EffectiveDiameter.ipf @ 153

Last change on this file since 153 was 127, checked in by srkline, 15 years ago

LOTS of changes to the analysis ipf files:

-- see sphere.ipf for the simplest example of the changes --

  • #pragma Igor 6
  • #if directive to look for XOP
  • AAO unsmeared functions
  • STRUCT functions for smearing (also AAO)
  • new wrappers for dependencies to struct functions

(2006 models have NOT been completed yet, only the old models)

  • loading data files into data folders (PlotUtils?) + some streamlining of the loaders
  • Smear_Model_N is now AAO + some streamlining of the quadrature code

-- SHS and SW structure factor XOPs are crashing (need DP wave, I may have old XOP)
-- this breaks fitting of the smeared models until wrappers can be devised
-- all packages will be broken due to the new data folder structure
-- multiple instances of functions will now cause problems (MSA)
-- RPA model is a problem with its odd functional form (extra wave)

-- lots of other carnage to follow as the bugs and typos are shaken out

24 JUL 2007 SRK

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.