Opened 11 years ago

Closed 10 years ago

#2534 closed discussion (fixed)

simulation results. How to handle the first data point?

Reported by: Lennart Ochel Owned by: Lennart Ochel
Priority: high Milestone: 1.9.1
Component: Run-time Version: trunk
Keywords: Cc: Adrian Pop, Martin Sjölund, Willi Braun

Description

What about the following example?

model Unnamed
  Real a;
equation
  when sample(0, 10) then
    a = 1;
  end when;
end Unnamed;

What should be the simulation result?

  1. a = 1 for all data points
  2. a = 1 for all data points with an additional data point at time=0 with a = 0

Actually, OpenModelica produces the second case and Dymola the first one…
Any comments?

Change History (4)

comment:1 by Lennart Ochel, 11 years ago

This problem arose, because I like to compare simulation results to Dymola ... . I think we need either to change our results or the result comparing function. Otherwise it is some kind of nasty...

comment:2 by Lennart Ochel, 11 years ago

Owner: changed from somebody to Lennart Ochel
Status: newassigned

I propose we should change our result files to case a, because the result files are actually simulation result files.

Last edited 11 years ago by Lennart Ochel (previous) (diff)

comment:3 by Willi Braun, 11 years ago

I think case b. is better, since the event is in the model equations and this should also be visible in the result file. The first entry in result file is the result of the initialisation.

For the following model case a. should be fine.

model Unnamed
  Real a;
equation
  when initial() then
    a = 1;
  end when;
end Unnamed;

comment:4 by Lennart Ochel, 10 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.