Opened 5 years ago

Last modified 5 years ago

#5396 new defect

how to select a large number of output variables in a mos script

Reported by: yulu.dong@… Owned by: somebody
Priority: high Milestone: Future
Component: *unknown* Version:
Keywords: variable filter, output, scripting Cc:

Description

I'm using a mos script to simulate OM model. So far I use the command "variableFilter" to select the outputs that I want to check after simulation. However, the number of output variables that I want to keep becomes larger and larger. I wonder if there's a way to call a file containing all the variable names from the mos script, instead of giving an exhaustive list of variables to "variableFilter"?
Thanks a lot!

Change History (8)

comment:1 Changed 5 years ago by casella

Have you considered using regular expressions? Pattern matching can be useful to shorten the description of the subset of variables you want to show.

comment:2 Changed 5 years ago by anonymous

Yes I'm already using regex. But I have many variables whose name are very different (it's a large system that I simulate). But if this is the only possible solution, then I have to modify the variable names that I want to select..

comment:3 Changed 5 years ago by casella

There is a working group in the MAP-LIB group dealing with annotations to embed this information in models. @youlu.dong, are you interested in participating to it?

comment:4 Changed 5 years ago by anonymous

Yes please add me in. Thanks!

comment:5 Changed 5 years ago by henrikt

Hi youlu.dong, I am still at the state of trying to form the MAP-Lib group that Francesco is speaking of. You are more than welcome to join us. The idea is to make a MCP (Modelica Change Proposal) driven by the needs of MAP-Lib, and based on the method we use to keep track of what variables to test when developing libraries with SystemModeler.

SystemModeler uses a model annotation to set up pre-defined plots, and then we apply the simple logic that a variable is worth testing if and only if it is part of one of the pre-defined plots. To us, this makes sense, since a variable that isn't part of a pre-defined plots cannot be assumed to be manually validated by an expert in the current modeling domain, and as such we don't trust it. At the same time, the number of variables present in pre-defined plots has never turned out to be too large to be included in the reference results.

Besides being a way of defining what variables to include for correctness testing, the pre-defined plots also have a huge value for all library users.

Does this sound like a solution that would suite you?

comment:6 Changed 5 years ago by Christoph Buchner <buchner@…>

henrikt, it's interesting to hear about this SystemModeler annotation, as I have previously proposed an OM annotation to do essentially the same thing (#4280)!

It would be great if this were also usable with OM, or even pushed upstream into Modelica itself as you seem to propose.

comment:7 follow-up: Changed 5 years ago by henrikt

Yes, #4280 seems to be about very much the same thing as the one we have. And, yes, the idea of working on a MCP is to push this upstream in to Modelica. Given this new wave of interest in the topic, I'll take the time now to initialize work on an MCP. Perhaps I could even have this prepared by tomorrow…

comment:8 in reply to: ↑ 7 Changed 5 years ago by ceraolo

Replying to henrikt:

Given this new wave of interest in the topic [...]

I think there is A LOT of interest on this topic! I've switched to Modelica several years ago, and since then I've been missing the ability to see my preferred plots upon opening of models (common behaviour of other simulation tools).
So I very much welcome this new effort, and I'm pretty sure many people do the same.

Note: See TracTickets for help on using tickets.