-
Notifications
You must be signed in to change notification settings - Fork 164
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 of step signal by CombiTimeTable #3115
Comments
In Modelica it is possible to model a discontinuous signal and then differentiate it as shown in your example M1. The differentiation of a table is in a similar spirit. In general, it seems hard (impossible) to detect such issues at compile time and therefore this needs to be detected during simulation. This in turn means that this is a tool issue (if a differentiation would lead to a Dirac impulse, and this is not supported by the tool, then at least a warning message needs to be printed). As I recall, in fact Dymola can detect some cases of this kind during run-time. |
Yes, Dymola simulation fails for models M1 and M2 at time 0.5s. With the knowledge of #1147 this is as expected. However, M3 models the same step signal using the same block (CombiTimeTable) but shows different behaviour when differentiating. I'd like to fix it (or at least document it) if @HansOlsson and @MartinOtter also think that it is misuse of the linear interpolation with duplicated sample points. |
The only possibility would be to add another Boolean flag, or interpolation-variant indicating whether duplicated are allowed or not. If duplicated points are allowed we, similarly as for constant-segments, forbid differentiation. I don't know how impactful this will be - but I guess it depends on the severity of the diagnostics, and how easy it is to set the flag. It seems problematic in general to skip the flag and generate the diagnostics when differentiated during simulation, as the derivative is also used in systems of equations, and sometimes dynamic state-selection will cause additional differentiation. |
Discontinous signals can/should not be differentiated:
This has been considered in #1147 when implementing the constant interpolation of CombiTimeTable:
However, using linear interpolation of CombiTimeTable and duplicated sample points we successfully can model a discontinuous signal and get its derivative.
This seems inconsistent, if not even wrong. Since linear interpolation with duplicated sample points was one of the designed features of the CombiTimeTable it would be a major loss if we'd deprecate it. I have no good idea how to solve this inconsistency and would like to get @HansOlsson's and @MartinOtter's feedback,
The text was updated successfully, but these errors were encountered: