Skip to content

Commit 4648424

Browse files
authored
Merge pull request #1239 from SciML/remove_nl_sys_conslaw_warning
Remove `remove_conserved` warning from nonlinear solve doc page
2 parents 34a9223 + 19cbf06 commit 4648424

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

docs/src/steady_state_functionality/nonlinear_solve.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,22 +67,19 @@ end
6767
```
6868
It has an infinite number of steady states. To make steady state finding possible, information of the system's conserved quantities (here $C = X1 + X2$) must be provided. Since these can be computed from system initial conditions (`u0`, i.e. those provided when performing ODE simulations), designating an `u0` is often the best way. There are two ways to do this. First, one can perform [forward ODE simulation-based steady state finding](@ref steady_state_solving_simulation), using the initial condition as the initial `u` guess. Alternatively, any conserved quantities can be eliminated when the `NonlinearProblem` is created. This feature is supported by [Catalyst's conservation law finding and elimination feature](@ref conservation_laws).
6969

70-
!!! warn
71-
For Catalyst versions >14.4.1, handling of conservation laws in `NonlinearProblem`s through the `remove_conserved = true` argument has been temporarily disabled. This is due to an upstream update in ModelingToolkit.jl. We aim to re-enable this as soon as possible. Currently, to find steady states of these systems, either use [homotopy continuation](@ref homotopy_continuation), the [simulation based approach](@ref steady_state_solving_simulation), or temporarily downgrade Catalyst to version 14.4.1. The remaining code of this section is left on display (and the text with it), but is not run dynamically, and cannot be run without generating an error.
72-
7370
To eliminate conservation laws we simply provide the `remove_conserved = true` argument to `NonlinearProblem`:
74-
```julia
71+
```@example steady_state_solving_claws
7572
p = [:k1 => 2.0, :k2 => 3.0]
7673
u_guess = [:X1 => 3.0, :X2 => 1.0]
7774
nl_prob = NonlinearProblem(two_state_model, u_guess, p; remove_conserved = true)
7875
nothing # hide
7976
```
8077
here it is important that the quantities used in `u_guess` correspond to the conserved quantities we wish to use. E.g. here the conserved quantity $X1 + X2 = 3.0 + 1.0 = 4$ holds for the initial condition, and will hence also hold in the computed steady state as well. We can now find the steady states using `solve` like before:
81-
```julia
78+
```@example steady_state_solving_claws
8279
sol = solve(nl_prob)
8380
```
8481
We note that the output only provides a single value. The reason is that the actual system solved only contains a single equation (the other being eliminated with the conserved quantity). To find the values of $X1$ and $X2$ we can [directly query the solution object for these species' values, using the species themselves as inputs](@ref simulation_structure_interfacing_solutions):
85-
```julia
82+
```@example steady_state_solving_claws
8683
sol[[:X1, :X2]]
8784
```
8885

0 commit comments

Comments
 (0)