home *** CD-ROM | disk | FTP | other *** search
/ Frostbyte's 1980s DOS Shareware Collection / floppyshareware.zip / floppyshareware / DPSX / TOOL-INC.ZIP / API1123.INC < prev    next >
Encoding:
Text File  |  1990-05-10  |  877 b   |  40 lines

  1. (* ------------------------------------------------------------ *)
  2. (*
  3.  * api1123 - calculation for api standard 12.2.3
  4.  *           water calibration of volumetric provers, aug 1984
  5.  *           as defined in 11.2.3.5
  6.  *
  7.  * returns water density in gm/cc for a given 'f temperature.
  8.  *)
  9. function api1123 (t: real): real;
  10. var
  11.    t2,t3,t4,t5: real;
  12.    rho:         real;
  13.  
  14. begin
  15.  
  16. (********
  17.    if (t < 32.0) or (t > 105.0) then
  18.    begin
  19.       api1123 := 99;
  20.       exit;
  21.    end;
  22. *********)
  23.  
  24.    t := (t-32.0) / 1.8;  {F to C}
  25.    t2 := t*t;
  26.    t3 := t2*t;
  27.    t4 := t3*t;
  28.    t5 := t4*t;
  29.    rho := 999.839563900000000000
  30.           + 0.067982999890000000 * t
  31.           - 0.009106025564000000 * t2
  32.           + 0.000100527299900000 * t3
  33.           - 0.000001126713526000 * t4
  34.           + 0.000000006591795606 * t5;
  35.  
  36.    api1123 := rho / 1000.0;
  37. end;
  38.  
  39.  
  40.