Returns geometrical factors associated with a given prolate spheroid (for which a>b=c) The relevant formulae are given in Sec. G.3. Parameters: - a,c: scalars or row vectors [1 x G] semi-axis length along x and and z (same as y) - sOptions: string (optional) if 'L', only L_1, L_3 are returned if 'x', or 'z', only properties related to corresponding axis are computed if 'All' (default), then all properties are returned Returns: - stEllGeom: structure with fields, all of size [1 x G] stEllGeom.a, c for future reference stEllGeom.S: surface area (in squared units of a, b, and c) stEllGeom.type: ='Prolate' (type of ellipsoid) stEllGeom.L1, L3: Geometrical factors (see Sec. G.1.5) stEllGeom.exix2ave: <|e_xi . e_x|^2> stEllGeom.exiz2ave: <|e_xi . e_z|^2> stEllGeom.exix4ave: <|e_xi . e_x|^4> stEllGeom.exiz4ave: <|e_xi . e_z|^4> stEllGeom.exix2z2ave: <|e_xi . e_x|^2 |e_xi . e_z|^2> stEllGeom.exiy2z2ave: <|e_xi . e_y|^2 |e_xi . e_z|^2> This file is part of the SPlaC v1.0 package (copyright 2008) Check the README file for further information
0001 if nargin<4, sOption='All'; end 0002 0003 bxaxis=true; bzaxis=true; 0004 if strcmpi(sOption,'x'), bzaxis=false; end 0005 if strcmpi(sOption,'z'), bxaxis=false; end 0006 0007 stEllGeom.a=a; 0008 stEllGeom.c=c; 0009 stEllGeom.type='Prolate'; % for reference 0010 0011 stEllGeom.h=a./c; % aspect ratio 0012 ep=sqrt(1-(c./a).^2); % eccentricity (Eq. G.60, note that the srqt is missing in the book) 0013 stEllGeom.e=ep; 0014 0015 fp=1./sqrt(1-ep.^2)./(ep) .* asin(ep); % Eq. G.62 0016 0017 % surface area 0018 stEllGeom.S=2*pi*c.^2 .* (1+fp); % Eq. G. 63 0019 0020 % geometrical factors 0021 L1=(1-ep.^2)./(ep.^2) .* ( -1 + 1./(2*ep) .* log((1+ep)./(1-ep)) ); % Eq. G.61 0022 0023 if (bxaxis) 0024 stEllGeom.L1=L1; 0025 end 0026 if (bzaxis) 0027 stEllGeom.L3=(1-L1)/2; % Eq. G.61 0028 end 0029 0030 if ~strcmpi(sOption,'L') % compute other geometrical averages 0031 0032 exiz2ave=1./(2*ep.^2) .*(1-(1-2*ep.^2).*fp)./(1+fp); % Eq. G.65 0033 exiz4ave=3/8./ep.^4 .*(3-2*ep.^2-(3-4*ep.^2).*fp)./(1+fp); % Eq. G.66 0034 if (bxaxis) 0035 stEllGeom.exix2ave=(1-2*exiz2ave); 0036 stEllGeom.exix4ave=1-4*exiz2ave+8/3*exiz4ave; % Eq. G.67 0037 % alternative direct calculation 0038 % stEllGeom.exix4ave=(1-ep.^2)./ep.^4.*(3-ep.^2-3*(1-ep.^2).*fp)./(1+fp); 0039 end 0040 if (bzaxis) 0041 stEllGeom.exiz2ave=exiz2ave; 0042 stEllGeom.exiz4ave=exiz4ave; 0043 end 0044 if strcmpi(sOption,'All') 0045 stEllGeom.exix2z2ave= (1-2*exiz2ave-stEllGeom.exix4ave)/2; 0046 stEllGeom.exiy2z2ave=(1-2*stEllGeom.exix2ave+stEllGeom.exix4ave ... 0047 -2*exiz4ave)/2; 0048 end 0049 end 0050 0051 0052 0053