How to Compare Animations in Dymola

In this blog post I’ll look at how you can compare animations generated by two different experiments. If you are simulating your model with different parameter settings, it can be very useful to compare the animation results as first pass to see what difference your parameter changes have made to the behaviour of the model.

Multibody models based upon the Modelica Standard Library’s MultiBody package (Modelica.Mechanics.MultiBody) generally include animation objects that allow you to visualise the models you create during and after an experiment has been simulated. Below is an example of the animation from the Furuta Pendulum demo in Dymola 2020x.

Video 1 – Example animation from the multibody demo Furuta Pendulum

Once you have simulated your experiment, an animation window automatically opens for that experiment, if it contains animation objects.

To demonstrate this I will compare two experiments from the VeSyMA – Suspensions library developed here at Claytex. We have two similar vehicle experiments where the same vehicle models perform a slalom test, but in one the vehicle’s electronic stability control (ESP) is enabled and in the other it is disabled; Suspensions.Experiments.PathFollowing.Slalom and Suspensions.Experiments.PathFollowing.SlalomESP. So you would expect to see a difference in the vehicle position in the animation between the two experiments.

Accessing animation options in the Variable Browser menu to compare animations
Figure 1 – Animation options in the Variable Browser menu

After I simulate the slalom test with and without ESP enabled, I have two experiment results in my Variable Browser in Dymola. If I right click on a result set, while an animation window is active, I get the context menu shown in the image above, which contains two animation options. Selecting:

  • Animate will show the animation of the selected result in the active animation window
  • Animate Together will show the animation of the selected result in the active animation window as well as the previous animation displayed in that animation window

I used the Animate Together option to create the animation comparison of the slalom test with and without ESP enabled as shown in the video below. A different colour was applied to the vehicle body animation object in each experiment to make it easier to distinguish between them. From this animation comparison it is obvious to see that the vehicle positions are different due to the ESP change between experiments, even before looking at the variable results in detail.

Video 2 – Animations using the Animate Together option to compare the slalom test with and without the ESP enabled

Written by: Hannah Hammond-Scott – Modelica Project Leader

Please get in touch if you have any questions or have got a topic in mind that you would like us to write about. You can submit your questions / topics via: Tech Blog Questions / Topic Suggestion


Got a question? Just fill in this form and send it to us and we'll get back to you shortly.


© Copyright 2010-2024 Claytex Services Ltd All Rights Reserved

Log in with your credentials

Forgot your details?