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
+23Lines changed: 23 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,29 @@
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
+
- 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:
11
+
(1) Every symbol explicitly declared using `@species`, `@variables`, and `@parameters` are assigned to the correct category.
12
+
(2) Every symbol used as a reaction reactant is inferred as a species.
13
+
(3) Every symbol not declared in (1) or (2) that occurs in an expression provided after `@equations` is inferred as a variable.
14
+
(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.
15
+
E.g. in
16
+
```julia
17
+
@reaction_networkbegin
18
+
@equations V1 + S ~ V2^2
19
+
(p + S + V1), S -->0
20
+
end
21
+
```
22
+
`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.
23
+
- 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:
24
+
```julia
25
+
@reaction_networkbegin
26
+
@equationsD(V) + V ~1
27
+
end
28
+
@reaction_networkbegin
29
+
@equationsD(D(V)) ~1
30
+
end
31
+
```
32
+
Please note that this cannot be used at the same time as `D` is used to represent a species, variable, or parameter (including is these are implicitly designated as such by e.g. appearing as a reaction reactant).
10
33
- Array symbolics support is more consistent with ModelingToolkit v9. Parameter
11
34
arrays are no longer scalarized by Catalyst, while species and variables
12
35
arrays still are (as in ModelingToolkit). As such, parameter arrays should now
"Unrecognized symbol $(diff_var) was used as a variable in an equation: \"$eq\". Since the @require_declaration flag is set, all variables in equations must be explicitly declared via @variables, @species, or @parameters."))
# If the default differential (`D`) is used, record that it should be decalred later on.
728
+
if (:D∉union(syms_declared, parameters_extracted)) &&find_D_call(eq)
729
+
requiredec &&throw(UndeclaredSymbolicError(
730
+
"Unrecognized symbol D was used as a differential in an equation: \"$eq\". Since the @require_declaration flag is set, all differentials in equations must be explicitly declared using the @differentials option."))
731
+
add_default_diff =true
732
+
push!(syms_declared, :D)
740
733
end
734
+
735
+
# Any undecalred symbolic variables encountered should be extracted as variables.
"Unrecognized symbolic variables $(join(vars_extracted, ", ")) detected in equation expression: \"$(string(eq))\". Since the flag @require_declaration is declared, all symbolic variables must be explicitly declared with the @species, @variables, and @parameters options."))
0 commit comments