-
Notifications
You must be signed in to change notification settings - Fork 167
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
Investigating regfun3 #4128
Comments
Also read #3758 (comment) |
I agree that there is something there, but I also realized a simple fix, that both seems to work and make sense. After computing xi2 add:
|
Do we looker deeper into this issue for this milestone or different milestone ?as we have already found a working solution. |
I guess this has lower priority now. I would fix other pending issues first. |
The first fix by @HansOlsson in #4157 fixed the originally reported issue in #3758, namely a jump in the mass flow rate when dp became larger than dp_small. Unfortunately, as reported by @MatthiasBSchaefer in #4312, it broke other models, in particular causing chattering in Modelica.Fluid.Examples.TraceSubstances.RoomCO2WithControls around zero mass flow rate. PR #4522, also by @HansOlsson, added further fixes to |
This MWE replicates the problem with
regFun3()
at the point were the mass flow rate function jumps:Since
x
is very close tox1
, one would expecty
to be very close toy1 = 0.0015270174250288026
. Instead one getsy = 0.00137275
.What I understand is that the derivative
yd1
is very, very close to(y1-y0)/(x1-x0)
, while the derivativeyd0
is slightly larger. I can replicate the issue with round figures:Variable
y
should go fromy0
toy1
, and quite obviously it doesn't do that.Bottom line:
regFun3()
is numerically ill-conditioned when the two supplied derivatives are very close to the slope of the curve connecting the two points. I'm not sure whether this is inherent to the algorithm by Gasparo and Morandi or if it is just @sielemann's implementation that has some glitch in those conditions.At this point this is no longer a Fluid issue, but a plain old computer science problem, so I gladly hand it over to someone else who's more competent than I am. @sielemann, @gkurzbach, @beutlich any suggestion? @hubertus65 do you think Michael would be interested at plunging back into this problem?
Originally posted by @casella in #3758 (comment)
The text was updated successfully, but these errors were encountered: