In https://trac.modelica.org/Modelica/ticket/2229#comment:2 it is mentioned that Dymola has the capability to automatically update a conversion script when changes are applied to a library. I was searching the Dymola manuals but could not find any actual guidelines how to apply this feature.
However, I could find some settings in the options, but I cannot force Dymola to create / update a conversion script.
Does anyone have some guidelines on how to enable the feature of automatically creating a conversion script?
In this experiment the vehicle accelerates from rest, going up through the gears, as shown in the video below. The easiest route to create your plot script is to generate the plots you need with the plot options in Dymola and then use the inbuilt script generation tool to capture your plots in a script for later reuse.
and select r3.mos. Dymola then translates the model, simulates and plot automatically. To view the animation of the robot, open the iconized animation window. Start the animation by selecting Animation / Run or using key F3. F4 is used to suspend animation, F5 and F6 to step forward and backward respectively.
The Dymola main window has a toolbar with five buttons to: Run a command script Modify parameter values Modify initial conditions Specify simulation run (e.g., start and stop times) Perform simulation. Simulating a model — industrial robot
Start Dymola or if it is already started then give the command File / Clear All in the model window. Go to the model window. It has the title "Unnamed". A model has different layers that can be edited. To specify a behavior directly in terms of equations, the Equation Layer has to be edited.
There are three advanced variables for that, namely:
Integer Advanced.ActivateSmartDelete = 3 "Updates other classes when deleting class/component [0 - no, 1 - ask, 2 yes (if possible)]";
Integer Advanced.ActivateSmartRename = 3 "Updates other classes when renaming component [0 - no, 1 - ask, 2 yes, 3 - also script]";
Integer Advanced.ActivateSmartRenameClass = 3 "Updates other classes when renaming class [0 - no, 1 - ask, 2 yes, 3 - also script]";
As the comments indicate, setting these variables on 3 (using the Dymola Command window or, in newer Dymola versions, the options which can be seen in your screenshot) results in automatically created conversion commands.
Dymola will write the conversion commands to the model annotation of your library. They will look something like this:
from(
version="3.2.3",
to="Intermediate",
change(item=convertClass("Modelica.Blocks.Continuous.PID", "Modelica.Blocks.Continuous.PID_Controller"),
item=convertClass("Modelica.Blocks.Continuous.FirstOrder", "Modelica.Blocks.Continuous.PT1")))
You have to convert the commands a little, if you want to have the conversion script in a separate file (instead of the package.mo
of your library).
In a script the above commands would look as follows:
convertClear()
convertClass("Modelica.Blocks.Continuous.PID", "Modelica.Blocks.Continuous.PID_Controller"),
convertClass("Modelica.Blocks.Continuous.FirstOrder", "Modelica.Blocks.Continuous.PT1")
so the same commands, but without item=
and trailing ,
.
Dymola 2022x can export the commands to a file.
Dymola will then remove the previously generated commands from the library annotation and copy them in the correct format to the specified file. Note that Dymola will also update the version number of the library and adjust the from
command. If this is not desired, change it back.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With