fix: properly eliminate identically zero variables in alias_elimination!#4704
Draft
AayushSabharwal wants to merge 2 commits into
Draft
fix: properly eliminate identically zero variables in alias_elimination!#4704AayushSabharwal wants to merge 2 commits into
alias_elimination!#4704AayushSabharwal wants to merge 2 commits into
Conversation
8b8bc98 to
b5a1c7c
Compare
| printstyled(io, k; bold = true) | ||
| println(io, ": ", v) | ||
| end | ||
| end |
Contributor
There was a problem hiding this comment.
[Runic] reported by reviewdog 🐶
Suggested change
| end | |
| return | |
| return |
Contributor
anti-derivatives? |
Member
Author
|
I knew there was a term I was forgetting 😅 Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on top of #4703
Requires JuliaComputing/StateSelection.jl#125
After bareiss, the matrix often contains rows with a single non-zero entry. This means the corresponding variable is identically zero. However, the pass never eliminated such variables and never included them in the
maybe_zerosheuristic. Thus, MTK was fine with dividing by them if present in a linear SCC it can analytically solve.These zero variables are now discovered after the pass, eagerly removed, and substituted into all equations where they are present. The above two PRs are required infrastructure to handle the case when a differentiated variable is found to analytically be zero. In this case, the variable, all its derivatives and all integrated forms are eliminated as observed. Lower order derivatives are analytically obtained as a polynomial in
t. The infrastructure is mostly to make sure initialization behaves correctly.TODO: