(* Plotting the function nearby its minimum *)
(* Choosing range *)
nmax = 16;
res=TimeConstrained[(fexp = Series[fun, {x, xmin, nmax}];), 3, False];
If[res===False,
nmax = 6;
fexp = Series[fun, {x, xmin, nmax}];
];
Do[c[n] = SeriesCoefficient[fexp, n], {n, 0, nmax}];
dxn = Table[If[c[n] == 0, 999, Abs[(c[n]/c[2])]^(-1/(n - 2))], {n, 3, nmax}];
dx = Min[dxn, 100];
{x1, x2} = {xmin - dx, xmin + dx};
rat=1/GoldenRatio//N;
plt = Plot[fun, {x, x1, x2},
Background -> RGBColor[1, 1, 0.8],
ImageSize -> 72 6,
AspectRatio -> rat,
PlotStyle -> {RGBColor[0, 0, 1]},
AxesLabel -> {"x", fname <> "(x)"},
TextStyle -> {18},
DisplayFunction -> Identity
];
(
If[Head[plt] === Graphics,(*Saving picture*)
outfile = program <> "-pot.gif";
pictfile = ToFileName[{dirtemp},outfile];
Export[pictfile, plt, "GIF", ImageSize -> {432,266}](*;
Run["chmod 755 " <> pictfile]*),
Goto[nograph];
];
(*Reference to the picture*)
Print["
"];
Print["
httpHost <> "/system/temp/"<>outfile<>"?" <> rndstring <>
"\" WIDTH=432 HEIGHT=266 ALT=\"Graph of the function "<>fname<>"(x) near its minimum\"> | "];
Print["Behavior of the potential ",fname,"(x) around its minimum |
|
"];
Label[nograph];
)