Concepts and methods
Creating and using subsystems
A subsystem in Dymola is a model that is used inside other models and is usually used to define models that correspond to physical parts. Making use of subsystems is important as it reduces the work required to build new models by increasing the reuse of existing models and reducing the future maintenance effort. The [...]
Posted on Wednesday, December 7th, 2011
The difference between class duplication and class extension
Duplicate or Extend? What is the difference? There is a fundamental difference between duplicating a class and extending a class (Blocks, Models, Functions, Types, Enumerations are all types of Class). Duplicating: When we duplicate a class we effectively create a separate instance or copy of that class. Any changes to the original class or duplicate [...]
Posted on Tuesday, September 27th, 2011
State Selection: Overview and Definitions
In most cases state selection should not concern the user and should be done automatically by Dymola. There are a number of times however when it is useful for the model developer to be able to influence the state selection. Using knowledge of the system being modelled, the state selection can be used: To improve [...]
Posted on Wednesday, August 3rd, 2011
Adding additional Units? Utilising Type definitions
What is a type class? Often in a physical modelling environment, the parameters and variables used equate to physical quantities defined as a number and unit declaration. In Modelica this unit quantity is defined using a ‘type’ class: type Density = Real ( final quantity=”Density”, final unit=”kg/m3″, min=0); The Modelica Standard Library includes definitions of the units [...]
Posted on Tuesday, July 12th, 2011
Useful Keyboard Shortcuts and Commands
The following list of Keyboard Shortcuts and Commands are used on a daily basis. Note, this list is not exhaustive, see Dymola User Manuals for more information. Shortcuts: Check Syntax and Format = Ctrl + L Check Model = F8 Code Completion = Ctrl + Space Duplicate = Ctrl + D Edit Function Call (text [...]
Posted on Monday, July 4th, 2011
How can I make my models run faster?
Improving model efficiency and lowering run times: There are 4 common causes of slow-running models: Poor initialisation values Large number of events during simulation Large number of non-linear systems of equations in model Large numbers of numerical jacobians in model Poor Initialisation Poor initialisation values can lead to slow model initialisation and large amounts of [...]
Posted on Monday, June 20th, 2011
Exporting models for co-simulation in other tools
With the release of Dymola 2012 it is now possible to compile models to the FMI standard for co-simulation. This means that a model built in Dymola can be compiled with an open standard interface and coupled to other simulation and integration tools. Dymola uses the SUNDIALS suite of numerical solvers for co-simulation and these [...]
Posted on Tuesday, June 14th, 2011
How to simulate a model multiple times with different parameter values
Here are 2 examples of how you can simulate a model multiple times using different parameters values in Dymola, also referred to as batch running, and often used to run sensitivity sweeps. For the purpose of these examples a simple test model, Test1.mo, will be used. The Modelica text for Test1 is shown below; parameter [...]
Posted on Tuesday, May 31st, 2011
How to restart a simulation from a given state
How to restart a simulation from a given state Often it is useful to be able to repeatedly restart a simulation from a given state. This is useful when we have a model that needs to simulate for a significant amount of time to reach a stable operating point from which we are interested in [...]
Posted on Monday, May 9th, 2011
Creating Models to easily Include / Remove Effects
Modelica supports a concept called conditional components which provides a convenient mechanism to include or remove effects from a model through the change of a single parameter. This means that the same models can be reused for different types of studies where different effects have to be considered. The ability to tune the model complexity [...]
Posted on Thursday, April 28th, 2011