Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

Variable Filtering for array type of variables

Variable Filtering for array type of variables

Hi,
During the simulation of Modelica.Mechanics.MultiBody.Examples.Elementary.Pendulum, I was trying to filter out some of the variables using the Simulation GUI>Output>Variable Filter option.

When I try to filter out the variable body.a_0[1], the filtering fails.

In fact even searching for the same variable in the Variable browser fails to show the variable.

Please guide on how to use variable filtering for such kind of variables

Re: Variable Filtering for array type of variables

The filtering works. If you give Simulation->Output->Variable Filter: body.a_0[1]
then it will NOT put these variables in the .mat file, that's why you cannot find it in the Variable Browser.

Note also the the Variable Filter is an regular expression which if it matches it will NOT put these variables in the .mat file.

Re: Variable Filtering for array type of variables

No, if the variableFilter matches a variable, it *will* be in the result file. But it is a regular expression, and the above matches body.a_01 since [1] is equivalent to 1.

Re: Variable Filtering for array type of variables

Is there a way to filter variables such as a_0[1] , Martin?

Re: Variable Filtering for array type of variables

Of course. Read up on regular expressions. You will be happy you did. Easiest way should be to just use a_0[[]1[]] or a_0.1. as the string.

There are 0 guests and 0 other users also viewing this topic
You are here: