Skip to content

Conversation

@AayushSabharwal
Copy link
Member

Close #3570

@AayushSabharwal AayushSabharwal force-pushed the as/remake-copy-initials branch from 7aa8c0c to 8a19a49 Compare April 21, 2025 07:38
u0 === missing && return newu0, (p === missing ? copy(newp) : newp)
# If the user passes `p` to `remake` but not `u0` and `u0` isn't empty,
# and if the system supports initialization (so it has initial parameters),
# and if the initialization solves for `u0`,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you don't know this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do. Initialization solves for unknowns if initializeprobmap !== nothing

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't know what the initialization will be until solve is called.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have all the information about the initialization in the ODEProblem?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't know which initialization method will be used until later. CheckInit and NoInit don't solve for u0.

@AayushSabharwal AayushSabharwal force-pushed the as/remake-copy-initials branch from ddc22ca to c385c11 Compare April 23, 2025 14:45
@AayushSabharwal
Copy link
Member Author

Waiting for SciML/DiffEqBase.jl#1143

@AayushSabharwal AayushSabharwal force-pushed the as/remake-copy-initials branch from f788eeb to 0aa0d8b Compare April 24, 2025 17:30
getter = if meta isa InitializationMetadata
meta.get_initial_unknowns
else
getu(sys, Initial.(unknowns(sys)))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this will get the guesses too?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would the guesses come into the picture here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the same reason as https://github.com/SciML/SciMLSensitivity.jl/pull/1168/files#diff-76127b1004a68143584d305e1c9ee36126238fd5a05ddeff5985f5b5450ed2c2R92, the u0 vector on DAEs is canonically interpreted as either the initial value or the guess for u0, depending on the choice of initialization and which one exists.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. That's a little more annoying, but not difficult to do. I'll fix it so this propagates guesses.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed now

@AayushSabharwal AayushSabharwal force-pushed the as/remake-copy-initials branch from 0aa0d8b to 1450a5f Compare April 25, 2025 13:50
@AayushSabharwal
Copy link
Member Author

Cancelled CI because I forgot to add a test

@AayushSabharwal AayushSabharwal force-pushed the as/remake-copy-initials branch from a611042 to 997da8d Compare April 28, 2025 06:53
@AayushSabharwal
Copy link
Member Author

SciMLBase/Downstream failure is SciML/SciMLBase.jl#1006. pre seems to be failing because NonlinearSolve doesn't precompile

@ChrisRackauckas ChrisRackauckas merged commit ba0807d into SciML:master Apr 29, 2025
34 of 44 checks passed
@AayushSabharwal AayushSabharwal deleted the as/remake-copy-initials branch April 29, 2025 11:31
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.

setting Initials is ignorred when using BrownFullBasicInit

2 participants