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
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:
78
-
```@example steady_state_solving_claws
78
+
<!--```@example steady_state_solving_claws
79
79
sol = solve(nl_prob)
80
-
```
80
+
```-->
81
81
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):
82
-
```@example steady_state_solving_claws
82
+
<!--```@example steady_state_solving_claws
83
83
sol[[:X1, :X2]]
84
-
```
84
+
```-->
85
85
86
86
## [Finding steady states through ODE simulations](@id steady_state_solving_simulation)
87
87
The `NonlinearProblem`s generated by Catalyst corresponds to ODEs. A common method of solving these is to simulate the ODE from an initial condition until a steady state is reached. Here we do so for the dimerisation system considered in the previous section. First, we declare our model, initial condition, and parameter values.
Copy file name to clipboardExpand all lines: ext/CatalystGraphMakieExtension/rn_graph_plot.jl
+99-45Lines changed: 99 additions & 45 deletions
Original file line number
Diff line number
Diff line change
@@ -3,18 +3,22 @@
3
3
#############
4
4
5
5
"""
6
-
SRGraphWrap{T}
6
+
MultiGraphWrap{T}
7
7
8
-
Wrapper for the species-reaction graph containing edges for rate-dependence on species. Intended to allow plotting of multiple edges.
8
+
Wrapper intended to allow plotting of multiple edges. This is needed in the following cases:
9
+
- For the species-reaction graph, multiple edges can exist when a reaction depends on some species for its rate, and if that species is produced by the reaction.
10
+
- For the complex graph, multiple edges can exist between a pair of nodes if there are multiple reactions between the same complexes. This might include a reversible pair of reactions - we might have three total edges if one reaction is reversible, and we have a separate reaction going from one complex to the other.
11
+
12
+
`gen_distances` sets the distances between the edges that allows multiple to be visible on the plot at the same time.
9
13
"""
10
-
structSRGraphWrap{T} <:Graphs.AbstractGraph{T}
14
+
structMultiGraphWrap{T} <:Graphs.AbstractGraph{T}
11
15
g::SimpleDiGraph{T}
12
-
rateedges::Vector{Graphs.SimpleEdge{T}}
16
+
multiedges::Vector{Graphs.SimpleEdge{T}}
13
17
edgeorder::Vector{Int64}
14
18
end
15
19
16
-
# Create the SimpleDiGraph corresponding to the species and reactions
17
-
functionSRGraphWrap(rn::ReactionSystem)
20
+
# Create the SimpleDiGraph corresponding to the species and reactions, the species-reaction graph
21
+
functionMultiGraphWrap(rn::ReactionSystem)
18
22
srg =species_reaction_graph(rn)
19
23
rateedges =Vector{Graphs.SimpleEdge{Int}}()
20
24
sm =speciesmap(rn); specs =species(rn)
@@ -32,29 +36,60 @@ function SRGraphWrap(rn::ReactionSystem)
0 commit comments