Skip to content

Commit f4b262c

Browse files
committed
use t = default_t()
1 parent 1c5121f commit f4b262c

33 files changed

+58
-56
lines changed

docs/src/api/catalyst_api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ models, and stochastic chemical kinetics jump process models.
3636

3737
```@example ex1
3838
using Catalyst, DifferentialEquations, Plots
39-
import Catalyst: t_nounits as t
39+
t = default_t()
4040
@parameters β γ
4141
@species S(t) I(t) R(t)
4242

docs/src/catalyst_applications/simulation_structure_interfacing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ Finally, we note that we cannot change the values of solution unknowns or parame
104104
Catalyst is built on an *intermediary representation* implemented by (ModelingToolkit.jl)[https://github.com/SciML/ModelingToolkit.jl]. ModelingToolkit is a modelling framework where one first declares a set of symbolic variables and parameters using e.g.
105105
```@example ex2
106106
using ModelingToolkit
107-
import ModelingToolkit: t_nounits as t
107+
t = default_t()
108108
@parameters σ ρ β
109109
@variables x(t) y(t) z(t)
110110
nothing # hide

docs/src/catalyst_functionality/chemistry_related_functionality.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ While Catalyst has primarily been designed around the modelling of biological sy
1010
We will first show how to create compound species through [programmatic model construction](@ref programmatic_CRN_construction), and then demonstrate using the DSL. To create a compound species, use the `@compound` macro, first designating the compound, followed by its components (and their stoichiometries). In this example, we will create a CO₂ molecule, consisting of one C atom and two O atoms. First, we create species corresponding to the components:
1111
```@example chem1
1212
using Catalyst
13-
import Catalyst: t_nounits as t
13+
t = default_t()
1414
@species C(t) O(t)
1515
```
1616
Next, we create the `CO2` compound species:
@@ -97,7 +97,7 @@ In all of these cases, the side to the left of the `~` must be enclosed within `
9797
### Compounds with multiple independent variables
9898
While we generally do not need to specify independent variables for compound, if the components (together) have more than one independent variable, this have to be done:
9999
```@example chem1
100-
import Catalyst: t_nounits as t
100+
t = default_t()
101101
@variables s
102102
@species N(s) O(t)
103103
@compound NO2(t,s) ~ N + 2O
@@ -118,7 +118,7 @@ which correctly finds the (rather trivial) solution `C + 2O --> CO2`. Here we no
118118
Let us consider a more elaborate example, the reaction between ammonia (NH₃) and oxygen (O₂) to form nitrogen monoxide (NO) and water (H₂O). Let us first create the components and the unbalanced reaction:
119119
```@example chem2
120120
using Catalyst # hide
121-
import Catalyst: t_nounits as t
121+
t = default_t()
122122
@species N(t) H(t) O(t)
123123
@compounds begin
124124
NH3 ~ N + 3H

docs/src/catalyst_functionality/compositional_modeling.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ plot(TreePlot(rn), method=:tree, fontsize=12, nodeshape=:ellipse)
5151
We could also have directly constructed `rn` using the same reaction as in
5252
`basern` as
5353
```@example ex1
54-
import Catalyst: t_nounits as t
54+
t = default_t()
5555
@parameters k
5656
@species A(t), B(t), C(t)
5757
rxs = [Reaction(k, [A,B], [C])]
@@ -114,7 +114,7 @@ ability to substitute the value of these variables into the DSL (see
114114
[Interpolation of Julia Variables](@ref dsl_description_interpolation_of_variables)). To make the repressilator we now make
115115
three genes, and then compose them together
116116
```@example ex1
117-
import Catalyst: t_nounits as t
117+
t = default_t()
118118
@species G3₊P(t)
119119
@named G1 = repressed_gene(; R=ParentScope(G3₊P))
120120
@named G2 = repressed_gene(; R=ParentScope(G1.P))

docs/src/catalyst_functionality/constraint_equations.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Here, to create differentials with respect to time (for our differential equatio
2929

3030
```@example ceq1
3131
using Catalyst, DifferentialEquations, Plots
32-
import Catalyst: t_nounits as t, D_nounits as D
32+
t = default_t(), D_nounits as D
3333
3434
# set the growth rate to 1.0
3535
@parameters λ = 1.0
@@ -72,7 +72,7 @@ As an alternative to the previous approach, we could have constructed our
7272
`ReactionSystem` all at once by directly using the symbolic interface:
7373
```@example ceq2
7474
using Catalyst, DifferentialEquations, Plots
75-
import Catalyst: t_nounits as t, D_nounits as D
75+
t = default_t(), D_nounits as D
7676
7777
@parameters λ = 1.0
7878
@variables V(t) = 1.0
@@ -104,7 +104,7 @@ advanced_simulations) tutorial.
104104
Let's first create our equations and unknowns/species again
105105
```@example ceq3
106106
using Catalyst, DifferentialEquations, Plots
107-
import Catalyst: t_nounits as t, D_nounits as D
107+
t = default_t(), D_nounits as D
108108
109109
@parameters λ = 1.0
110110
@variables V(t) = 1.0
@@ -128,7 +128,7 @@ plot(sol; plotdensity = 1000)
128128
```
129129
We can also model discrete events. Similar to our example with continuous events, we start by creating reaction equations, parameters, variables, and unknowns.
130130
```@example ceq3
131-
import Catalyst: t_nounits as t
131+
t = default_t()
132132
@parameters k_on switch_time k_off
133133
@species A(t) B(t)
134134

