Opened 14 years ago
Last modified 14 years ago
#1387 closed defect (fixed)
small stop time causes simulation to end early
Reported by: | Martin Sjölund | Owned by: | Martin Sjölund |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | Version: | ||
Keywords: | Cc: | Martin Sjölund, Frenkel TUD, Martin Sjölund, Willi Braun |
Description
The issue is that calcTinyStep calculates a time step larger than the time step of the simulation. I'll fix it by using the delta stopTime-startTime instead of only stopTime (which matches the C-comments of the calcTinyStep function).
If this is wrong for some reason, feel free to correct me.
From forums: http://www.openmodelica.org/index.php?option=com_agora&task=topic&id=172&Itemid=87
Change History (4)
comment:1 by , 14 years ago
comment:2 by , 14 years ago
I don't think tolerance has anything to do with this. That's the error of values, not the error in time (right?).
Anyway, calcTiny choses an epsilon in a really weird way :)
comment:3 by , 14 years ago
I think it does, at least if the step is *smaller* than the tolerance we should report that to the user and automatically make tolerance smaller than the step.
comment:4 by , 14 years ago
If the user accepts a tolerance of 1e-6, but simulates from time=0 to 1e100 using 10 steps, that would be totally wrong, right?
I think also tolerance has to be taken into account when calculating the small step at the beginning. Also there are some epsilons we use to find events at (time - eps, time + eps) and these eps should also be set according to tolerance and (stopTime-startTime)/numberOfIntervals.
To be very configurable I think also the epsilons could be set via simulate or build /translateModel, but we can leave that for later.