File: hexa.fnc

package info (click to toggle)
gnuplot 6.0.2%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 14,940 kB
  • sloc: ansic: 95,319; cpp: 7,590; makefile: 2,470; javascript: 2,328; sh: 1,531; lisp: 664; perl: 304; pascal: 191; tcl: 88; python: 46
file content (30 lines) | stat: -rw-r--r-- 1,056 bytes parent folder | download | duplicates (22)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#
#   Use this function to fit sound velocity data as function of
#   sound propagation direction, indicated by its angle against the
#   z-axis of an hexagonal symmetry coordinate system
#
#   Adjustable parameters:
#
#   c33, c11, c13, c44		elastic moduli - materials constants
#   phi0			angle offset
#
# HBB 970522: factored out common factor 1e9 from c?? into the
#  function, to improve the fit convergence. Fit parameters were
#  just too grossly different before.

rho         = 1000.0         # density in kg/m3

phi(x)	    = (x - phi0)/360.0*2.0*pi

main(x)     = c11*sin(phi(x))**2 + c33*cos(phi(x))**2 + c44
mixed(x)    = sqrt( ((c11-c44)*sin(phi(x))**2				\
                    +(c44-c33)*cos(phi(x))**2)**2  \
                   +(2.0*(c13+c44)*sin(phi(x))*cos(phi(x)))**2 ) 

vlong(x)    = sqrt(1.0/2.0/rho*1e9*(main(x) + mixed(x)))
vtrans(x)   = sqrt(1.0/2.0/rho*1e9*(main(x) - mixed(x)))

# When we read the file in, we set y=index, and we use
# y in this (pseudo) 3d fit to choose an x function

f(x,y)	=  y==1  ?  vlong(x)  :  vtrans(x)