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
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
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.
on | off
If options is on; enable/disable display of the legend.
on | off
If options is on; enable/disable display of the logotype.
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 | flash | avi | webm
The movie format to use if type is movie: GIF, Flash, AVI, or WebM.
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.
true | false
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.
The solutions to animate if sweeptype is solutions.
level1 | level2 | level3 | all | inner | outer
solutions | parameter | globalparameter | dde
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 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 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