Include functionality for rearranging algebraic loops to turn certain DAEs into ODEs#1400
Open
agarny wants to merge 143 commits into
Open
Include functionality for rearranging algebraic loops to turn certain DAEs into ODEs#1400agarny wants to merge 143 commits into
agarny wants to merge 143 commits into
Conversation
Also changed the name of astMap to variableMap to better reflect what it's actually mapping to
Substituted with std::pair<bool, SymEngine::RCP<const SymEngine::Basic>> use instead
Mostly GPT generated test cases
Test case has been superseded by the newly added test suite to more robustly test for equation rearrangement
Previous system assumed that symengine expressions contained only 0-2 children, but in reality it could be any whole number. This adjusts the existing conversion logic to account for this.
Made it so that we also now consider mathml unary +/- operators
Can now handle unary plus, minus, unary minus, and CN types from AST (which means code now passes Analyser.rearrangeAdditiveEquations)
Had an error at equation 4 Also added brackets to equation comments to make things more clear
Now passes Analyser.rearrangeMultiplicativeEquations
Now covers a greater variety of cases
Symengine is not capable of rearranging trig functions into inverse trig functions (e.g. tan(x) = y cannot become x = atan(y))
Now has better Eq 1 test case and more consistent variable naming
Now supports - Decimal point values (i.e. doubles) - Constants (E, pi, and inf)
We need to ensure that there can only be one real solution for each
Some specific things had to be added to handle this - CN representing integers must be appropriately converted since symengine requires exponentials to be whole numbers - We need to filter out real from non-real solutions since we assume users will want to ignore the complex domain in most cases
Now assumes left child will always be the non-null component
SymEngine doesn't simplify anything past an equality
Test cases out of sync with simplification commit
Avoid matching external variable to an equation since it's possible it's meant to be undefined for the equation. Also initialise external variables at the end if still unknown
Removed unused code, introduced proper comment formatting, used/removed const, auto, and & where appropriate.
Removed unused code, introduced proper comment formatting, used/removed const, auto, and & where appropriate. Also fixed minor issues where relevant.
Only support the three most recent versions of macOS, not to mention that we want to be able to use `std::format()` which is only available on macOS 13 and later.
This has indeed been done "properly" in PR cellml#1390.
They were making the code a bit faster but more difficult to maintain.
…txt`. The idea is for the library type to be determined by CMake to allow building `test_utils` as static or shared, depending on the project's configuration.
They were making the code a bit faster but more difficult to maintain.
…txt`. The idea is for the library type to be determined by CMake to allow building `test_utils` as static or shared, depending on the project's configuration.
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.
Fixes #1050.