(*  gud_values.nb *)
(* *)
(*  Purpose: *)
(*    Evaluate the Gudermannian *)
(*    function at selected argument values, *)
(*    and write the data to a file. *)
(* *)
(*  Modified:  21 January 2006 *)
(*  Author:  John Burkardt *)

xvec = { -2, -1, 0, 1/10, 2/10,
5/10, 1, 15/10, 2, 25/10,
3, 35/10, 4 };
fvec = {};
num = Length [ xvec ];

Do [ {  
x = xvec[[i]], 
f = 2 * ArcTan[ Exp[x]] - Pi / 2 ,
fvec = Append[fvec,f],
 Print[ "f[", x,"] = ",N[f,16]] 
}, {i,1, num,1} ]

fileout=OpenWrite["C:\\Documents and Settings\\burkardt\\Desktop\\Misc\\mathematica\\gud_values.txt"];
SetOptions[fileout,FormatType->TextForm];
Write[fileout,"#  gud_values.txt"];today=DateList[];Write[fileout,"#  Created on ",today];Write[fileout,"#"];
Write[fileout,"#  x  f"];
Write[fileout,"#"];
Do[{x=xvec[[i]];f=fvec[[i]];Write[fileout,N[x,16],"  ",N[f,16]]},{i,1,num,1}];Close[fileout];