#2088 closed defect (fixed)
Mat results get corrupted with variable filters
Reported by: | Teemu Lempinen | Owned by: | Lennart Ochel |
---|---|---|---|
Priority: | high | Milestone: | 1.9.0 |
Component: | Run-time | Version: | trunk |
Keywords: | Cc: |
Description (last modified by )
Mat file is corrupted with "A = B" equations, if B is filtered out.
To reproduce the problem, simulate the example model below with
variableFilter=".*[^X]"
model Model Real Var3; parameter Real Var1 = 1; Real Var2X( start=0, fixed=true); equation Var3 = Var2X; der(Var2X) = + Var1; end Model;
The resulting mat file dataInfo block becomes as follows:
int dataInfo(4,4) 2 1 0 -1 2 2 0 -1 1 2 0 0 0 0 0 0
If there are more "A=B" equations, there are more "0 0 0 0" lines.
What I would like is as follows, but I do not know if it is possible:
If there are equations "A=C" and "B=C" and the variable C is filtered out, A or B should become the "primary" variable for .mat file, store the values of C and the other should refer to those values.
The easy way would be to filter A and B out too. At least that way the results would not be distorted. It took me quite a few hours to realize why my relatively large model was giving wrong results for certain parameter variables.
Change History (15)
comment:1 by , 12 years ago
Component: | Backend → Run-time |
---|---|
Owner: | changed from | to
Status: | new → assigned |
comment:2 by , 12 years ago
Description: | modified (diff) |
---|
comment:3 by , 12 years ago
follow-up: 6 comment:4 by , 12 years ago
Replying to lempinen:
The easy way would be to filter A and B out too. At least that way the results would not be distorted. It took me quite a few hours to realize why my relatively large model was giving wrong results for certain parameter variables.
I would prefer to not filter C if there are corresponding not-filtered primary variables. I have already implemented it locally. That works for your test model fine but it seems that we have some trouble with alias-indices. I have to check this a bit more.
comment:5 by , 12 years ago
Status: | assigned → accepted |
---|
comment:6 by , 12 years ago
Replying to lochel:
Replying to lempinen:
The easy way would be to filter A and B out too. At least that way the results would not be distorted. It took me quite a few hours to realize why my relatively large model was giving wrong results for certain parameter variables.
I would prefer to not filter C if there are corresponding not-filtered primary variables. I have already implemented it locally. That works for your test model fine but it seems that we have some trouble with alias-indices. I have to check this a bit more.
That sounds like a good compromise.
The idea of filtering for me is to reduce the size of results. The size of results does not rise when C is included if the same time series would be stored anyway for A or B. Only name and location information are added.
Thanks for working on this issue so quickly. Hopefully you can solve the issues with alias-indices.
comment:8 by , 12 years ago
Currently we do not filter parameters at all. Should we filter them also?
comment:9 by , 12 years ago
There's no point in filtering parameters. They take up so little space in the file anyway.
comment:10 by , 12 years ago
Yes, for sure. But maybe someone wants to use that filter-feature to reduce the amount of variables inside his constricted plotting-tool.
comment:11 by , 12 years ago
That's not really a valid concern though. If the functionality is requested and motivated you should just add another simflag to also filter parameters.
comment:13 by , 12 years ago
Last minute note from a user! :)
I'd like to see this behavior documented. Current OpenModelica user documentation states that variable filter filters variables by their names. It does not state that parameters are not filtered.
comment:14 by , 12 years ago
Oh, it's a variable filter. No-where does it say it filters parameters ;)
comment:15 by , 12 years ago
True! How silly of me. Maybe just a small and explicit reminder for people like me, who do not understand what they are reading? :P
testsuite/simulation/modelica/others/filterTest.mos (r15337)