docs/src/catalyst_functionality/dsl_description.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ the model. We do this by creating a mapping from each symbolic variable
5454
representing a chemical species to its initial value
5555
```@example tut2
5656
# define the symbolic variables
57-
import Catalyst: t_nounits as t
57+
t = default_t()
5858
@species X(t) Y(t) Z(t) XY(t) Z1(t) Z2(t)
5959
6060
# create the mapping
@@ -610,7 +610,7 @@ parameters outside of the macro, which can then be used within expressions in
610610
the DSL (see the [Programmatic Construction of Symbolic Reaction Systems](@ref programmatic_CRN_construction)
611611
tutorial for details on the lower-level symbolic interface). For example,
612612
```@example tut2
613-
import Catalyst: t_nounits as t
613+
t = default_t()
614614
@parameters k α
615615
@species A(t)
616616
spec = A

docs/src/catalyst_functionality/example_networks/hodgkin_huxley_equation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ We begin by importing some necessary packages.
1515
using ModelingToolkit, Catalyst, NonlinearSolve
1616
using DifferentialEquations, Symbolics
1717
using Plots
18-
import Catalyst: t_nounits as t, D_nounits as D
18+
t = default_t(), D_nounits as D
1919
```
2020

2121
We'll build a simple Hodgkin-Huxley model for a single neuron, with the voltage,

docs/src/catalyst_functionality/example_networks/smoluchowski_coagulation_equation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ end
5252
We'll store the reaction rates in `pars` as `Pair`s, and set the initial condition that only monomers are present at ``t=0`` in `u₀map`.
5353
```julia
5454
# unknown variables are X, pars stores rate parameters for each rx
55-
import Catalyst: t_nounits as t
55+
t = default_t()
5656
@species k[1:nr] (X(t))[1:N]
5757
pars = Pair.(collect(k), kv)
5858

docs/src/catalyst_functionality/parametric_stoichiometry.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ rx.substrates[1],rx.substoich[1]
3535
We could have equivalently specified our systems directly via the Catalyst
3636
API. For example, for `revsys` we would could use
3737
```@example s1
38-
import Catalyst: t_nounits as t
38+
t = default_t()
3939
@parameters k₊, k₋, m, n
4040
@species A(t), B(t)
4141
rxs = [Reaction(k₊, [A], [B], [m], [m*n]),
@@ -177,7 +177,7 @@ calculate and plot the average amount of protein (which is also plotted in the
177177
MomentClosure.jl
178178
[tutorial](https://augustinas1.github.io/MomentClosure.jl/dev/tutorials/geometric_reactions+conditional_closures/)).
179179
```@example s1
180-
import Catalyst: t_nounits as t
180+
t = default_t()
181181
function getmean(jprob, Nsims, tv)
182182
Pmean = zeros(length(tv))
183183
@variables P(t)

docs/src/catalyst_functionality/programmatic_CRN_construction.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ and then define symbolic variables for each parameter and species in the system
1515
(the latter corresponding to a `variable` or `unknown` in ModelingToolkit
1616
terminology)
1717
```@example ex
18-
import Catalyst: t_nounits as t
18+
t = default_t()
1919
@parameters α K n δ γ β μ
2020
@species m₁(t) m₂(t) m₃(t) P₁(t) P₂(t) P₃(t)
2121
nothing # hide
2222
```
23-
Note: Each species is declared as a function of time. Here, we first import the *time independent variable using `import Catalyst: t_nounits as t`, and then use it to declare out species.
23+
Note: Each species is declared as a function of time. Here, we first import the *time independent variable using `t = default_t()`, and then use it to declare out species.
2424

2525
!!! note
2626
For users familiar with ModelingToolkit, chemical species must be declared
@@ -117,7 +117,7 @@ Reaction(rate, nothing, [P₁,...,Pₙ], nothing, [β₁,...,βₙ])
117117
Finally, we note that the rate constant, `rate` above, does not need to be a
118118
constant or fixed function, but can be a general symbolic expression:
119119
```julia
120-
import Catalyst: t_nounits as t
120+
t = default_t()
121121
@parameters α, β
122122
@species A(t), B(t)
123123
rx = Reaction+ β*t*A, [A], [B])
@@ -133,7 +133,7 @@ reactions using the [`@reaction`](@ref) macro.
133133

134134
For example, the repressilator reactions could also have been constructed like
135135
```julia
136-
import Catalyst: t_nounits as t
136+
t = default_t()
137137
@species P₁(t) P₂(t) P₃(t)
138138
rxs = [(@reaction hillr($P₃,α,K,n), ∅ --> m₁),
139139
(@reaction hillr($P₁,α,K,n), ∅ --> m₂),
@@ -162,7 +162,7 @@ rx = @reaction hillr(P,α,K,n), A --> B
162162
```
163163
is equivalent to
164164
```julia
165-
import Catalyst: t_nounits as t
165+
t = default_t()
166166
@parameters P α K n
167167
@variables A(t) B(t)
168168
rx = Reaction(hillr(P,α,K,n), [A], [B])

0 commit comments

Comments
 (0)