2

I want to create a graphics grid as in this example below, but for the manipulate example below and store that as a playable gif file. Is this possible (I would like to see each grid location running it's particular animation in unison)?

  GraphicsGrid[
   Table[GraphPlot[Table[i -> Mod[i^p, m], {i, m}]], {m, 30, 33}, {p, 2,
    5}], Frame -> All]

$~~~~~~~~~~~~~~~~~~~~~~$enter image description here

Using the following (or any method that works), I want to step through each value of $\lambda$ (that is, set $\lambda = 10$, run the steps for $\mu \in (-5, 5)$ in the first grid location, then, $\lambda = 9$, run all the $\mu$ values again and put that in the second grid location, et. al. Note, the grid is likely $2~ by~ n$ so that it is easily viewable

A user can then view the changes in the system for varying the parameters and hopefully get a sense for any bifurcations that might be occurring in the system.

  Manipulate[
    StreamPlot[{1, -(x^3/(1 + x^2)) + \[Lambda] x^2 + \[Mu]}, {x, -8, 
    8}, {y, -8, 8}], {\[Lambda], -5, 5}, {\[Mu], -5, 5}]

$~~~~~~~~~~~~~~~~~~~~~~$enter image description here

Moo
  • 3,260
  • 1
  • 12
  • 28

1 Answers1

2

Maybe this is what you want:

results = 
  Table[StreamPlot[{1, -(x^3/(1 + 
           x^2)) + λ x^2 + μ}, {x, -8, 8}, {y, -8, 8}, 
    PlotLabel -> 
     Framed[Row[{"λ \[LongEqual] ", λ, 
        ", μ \[LongEqual] ", μ}]], 
    ImageSize -> 160], {μ, -5, 5, 1}, {λ, 10, 1, -1}];

frames = Table[GraphicsGrid[Partition[r, 2]], {r, results}];

Export["frames.gif", Join[frames, Rest[Reverse[frames]]], 
 "DisplayDurations" -> .5]

frames

Here I added the option "DisplayDurations" -> .5 to the Gif export so that the frames don't rush by too quickly. I also made the animation palindromic by going through the list frames in forward and reversed order. The variation in μ takes integer steps, and that may be too coarse. But if you add too many steps it will take longer to produce the frames and export them.

Jens
  • 97,245
  • 7
  • 213
  • 499
  • That is precisely the sort of solution I was looking for and am amazed at how short it is! I would change $\lambda$ to range from ${\lambda, -5,5,1}$, but other than that - spot on! – Moo Aug 08 '16 at 04:13