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

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

Do [ 
{  
r = rvec[[i]],
q = qvec[[i]], 
a = MathieuCharacteristicA[r,q] ,
avec = Append[avec,a],
 Print[ "a[", r, ",", q,"] = ",N[a,16]] 
}, {i,1,num,1} ]

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