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: HISTORY.md
+49-25Lines changed: 49 additions & 25 deletions
Original file line number
Diff line number
Diff line change
@@ -7,29 +7,47 @@
7
7
(at the time the release is made). If you need a dependency version increased,
8
8
please open an issue and we can update it and make a new Catalyst release once
9
9
testing against the newer dependency version is complete.
10
-
- It is no longer recommended to install and use the full OrdinaryDiffEq library to access specific ODE solvers.
11
-
Instead, only install the specific OrdinaryDiffEq sub-libraries that contain the desired
12
-
solver. This significantly reduces installation and package loading times. I.e. to use the default
13
-
solver that auto-switches between explicit and implicit methods, install `OrdinaryDiffEqDefault`. To
14
-
use `Tsit5` install `OrdinaryDiffEqTsit5`, etc. The possible sub-libraries, each containing different solvers,
15
-
can be viewed [here](https://github.com/SciML/OrdinaryDiffEq.jl/tree/master/lib).
16
-
- It should now be safe to use `remake` on problems which have had conservation laws removed.
17
-
The warning regarding this when eliminating conservation laws have been removed (in conjunction
18
-
with the `remove_conserved_warn` argument for disabling this warning).
19
-
- New formula for inferring variables from equations (declared using the `@equations` options) in the DSL. The order of inference of species/variables/parameters is now:
20
-
(1) Every symbol explicitly declared using `@species`, `@variables`, and `@parameters` are assigned to the correct category.
21
-
(2) Every symbol used as a reaction reactant is inferred as a species.
22
-
(3) Every symbol not declared in (1) or (2) that occurs in an expression provided after `@equations` is inferred as a variable.
23
-
(4) Every symbol not declared in (1), (2), or (3) that occurs either as a reaction rate or stoichiometric coefficient is inferred to be a parameter.
24
-
E.g. in
25
-
```julia
26
-
@reaction_networkbegin
27
-
@equations V1 + S ~ V2^2
28
-
(p + S + V1), S -->0
29
-
end
30
-
```
31
-
`S` is inferred as a species, `V1` and `V2` as variables, and `p` as a parameter. The previous special cases for the `@observables`, `@compounds`, and `@differentials` options still hold. Finally, the `@require_declaration` options (described in more detail below) can now be used to require everything to be explicitly declared.
32
-
- New formula for determining whether the default differentials have been used within an `@equations` option. Now, if any expression `D(...)` is encountered (where `...` can be anything), this is inferred as usage of the default differential D. E.g. in the following equations `D` is inferred as a differential with respect to the default independent variable:
10
+
- It is no longer recommended to install and use the full OrdinaryDiffEq library
11
+
to access specific ODE solvers. Instead, only install the specific
12
+
OrdinaryDiffEq sub-libraries that contain the desired solver. This
13
+
significantly reduces installation and package loading times. I.e. to use the
14
+
default solver that auto-switches between explicit and implicit methods,
15
+
install `OrdinaryDiffEqDefault`. To use `Tsit5` install `OrdinaryDiffEqTsit5`,
16
+
etc. The possible sub-libraries, each containing different solvers, can be
- New formula for inferring variables from equations (declared using the
25
+
`@equations` options) in the DSL. The order of inference of
26
+
species/variables/parameters is now:
27
+
1. Every symbol explicitly declared using `@species`, `@variables`, and
28
+
`@parameters` are assigned to the correct category.
29
+
2. Every symbol used as a reaction reactant is inferred as a species.
30
+
3. Every symbol not declared in (1) or (2) that occurs in an expression
31
+
provided after `@equations` is inferred as a variable.
32
+
4. Every symbol not declared in (1), (2), or (3) that occurs either as a
33
+
reaction rate or stoichiometric coefficient is inferred to be a
34
+
parameter. E.g. in
35
+
```julia
36
+
@reaction_networkbegin
37
+
@equations V1 + S ~ V2^2
38
+
(p + S + V1), S -->0
39
+
end
40
+
```
41
+
`S` is inferred as a species, `V1` and `V2` as variables, and `p` as a
42
+
parameter. The previous special cases for the `@observables`, `@compounds`,
43
+
and `@differentials` options still hold. Finally, the `@require_declaration`
44
+
options (described in more detail below) can now be used to require everything
45
+
to be explicitly declared.
46
+
- New formula for determining whether the default differentials have been used
47
+
within an `@equations` option. Now, if any expression `D(...)` is encountered
48
+
(where`...` can be anything), this is inferred as usage of the default
49
+
differential D. E.g. in the following equations `D` is inferred as a
50
+
differential with respect to the default independent variable:
33
51
```julia
34
52
@reaction_network begin
35
53
@equations D(V) + V ~ 1
@@ -38,7 +56,9 @@
38
56
@equations D(D(V)) ~ 1
39
57
end
40
58
```
41
-
Please note that this cannot be used at the same time as `D` is used to represent a species, variable, or parameter (including if these are implicitly designated as such by e.g. appearing as a reaction reactant).
59
+
Please note that this cannot be used at the same time as `D` is used to
60
+
represent a species, variable, or parameter (including if these are implicitly
61
+
designated as such by e.g. appearing as a reaction reactant).
42
62
- Array symbolics support is more consistent with ModelingToolkit v9. Parameter
43
63
arrays are no longer scalarized by Catalyst, while species and variables
44
64
arrays still are (as in ModelingToolkit). As such, parameter arrays should now
@@ -51,7 +71,11 @@
51
71
*not* to do this as it has signifcant performance costs with ModelingToolkit
52
72
v9. Note, scalarized parameter arrays passed to the two-argument
53
73
`ReactionSystem` constructor may become unscalarized.
54
-
- Functional (e.g. time-dependent) parameters can now be used in Catalyst models. These can e.g. be used to incorporate arbitrary time-dependent functions (as a parameter) in a model. For more details on how to use these, please read: https://docs.sciml.ai/Catalyst/stable/model_creation/functional_parameters/.
74
+
- Functional (e.g. time-dependent) parameters can now be used in Catalyst
75
+
models. These can e.g. be used to incorporate arbitrary time-dependent
76
+
functions (as a parameter) in a model. For more details on how to use these,
Copy file name to clipboardExpand all lines: docs/src/model_creation/conservation_laws.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -133,7 +133,7 @@ Generally, for a conservation law where we have:
133
133
If the value of the conservation law parameter $Γ$'s value *has never been specified*, its value will be updated to accommodate changes in species values. If the conservation law parameter ($Γ$)'s value *has been specified* (either when the `ODEProblem` was created, or using `remake`), then the eliminated species's value will be updated to accommodate changes in the conservation law parameter or non-eliminated species's values. Furthermore, in this case, the value of the eliminated species *cannot be updated*.
134
134
135
135
!!! warn
136
-
When updating the values of problems with conservation laws it is additionally important to use `remake` (as opposed to direct indexing, e.g. setting `oprob[:X₁] = 16.0`).
136
+
When updating the values of problems with conservation laws it is additionally important to use `remake` (as opposed to direct indexing, e.g. setting `oprob[:X₁] = 16.0`). Moreover, care is needed when using `remake` with `NonlinearProblem`s for which conserved equations have been removed. See [the FAQ](https://docs.sciml.ai/Catalyst/stable/faqs/#faq_remake_nonlinprob) for details on what is supported and what may lead to `u0` values that do not satisfy the conservation law in the special case of `NonlinearProblem`s.
137
137
138
138
### [Extracting the conservation law parameter's symbolic variable](@id conservation_laws_prob_updating_symvar)
139
139
Catalyst represents its models using the [Symbolics.jl](https://github.com/JuliaSymbolics/Symbolics.jl) computer algebraic system, something which allows the user to [form symbolic expressions of model components](@ref simulation_structure_interfacing_symbolic_representation). If you wish to extract and use the symbolic variable corresponding to a model's conserved quantities, you can use the following syntax:
Uses homotopy continuation via HomotopyContinuation.jl to find the steady states of the ODE system corresponding to the provided reaction system.
7
7
8
8
Arguments:
9
9
- `rs::ReactionSystem`: The reaction system for which we want to find the steady states.
10
10
- `ps`: The parameter values for which we want to find the steady states.
11
-
- `filter_negative=true`: If set to true, solutions with any species concentration <neg_thres is removed from the output.
12
-
- `neg_thres=-1e-20`: Determine the minimum values for which a species concentration is to be considered non-negative. Species concentrations ``> neg_thres`` but `< 0.0` are set to `0.0`.
13
-
- `u0=nothing`: Initial conditions for which we want to find the steady states. For systems with conservation laws this are required to compute conserved quantities. Initial conditions are not required for all species, only those involved in conserved quantities (if this set is unknown, it is recommended to provide initial conditions for all species).
11
+
- `filter_negative = true`: If set to true, solutions with any species concentration <neg_thres is removed from the output.
12
+
- `neg_thres = -1e-15`: Determine the minimum values for which a species concentration is to be considered non-negative. Species concentrations ``> neg_thres`` but `< 0.0` are set to `0.0`.
13
+
- `u0 = nothing`: Initial conditions for which we want to find the steady states. For systems with conservation laws this are required to compute conserved quantities. Initial conditions are not required for all species, only those involved in conserved quantities (if this set is unknown, it is recommended to provide initial conditions for all species).
14
14
- `kwargs...`: any additional arguments (like `show_progress= true`) are passed into HomotopyContinuation.jl's `solve` call.
15
15
16
16
Examples
@@ -36,7 +36,7 @@ Notes:
36
36
```
37
37
"""
38
38
function Catalyst.hc_steady_states(rs::ReactionSystem, ps; filter_negative =true,
39
-
neg_thres =-1e-20, u0 = [], kwargs...)
39
+
neg_thres =-1e-15, u0 = [], kwargs...)
40
40
if!isautonomous(rs)
41
41
error("Attempting to compute steady state for a non-autonomous system (e.g. where some rate depend on $(get_iv(rs))). This is not possible.")
42
42
end
@@ -51,7 +51,7 @@ function steady_state_polynomial(rs::ReactionSystem, ps, u0)
51
51
# Creates the appropriate nonlinear system, and converts parameters to a form that can
0 commit comments