(* Initial definitions *) ClearAll["@"]; Off[General::"spell", General::"spell1"]; dirhome = "C:\\sergeev\\Tulane\\math\\twodim\\examples"; dirhtml = "C:\\html\\files\\tulane\\twodim"; dirtemp = "C:\\temp\\twodim"; checkdir[dir_] := ( If[Head[dir] =!= String, Print["Error: checkdir: Undefined input string: ", dir, ". Exiting..."]; Exit[]; ]; If[FileType[dir] =!= Directory, Print["Error: checkdir: Directory ", dir, " does not exist. Exiting ..."]; Exit[]]; ); checkdir /@ {dirhome, dirhtml, dirtemp}; getfile[s_String] := Get[ToFileName[dirhome, s <> ".m"]]; print[minprior_(*0,1,2,...*), stuff__] := If[iprint > minprior, Print[stuff]]; ifwrite := (FileType[file] =!= File || ifoverwrite); display := If[ifdisplay === True, $DisplayFunction, Identity]; ifindex = (FileType[ToFileName[dirhtml, "index.htm"]] =!= File || ifoverwrite); ifpage := (FileType[ToFileName[subdirhtml, "index.htm"]] =!= File || ifoverwrite); subdirhtml := Module[{res}, If[MemberQ[handles, handle], res = ToFileName[{dirhtml, handle}]; If[FileType[res] =!= Directory, print[0, "Creating HTML sub-directory ", res]; CreateDirectory[res]]; res, Print["Error: subdirhtml: handle is incorrect: ",handle]; "C:\\temp"] ]; subdirtemp := Module[{res}, If[MemberQ[handles, handle], res = ToFileName[{dirtemp, handle}]; If[FileType[res] =!= Directory, print[0, "Creating TEMP sub-directory ", res]; CreateDirectory[res]]; res, Print["Error: subdirtemp: handle is incorrect: ",handle]; "C:\\temp"] ]; samples[rstart_, drmax_, drstart_, fr_] := Module[ {rt, mdr, rtab}, mdr = Log[drmax/drstart]/Log[fr]; rt = rstart; rtab = Table[rt = rt + drstart fr^ndr, {ndr, 0, mdr}]; Select[rtab, # < drmax &] ]; (* Upper limit of arguments where the function is non-zero *) upper[f_Function, eps_Real] := Module[ {rtab, mr, r}, rtab = samples[0, 1000, 0.01, 1.01]; mr = Length[rtab]; Do[r = rtab[[nr]]; If[Abs[f[r]] > eps, Break[]], {nr, mr, 1, -1}]; If[r == Last[rtab], print[0,"Error: upper: Upper limit of arguments not determined: The function is non-zero everywhere up to ", r]]; If[r == First[rtab], print[0,"Error: upper: Upper limit of arguments not determined: The function is zero everywhere from ", r]]; r ]; o[string_] := Write[of, string]; printnumb[numb_] := Module[ {inumb,numb1}, inumb = Round[numb]; numb1 = If[inumb == numb, inumb, numb]; ToString[NumberForm[numb1, ExponentFunction -> (Null &)]]]; getfile["examples"]; getfile["potplots"]; getfile["mapping"]; getfile["exact"]; getfile["index"]; getfile["page"];