ModelicaStandardLibrary icon indicating copy to clipboard operation
ModelicaStandardLibrary copied to clipboard

Restore checks for extrapolation detection of CombiTable2D

Open beutlich opened this issue 11 months ago • 2 comments

This restores the checks for extrapolation detection in functions ModelicaStandardTables_CombiTable2D_getDerValue and ModelicaStandardTables_CombiTable2D_getDer2Value as regression of #3893. They are also consistent with ModelicaStandardTables_CombiTable2D_getValue where there is no derivative information.

Closes #4343.

This also is relevant for MSL 4.1.0: If merged, it needs to be back-ported to maint/4.1.x branch and binaries need to be rebuilt as well.

beutlich avatar Mar 23 '24 10:03 beutlich

but I don't see that this PR currently solves the issue.

Not sure what you mean exactly. Can read it as the patch is not good enough or not good at all.

I can confirm, that by restoring the extrapolation checks (to MSL v4.0.0 behaviour) the reported regression (of ModelicaTest.Tables.CombiTable2Ds.Test26 etc.) no longer is oberservable. See https://github.com/modelica/ModelicaStandardLibrary/issues/4343#issuecomment-2013739246

Edit: The patch already is applied to ModelicaTableAdditions: https://github.com/tbeu/ModelicaTableAdditions/commit/cf98e2b1c0a2dec06d4d10e875c0eea0e8b06ee6

beutlich avatar Apr 02 '24 16:04 beutlich

but I don't see that this PR currently solves the issue.

Not sure what you mean exactly. Can read it as the patch is not good enough or not good at all.

I'm not sure if it is good enough at least.

The problem that https://github.com/modelica/ModelicaStandardLibrary/pull/3893 intends to solve also occurs for the boundary, and as far as I can tell this PR removes that handling for the boundary. The test-case for that PR even include a test at the boundary - but it could be it doesn't cover all possibilities and thus doesn't trigger.

HansOlsson avatar Apr 03 '24 12:04 HansOlsson

As explained above I propose to close this without merging it - as I view #3893 as more problematic than switching between left- and right-limit at end of simulation.

HansOlsson avatar Jun 11 '24 13:06 HansOlsson

As you can imagine I am not happy with this rejection. The reason is that now the second derivative no longer corresponds to the first derivative: Jump to zero in the second derivative whereas first derivative is not constant. I consider this also a true regression (and an independent one of #4415).

beutlich avatar Jun 11 '24 16:06 beutlich