Skip to content

Commit 43a4ae4

Browse files
committed
init
1 parent 670c5be commit 43a4ae4

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

docs/src/model_creation/constraint_equations.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ creating these two systems.
2828
Here, to create differentials with respect to time (for our differential equations), we must import the time differential operator from Catalyst. We do this through `D = default_time_deriv()`. Here, `D(V)` denotes the differential of the variable `V` with respect to time.
2929

3030
```@example ceq1
31-
using Catalyst, DifferentialEquations, Plots
31+
using Catalyst, OrdinaryDiffEq, Plots
3232
t = default_t()
3333
D = default_time_deriv()
3434
@@ -58,6 +58,7 @@ We can now merge the two systems into one complete `ReactionSystem` model using
5858
[`ModelingToolkit.extend`](@ref):
5959
```@example ceq1
6060
@named growing_cell = extend(osys, rn)
61+
growing_cell = complete(growing_cell)
6162
```
6263

6364
We see that the combined model now has both the reactions and ODEs as its
@@ -72,7 +73,7 @@ plot(sol)
7273
As an alternative to the previous approach, we could have constructed our
7374
`ReactionSystem` all at once by directly using the symbolic interface:
7475
```@example ceq2
75-
using Catalyst, DifferentialEquations, Plots
76+
using Catalyst, OrdinaryDiffEq, Plots
7677
t = default_t()
7778
D = default_time_deriv()
7879
@@ -83,6 +84,7 @@ rx1 = @reaction $V, 0 --> P
8384
rx2 = @reaction 1.0, P --> 0
8485
@named growing_cell = ReactionSystem([rx1, rx2, eq], t)
8586
setdefaults!(growing_cell, [:P => 0.0])
87+
growing_cell = complete(growing_cell)
8688
8789
oprob = ODEProblem(growing_cell, [], (0.0, 1.0))
8890
sol = solve(oprob, Tsit5())
@@ -100,12 +102,11 @@ the associated [ModelingToolkit
100102
tutorial](https://docs.sciml.ai/ModelingToolkit/stable/basics/Events/) for more
101103
details on the types of events that can be represented symbolically. A
102104
lower-level approach for creating events via the DifferentialEquations.jl
103-
callback interface is illustrated in the [Advanced Simulation Options](@ref
104-
advanced_simulations) tutorial.
105+
callback interface is illustrated [here](https://docs.sciml.ai/DiffEqDocs/stable/features/callback_functions/) tutorial.
105106

106107
Let's first create our equations and unknowns/species again
107108
```@example ceq3
108-
using Catalyst, DifferentialEquations, Plots
109+
using Catalyst, OrdinaryDiffEq, Plots
109110
t = default_t()
110111
D = default_time_deriv()
111112
@@ -124,6 +125,7 @@ continuous_events = [V ~ 2.0] => [V ~ V/2, P ~ P/2]
124125
We can now create and simulate our model
125126
```@example ceq3
126127
@named rs = ReactionSystem([rx1, rx2, eq], t; continuous_events)
128+
rs = complete(rs)
127129
128130
oprob = ODEProblem(rs, [], (0.0, 10.0))
129131
sol = solve(oprob, Tsit5())
@@ -148,6 +150,7 @@ p = [k_on => 100.0, switch_time => 2.0, k_off => 10.0]
148150
Simulating our model,
149151
```@example ceq3
150152
@named osys = ReactionSystem(rxs, t, [A, B], [k_on, k_off, switch_time]; discrete_events)
153+
osys = complete(osys)
151154
152155
oprob = ODEProblem(osys, u0, tspan, p)
153156
sol = solve(oprob, Tsit5(); tstops = 2.0)

0 commit comments

Comments
 (0)