modelica / ModelicaStandardLibrary

Free (standard conforming) library to model mechanical (1D/3D), electrical (analog, digital, machines), magnetic, thermal, fluid, control systems and hierarchical state machines. Also numerical functions and functions for strings, files and streams are included.
https://doc.modelica.org
BSD 3-Clause "New" or "Revised" License
452 stars 165 forks source link

Consider shiftTime for verbose extrapolation in CombiTimeTable #4331

Closed beutlich closed 4 months ago

beutlich commented 4 months ago

The time table data is relative to the shiftTime parameter, which should also be considered for the verbose extrapolation warning.

It's already correct (in the C code) for extrapolation=Modelica.Blocks.Types.Extrapolation.NoExtrapolation, i.e., if extrapolation triggers an error.

Of course, the warning or error message, respectively, could still be improved to also mention the shiftTime (if non-zero), if desired.

HansOlsson commented 4 months ago

The time table data is relative to the shiftTime parameter, which should also be considered for the verbose extrapolation warning.

It's already correct (in the C code) for extrapolation=Modelica.Blocks.Types.Extrapolation.NoExtrapolation, i.e., if extrapolation triggers an error.

Of course, the warning or error message, respectively, could still be improved to also mention the shiftTime (if non-zero), if desired.

I think that, or just reducing the error message to the actual error, is needed: "Time must be greater or equal than the shifted minimum abscissa value defined in the table."

Currently the error message can look as follows in Dymola:

Warning: The following was detected at time: 0

Extrapolation warning: Time (=0) must be greater or equal than the minimum abscissa value t_min (=0) defined in the table.

Failed condition: noEvent(time >= t_min+shiftTime)

beutlich commented 4 months ago

I think that, or just reducing the error message to the actual error, is needed: "Time must be greater or equal than the shifted minimum abscissa value defined in the table."

Yes, I accepted this formulation.