(*  cinh_values.nb *)
(* *)
(*  Purpose: *)
(*    Evaluate the Cinh function *)
(*    at selected argument values, *)
(*    and write the data to a file. *)
(* *)
(*  Modified:  25 March 2010 *)
(*  Author:  John Burkardt *)

xvec = {0/10, 5/10, 6/10, 7/10, 8/10, 9/10, 1, 12/10, 14/10, 16/10, 18/10, 2, 25/10, 30/10, 35/10, 40/10, 45/10}
fvec = {};
num = Length [ xvec ]

Do [ { x = xvec[[i]], f = Integrate[(Cosh[t] - 1 ) / t, { t, 0, x}] ,
fvec = Append [ fvec, f ],
      Print["  Cinh[",x,"]=",N[f,16]] },{i,1,num,1}]

fileout=OpenWrite["/Users/burkardt/public_html/math_src/test_values/cinh_values.txt"];
SetOptions[fileout,FormatType->TextForm];
Write[fileout,"#  cinh_values.txt"];today=DateList[];Write[fileout,"#  Created on ",today];Write[fileout,"#"];
Write[fileout,"#  x  fx"];
Write[fileout,"#"];
Do[{x=xvec[[i]];f=fvec[[i]];Write[fileout,N[x,16],"  ",N[f,16]]},{i,1,num,1}];Close[fileout];