-
Notifications
You must be signed in to change notification settings - Fork 292
Add Smooth Heaviside Function to Math #1603
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
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1603 +/- ##
==========================================
- Coverage 76.85% 76.85% -0.01%
==========================================
Files 394 394
Lines 63241 63244 +3
Branches 10359 10359
==========================================
Hits 48604 48604
- Misses 12188 12192 +4
+ Partials 2449 2448 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
dallan-keylogic
left a comment
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.
Could we augment this function with an additional function that is a drop-in replacement for expr_if? Maybe have two expr_if replacements, depending on whether the underlying expression is continuous (when we can use smooth_max or smooth_min or discontinuous, when we use smooth_heaviside.
After thinking about this a bit more (and trying to implement it), I'm finding it difficult to cover all the possible scenarios since there's not necessarily uniformity in how the conditional statement is set up (number of terms on the LHS and RHS). If we do assume a simple if x > y or x < y, I feel that it is fairly straightforward for the users to replace the Expr_if themselves. That way we don't need to keep Expr_ifs in the code at all (i.e. "the drop-in replacement" function would need to be passed the Expr_if) |
dallan-keylogic
left a comment
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.
LGTM
Morgan88888888
left a comment
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.
Everything looks good.
Summary/Motivation:
Addresses a comment made here to add the smooth_heaviside function into IDAES rather than WaterTAP
Changes proposed in this PR:
Legal Acknowledgement
By contributing to this software project, I agree to the following terms and conditions for my contribution: