Skip to main content
2 of 2
Formatted code, special characters, tags
MarcoB
  • 67.7k
  • 18
  • 96
  • 198

Create a GIF from animated plots

ss1 = NDSolve[{x'[t] == (1 - (x[t]^2 + y[t]^2))*x[t] + ω[t]*y[t] + 1.3*Sin[11*t], 
               y'[t] == (1 - (x[t]^2 + y[t]^2))*y[t] - ω[t]*x[t],
               ω'[t] == 1.3*Sin[11*t]*y[t]/(Sqrt[x[t]^2 + y[t]^2]), 
               x[0] == 1, y[0] == 0, ω[0] == 2}, {x, y, ω}, {t, 0, 200*Pi}];
Animate[
  Show[
    ParametricPlot[
      Evaluate[{x[t], y[t]} /. ss1], {t, tmax - 1, tmax}, 
      PlotStyle -> {Thick, Green}, PlotRange -> 1.4, AspectRatio -> 1, 
      PerformanceGoal -> "Quality"
    ], 
    Graphics[{PointSize[.03], Red, Point@{x[tmax], y[tmax]} /. ss1}, PlotRange -> 1.4], 
    ParametricPlot[
      Evaluate[{x[t], y[t]} /. ss1], {t, 626, 200*Pi}, 
      PlotRange -> 1.2, PlotStyle -> {Thick, Orange}, 
      ImageSize -> Medium, Frame -> True, 
      FrameLabel -> {{Style["V", Bold], None}, {Style["X", Bold], None}}
    ]
  ], 
  {tmax, 1, 200*Pi}, DefaultDuration -> 200 π, AnimationRate -> 0.03
]

I would like to export my animation as a GIF (a good visualization for presentation). I tried a lot of different ways of making it work but unfortunately I could not make it.