# SteadyStateProblem solved result problem

**URL:** <https://discourse.julialang.org/t/steadystateproblem-solved-result-problem/88511>\
**Category:** Modelling & Simulations\
**Tags:** modelingtoolkit\
**Created:** [October 10, 2022, 8:15am UTC](https://discourse.julialang.org/t/steadystateproblem-solved-result-problem/88511 "2022-10-10T08:15:32Z")\
**Posts on this page:** 7\
**Page:** 2

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [October 12, 2022, 8:47pm UTC](https://discourse.julialang.org/t/steadystateproblem-solved-result-problem/88511/21 "2022-10-12T20:47:00Z")

</div>

It’s a special enough case that `NonlinearProblem((du,p,t)->prob.f(du,u,p,0.0), prob.u0)` is fine. It’s not more than one line of code.

---

<div class="post-metadata">

**Author:** ![hzgzh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hzgzh/32/6596_2.png) [@hzgzh](https://discourse.julialang.org/u/hzgzh)\
**Post date:** [October 13, 2022, 1:36pm UTC](https://discourse.julialang.org/t/steadystateproblem-solved-result-problem/88511/22 "2022-10-13T13:36:38Z")

</div>

Thank you very much @ ChrisRackauckas, ,the pretty-good solution.

```julia
prob3 = NonlinearProblem((du,u,p)->prob.f(du, u, p, 0.0), prob.u0)
sol2 = solve(prob3, NewtonRaphson())

```

---

<div class="post-metadata">

**Author:** ![BambOoxX](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bambooxx/32/22179_2.png) [@BambOoxX](https://discourse.julialang.org/u/BambOoxX)\
**Post date:** [September 17, 2025, 3:48pm UTC](https://discourse.julialang.org/t/steadystateproblem-solved-result-problem/88511/23 "2025-09-17T15:48:39Z")

</div>

Sorry for reviving this, but is there a way in recent ModelingToolkit releases to build a similar `NonlinearProblem` based on `prob` directly ? The solution you proposed loses the “indexing by name” capability of ModelingToolkit solutions, and I would like to avoid rebuild all values by hand.

I can open a new topic if required.

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [September 17, 2025, 3:55pm UTC](https://discourse.julialang.org/t/steadystateproblem-solved-result-problem/88511/24 "2025-09-17T15:55:18Z")

</div>

Open an issue on ModelingToolkit if you have an example to solve. Using `SteadyStateProblem` constructor should just work and is tested. And it should support symbolic indexing. So my guess is that this is all solved by now unless there’s a bug that you’re specifically hitting that we don’t know about, hence an issue.

---

<div class="post-metadata">

**Author:** ![BambOoxX](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bambooxx/32/22179_2.png) [@BambOoxX](https://discourse.julialang.org/u/BambOoxX)\
**Post date:** [September 18, 2025, 10:39am UTC](https://discourse.julialang.org/t/steadystateproblem-solved-result-problem/88511/25 "2025-09-18T10:39:41Z")

</div>

Hum, I do not have a simple model to show this right now and I do not think it warrants and issue.  
It looks like I have the same need as the OP, which seems to be : solve the initialization problem at some given initial condition imposed for one of the variables.  
`SteadyStateProblem` seems not to enforce this initial constraint on part of the solution.  
Right now I solved this by adding some kind of multiplier to omptimize in an `OptimizationProblem` to fulfill this initial constraint, but that feels far-fetched.  
I will try and open a new topic and link this one.

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [September 18, 2025, 11:10am UTC](https://discourse.julialang.org/t/steadystateproblem-solved-result-problem/88511/26 "2025-09-18T11:10:23Z")

</div>

> [@BambOoxX](#):
>
> `SteadyStateProblem` seems not to enforce this initial constraint on part of the solution.

Interesting. All of the problem types (SteadyStateProblem, OptimizationProblem, NonlinearProblem) should be running the initializer these days. For non-ODEs, the initialization is just parameter initialization though, since they are non-dynamic.

---

<div class="post-metadata">

**Author:** ![BambOoxX](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bambooxx/32/22179_2.png) [@BambOoxX](https://discourse.julialang.org/u/BambOoxX)\
**Post date:** [September 18, 2025, 11:39am UTC](https://discourse.julialang.org/t/steadystateproblem-solved-result-problem/88511/27 "2025-09-18T11:39:39Z")

</div>

Ok, let me assemble some MWE in a new topic and we will continue the discussions there.

[Previous page](https://discourse.julialang.org/t/steadystateproblem-solved-result-problem/88511.md?page=1)
