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
The quality of the AVI file if movietype is avi; higher is better.
on | off
If options is on; enable/disable display of the coordinate axes. Used for 1D and 2D animations.
on | off
If options is on; enable/disable display of the axis orientation indicator. Used for 3D animations.
current | color | fromtheme | transparent
on | off | auto
If background is set to color, the red, green, and blue components of the background color.
fullharm | halfharm | linear
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
If options is on; enable/disable display of the coordinate grid. Used for 3D animations.
The times to use, for transient levels, that the multilooplevel property points to. Available when the underlying data is transient, looplevelinput is interp.
true | false
If true, then the aspect ratio of the image is preserved when the width or the height is changed. Available if size is manual.
true | false
on | off
If options is on; enable/disable display of the legend.
on | off
If options is on; enable/disable display of the logo.
The solutions to use. Applicable to the level that the multilooplevel property points to, when looplevelinput is manual.
An alternative 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 | avi | webm
The movie format to use if type is movie: GIF, AVI, or WebM.
The loop level to animate over. Only applied if solnumtype is pointing to the same level and solrepresentation is set to 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 streamline plot to animate if sweeptype is set to streamline.
The parameter’s start value if sweeptype is set to parameter.
The parameter’s stop value if sweeptype is set to parameter.
The unit of the parameter if sweeptype is set to parameter.
off | forever | iterations
Whether to repeat from the beginning when the end is reached when playing. If forever, iterate until stopped. If iterations, as many times as given in iterations.
true | false
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.
current | hd | manual
The solutions to animate if sweeptype is solutions.
level1 | level2 | level3 | all | inner | outer
solutions | parameter | globalparameter | dde | streamline
file | player
on | off
If options is on; enable/disable display of the title.
imageseq | movie
automatic | manual
vp8 | vp9
Codec, when movietype is webm.
Quality level, when movietype is set to webm.
on | off
on | off
on | off
optimizeForQuality | optimizeForSpeed
BT601Limited | BT601Full | BT709Limited | BT709Full
true | false
Example
Create a 2D animation of a surface and contour plot:
Code for Use with Java
ExportFeature anim = 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;
Compatibility
As of version 6.1, the Flash format is no longer available for animations, and the flashfilename, flashinterp, and flashopen properties are no longer used.
See Also
Image (Export)