(*  cos_power_int_values.nb *)
(* *)
(*  Purpose: *)
(*    Evaluate the sine power integral *)
(*    function at selected argument values, *)
(*    and write the data to a file. *)
(* *)
(*  Modified:  09 February 2006 *)
(*  Author:  John Burkardt *)

nvec = {0,1,2,3,4,5,6, 7, 8, 9,10};
avec= {0,0,0,0,0,0,0,0,0,0,0};
bvec = {Pi,Pi,Pi,Pi,Pi,Pi,Pi,Pi,Pi,Pi,Pi};
fvec = {};
num = Length [ nvec ];

Do [ { n = nvec[[i]],
a=avec[[i]],
b=bvec[[i]],
f = Integrate[(Cos[x])^n,{x,a,b}] ,
fvec = Append [ fvec, f],
      Print["CPI[",n,",",a,",",b,"]=",N[f,20]] },{i,1,num,1}]

fileout=OpenWrite["/panfs/panasas1/users/jburkardt/public_html/math_src/test_values/cos_power_int_values.txt"];
SetOptions[fileout,FormatType->TextForm];
Write[fileout,"#  cos_power_int_values.txt"];today=DateList[];Write[fileout,"#  Created on ",today];Write[fileout,"#"];
Write[fileout,"#  n  a  b  f"];
Write[fileout,"#"];
Do[{n=nvec[[i]];a=avec[[i]];b=bvec[[i]];f=fvec[[i]];Write[fileout,n,"  ",N[a,16],"  ",N[b,16],"  ",N[f,16]]},{i,1,num,1}];Close[fileout];