Opened 14 years ago

Last modified 14 years ago

#1387 closed defect (fixed)

small stop time causes simulation to end early

Reported by: sjoelund.se Owned by: sjoelund.se
Priority: high Milestone:
Component: Version:
Keywords: Cc: sjoelund.se, Frenkel TUD, sjoelund.se, wbraun

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 Changed 14 years ago by adrpo

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.

comment:2 Changed 14 years ago by sjoelund.se

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 Changed 14 years ago by adrpo

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 Changed 14 years ago by sjoelund.se

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?

Note: See TracTickets for help on using tickets.