How to remake a SteadyStateProblem efficiently

I am trying to efficiently reinitialize a SteadyStateProblem, built from a ModelingToolkit System.

steady_prob = SteadyStateProblem(prob)
steady_prob = remake(steady_prob; u0=new_u0)

But this doesn’t actually change the u0 of the problem. What would be the correct way to update the state? It has to be efficient, so either using setsym or preferably by providing u0 directly.

This is not the solution to your problem but for me the remake works as expected for NonlinearProblem. It does not work for SteadyStateProblem

Figured it out. I was providing defaults while building the problem, which were overriding the Initial values I was providing when reinitializing.

1 Like