Skip to content
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

feat: always build initialization problem #3347

Open
wants to merge 96 commits into
base: master
Choose a base branch
from

Conversation

AayushSabharwal
Copy link
Member

I'll link issues this closes once the PR is ready and I've added tests for them.

@AayushSabharwal
Copy link
Member Author

The updated initialization was causing problems for linearization. #3348 already fixed initialization in linearization_function so hacking something here only for it to be overwritten is pointless. #3348 is now merged into this PR.

@AayushSabharwal
Copy link
Member Author

The challenge is now remake. prob2 = remake(prob; u0 = [x => 1.0]) rebuilds the initialization problem appropriately, but doesn't set Initial(x) to 1.0 in prob2, which causes initialization to use whatever value is already in there. I don't think we can do this update in remake_initialization_data in MTK either, since what if the user does [x => ForwardDiff.Dual(1.0)]? The parameter object will still store Initial(x) as a Float64 and we'll get a MethodError trying to convert between the two.

@AayushSabharwal
Copy link
Member Author

Requires SciML/SciMLBase.jl#926

@AayushSabharwal
Copy link
Member Author

AayushSabharwal commented Feb 10, 2025

This makes tests in the global test environment run locally 🥳. I haven't run anything requiring its own environment (Downstream/etc) because linearization needs updates to use Initial. There's also something that works but seems incorrect which I'm working on investigating.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant