(*  chebyshev_u_values.nb *)
(* *)
(*  Purpose: *)
(*    Evaluate the Chebyshev U polynomial *)
(*    at selected argument values, *)
(*    and write the data to a file. *)
(* *)
(*  Modified:  05 January 2006 *)
(*  Author:  John Burkardt *)

nvec = {};
xvec = {};
fvec = {};
Do [ { n = i - 1, 
x = 8/10, 
f = ChebyshevU[n,x] ,
nvec = Append [ nvec, n ],
xvec = Append [ xvec, x ],
fvec = Append [ fvec, f ],
      Print["  ChebyshevU[",n,",",x,"]=",N[f,16]] },{i,1,13,1}]
num = Length [ xvec ]

fileout=OpenWrite["C:\\Documents and Settings\\burkardt\\Desktop\\Misc\\mathematica\\chebyshev_u_values.txt"];
SetOptions[fileout,FormatType->TextForm];
Write[fileout,"#  chebyshev_u_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[x,16],"  ",N[f,16]]},{i,1,num,1}];Close[fileout];