|
Packit |
0986c0 |
#
|
|
Packit |
0986c0 |
# Use this function to fit sound velocity data as function of
|
|
Packit |
0986c0 |
# sound propagation direction, indicated by its angle against the
|
|
Packit |
0986c0 |
# z-axis of an hexagonal symmetry coordinate system
|
|
Packit |
0986c0 |
#
|
|
Packit |
0986c0 |
# Adjustable parameters:
|
|
Packit |
0986c0 |
#
|
|
Packit |
0986c0 |
# c33, c11, c13, c44 elastic moduli - materials constants
|
|
Packit |
0986c0 |
# phi0 angle offset
|
|
Packit |
0986c0 |
#
|
|
Packit |
0986c0 |
# HBB 970522: factored out common factor 1e9 from c?? into the
|
|
Packit |
0986c0 |
# function, to improve the fit convergence. Fit parameters were
|
|
Packit |
0986c0 |
# just too grossly different before.
|
|
Packit |
0986c0 |
|
|
Packit |
0986c0 |
rho = 1000.0 # density in kg/m3
|
|
Packit |
0986c0 |
|
|
Packit |
0986c0 |
phi(x) = (x - phi0)/360.0*2.0*pi
|
|
Packit |
0986c0 |
|
|
Packit |
0986c0 |
main(x) = c11*sin(phi(x))**2 + c33*cos(phi(x))**2 + c44
|
|
Packit |
0986c0 |
mixed(x) = sqrt( ((c11-c44)*sin(phi(x))**2 \
|
|
Packit |
0986c0 |
+(c44-c33)*cos(phi(x))**2)**2 \
|
|
Packit |
0986c0 |
+(2.0*(c13+c44)*sin(phi(x))*cos(phi(x)))**2 )
|
|
Packit |
0986c0 |
|
|
Packit |
0986c0 |
vlong(x) = sqrt(1.0/2.0/rho*1e9*(main(x) + mixed(x)))
|
|
Packit |
0986c0 |
vtrans(x) = sqrt(1.0/2.0/rho*1e9*(main(x) - mixed(x)))
|
|
Packit |
0986c0 |
|
|
Packit |
0986c0 |
# When we read the file in, we set y=index, and we use
|
|
Packit |
0986c0 |
# y in this (pseudo) 3d fit to choose an x function
|
|
Packit |
0986c0 |
|
|
Packit |
0986c0 |
f(x,y) = y==1 ? vlong(x) : vtrans(x)
|