Skip to content

Commit 4517937

Browse files
committed
fix xy eval func
1 parent f6f76da commit 4517937

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/src/steady_state_functionality/examples/nullcline_plotting.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# [Plotting Nullclines and Steady States in Phase Space](@id nullcline_plotting)
2-
In this tutorial we will show how to extract a system's steady states and [nullclines](https://en.wikipedia.org/wiki/Nullcline), and how to plot these in [phase space](https://en.wikipedia.org/wiki/Phase_space). Generally, while nullclines are not directly needed for much analysis, plotting these can give some understanding of a system's steady state and stability properties.
2+
In this tutorial we will show how to extract a system's steady states and [nullclines](https://en.wikipedia.org/wiki/Nullcline), and how to plot these in [phase space](https://en.wikipedia.org/wiki/Phase_space). Generally, while nullclines are not directly needed for most types analysis, plotting these can give some understanding of a system's steady state and stability properties.
33

44
For an ordinary differential equation
55
```math
@@ -32,10 +32,10 @@ sss = hc_steady_states(bs_switch, ps; show_progress = false)
3232

3333
Finally, we will compute the nullclines. First we create a function which, for species values $(X,Y)$, returns the evaluation of the model's ODE's right-hand side.
3434
```@example nullcline_plotting
35-
nlprob = NonlinearProblem(complete(nlsys), [X => 0.0, Y => 0.0], ps)
35+
nlprob = NonlinearProblem(bs_switch, [X => 0.0, Y => 0.0], ps)
3636
function get_XY(Xval, Yval)
3737
prob = Catalyst.remake(nlprob; u0 = [X => Xval, Y => Yval])
38-
return prob[equations(nlsys)[2].rhs], prob[equations(nlsys)[1].rhs]
38+
return nlprob.f(prob.u0, prob.p)
3939
end
4040
```
4141
Next, we plot our nullclines by using Plot.jl's [`contour` function](https://docs.juliaplots.org/latest/series_types/contour/). Here, we plot the $0$ contour lines (which corresponds to the nullclines) for both the $X$ and $Y$ nullclines. We will plot the steady states using `scatter`. We use the `steady_state_stability` function to [compute steady state stabilities](@ref steady_state_stability) (and use this to determine how to plot the steady state markers).

0 commit comments

Comments
 (0)