(*  airy_cai_values.nb *)
(* *)
(*  Purpose: *)
(*    Evaluate the Airy Ai function*)
(*    at selected COMPLEX argument values fz(z), *)
(*    and write the data to a file. *)
(* *)
(*  Modified:  13 April 2007 *)
(*  Author:  John Burkardt *)

zvec = {};
fvec = {};
n = 10;
Do [ 
{  
theta = i * 2 * Pi / n,
z = Cos [theta] + I * Sin[theta], 
zvec = Append [ zvec, z],
f = AiryAi[z] ,
fvec = Append[fvec,f],
 Print[ "f[", z,"] = ",N[f,16]] 
}, {i,0,n-1,1} ]
num = Length [ zvec ];

fileout=OpenWrite["/Users/burkardt/public_html/math_src/test_values/airy_cai_values.txt"];
SetOptions[fileout,FormatType->TextForm];
Write[fileout,"#  airy_cai_values.txt"];today=DateList[];Write[fileout,"#  Created on ",today];Write[fileout,"#"];
Write[fileout,"#  z  fz"];
Write[fileout,"#"];
Do[{z=zvec[[i]];f=fvec[[i]];Write[fileout,N[Re[z],16],"  ",N[Im[z],16],"  ",N[Re[f],16],"  ",N[Im[f],16]]},{i,1,num,1}];Close[fileout];