(*  mathieu_odd_values.nb *)
(* *)
(*  Purpose: *)
(*    Evaluate the eigenvalues of the Mathieu *)
(*    differential equation associated with odd *)
(*    periodic functions, for selected arguments *)
(*    and write the data to a file. *)
(* *)
(*  Modified:  19 January 2006 *)
(*  Author:  John Burkardt *)

rvec = {1, 1, 2, 2, 2,
2, 2, 2, 5, 10,
10, 15, 15 };
qvec = {0,25,0,5,10,
15, 20, 25, 15, 0,
10, 0, 20 };
bvec = {};
num = Length [ rvec ];

Do [ 
{  
r = rvec[[i]],
q = qvec[[i]], 
b = MathieuCharacteristicB[r,q] ,
bvec = Append[bvec,b],
 Print[ "b[", r, ",", q,"] = ",N[b,16]] 
}, {i,1,num,1} ]

fileout=OpenWrite["C:\\Documents and Settings\\burkardt\\Desktop\\Misc\\mathematica\\mathieu_odd_values.txt"];
SetOptions[fileout,FormatType->TextForm];
Write[fileout,"#  mathieu_odd_values.txt"];today=DateList[];Write[fileout,"#  Created on ",today];Write[fileout,"#"];
Write[fileout,"#  r  q  b"];
Write[fileout,"#"];
Do[{r=rvec[[i]];q=qvec[[i]];b=bvec[[i]];Write[fileout,r,"  ",q,"  ",N[b,16]]},{i,1,num,1}];Close[fileout];