#2088 closed defect (fixed)
Mat results get corrupted with variable filters
Reported by: | lempinen | Owned by: | lochel |
---|---|---|---|
Priority: | high | Milestone: | 1.9.0 |
Component: | Run-time | Version: | trunk |
Keywords: | Cc: |
Description (last modified by lochel)
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 Changed 12 years ago by sjoelund.se
- Component changed from Backend to Run-time
- Owner changed from probably noone to lochel
- Status changed from new to assigned
comment:2 Changed 12 years ago by lochel
- Description modified (diff)
comment:3 Changed 12 years ago by lochel
comment:4 in reply to: ↑ description ; follow-up: ↓ 6 Changed 12 years ago by 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.
comment:5 Changed 12 years ago by lochel
- Status changed from assigned to accepted
comment:6 in reply to: ↑ 4 Changed 12 years ago by lempinen
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:7 Changed 12 years ago by lochel
- Resolution set to fixed
- Status changed from accepted to closed
fixed in r15355
comment:8 Changed 12 years ago by lochel
Currently we do not filter parameters at all. Should we filter them also?
comment:9 Changed 12 years ago by sjoelund.se
There's no point in filtering parameters. They take up so little space in the file anyway.
comment:10 Changed 12 years ago by lochel
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 Changed 12 years ago by sjoelund.se
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:12 Changed 12 years ago by lochel
Well, then this ticket is done. :-)
comment:13 Changed 12 years ago by lempinen
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 Changed 12 years ago by sjoelund.se
Oh, it's a variable filter. No-where does it say it filters parameters ;)
comment:15 Changed 12 years ago by lempinen
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)