Activated Mathematica Example 3:
Taken from
"4. Shaded Nullclines and Single ODEs"
In[32]:=
equation = x'[t] == If[Abs[x[t]] <= 2.5, x[t]^2 + t^2 - 1]; Off[NDSolve::ndnum]; shadedBackground = ContourPlot[ equation[[2, 2]] /. x[t] -> x, {t, -2.5, 2.5}, {x, -2.5, 2.5}, Contours -> 15, ContourLines -> False, PlotPoints -> 40, ColorFunction -> (GrayLevel[# 0.6 + 0.4]&), DisplayFunction -> Identity]; thickNullcline = ContourPlot[ equation[[2, 2]] /. x[t] -> x, {t, -2.5, 2.5}, {x, -2.5, 2.5}, Contours -> {0}, ContourShading -> False, PlotPoints -> 40, ContourStyle -> {Thickness[0.015]}, DisplayFunction -> Identity]; initialVals = Table[1.5 {Cos[t], Sin[t]}, {t, 0, 2 Pi, N[Pi]/10}]; solutions = x[t] /. Map[First[ NDSolve[{equation, x[#[[1]]] == #[[2]]}, x[t], {t, -2.5, 2.5}]]&, initialVals]; solutionImages = Table[ Plot[Evaluate[solutions[[i]]], {t, solutions[[i, 0, 1, 1]], solutions[[i, 0, 1, 2]]}, PlotStyle -> {{AbsoluteThickness[2], Hue[1 - 0.8 i/21]}}, DisplayFunction -> Identity], {i, 21}]; Show[{shadedBackground, thickNullcline, solutionImages}, Graphics[{PointSize[0.02], Map[Point, initialVals]}], DisplayFunction -> $DisplayFunction, AspectRatio -> Automatic];
If your output will be a sequence of graphs, select a display option.
Display as:
individual images
a movie
both of the above