Opened 14 years ago

Closed 7 years ago

#1468 closed discussion (fixed)

Discontinuity in results not properly stored (?)

Reported by: asodja Owned by: asodja
Priority: normal Milestone: 1.12.0
Component: Run-time Version:
Keywords: Cc: asodja, Willi Braun, Lennart Ochel

Description (last modified by Martin Sjölund)

Consider the model

model Test
  Real x(start=1);

equation
  der(x) = -2 * x;

  when time > 0.5 then
    reinit(x,-1);
  end when;
end Test;

At the time of event (time = 0.5) there are stored two data points:

t_1 = 0.499999023437500, x_1 = 0.36
t_2 = 0.500000000000000, x_2 = 1.00

Times t_1 and t_2 should be identical (t_1 == t_2), but are not.
This is fine for plotting, but it is very impractical, since from the results it is impossible to determine if we are dealing with discontinuity of with just very short continuous time interval! As a consequence, some postprocessing algorithms might fail.

Maybe this should be even reported as a bug?!

Change History (4)

comment:1 by Martin Sjölund, 12 years ago

Cc: asodja, → asodja
Description: modified (diff)

comment:2 by Martin Sjölund, 12 years ago

Cc: Willi Braun Lennart Ochel added
Milestone: Future

Would be fixed if we supported time-events. Else, can you do anything about this?

comment:3 by Lennart Ochel, 12 years ago

This should work with both state and time event implementation. I can look at it a bit more.

comment:4 by Francesco Casella, 7 years ago

Milestone: Future1.12.0
Resolution: fixed
Status: newclosed

This is an excerpt of the CSV output obtained with 1.12.0-beta3

0.498,0.3693539141362292,-0.7387078282724584
0.5,0.3678794515339768,-0.7357589030679537
0.5000000001500057,0.367879451423609,-0.735758902847218
0.5000000001500057,-1,2
0.502,-0.9960079874973287,1.992015974994657
0.504,-0.9920318979588001,1.9840637959176

I'd say this is exactly what is expected.

Note: See TracTickets for help on using tickets.