I am attempting to plot a combination of StreamPlot and ParametricPlot that is a function of a parameter. When using Manipulate or Animate, the evaluation is slow but the graphs are outputted as intended.
However, when attempting to generate a Table of these plots over the same range of parameter values, Mathematica will both fail to generate any plots and will also "de-evaluate" all of my previous expressions (as if I had opened the notebook where I stored them for the first time)!
Mathematica will not output an error or otherwise indicate that there was an issue in the evaluation. Is there a simple fix, or is this some unavoidable bug?
Code that replicates the problem:
Sol[s_, T_] := {x[s], x'[s]} /.NDSolve[{x''[t] + Sin[x[t]]*(1/2 -(10)*Cos[8*t]) == 0, x[0] == Pi, x'[0] == 0.01}, x, {t, 0, T}];
p1[T_] := StreamPlot[{v, -Sin[x]*(1/2 - 10*Cos[8*T])}, {x, Pi - 0.05, Pi + 0.05}, {v, -0.05, 0.05}, StreamPoints -> Fine, FrameLabel -> {{\!\(\*OverscriptBox[\(\[CurlyPhi]\), \(.\)]\),}, {\[CurlyPhi],"\!\(\*OverscriptBox[\(\[CurlyPhi]\), \(..\)]\) + \sin(\[CurlyPhi])(1/2 - 10cos(8*" <> ToString[T] <> "))= 0"}}]
p2[T_] := ParametricPlot[Sol[s, T], {s, 0, T}];
plots2 = Table[Show[p1[T], p2[T]], {T, 0.001, 3.72*Pi, ((3.72*Pi) - 0.001)/100}];
In order to show the error isn't in the p1 or p2 objects, you can replace the Table line of code with Manipulate[Show[p1[T], p2[T]], {T, 0.001, 3.72*Pi}]
and you will find both graphs plotted correctly.