0

I am solving the Cahn hilliard equation, and it's already working. If i plot the figures at different iterations I obtain the correct result at the end. However, I need to show the change in concentration over the course of time in a video and not in multiple plots. I have tried using FuncAnimation but I can't figure out how to do it. I can't create a function that includes the frames. My concentration matrix is already updating after each iteration so how can I just tell the code to plot every update on the video?

  • what about saving those multiple plots into files, then create animated gifs from them (e.g.: https://stackoverflow.com/questions/753190/programmatically-generate-video-or-animated-gif-in-python ) – Kristian May 24 '21 at 01:08
  • Hello thank you for your comment. This would not work since I would have to generate a plot at each iteration(12000 iterations) and then create animated gifs . This will make my code very slow and inefficient. – joey challita May 24 '21 at 05:23
  • If you show 12.000 frames at real time, assuming you use 30 frame per second, you'd end with 12.000/30=400second=6.67minutes of animation – Kristian May 24 '21 at 10:53
  • Rather than that, I think it's better to sample those 12.000 frames (or iteration) and limit it to 30-150 frames (only save plot for i mod 100 th iteration) – Kristian May 24 '21 at 10:55

0 Answers0