Question: exporting plot frames as animated gif file, options.

I am learning how to do animations in Maple, and I need to export an animation I made to animated gif file.

nTerms := 20:
lam    := evalf([BesselJZeros(0,1..nTerms)]):
c      := seq(1/lam[n]^2*BesselJ(1,lam[n]/2)/BesselJ(1,lam[n])^2,n=1..nTerms):
mySol  := proc(r,t)
   local n;
   4/Pi*sum(c[n]*BesselJ(0,lam[n]*r)*sin(lam[n]*t),n=1..nTerms);
end proc:

maxTime := 5: (*seconds*)
delay   := 0.03:
nFrames := round(maxTime/delay):
frames  := Array([seq(0,i=1..nFrames)]):

frames  := [seq( plot3d([ r, theta, mySol(r,(i*delay)) ],
                   r      = 0..1,
                   theta  = 0..2*Pi,
                   coords = cylindrical,
                   axes   = none,                    
                   title  = sprintf("%s %3.2f %s","time ",(i*delay),"seconds")
                ),
             i=0..nFrames-1)
           ]:
plots:-display(convert(frames,list),insequence=true);

And the above makes

 

I have few questions which I could not find an answer for.

How to save the above sequence of images frames (in the list frames) to an animated gif file programmatically? Currently, I use plots:-display(frames,insequence=true); and then right-click on the screen out, select export->GIF  and this does save the file as animated file.

The problem with the above method, is that I have no control on telling Maple some options. For example, I want to control the amount of delay between each frame when it is played in the web page. I also want to tell Maple for example to play this once in the gif file.

These options are suppored in Mathematica. But I do not see how to do them in Maple. In Mathematica, given a list of frames (generted from a Plot command), which is the variable "frames" in the above Maple code, then one can do this

Export["anim.gif",frames,"DisplayDurations"->Table[.2,{Length@frames}]]

Now when loading anim.gif in a browser, the delay between each frame is 0.2 seconds. The "DisplayDurations" set the delay between each frame when played in the browser  automatically.

One can also add the option

"AnimationRepetitions" -> 1

and this will make the animation play one time in the browser when first loaded. Now Maple generated animation gif file plays continuously which I do not want to, this is even though inside the notebook, Maple says it will play "single" time. But this option does not seem to be exported to the animation gif file

 

 

Is there a way to configure these options? When I right-click, and export the animation to GIF file, I see no export options to change.

I could not use the export("anim.gif",frames)  command in Maple, the generated GIF file is not animated.

thank you

Please Wait...