Skip to content

feat: add get_updated_symbolic_problem #1141

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

Merged
merged 3 commits into from
Apr 23, 2025

Conversation

AayushSabharwal
Copy link
Member

Is there a better place to call this than init_call?

@ChrisRackauckas
Copy link
Member

Should do the same in solve_call

@AayushSabharwal
Copy link
Member Author

Wouldn't that do double the work for algorithms that call init in solve? Is that acceptable?

@ChrisRackauckas
Copy link
Member

No it won't because of how the problems recurse.

But I just realized that where this makes sense is actually in get_concrete_u0.

@AayushSabharwal
Copy link
Member Author

Wouldn't get_concrete_problem be better?

@ChrisRackauckas
Copy link
Member

Well this is updating the u0 though? But yes, it's part of the concretization process.

src/solve.jl Outdated
prob
end

function get_concrete_problem(prob::SteadyStateProblem, isadapt; kwargs...)
p = get_concrete_p(prob, kwargs)
u0 = get_concrete_u0(prob, isadapt, Inf, kwargs)
u0 = promote_u0(u0, p, nothing)
remake(prob; u0 = u0, p = p)
prob = remake(prob; u0 = u0, p = p)
get_updated_symbolic_problem(_get_root_indp(prob), prob)
Copy link
Member

Choose a reason for hiding this comment

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

why is this after the remake and promotions? This should go up before promote_u0

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh hm. Yeah in my head I thought if we do it after promotions MTK knows the type to use but of course that is backward. We should let MTK populate the values and then promote to the correct type after.

@ChrisRackauckas ChrisRackauckas merged commit d42923c into SciML:master Apr 23, 2025
0 of 43 checks passed
@AayushSabharwal AayushSabharwal deleted the as/pre-solve-hook branch April 23, 2025 11:26
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.

2 participants