(*  laguerre_poly_values.nb *)
(* *)
(*  Purpose: *)
(*    Evaluate the Laguerre polynomials *)
(*    at selected argument values, *)
(*    and write the data to a file. *)
(* *)
(*  Modified:  27 January 2006 *)
(*  Author:  John Burkardt *)

xvec={1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 
1, 1,  1, 1/2,3,
5,10};
nvec = { 0, 1, 2, 3, 4,
5, 6, 7, 8, 9,
10,11, 12,5, 5,
5, 5 };
fvec = {};
num = Length [ xvec ];

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

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