-
-
Notifications
You must be signed in to change notification settings - Fork 79
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
WIP: fixes for MTK changes #1186
Open
TorkelE
wants to merge
16
commits into
master
Choose a base branch
from
mtk_update
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 15 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
f0f7b32
initi
TorkelE 1121ce7
don't provide system level conservation law defaults
TorkelE 82ecb25
Update Project.toml
isaacsas 7005533
use vector conservation law constant in ps only
isaacsas ac0222b
unwrap
isaacsas a9c2d7d
MT.unwrap
isaacsas 8008a98
mtk update documentation
isaacsas af91bfa
updates
isaacsas 3f1f19f
more test updates
isaacsas 80540fe
more test fixes
isaacsas 1d376f0
more fixes
isaacsas ae8c524
finish fixing DSL tests
isaacsas da09d93
more fixes
isaacsas d8ce691
fix isequivalent test
isaacsas ebe63a8
fixes
isaacsas 002da5f
uncomment disabled error
isaacsas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
ANy reason to remove this?
structural_simplify
is still a mess, but this still seems like a useful error to throw?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.
What's the issue with structural simplify? I don't know of one related to Catalyst
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.
Wasn't there the cases where it may or may not simplify things into DAEs. However, depending on whichever variable was reduced to an algebraic equation, the user now have to determine whether its initial condition should go as an initial condition or a guess. And where the user have to explicitly check the simplified system to figure out which ended up being the case?
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.
No and no. First of all, that is no issue of
structural_simplify
, this is just a property of DAEs and index 1 transformations 😅 . So if you're waiting for that to ever change, sorry but it's just the math of DAEs. I'd be happy to hop on a call and explain it since you and @isaacsas keep asking the same question, it's probably just easiest to pull out a whiteboard at this point. But it shouldn't cause any difficulties to the user.Here's a simple way to understand it. If your DAE is index 1 (which it will be after transformation), then every equation is either a differential equation or an algebraic equation, and every equation is associated through matching to be solving for one variable (this is equivalent to the index 1 condition and not having a singularity in the Jacobian). So with this, any variable can be called either a differential or algebraic variable. You need as many initial conditions as you have algebraic variables, and any variable that doesn't have an initial condition needs a guess. It doesn't matter which one is chosen by the system as differential or algebraic, but it does matter that you have the right number of conditions. If you have more conditions, it throws you a warning because it's generally not a good idea to have an overdetermined system, but it doesn't mean it's impossible to solve. If it's over or underdetermined it will still try to initialize, with many caveats of course.
The simplest way to understand this then is that, every variable needs either an initial condition or a guess. You should probably be making every differential variable have an initial condition, and for every algebraic condition you should be introducing a new variable and give that one a guess.
There is potentially a way to not need guesses if we move beyond Newton methods to more homotopy type solvers, since it's really just a property of Newton that you need a
u0
, but this'll be years of research and not something to rely on.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 just commented this out while debugging. I didn't intend to keep it commented out when merging...