home *** CD-ROM | disk | FTP | other *** search
/ c't freeware shareware 1999 February / CT_SW9902.ISO / pc / software / wissen / daten / gnuplot.hqx / gnuplot.2.0b4 / Scripts / demo / hexa.fnc < prev    next >
Text File  |  1997-05-03  |  863b  |  28 lines

  1. #
  2. #   Use this function to fit sound velocity data as function of
  3. #   sound propagation direction, indicated by its angle against the
  4. #   z-axis of an hexagonal symmetry coordinate system
  5. #
  6. #   Adjustable parameters:
  7. #
  8. #   c33, c11, c13, c44        elastic moduli - materials constants
  9. #   phi0            angle offset
  10. #
  11.  
  12. rho         = 1000.0         # density in kg/m3
  13.  
  14. phi(x)        = (x - phi0)/360.0*2.0*pi
  15.  
  16. main(x)     = c11*sin(phi(x))**2 + c33*cos(phi(x))**2 + c44
  17. mixed(x)    = sqrt( ((c11-c44)*sin(phi(x))**2                \
  18.                     + (c44-c33)*cos(phi(x))**2)**2 +    \
  19.              4.0*sin(phi(x))**2 * cos(phi(x))**2 * (c13+c44)**2 )
  20.  
  21. vlong(x)    = sqrt(1.0/2.0/rho*(main(x) + mixed(x)))
  22. vtrans(x)   = sqrt(1.0/2.0/rho*(main(x) - mixed(x)))
  23.  
  24. # When we read the file in, we set y=index, and we use
  25. # y in this (pseudo) 3d fit to choose an x function
  26.  
  27. f(x,y)    =  y==1  ?  vlong(x)  :  vtrans(x)
  28.