Opened 10 years ago

Last modified 8 years ago

#2973 new discussion

relations vs. zero crossings

Reported by: lochel Owned by: somebody
Priority: high Milestone: Future
Component: Backend Version: trunk
Keywords: Cc: niklwors, wbraun

Description

I investigated a bit how zero crossings get collected. I think there are a couple of problems. First of all, zero crossings and relations still seem to be swapped. The following simple example shows that:

model test8
  Boolean b = sin(time) < 0.0 and cos(time) > 0.1;
  annotation(experiment(StartTime = 0, StopTime = 10));
end test8;
Zero Crossings (1)
========================================
sin(time) < 0.0 and cos(time) > 0.1 in equations [1] and when conditions []


Relations (2)
========================================
sin(time) < 0.0 with index = 0 in equations [1] and when conditions []
cos(time) > 0.1 with index = 1 in equations [1] and when conditions []

A zero crossing is a continuous function whose zero crossing is of interest. Whereas relations are logical expressions that may depend on zero crossings.

Because the runtime systems depend on this data structures, this should get fixed before one does further improvements of the event systems.

Change History (2)

comment:1 Changed 10 years ago by lochel

It seems that there is already a workaround for the cpp runtime:

SimCodeUtil.mo, line 1592

zeroCrossings = if ifcpp then FindZeroCrossings.getRelations(dlow) else FindZeroCrossings.getZeroCrossings(dlow);

comment:2 Changed 8 years ago by wbraun

  • Type changed from defect to discussion

In my understanding the zero crossings are the event indicator, which are monitored to switch the domain and at the end of type Bool. While one zero-crossing may consist of several relations, which are connected with logical operators.

Note: See TracTickets for help on using tickets.