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/introduction_to_catalyst/catalyst_for_new_julia_users.md
+7-6Lines changed: 7 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -137,9 +137,9 @@ using JumpProcesses
137
137
```
138
138
139
139
This time, we will declare a so-called [SIR model for an infectious disease](@ref basic_CRN_library_sir). Note that even if this model does not describe a set of chemical reactions, it can be modelled using the same framework. The model consists of 3 species:
140
-
*$S$, the amount of *susceptible* individuals.
141
-
*$I$, the amount of *infected* individuals.
142
-
*$R$, the amount of *recovered* (or *removed*) individuals.
140
+
**S*, the amount of *susceptible* individuals.
141
+
**I*, the amount of *infected* individuals.
142
+
**R*, the amount of *recovered* (or *removed*) individuals.
143
143
144
144
It also has 2 reaction events:
145
145
* Infection, where a susceptible individual meets an infected individual and also becomes infected.
@@ -171,6 +171,7 @@ Previously we have bundled this information into an `ODEProblem` (denoting a det
Again, the order in which the inputs are given to the `DiscreteProblem` and the `JumpProblem` is important. The last argument to the `JumpProblem` (`Direct()`) denotes which simulation method we wish to use. For now, we recommend that users simply use the `Direct()` option, and then consider alternative ones (see the [JumpProcesses.jl docs](https://docs.sciml.ai/JumpProcesses/stable/)) when they are more familiar with modelling in Catalyst and Julia.
176
177
@@ -199,7 +200,7 @@ This will:
199
200
2. Switch your current Julia session to use the current folder's environment.
200
201
201
202
!!! note
202
-
If you check any folder which has been designated as a Julia environment, it contains a Project.toml and a Manifest.toml file. These store all information regarding the corresponding environment. For non-advanced users, it is recommended to never touch these files directly (and instead do so using various functions from the Pkg package, the important ones which are described in the next two subsections).
203
+
If you check any folder which has been designated as a Julia environment, it contains a Project.toml and a Manifest.toml file. These store all information regarding the corresponding environment. For non-advanced users, it is recommended to never touch these files directly (and instead do so using various functions from the Pkg package, the important ones which are described in the next two subsections).
203
204
204
205
### [Installing and importing packages in Julia](@id catalyst_for_new_julia_users_packages_installing)
205
206
Package installation and import have been described [previously](@ref catalyst_for_new_julia_users_packages_intro). However, for the sake of this extended tutorial, let us repeat the description by demonstrating how to install the [Latexify.jl](https://github.com/korsbo/Latexify.jl) package (which enables e.g. displaying Catalyst models in Latex format). First, we import the Julia Package manager ([Pkg](https://github.com/JuliaLang/Pkg.jl)) (which is required to install Julia packages):
@@ -236,15 +237,15 @@ So, why is this required, and why cannot we simply import any package installed
236
237
The reason why all this is important is that it is *highly recommended* to, for each project, define a separate environment. To these, only add the required packages. General-purpose environments with a large number of packages often, in the long term, produce package incompatibility issues. While these might not prevent you from installing all desired package, they often mean that you are unable to use the latest version of some packages.
237
238
238
239
!!! note
239
-
A not-infrequent cause for reported errors with Catalyst (typically the inability to replicate code in tutorials) is package incompatibilities in large environments preventing the latest version of Catalyst from being installed. Hence, whenever an issue is encountered, it is useful to run `Pkg.status()` to check whenever the latest version of Catalyst is being used.
240
+
A not-infrequent cause for reported errors with Catalyst (typically the inability to replicate code in tutorials) is package incompatibilities in large environments preventing the latest version of Catalyst from being installed. Hence, whenever an issue is encountered, it is useful to run `Pkg.status()` to check whenever the latest version of Catalyst is being used.
240
241
241
242
Some additional useful Pkg commands are:
242
243
-`Pk.rm("PackageName")` removes a package from the current environment.
243
244
-`Pkg.update("PackageName")`: updates the designated package.
244
245
-`Pkg.update()`: updates all packages.
245
246
246
247
!!! note
247
-
A useful feature of Julia's environment system is that enables the exact definition of what packages and versions were used to execute a script. This supports e.g. reproducibility in academic research. Here, by providing the corresponding Project.toml and Manifest.toml files, you can enable someone to reproduce the exact program used to perform some set of analyses.
248
+
A useful feature of Julia's environment system is that enables the exact definition of what packages and versions were used to execute a script. This supports e.g. reproducibility in academic research. Here, by providing the corresponding Project.toml and Manifest.toml files, you can enable someone to reproduce the exact program used to perform some set of analyses.
As described in a [previous section on Optimization.jl](@ref optimization_parameter_fitting), `OptimizationProblem`s do not support setting parameter values using maps. We must instead set `initial_guess` values using a vector. Next, in the first line of our cost function, we reshape the parameter values to the common form used across Catalyst (e.g. `[:pX => p[1], :pY => p[2], :pZ => p[2]]`, however, here we use a dictionary to easier compute the steady state initial condition). We also note that the order used in this array corresponds to the order we give each parameter's bounds in `lb` and `ub`, and the order in which their values occur in the output solution.
@@ -55,6 +56,7 @@ As [previously described](@ref optimization_parameter_fitting), Optimization.jl
Finally, we can find the optimum using some differentiation-based optimisation methods. Here we will use [Optim.jl](https://github.com/JuliaNLSolvers/Optim.jl)'s `BFGS` method:
Copy file name to clipboardExpand all lines: docs/src/inverse_problems/structural_identifiability.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,15 +60,15 @@ To, in a similar manner, indicate that certain initial conditions are known is a
60
60
### Providing non-trivial measured quantities
61
61
Sometimes, ones may not have measurements of species, but rather some combinations of species (or possibly parameters). To account for this, `measured_quantities` accepts any algebraic expression (and not just single species). To form such expressions, species and parameters have to first be `@unpack`'ed from the model. Say that we have a model where an enzyme ($E$) is converted between an active and inactive form, which in turns activates the production of a product, $P$:
62
62
```@example si1
63
-
enzyme_activation = @reaction_network begin
63
+
rs = @reaction_network begin
64
64
(kA,kD), Eᵢ <--> Eₐ
65
65
(Eₐ, d), 0 <-->P
66
66
end
67
67
```
68
68
If we can measure the total amount of $E$ ($=Eᵢ+Eₐ$), as well as the amount of $P$, we can use the following to assess identifiability:
Copy file name to clipboardExpand all lines: docs/src/model_creation/chemistry_related_functionality.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,8 @@ We will first show how to create compound species through [programmatic model co
12
12
```@example chem1
13
13
using Catalyst
14
14
t = default_t()
15
-
@species C(t) O(t)
15
+
@species C(t) O(t)
16
+
nothing # hide
16
17
```
17
18
Next, we create the `CO2` compound species:
18
19
```@example chem1
@@ -84,14 +85,17 @@ as the components `C`, `H`, and `O` are not declared as species anywhere. Please
84
85
Just like for normal species, it is possible to designate metadata and default values for compounds. Metadata is provided after the compound name, but separated from it by a `,`:
85
86
```@example chem1
86
87
@compound (CO2, [unit="mol"]) ~ C + 2O
88
+
nothing # hide
87
89
```
88
90
Default values are designated using `=`, and provided directly after the compound name.:
89
91
```@example chem1
90
92
@compound (CO2 = 2.0) ~ C + 2O
93
+
nothing # hide
91
94
```
92
95
If both default values and meta data are provided, the metadata is provided after the default value:
93
96
```@example chem1
94
97
@compound (CO2 = 2.0, [unit="mol"]) ~ C + 2O
98
+
nothing # hide
95
99
```
96
100
In all of these cases, the left-hand side must be enclosed within `()`.
0 commit comments