(* Printing head of list of examples *)
Get["\\sergeev\\purdue\\math\\packages\\printing.m"];
<< Graphics`Graphics`; << Graphics`MultipleListPlot`;
rndm := ToString[Random[Integer, {0, 999999}]];
p[s_String] := Write[of, s];
Discriminant[p_?PolynomialQ, x_] :=
With[{n = Exponent[p, x]},
Cancel[((-1)^(n(n - 1)/2)Resultant[p, D[p, x], x])/
Coefficient[p, x, n]^(2n - 1)]];
(* Printing navigation line at bottom of each table or figure *)
printnav := (
"<FONT SIze=\"-2\"><A HREF=\"#top\"><IMG SRC=\"../../../../iconz/top.gif\" WIDTH=13 HEIGHT=9 BORDER=0 ALT=\"Top of Page\" ALIGN=\"MIDDLE\"></A> <A HREF=\"#top\">Top of the page</A> " // p;
If[nser != 1,
namem = names[[nser-1]];
nameml = StringReplace[ToLowerCase[namem], "+" -> "-"];
ref = "../" <> nameml <>"/index.htm#" <> sect;
" <A HREF=\"" <> ref <> "\"><IMG SRC=\"../../../../iconz/top270.gif\" WIDTH=9 HEIGHT=13 BORDER=0 ALT=\"Previous Example\" ALIGN=\"MIDDLE\"></A> <A HREF=\"" <> ref <> "\">Prev. (" <> namem <> ")</A>" // p];
" <A HREF=\"#" <> sect <> "\"><IMG SRC=\"../../../../iconz/top.gif\" WIDTH=13 HEIGHT=9 BORDER=0 ALT=\"Top of" <> entity <> "\" ALIGN=\"MIDDLE\"></A> <A HREF=\"#" <> sect <> "\">Top of this " <> entity <> " (" <> name <> ")</A>" // p;
If[nser != mser,
namep = names[[nser+1]];
namepl = StringReplace[ToLowerCase[namep], "+" -> "-"];
ref = "../" <> namepl <>"/index.htm#" <> sect;
" <A HREF=\"" <> ref <> "\"><IMG SRC=\"../../../../iconz/top90.gif\" WIDTH=9 HEIGHT=13 BORDER=0 ALT=\"Next Example\" ALIGN=\"MIDDLE\"></A> <A HREF=\"" <> ref <> "\">Next (" <> namep <> ")</A>" // p];
" " // p;
" <A HREF=\"../" <> sect <> ".htm\"><IMG SRC=\"../../../../iconz/smalldig.gif\" WIDTH=12 HEIGHT=17 BORDER=0 ALT=\"Mathematica program\" ALIGN=\"MIDDLE\"></A> <A HREF=\"../" <> sect <> ".htm\"><I>Mathematica</I> program</A>" // p;
"</FONT><BR><BR>" // p;
);
(* Printing Mathematica program in HTML-format *)
htmlrepl[s_String] := StringReplace[s, {"<"->"<", ">"->">", "&"->"&", "\""->"""}];
flankblank[s_String]:=
Module[{s0,s9},
If[s=="",s,
If[s0=StringTake[s,1];s0==" "||s0=="\n",flankblank[StringDrop[s,1]],
If[s9=StringTake[s,-1];s9==" "||s9=="\n",flankblank[StringDrop[s,-1]],s]]]
];
printprogrs = {};
printprogr[sect_String] := If[!MemberQ[printprogrs, sect],
progfile = ToFileName[dirhome, sect <> ".m"];
progtext = Import[progfile, "Text"];
sp1 = StringPosition[progtext, "(*"];
sp2 = StringPosition[progtext, "*)"];
progtitle =
If[sp1 =!= {} && sp2 =!= {},
StringTake[progtext, {sp1[[1, 2]] + 1, sp2[[1, 1]] - 1}], ""];
{progtext,progtitle} = htmlrepl/@flankblank/@{progtext,progtitle};
outfile = ToFileName[dirhtml, sect <> ".htm"];
of1 = OpenWrite[outfile, PageWidth -> Infinity, FormatType -> OutputForm];
proghtml = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2//EN\">\n
<HTML><HEAD>\n
<TITLE>" <> progtitle <> "</TITLE>\n
<META http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\n
<META name=\"description\" content=\"Source text of Mathematica program used for study of MP perturbation series\">\n
<META name=\"keywords\" content=\"Mathematica, programming, computation, Moller Plesset perturbation theory, summation, Pade approximants\">\n
</HEAD><BODY BACKGROUND=\"../../../iconz/bg-calc.gif\">\n
<H1>" <> progtitle <> "</H1>\n
<H2><I>Mathematica</I> program</H2>\n
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=10 BGCOLOR=\"#FEF8CB\"><TR>\n
<TD><PRE>" <> progtext <> "</PRE></TD></TR></TABLE>\n
<BR>\n
<TABLE><TR ALIGN=\"CENTER\">\n
<TD ALIGN=\"CENTER\" VALIGN=\"CENTER\"><A HREF=\"proglist.htm\">All <I>Mathematica</I> programs used to study M. - P. series</A></TD>\n
<TD ALIGN=\"CENTER\" VALIGN=\"TOP\"><img SRC=\"../../../blank.gif\" WIDTH=32 HEIGHT=43 ALT=\"Blank\"></TD>\n
<TD ALIGN=\"CENTER\" VALIGN=\"CENTER\"><A HREF=\"../index.htm\">Work in UMassD</A></TD>\n
<TD ALIGN=\"CENTER\" VALIGN=\"TOP\"><IMG SRC=\"../../../blank.gif\" WIDTH=32 HEIGHT=43 ALT=\"Blank\"><IMG SRC=\"../../waste.gif\" WIDTH=32 HEIGHT=43 ALT=\"Waste icon\"></TD>\n
<TD ALIGN=\"CENTER\" VALIGN=\"CENTER\"><A HREF=\"../../reports.htm\">Unpublished reports</A></TD>\n
</TR></TABLE>\n
<P><FONT SIZE=\"-2\">Designed by <A HREF=\"../../../index.htm\">A. Sergeev</A></FONT>.</P>\n
</BODY>\n
</HTML>";
Write[of1, proghtml];
Close[of1];
plist = "
<TR ALIGN=\"CENTER\" VALIGN=\"MIDDLE\" BGCOLOR=\"#" <> If[EvenQ[Length[printprogrs]],"FFFFFF","E0E0E0"] <> "\">\n
<TD><TT><A HREF=\"" <> sect <> ".htm\">" <> sect <> "</A></TT></TD>\n
<TD>" <> progtitle <> "</TD></TR>";
Write[oproglist, plist];
printprogrs = Append[printprogrs, sect];
];
(* Starting list of Mathematica programs *)
proglistfile = ToFileName[dirhtml, "proglist.htm"];
oproglist = OpenWrite[proglistfile, PageWidth -> Infinity, FormatType -> OutputForm];
plist = "
<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2//EN\">\n
<HTML>\n
<HEAD>\n
<TITLE>Programs to display results of summation of Moller-Plesset perturbation series as web-pages</TITLE>\n
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\n
<META name=\"description\" content=\"Texts of programs for Mathematica software used to calculate and display coefficients of Moller-Plesset perturbation theory, partial sums, Pade approximants, singularities etc.\">\n
<META name=\"keywords\" content=\"quantum mechanics, Moller Plesset perturbation theory, summation, Pade approximants\">\n
</HEAD>\n
<BODY BACKGROUND=\"../../../iconz/bg-calc.gif\">\n
<H1><I>Mathematica</I> programs to display results of summation of Moller-Plesset perturbation series as web-pages</H1>\n
\n
<H2>Main program</H2>\n
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=10 BGCOLOR=\"#FEF8CB\"><TR>\n
<TD><PRE>(* Display results for each example of series in HTML - format *)\n
Clear["@"];\n
itest = 0; (* 1 for testing *)\n
newabc = True; (* re - calculate parameters a, b, c *)\n
newfigure = True; (* re - create figure files *)\n
dirhtml = "C:\\html\\files\\umassd\\mollerpl";\n
dirser = "C:\\sergeev\\umassd\\dgoodson\\projects\\qsum\\series";\n
dirhome = "C:\\sergeev\\umassd\\math\\internet";\n
If[FileType[dirhtml] =!= Directory,\n
Print["Creating HTML-directory ", dirhtml]; CreateDirectory[dirhtml]];\n
Get["\\sergeev\\umassd\\math\\series\\read.m"];\n
SetDirectory[dirhome];\n
\n
<< indhead.m;\n
Do[\n
<< indline.m;\n
<< head.m;\n
<< ctable.m;\n
<< cplot.m;\n
<< cplots.m;\n
<< errors.m;\n
<< sings3.m;\n
<< foot.m,\n
{nser, mser}];\n
<< indfoot.m;</PRE></TD></TR></TABLE>\n
\n
<H2>Sub-programs</H2>\n
<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=5 BGCOLOR=\"C0C0C0\">\n
<TR ALIGN=\"CENTER\" VALIGN=\"MIDDLE\" BGCOLOR=\"#FFFFFF\">";
Write[oproglist,plist];
plt0 = ListPlot[{{0, 0}}, PlotStyle -> {PointSize[0]},
DisplayFunction -> Identity];
names = Select[names, exact[#] != 0 &];
mser = Length[names];
mrul = mser; (* to shrink ruler, decrease to ~20 *)
names1 = names;
ruler = "<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=5>";
While[(m = Length[names1]) != 0,
ruler = ruler <> "<TR>";
Do[
c = If[nrul <= m,
name = names1[[nrul]];
namel = StringReplace[ToLowerCase[name], "+" -> "-"];
"<FONT SIZE=\"-2\"><A HREF=\"../" <> namel <> "/index.htm\">" <> name <> "</A></FONT>",
" "];
ruler = ruler <> "<TD>" <> c <> "</TD>"
, {nrul, mrul}];
ruler = ruler <> "</TR>";
names1 = Drop[names1, Min[m, mrul]]];
ruler = ruler <> "</TABLE>";
indfile = ToFileName[dirhtml, "index.htm"];
indf =
OpenWrite[indfile, PageWidth -> Infinity,
FormatType -> OutputForm];
of = indf;
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2//EN\">" // p;
"<HTML><HEAD>" // p;
"<TITLE>Examples of Moller-Plesset perturbation theory for different molecules</TITLE>" // p;
"<META name=\"description\" content=\"Details of computations for each example of MP perturbation series\">" // p;
"<META name=\"keywords\" content=\"quantum mechanics, Moller Plesset perturbation theory, summation, Pade approximants\">" // p;
"</HEAD><BODY BGCOLOR=\"#C0C0C0\">" // p;
"<H1>Examples of Moller-Plesset perturbation theory</H1>" // p;
"<TABLE BORDER=1 CELLSPACING=1 CELLPADDING=5>" // p;
"<TR><TH ALIGN=\"CENTER\" VALIGN=\"MIDDLE\" BGCOLOR=\"#FFFFFF\" COLSPAN=4>List of examples. " <>
"To view details for each example, follow a link to its name</TH></TR>" // p;
"<TR ALIGN=\"LEFT\" VALIGN=\"MIDDLE\" BGCOLOR=\"#FEF8CB\"><TH WIDTH=\"13%\">Name</TH>" <>
"<TH WIDTH=\"13%\">System</TH><TH WIDTH=\"8%\">Class</TH><TH>Moller-Plesset perturbation series</TH></TR>" // p;
printprogr["indhead"]; |