-
Notifications
You must be signed in to change notification settings - Fork 168
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
Issues with Modelica.Blocks.Math.ContinuousMean #3906
Comments
W.r.t. units the proposed change LGTM. Should |
|
I am in favor of the proposed change for the sake of having I would yet like to comment that this change could cause a non-backwards compatible effect. If a simulation model of user has a simulation start time less than zero, the new implementation of the ContinuousMean model would behave differently as the start time is 0 by default but it was We might overcome this (unlikely case) by
|
To me it would seem reasonable to try to restore this behavior rather than documenting the degraded functionality as a known potential issue. (But I don't see exactly how initializing with |
Ok, that is tricky - I assume something like the following will work:
(Or possibly having actualStartTime with fixed=false as well, might be more readable). In general I see two problems with sources:
|
I see two problems:
startTime
as for most blocks, see https://stackoverflow.com/questions/70124980/dymola-modelica-how-can-i-calculate-the-mean-of-a-signal-only-in-the-steady-st/70127878 (a previous issue was thatstartTime
had no effect).ModelicaStandardLibrary/Modelica/Blocks/Math.mo
Lines 2318 to 2319 in 8d09081
I would propose the simpler:
Basically just integrating the signal and dividing by time.
Note that we can safely skip "t_eps" with this formulation due to the subtle change.
If we for some reason really need the extra precision I would propose switching between the two formulas after some time, i.e. use the simple formula for the first part and then switch to the current formula.
The text was updated successfully, but these errors were encountered: