(*  bessel_in_values.nb *)
(* *)
(*  Purpose: *)
(*    Evaluate the Bessel I function at *)
(*    selected orders N and argument values X, *)
(*    and write the data to a file. *)
(* *)
(*  Modified:  09 December 2005 *)
(*  Author:  John Burkardt *)

nvec={2,2,2,2,2,2,2,2,3,3,3,3,3,5,5,5,5,5,10,10,10,10,10,20,20,20,20,20}
xvec = {2/10,1,2,25/10,3,5,10,20,1,2,5,10,50,1,2,5,10,50,1,2,5,10,50,1,2,5,10,50}
fvec = {};
num = Length[nvec];

Do [ {
 n=nvec[[i]],
x = xvec[[i]], 
f = BesselI[n,x] ,
fvec = Append [ fvec, f ],
      Print["  BesselI[",n,",",x,"]=",N[f,16]] },{i,1,num,1}]

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