Opened 9 years ago
Last modified 3 years ago
#3851 assigned defect
optimized zero crossings for cpp runtime
Reported by: | Niklas Worschech | Owned by: | Willi Braun |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | Backend | Version: | |
Keywords: | zerocrossings, cpp runtime | Cc: | Volker Waurich, Lennart Ochel |
Description
Thus the cpp runtime can use the optimized zero crossings, that are zero crossings which could arise from combined relations like
((h)<=0)&&(v<=0))
additional information in the backend is needed.
At the moment all relations have an index in the backend which is used in the cpp code generation to replace the relations with condition variables
if(h<=0)
is replaced with
if(condition_[index])
To use the optimized zero crossings, expressions for lbinary and lunary also needs this index to replace e.g
if(h<=0 && v<=0)
with
if(condition_[index])
during code generation
Change History (13)
comment:1 by , 9 years ago
comment:2 by , 9 years ago
The c runtime does not replace the relations in equations like the cpp runtime. Because of this the c runtime does not need this index.
comment:3 by , 9 years ago
Well, I still see no reason to generate different data structures depending on the selected runtime system at this point. We should have a discussion about the preferable approach and use it for both (all) runtime systems.
comment:4 by , 9 years ago
This is a simplified description of the cpp runtime approach for zero detection zero search and event handling.
If the solver detects a zero crossing the zero search method will start for the corresponding zero function. If the root of the zero function was found the condition is set to the value of the corresponding relation and the event iteration starts to handle all active events which conditions are true.
The system evaluation in each step only checks a condition it don't checks the relation. This is the case if the system is in a continuous mode.
During event iteration the system is in discrete mode which means the relations also are checked. The event iteration stops if no discrete variable and condition has changed.
Therefore we need the index for all relations, to replace the relations in the equations with condition variables.
comment:5 by , 8 years ago
Milestone: | Future → 1.12.0 |
---|---|
Status: | new → assigned |
comment:6 by , 8 years ago
Cc: | added |
---|
comment:7 by , 7 years ago
Milestone: | 1.12.0 → Future |
---|
The milestone of this ticket has been reassigned to "Future".
If you think the issue is still valid and relevant for you, please select milestone 1.13.0 for back-end, code generation and run-time issues, or 2.0.0 for front-end issues.
If you are aware that the problem is no longer present, please select the milestone corresponding to the version of OMC you used to check that, and set the status to "worksforme".
In both cases, a short informative comment would be welcome.
comment:8 by , 7 years ago
Milestone: | Future → 1.13.0 |
---|
Since this seems connected (https://trac.openmodelica.org/OpenModelica/ticket/4254#comment:9) to #4254, it seems proper to put it on the same milestone.
comment:10 by , 5 years ago
Milestone: | 1.14.0 → 1.16.0 |
---|
Releasing 1.14.0 which is stable and has many improvements w.r.t. 1.13.2. This issue is rescheduled to 1.16.0
comment:12 by , 4 years ago
Milestone: | 1.17.0 → 1.18.0 |
---|
Retargeted to 1.18.0 because of 1.17.0 timed release.
I guess it's the same for the c runtime. I see no good reason to handle zero-crossings different for both runtime systems.