Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Searching for a concept like 'verbosity' in Modelica

Tags:

modelica

I'm struggling with the size of output files for large Modelica models. Off course, I can protect some objects in order to remove them completely from the result file. However, that gives rise to two problems:

  1. it's not possible to redeclare protected objects
  2. if i want to test my model in detail (eg for a short time period), i need to declare those objects publicly again in order to see their variables

I wonder if there's a trick to set the 'verbosity' of a Modelica model. Maybe what I would like is a third keyword next to public, protected, eg. transparent. Then, when setting up a simulation, I want be able to set the verbosity level to 1, or 2 with the following effect:

1--> consider all transparentelements as protected

2--> consider all transparentelements as public

This effect would propagate to all models and submodels.
I don't think this already exists. But is there an easy workaround?

Thanks, Roel

like image 375
saroele Avatar asked Sep 28 '11 12:09

saroele


2 Answers

As Michael Tiller wrote above, this is not handled the same way in all Modelica tools and there is no definite answer. To give an OpenModelica-specific answer, it's possible to use simulate(ModelName,outputFilter="regex"), to store only the variables that fully match the given regex (default is .*, matching any variable).

like image 71
sjoelund.se Avatar answered Oct 03 '22 10:10

sjoelund.se


Roel,

I know several people wrestling with this issue. At the moment, all of this depends on the tool being used. I don't know how other tools handle filtering of results, but in Dymola you control it (as you point out) by giving the signals special qualifiers (e.g. protected).

One thing I've done in the past is to extend from a model and then add a bunch of output signals for things I'm interested in. Then you can select "Outputs" in Dymola to make sure those get in the results file. This is far from perfect because a) listing everything you want can get tedious and b) referencing protected variables is not strictly allowed (although Dymola lets you get away with it but issues a warning).

At Dassault, we are actively discussing this idea and hope to provide some better functionality along these lines. It isn't clear whether such functionality will be strictly tool specific or whether it will involve the language somehow. But if it is language related, we will (of course) work with the design group to formulate a specification that other tool vendors can support as well.

like image 31
Michael Tiller Avatar answered Oct 03 '22 10:10

Michael Tiller