Results Commands
Animation
Create animations of plots, saved to a file or shown in a player in the COMSOL Desktop main window.
Syntax
model.result().export().create(<ftag>,"Animation");
model.result().export(<ftag>).set(property, <value>);
model.result().export(<ftag>).run();
Description
model.result().export().create(<ftag>,"Animation") creates an animation feature with the name <ftag>.
result().export(<ftag>).set("plotgroup", <ptag>) changes the source of the animation to the plot group named <ptag>.
The following properties are available:
on | off
on | off
on | off
on | off
current | color
fullharm | halfharm | linear
on | off
on | off
all | number
on | off
The parameter’s start value if sweeptype is globalparameter.
The parameter’s stop value if sweeptype is globalparameter.
The unit of the parameter if sweeptype is globalparameter.
on | off
The times to use, for transient levels, that the multilooplevel property points to. Available when the underlying data is transient, looplevelinput is interp.
on | off
on | off
The solutions to use. Applicable to the level that the multilooplevel property points to, when looplevelinput is manual.
An alternate way to specify the solutions to use, allowing you to enter, for example, range(1,1,20). Applicable to the level that the multilooplevel property points to, when looplevelinput is manualindices.
all | manual | manualindices | interp
How to input the solution to use, for the level that multilooplevel points to. manual indicates that looplevel is used for that level. manualindices indicates that looplevelindices is used for that level. interp indicates that interp is used for that level.
gif | flash | avi
The loop level to animate over. Only applied if solnumtype is pointing to the same level and solrepresentation is solutioninfo
on | off
first | last | all
When solnumtype is outer, outerinnertype controls whether to plot all, the first or the last inner solution. Applicable only for parametric sweep models.
The parameter’s start value if sweeptype is parameter.
The parameter’s stop value if sweeptype is parameter.
The unit of the parameter if sweeptype is parameter.
on | off
Time corresponding to last selected solnum for transient levels.
The time to use, for transient levels with the level pointed to by multilooplevel exempt. Available when the underlying data is transient.
The index of the solution to use, per level with the level pointed to by multilooplevel exempt, or interp, but only when the underlying data is transient.
level1 | level2 | level3 | all | inner | outer
solutions | parameter | globalparameter | dde
file | player
on | off
on | off
imageseq | movie
Example
Create a 2D animation of a surface and contour plot:
Code for Use with Java
ExportFeature amim = model.result().export().create("c2","pg1","Animation");
anim.set("plotgroup", "pg1");
anim.run();
Code for Use with MATLAB
anim = model.result.export.create('c2','pg1','Animation');
anim.set('plotgroup', 'pg1');
anim.export('c2').run;
See Also
Image1D, Image2D, Image3D