#2927 closed defect (fixed)
Wrong zero crossing function generation
Reported by: | niklwors | Owned by: | lochel |
---|---|---|---|
Priority: | blocker | Milestone: | 1.9.4 |
Component: | Backend | Version: | trunk |
Keywords: | zero crossings | Cc: | wbraun |
Description (last modified by lochel)
For this model:
model miniModel // PARAMETERS parameter Integer nZ = 5; // VARIABLES Integer lowerZrow; Real zIn = 4.3; Real[nZ] rowZ = {1,2,3,4,5}; algorithm // Finde zIndex lowerZrow := 0 "Reset Index"; for i in 2:nZ loop if (i == nZ) then lowerZrow := i - 1; break; end if; if zIn < rowZ[i] then lowerZrow := i-1; break; end if; end for; end miniModel;
The omc generate 4 zero crossing functions which is not correct
Change History (8)
comment:1 Changed 10 years ago by lochel
- Description modified (diff)
comment:2 Changed 10 years ago by lochel
comment:3 Changed 10 years ago by niklwors
For discrete variables it should not be generate zero crossings.
comment:4 Changed 10 years ago by lochel
- Owner changed from somebody to wbraun
- Status changed from new to assigned
comment:5 Changed 10 years ago by lochel
- Cc wbraun added
- Owner changed from wbraun to lochel
Well, I can take care of this ticket. Obviously, the check if a relation is discrete doesn't work as it is supposed to. But that is probably not the only issue with zero crossings. I thought it would be good to also involve Willi since he developed the event stuff some time ago...
comment:6 Changed 8 years ago by lochel
- Milestone changed from Future to 1.9.4
- Resolution set to fixed
- Status changed from assigned to closed
This seems to be fixed.
comment:7 Changed 8 years ago by sjoelund.se
- Milestone changed from 1.9.4 to 1.9.4-1.9.x
Milestone renamed
comment:8 Changed 8 years ago by sjoelund.se
- Milestone changed from 1.9.4-1.9.x to 1.9.4
Milestone renamed
The debug-dump "relidx" prints:
This output is not very helpful – at least for me.
The debug-dump "dumpindxdae" prints:
So there are indeed 4 zero crossings. What are the expected zero crossings? At least the simulation result seem to be what Dymola calculates.