Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Derivative signal of combiTable2Ds is set to zero outside of table with HoldLastPoint #3894

Closed
GarronFish opened this issue Nov 11, 2021 · 3 comments · Fixed by #3896
Closed
Assignees
Labels
bug Critical/severe issue L: C-Sources Issue addresses Modelica/Resources/C-Sources V: 3.2.3 Issue originates in MSL v3.2.3 (and is not present in earlier releases)
Milestone

Comments

@GarronFish
Copy link

The derivative signal of a Modelica.Blocks.Tables.CombiTable2Ds with extrapolation set to HoldLastPoint is zero if extrapolation is required to calculate the output.

This is incorrect for example if the input signals to a combiTable2Ds component is set to
u1=time+1
u2 = -1
is feed into a combiTable2Ds component with
table = [0,1,2;
1,2,3;
2,3,4]
and is simulated for 1[s]

The derivative of the output is zero however the output of the signal changes from 2 to 3 and the derivative should be 1.

Steps to recreate the issue in Dymola:

  1. clearFlags()
  2. open the tabletest3.mo (the extension will have to be renamed to .mo) and simulate by pressing F10, this should simulate and generate the plots.
  3. Compare der1.y and derivative.y

der1.y is the der() of the table and this is zero when run here, derivative.y is the estimate of the derivative and converges to 1. der1.y should be 1
tabletest3.txt
.

@HansOlsson
Copy link
Contributor

Is this same issue as #3893 ?

@GarronFish
Copy link
Author

GarronFish commented Nov 11, 2021

It may be a different issue as this is specifically related to using extrapolation=HoldLastPoint. This issue is not present with extrapolation=LastTwoPoints.

@GarronFish GarronFish changed the title Derivative signal of combiTable2Ds is set to zero outside outside of table with HoldLastPoint Derivative signal of combiTable2Ds is set to zero outside of table with HoldLastPoint Nov 11, 2021
@beutlich beutlich added bug Critical/severe issue L: C-Sources Issue addresses Modelica/Resources/C-Sources labels Nov 11, 2021
@beutlich beutlich self-assigned this Nov 11, 2021
@beutlich beutlich added the V: 3.2.3 Issue originates in MSL v3.2.3 (and is not present in earlier releases) label Nov 11, 2021
@beutlich
Copy link
Member

It is independent of #3893 indeed. I will fix this issue soon and review #3893 afterwards.

@beutlich beutlich added this to the MSL4.1.0 milestone Nov 12, 2021
beutlich added a commit to beutlich/ModelicaStandardLibrary that referenced this issue Nov 12, 2021
beutlich added a commit to beutlich/ModelicaStandardLibrary that referenced this issue Nov 13, 2021
beutlich added a commit to beutlich/ModelicaStandardLibrary that referenced this issue Nov 14, 2021
beutlich added a commit to beutlich/ModelicaStandardLibrary that referenced this issue Nov 14, 2021
beutlich added a commit to beutlich/ModelicaStandardLibrary that referenced this issue Nov 14, 2021
beutlich added a commit to beutlich/ModelicaStandardLibrary that referenced this issue Nov 17, 2021
beutlich added a commit to beutlich/ModelicaStandardLibrary that referenced this issue Nov 17, 2021
beutlich added a commit that referenced this issue Dec 29, 2021
…ontinuation (#3896)

* refs #3894: Fix derivatives in 2D-table for one-sided extrapolation by constant continuation

* refs #3894: Add test model
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Critical/severe issue L: C-Sources Issue addresses Modelica/Resources/C-Sources V: 3.2.3 Issue originates in MSL v3.2.3 (and is not present in earlier releases)
Projects
None yet
3 participants