-
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
Fix algorithm of IdealGases.Common.Functions.s0_Tlow_der #2919
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked that the code is same as cp_Tlow(data,T)/T and it's all right.
That you!
Sorry, I dropped T_der in my comment. The code value is same as,
and It's OK! |
My understanding of #1909 was that the smoothOrder annotation is preferred!? |
Well, stating the derivative was easier for me (as I do not know which smooth order to set). |
I agree with @thorade. For functions which are not too involved, I think it is preferrable to leave the tools compute the derivatives via AD. This is certainly the case for these functions, which are based on generalized polynomials, logarithms, and other expressions for which derivative are computed in the most straightforward way by AD. This makes the codebase smaller and more reliable, and avoids potential errors. AFAIK also OpenModelica supports this option. |
The original functions are analytic, so they can be differentiated as many times as one wants. In practice, thermodynamic systems are at most index 1, so I guess you can write smoothOrder = 2 and that will be more than enough for all practical applications. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest to add the smoothOrder=2
annotation as explained in my comment.
OK. Resolved. |
@hubertus65 @wischhusen @casella Please add your review. |
@thorade OK for you to merge? |
Yes, good to merge, IIRC this was the version that passed the test. |
@finback-at @thorade FYI
Fix #2870, fix #1909.