You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/steady_state_functionality/examples/nullcline_plotting.md
+36-2Lines changed: 36 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,27 @@
1
1
# [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 systems steady state and stability properties. While nullclines can be "brute forced", we will here use [BifurcationKit.jl](https://github.com/bifurcationkit/BifurcationKit.jl) to rack their path exactly.
2
3
3
-
Introduction text.
4
+
For a ordinary differential equation
5
+
```math
6
+
\begin{aligned}
7
+
\frac{dx_1}{dt} &= f_1(x_1, x_2, ..., x_3) \\
8
+
\frac{dx_2}{dt} &= f_2(x_1, x_2, ..., x_3) \\
9
+
&\vdots\\
10
+
\frac{dx_n}{dt} &= f_3(x_1, x_2, ..., x_3) \\
11
+
\end{aligned}
12
+
```
13
+
The nullclines are the curves
14
+
```math
15
+
\begin{aligned}
16
+
0 &= f_1(x_1, x_2, ..., x_3) \\
17
+
0 &= f_2(x_1, x_2, ..., x_3) \\
18
+
&\vdots\\
19
+
0 &= f_3(x_1, x_2, ..., x_3) \\
20
+
\end{aligned}
21
+
```
22
+
where the $i$'th nullclines is the curve along which $\frac{dx_i}{dt} = 0$. Generally, nullclines are primarily computed for models with 2 variable (as only here can they be easily plotted).
4
23
24
+
## [Computing nucclines and steady states for a bistable switch](@id nullcline_plotting_computation)
5
25
For our example we will use a simple bistable switch model, consisting of two species ($X$ and $Y$) which mutually inhibits each other through repressive hill functions. We will create our model [programmatically](@ref programmatic_CRN_construction).
6
26
```@example nullcline_plotting
7
27
using Catalyst
@@ -17,13 +37,27 @@ rxs = [
17
37
@named bs_switch = ReactionSystem(rxs, t)
18
38
bs_switch = complete(bs_switch)
19
39
```
40
+
20
41
Next, we compute the steady states [using homotopy continuation](@ref homotopy_continuation).
Next we wish to compute the nullclines. We will first extract the equations corresponding to these from our model. Next, we will compute them using [BifurcationKit.jl](https://github.com/bifurcationkit/BifurcationKit.jl). To generate our equations, we first convert our model to a `NonlinearSystem`. For each nullcline equation, we also have to replace the corresponding variable with a parameter (which can be varied to compute the full nullcline curve).
47
+
48
+
Finally, we will compute the nullclines. We will first extract our models steady state equations (which we do by creating a `NonlinearSystem`).
49
+
```@example nullcline_plotting
50
+
nlsys = convert(NonlinearSystem, bs_switch)
51
+
eqs = equations(nlsys)
52
+
```
53
+
Here, each equation is an expression of two variables. To plot the corr
We will first extract the equations corresponding to these from our model. Next, we will compute them using [BifurcationKit.jl](https://github.com/bifurcationkit/BifurcationKit.jl). To generate our equations, we first convert our model to a `NonlinearSystem`. For each nullcline equation, we also have to replace the corresponding variable with a parameter (which can be varied to compute the full nullcline curve).
0 commit comments