(*  sin_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,5,5,10,11};
avec= {10,0,0,0,0,0,0,1,0,0};
bvec = {20,1,1,1,1,1,2,2,1,1};
fvec = {};
num = Length [ nvec ];

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

fileout=OpenWrite["/Users/jburkardt/public_html/math_src/test_values/sin_power_int_values.txt"];
SetOptions[fileout,FormatType->TextForm];
Write[fileout,"#  sin_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];