#2927 closed defect (fixed)
Wrong zero crossing function generation
| Reported by: | Niklas Worschech | Owned by: | Lennart Ochel | 
|---|---|---|---|
| Priority: | blocker | Milestone: | 1.9.4 | 
| Component: | Backend | Version: | trunk | 
| Keywords: | zero crossings | Cc: | Willi Braun | 
Description (last modified by )
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 by , 11 years ago
| Description: | modified (diff) | 
|---|
comment:2 by , 11 years ago
comment:4 by , 11 years ago
| Owner: | changed from to | 
|---|---|
| Status: | new → assigned | 
comment:5 by , 11 years ago
| Cc: | added | 
|---|---|
| Owner: | changed from to | 
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 by , 10 years ago
| Milestone: | Future → 1.9.4 | 
|---|---|
| Resolution: | → fixed | 
| Status: | assigned → closed | 
This seems to be fixed.
  Note:
 See   TracTickets
 for help on using tickets.
    
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.