(*  owen_values.nb *)
(* *)
(*  Purpose: *)
(*    Evaluate the Owen *)
(*    function at selected argument values, *)
(*    and write the data to a file. *)
(* *)
(*  Modified:  03 February 2006 *)
(*  Author:  John Burkardt *)

hvec = { 1, 1,1,1,1/2,1/2,1/2,1/2,1/4,1/4,1/4,1/4,1/8,1/8,1/8,1/8,1/128,1/128,1/128,1/128,1/128,1/128};
avec = { 1/2,1,2,3, 1/2,1, 2, 3,1/2,1,2,3,1/2,1,2,3,1/2,1,2,3,10,100};
fvec = {};
num = Length [ hvec ];

g[h_,x_] := E^(-h^2*(1+x^2)/2)/(1+x^2)
Do [ { h = hvec[[i]], a=avec[[i]],
f=1/(2*Pi)*Integrate[g[h,x],{x,0,a}],
fvec = Append [ fvec, f ],
      Print["T[",h,",",a,"]=",N[f,16]] },{i,1,num,1}]

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