(*  elliptic_em_values.nb *)
(* *)
(*  Purpose: *)
(*    Evaluate the elliptic EM *)
(*    function at selected argument values, *)
(*    and write the data to a file. *)
(* *)
(*  Modified:  11 January 2006 *)
(*  Author:  John Burkardt *)

mvec = {};
Do [ { m = i/20,mvec = Append [ mvec, m ] },{i,0,20,1}]
fvec = {};
num = Length [ mvec ];

Do [ { m = mvec[[i]],f = EllipticE[m],
fvec = Append[fvec, f ],
      Print["  EllipticE[",m,"]]=",N[f,16]] },{i,1, num,1}]

fileout=OpenWrite["C:\\Documents and Settings\\burkardt\\Desktop\\Misc\\mathematica\\elliptic_em_values.txt"];
SetOptions[fileout,FormatType->TextForm];
Write[fileout,"#  elliptic_em_values.txt"];today=DateList[];Write[fileout,"#  Created on ",today];Write[fileout,"#"];
Write[fileout,"#  m  fx"];
Write[fileout,"#"];
Do[{m=mvec[[i]];f=fvec[[i]];Write[fileout,N[m,16],"  ",N[f,16]]},{i,1,num,1}];Close[fileout];