- ⚙️ Dymola 2025xR1 flags
Hide=trueas invalid during pedantic checks, enforcing language compliance. - 📘
HideResult=trueis the standardized replacement supported by Modelica 3.4 and major simulation tools. - ❌ Using
Hide=trueintroduces compatibility and maintenance risks across simulation environments. - 🧪 Tools like OpenModelica and the Modelica Standard Library accept only standardized annotations, rejecting vendor-specific ones.
- ✅ Replacing
Hide=truewith proper annotations ensures clean simulation runs and cross-platform portability.
Modelica Hide Annotation: Should You Use It?
If you use Hide=true in Modelica to make simulation outputs clearer or to simplify what you see in the GUI, you are not alone. But this might cause problems now. Dymola 2025xR1 checks Modelica code more strictly. Models with Hide=true will now be marked as invalid. Let's look at why this change happened, what problems vendor-specific annotations cause, and how using the standard HideResult=true helps you build models that work better across different systems.
What Are Modelica Annotations?
Modelica annotations are extra data that give tools more information. They do not change how a model works mathematically. Usually, you find them at the end of variable, parameter, connector, or component declarations. These annotations do many things. For example, they decide how parameters appear in dialogs, where diagrams are placed, and how visible things are in result viewers.
Here is a simple example of how to write one:
parameter Real gain = 2.5 annotation(Dialog(group="Controller Settings"));
Here, Dialog(group="Controller Settings") is an annotation. It puts the parameter into a specific section in the GUI.
Modelica tools like Dymola, OpenModelica, and JModelica.org read these annotations. They use them for editor actions, to control simulation outputs, for debugger views, and for how things look. Most important, annotations themselves do not change simulation results or numbers.
But the Modelica rules only allow some official annotations. When people use annotations the rules do not recognize, which are often tool-specific, they might cause problems for how well the model works on other systems and in the future.
How Developers Use the Hide=true Annotation
In the past, Hide=true was an unofficial solution from specific tool makers. People often used it to hide variables or parameters in simulation tools and log files. This helped make complex models look less messy and easier to use.
Example usage:
parameter Real secretParam = 1.23 annotation(Hide=true);
This usually told the GUI or result processor to fully hide secretParam from the simulation result view. And this happened even though the variable was still in the model.
The reason people liked it was clear:
- Make the GUI cleaner for users.
- Hide parameters that were not important or were too detailed.
- Lower distractions in model views.
But even though this feature seemed good, Hide=true was never an official part of Modelica. This makes it risky for making models today, mainly as tools change and add stricter checks.
Why Dymola 2025xR1 Flags Hide=true as Invalid
Dymola 2025xR1 now checks the Modelica Language Specification more strictly with its pedantic checking mode. This mode does careful parsing and validation. It makes sure a model fully follows the published and supported standard. It does not allow any leniencies specific to one tool maker.
📌 As noted in the Dymola 2025xR1 Release Notes:
“The pedantic model check has been strengthened to flag the use of unsupported or non-standard annotations, including
Hide=true.”
There are three main reasons for this:
- Compatibility: Stop fragile behavior that relies on one tool and breaks when moved to other systems.
- Quality Assurance: Make sure codebases are clean and follow standards.
- Predictability: Stop future support problems from tool-specific features that might change or be removed.
By not allowing non-standard properties through the pedantic check, Dymola lowers the chance of unwanted modeling errors. And it makes simulation behavior clearer.
HideResult=true: The Safe and Standard Alternative
The Modelica Language Specification gives a proper, tool-independent choice: HideResult=true.
When you add this annotation to a declaration, it tells tools not to put the variable in the result file. For the simulation, the variable still works in the model as it should. But its results are left out of analysis and viewing.
Example:
parameter Real gain = 0.8 annotation(HideResult=true);
Advantages are:
- Sure support in tools like Dymola and OpenModelica.
- It fully follows Modelica Specification 3.4.
- It stops warnings or errors during pedantic checks.
A clear meaning is also a plus: HideResult clearly shows that the goal is to keep it out of the result file, not to hide it in the GUI.
Official Standards vs. Vendor-Specific Extensions
It is very important to know the difference between standard features and tool-specific additions. This helps you make Modelica models that last, grow, and work on many systems.
Standards-Based Development
The Modelica Association keeps the official language rules. These rules set out clear ways for language syntax, meaning, and how tools work together. Following these rules makes sure models act the same way across different tools. This is key for being able to repeat results, for checks, for getting approval, and for working with other groups.
Vendor-Specific Extensions
A tool maker might offer extra annotations, compiler options, or GUI features. These are not part of the Modelica Specification. Hide=true is one such tool-specific extra. These types of solutions:
- Only work with certain tool versions.
- Might not have documents or work with older versions.
- Cannot be checked with standard methods.
In Modelica setups that need to work across tools (like in companies, studies, and schools), these extras cause more trouble than they help.
Why Hide=true Leads to Compatibility Issues
Using Hide=true causes differences between Modelica tools. Some tools might ignore the annotation quietly. Others, like newer Dymola versions, might show warnings or errors. They might even stop validation runs.
Let's look at the problems:
1. Compilation Without Pedantic Mode
Sometimes the model compiles with Hide=true. This makes it seem like it works. But problems appear later. For example, when it is checked in a CI/CD system set to use strict validation.
2. Different Parsing Behavior
OpenModelica might just ignore the annotation. Dymola might just reject it. This leads to different behavior depending on which tools you use.
3. CI/CD and Automation Pipelines
In a strong development process, automatic checkModel() or openModel() validations are part of your continuous integration. Pedantic mode would now stop models that use non-standard annotations like Hide=true.
4. Broken Interoperability
Trying to use a model again across different tool makers or in co-simulation setups (like FMUs shared between teams) often shows these settings do not work together. This breaks the process when you do not expect it.
What we learn from OpenModelica and the Modelica Standard Library
The Modelica Standard Library (MSL) is seen as the best example for clean Modelica code. It is fully tested, works on any system, and strictly follows the official language.
Also:
- All models in the MSL must pass checks in both Dymola and OpenModelica.
- No tool-specific annotations like
Hide=trueare allowed. - Annotations must have a general use and not rely on the GUI.
OpenModelica is open-source and run by a community. It also carefully follows the Modelica rules. It does not understand annotations outside the official standard. It just ignores them or marks them as unknown.
This shows a main rule:
If your model needs to work with MSL or be used for a long time, you must avoid tool-specific annotations.
Real-World Debugging: When the Pedantic Check Fails
Let's look at a real development situation in Dymola:
You have this simple part of a model:
parameter Real offset = 5 annotation(Hide=true);
When you start a model check:
checkModel(ModelName);
You see an error like this:
Error: Annotation "Hide=true" is not recognized. Use of vendor-specific annotations is not allowed in pedantic mode.
This output not only stops your simulation setup. It also breaks any systems that depend on this check. Then, developers must look through the code and fix every time a non-standard annotation is used, so they can continue.
To fix it, you either replace it with a standard annotation (HideResult=true) or think again about why it was hidden.
When and How to Use HideResult Right
When used carefully, HideResult=true can keep your result files neat. And it keeps your simulation working correctly. Good times to use it are for:
- Parameters for debugging and internal changes.
- Fixed setup values that change how components size.
- Gain terms or offsets in complex equations.
Example:
parameter Real K_gain = 3 annotation(HideResult=true);
Helpful Advice:
- Use it only when needed — do not hide too much. Or your model might not have enough data to see what is happening.
- Explain why in comments — for example,
HideResult=true// Internal scalar parameter, not important for output. - Never hide key outputs — if you cannot see important numbers during checks, it can confuse others who use or review your model.
Replacing Hide=true in Models You Already Have
If you work with a lot of code that has many Hide=true annotations, updating it might seem hard. But it is a simple change.
Here is how to do it step-by-step:
-
Look for where it is used
Use a global search tool or grep to find every time"Hide=true"shows up. -
Figure out what it is for
Was the annotation meant to hide from results or from the GUI? -
Replace wisely
- To stop results from showing: change to
HideResult=true. - For GUI hiding: Think about
Dialog(enable=false)orDialog(group="...").
- To stop results from showing: change to
-
Run tests
Check how it works in Dymola with pedantic mode on. And check it in OpenModelica.
Example of changing it:
Before:
parameter Real x = 1 annotation(Hide=true);
After:
parameter Real x = 1 annotation(HideResult=true); // Hides from result file
If you need to hide it in the GUI:
parameter Real x = 1 annotation(Dialog(enable=false)); // Hides in GUI dialog
Why Hiding Variables Can Be a Problem
It is tempting to hide all internal parameters. But doing this without thinking ahead can make your model harder to keep up and harder to see what is going on.
Do not hide:
- Parameters that define the state.
- Coefficients for tuning models that matter when running.
- Loop or coupling terms that affect how things come together.
Instead, do these things:
- Put related parameters into groups with
Dialog(group="..."). - Give useful annotations like
evaluate=trueorquantity="Voltage"to add meaning. - Use comments to explain why anything is hidden.
Visibility helps you trace and debug. If you are not sure, make it visible.
Tool Compatibility: HideResult Is Better
| Simulation Tool | Supports Hide=true |
Supports HideResult=true |
|---|---|---|
| Dymola (2025xR1) | ❌ Invalid (Error) | ✅ Fully supported |
| OpenModelica | ❌ Ignored | ✅ Fully supported |
| JModelica.org | ❌ Ignored | ✅ Fully supported |
Only use HideResult=true if you want your code to work with many tools and follow rules from now on.
Good Ways to Make Modelica Models Work Anywhere
For lasting success and easy upkeep in Modelica projects:
- ✅ Stick to the Modelica 3.4 Specification.
- 🚫 Do not use non-standard annotations like
Hide=true. - 📉 Use
HideResult=trueonly when you really need to. - 🧪 Run
checkModel()often with pedantic mode on. - 📎 Write down notes for annotations carefully.
- 🔁 Test with main tools like Dymola and OpenModelica.
- 📦 Make your models match MSL standards if you want many people to use them again.
Write Cleaner Modelica Today
Do you need your Modelica code to work well with different tools and pass tough checks? Then it is time to stop using quick fixes like Hide=true. At Devsolus, we help engineering teams make better models. We do this with clear coding rules, proven patterns, and useful ways to make things faster. Look at more how-to guides, examples, and good methods at our resource center to improve how you do simulations. And do it the right way.
Citations
Modelica Association. (2020). Modelica – A unified object-oriented language for systems modeling, Language Specification Version 3.4. Retrieved from https://www.modelica.org/documents/ModelicaSpec34.pdf
Dassault Systèmes. (2024). Dymola 2025xR1 Release Notes. Retrieved from https://www.3ds.com/support/documentation/developer/development-tools/dymola/