|
3 | 3 | ## Catalyst unreleased (master branch)
|
4 | 4 |
|
5 | 5 | ## Catalyst 14.0
|
6 |
| -- The `reactionparams`, `numreactionparams`, and `reactionparamsmap` functions have been removed. |
7 |
| -- To be more consistent with ModelingToolkit's immutability requirement for systems, we have removed API functions that mutate `ReactionSystem`s such as `addparam!`, `addreaction!`, `addspecies`, `@add_reactions`, and `merge!`. Please use `ModelingToolkit.extend` and `ModelingToolkit.compose` to generate new merged and/or composed `ReactionSystem`s from multiple component systems. |
8 |
| -- Added CatalystStructuralIdentifiabilityExtension, which permits StructuralIdentifiability.jl function to be applied directly to Catalyst systems. E.g. use |
9 |
| -```julia |
10 |
| -using Catalyst, StructuralIdentifiability |
11 |
| -goodwind_oscillator = @reaction_network begin |
12 |
| - (mmr(P,pₘ,1), dₘ), 0 <--> M |
13 |
| - (pₑ*M,dₑ), 0 <--> E |
14 |
| - (pₚ*E,dₚ), 0 <--> P |
15 |
| -end |
16 |
| -assess_identifiability(goodwind_oscillator; measured_quantities=[:M]) |
17 |
| -``` |
18 |
| -to assess (global) structural identifiability for all parameters and variables of the `goodwind_oscillator` model (under the presumption that we can measure `M` only). |
19 |
| -- Automatically handles conservation laws for structural identifiability problems (eliminates these internally to speed up computations). |
20 |
| -- Adds a tutorial to illustrate the use of the extension. |
21 |
| -- Enable adding metadata to individual reactions, e.g: |
22 |
| -```julia |
23 |
| -rn = @reaction_network begin |
24 |
| - @parameters η |
25 |
| - k, 2X --> X2, [noise_scaling=η] |
26 |
| -end |
27 |
| -getnoisescaling(rn) |
28 |
| -``` |
29 |
| -- `SDEProblem` no longer takes the `noise_scaling` argument (see above for new approach to handle noise scaling). |
30 |
| -- Changed fields of internal `Reaction` structure. `ReactionSystems`s saved using `serialize` on previous Catalyst versions cannot be loaded using this (or later) versions. |
31 |
| -- Simulation of spatial ODEs now supported. For full details, please see https://github.com/SciML/Catalyst.jl/pull/644 and upcoming documentation. Note that these methods are currently considered alpha, with the interface and approach changing even in non-breaking Catalyst releases. |
32 |
| -- LatticeReactionSystem structure represents a spatial reaction network: |
| 6 | + |
| 7 | +#### Breaking changes |
| 8 | +Catalyst v14 was prompted by the (breaking) release of ModelingToolkit v9, which |
| 9 | +introduced several breaking changes to Catalyst. A summary of these (and how to |
| 10 | +handle them) can be found |
| 11 | +[here](https://docs.sciml.ai/Catalyst/stable/v14_migration_guide/). These are |
| 12 | +briefly summarised in the following bullet points: |
| 13 | +- `ReactionSystem`s must now be marked *complete* before they are exposed to |
| 14 | + most forms of simulation and analysis. With the exception of `ReactionSystem`s |
| 15 | + created through the `@reaction_network` macro, all `ReactionSystem`s are *not* |
| 16 | + marked complete upon construction. The `complete` function can be used to mark |
| 17 | + `ReactionSystem`s as complete. To construct a `ReactionSystem` that is not |
| 18 | + marked complete via the DSL the new `@network_component` macro can be used. |
| 19 | +- The `states` function has been replaced with `unknowns`. The `get_states` |
| 20 | + function has been replaced with `get_unknowns`. |
| 21 | +- Support for most units (with the exception of `s`, `m`, `kg`, `A`, `K`, `mol`, |
| 22 | + and `cd`) has currently been dropped by ModelingToolkit, and hence they are |
| 23 | + unavailable via Catalyst too. Its is expected that eventually support for |
| 24 | + relevant chemical units such as molar will return to ModelingToolkit (and |
| 25 | + should then immediately work in Catalyst too). |
| 26 | +- Problem parameter values are now accessed through `prob.ps[p]` (rather than |
| 27 | + `prob[p]`). |
| 28 | +- ModelingToolkit currently does not support the safe application of the |
| 29 | + `remake` function, or safe direct mutation, for problems for which |
| 30 | + `remove_conserved = true` was used when updating the values of initial |
| 31 | + conditions. Instead, the values of each conserved constant must be directly |
| 32 | + specified. |
| 33 | +- The `reactionparams`, `numreactionparams`, and `reactionparamsmap` functions |
| 34 | + have been deprecated and removed. |
| 35 | +- To be more consistent with ModelingToolkit's immutability requirement for |
| 36 | + systems, we have removed API functions that mutate `ReactionSystem`s such as |
| 37 | + `addparam!`, `addreaction!`, `addspecies`, `@add_reactions`, and `merge!`. |
| 38 | + Please use `ModelingToolkit.extend` and `ModelingToolkit.compose` to generate |
| 39 | + new merged and/or composed `ReactionSystem`s from multiple component systems. |
| 40 | + |
| 41 | +#### General changes |
| 42 | +- The `default_t()` and `default_time_deriv()` functions are now the preferred |
| 43 | + approaches for creating the default time independent variable and its |
| 44 | + differential. i.e. |
| 45 | + ```julia |
| 46 | + # do |
| 47 | + t = default_t() |
| 48 | + @species A(t) |
| 49 | + |
| 50 | + # avoid |
| 51 | + @variables t |
| 52 | + @species A(t) |
| 53 | +- It is now possible to add metadata to individual reactions, e.g. using: |
| 54 | + ```julia |
| 55 | + rn = @reaction_network begin |
| 56 | + @parameters η |
| 57 | + k, 2X --> X2, [description="Dimerisation"] |
| 58 | + end |
| 59 | + getdescription(rn) |
| 60 | + ``` |
| 61 | + a more detailed description can be found [here](https://docs.sciml.ai/Catalyst/dev/model_creation/dsl_advanced/#dsl_advanced_options_reaction_metadata). |
| 62 | +- `SDEProblem` no longer takes the `noise_scaling` argument. Noise scaling is |
| 63 | + now handled through the `noise_scaling` metadata (described in more detail |
| 64 | + [here](https://docs.sciml.ai/Catalyst/stable/model_simulation/simulation_introduction/#simulation_intro_SDEs_noise_saling)) |
| 65 | +- Fields of the internal `Reaction` structure have been changed. |
| 66 | + `ReactionSystems`s saved using `serialize` on previous Catalyst versions |
| 67 | + cannot be loaded using this (or later) versions. |
| 68 | +- A new function, `save_reactionsystem`, which permits the writing of |
| 69 | + `ReactionSystem` models to files, has been created. A thorough description of |
| 70 | + this function can be found |
| 71 | + [here](https://docs.sciml.ai/Catalyst/stable/model_creation/model_file_loading_and_export/#Saving-Catalyst-models-to,-and-loading-them-from,-Julia-files) |
| 72 | +- Updated how compounds are created. E.g. use |
| 73 | + ```julia |
| 74 | + @variables t C(t) O(t) |
| 75 | + @compound CO2 ~ C + 2O |
| 76 | + ``` |
| 77 | + to create a compound species `CO2` that consists of `C` and two `O`. |
| 78 | +- Added documentation for chemistry-related functionality (compound creation and |
| 79 | + reaction balancing). |
| 80 | +- Added function `isautonomous` to check if a `ReactionSystem` is autonomous. |
| 81 | +- Added function `steady_state_stability` to compute stability for steady |
| 82 | + states. Example: |
33 | 83 | ```julia
|
| 84 | + # Creates model. |
34 | 85 | rn = @reaction_network begin
|
35 | 86 | (p,d), 0 <--> X
|
36 | 87 | end
|
37 |
| - tr = @transport_reaction D X |
38 |
| - lattice = Graphs.grid([5, 5]) |
39 |
| - lrs = LatticeReactionSystem(rn, [tr], lattice) |
40 |
| -``` |
41 |
| -- Here, if a `u0` or `p` vector is given with scalar values: |
| 88 | + p = [:p => 1.0, :d => 0.5] |
| 89 | +
|
| 90 | + # Finds (the trivial) steady state, and computes stability. |
| 91 | + steady_state = [2.0] |
| 92 | + steady_state_stability(steady_state, rn, p) |
| 93 | + ``` |
| 94 | + Here, `steady_state_stability` takes an optional keyword argument `tol = |
| 95 | + 10*sqrt(eps())`, which is used to check that the real part of all eigenvalues |
| 96 | + are at least `tol` away from zero. Eigenvalues within `tol` of zero indicate |
| 97 | + that stability may not be reliably calculated. |
| 98 | +- Added a DSL option, `@combinatoric_ratelaws`, which can be used to toggle |
| 99 | + whether to use combinatorial rate laws within the DSL (this feature was |
| 100 | + already supported for programmatic modelling). Example: |
| 101 | + ```julia |
| 102 | + # Creates model. |
| 103 | + rn = @reaction_network begin |
| 104 | + @combinatoric_ratelaws false |
| 105 | + (kB,kD), 2X <--> X2 |
| 106 | + end |
| 107 | + ``` |
| 108 | +- Added a DSL option, `@observables` for [creating |
| 109 | + observables](https://docs.sciml.ai/Catalyst/stable/model_creation/dsl_advanced/#dsl_advanced_options_observables) |
| 110 | + (this feature was already supported for programmatic modelling). |
| 111 | +- Added DSL options `@continuous_events` and `@discrete_events` to add events to |
| 112 | + a model as part of its creation (this feature was already supported for |
| 113 | + programmatic modelling). Example: |
| 114 | + ```julia |
| 115 | + rn = @reaction_network begin |
| 116 | + @continuous_events begin |
| 117 | + [X ~ 1.0] => [X ~ X + 1.0] |
| 118 | + end |
| 119 | + d, X --> 0 |
| 120 | + end |
| 121 | + ``` |
| 122 | +- Added DSL option `@equations` to add (algebraic or differential) equations to |
| 123 | + a model as part of its creation (this feature was already supported for |
| 124 | + programmatic modelling). Example: |
42 | 125 | ```julia
|
43 |
| - u0 = [:X => 1.0] |
44 |
| - p = [:p => 1.0, :d => 0.5, :D => 0.1] |
| 126 | + rn = @reaction_network begin |
| 127 | + @equations begin |
| 128 | + D(V) ~ 1 - V |
| 129 | + end |
| 130 | + (p/V,d/V), 0 <--> X |
| 131 | + end |
45 | 132 | ```
|
46 |
| - this value will be used across the entire system. If their values are instead vectors, different values are used across the spatial system. Here |
| 133 | + couples the ODE $dV/dt = 1 - V$ to the reaction system. |
| 134 | +- Coupled reaction networks and differential equation (or algebraic differential |
| 135 | + equation) systems can now be converted to `SDESystem`s and `NonlinearSystem`s. |
| 136 | + |
| 137 | +#### Structural identifiability extension |
| 138 | +- Added CatalystStructuralIdentifiabilityExtension, which permits |
| 139 | + StructuralIdentifiability.jl to be applied directly to Catalyst systems. E.g. |
| 140 | + use |
47 | 141 | ```julia
|
48 |
| - X0 = zeros(25) |
49 |
| - X0[1] = 1.0 |
50 |
| - u0 = [:X => X0] |
| 142 | + using Catalyst, StructuralIdentifiability |
| 143 | + goodwind_oscillator = @reaction_network begin |
| 144 | + (mmr(P,pₘ,1), dₘ), 0 <--> M |
| 145 | + (pₑ*M,dₑ), 0 <--> E |
| 146 | + (pₚ*E,dₚ), 0 <--> P |
| 147 | + end |
| 148 | + assess_identifiability(goodwind_oscillator; measured_quantities=[:M]) |
51 | 149 | ```
|
52 |
| - X's value will be `1.0` in the first vertex, but `0.0` in the remaining one (the system have 25 vertexes in total). SInce th parameters `p` and `d` are part of the non-spatial reaction network, their values are tied to vertexes. However, if the `D` parameter (which governs diffusion between vertexes) is given several values, these will instead correspond to the specific edges (and transportation along those edges.) |
| 150 | + to assess (global) structural identifiability for all parameters and variables |
| 151 | + of the `goodwind_oscillator` model (under the presumption that we can measure |
| 152 | + `M` only). |
| 153 | +- Automatically handles conservation laws for structural identifiability |
| 154 | + problems (eliminates these internally to speed up computations). |
| 155 | +- A more detailed of how this extension works can be found |
| 156 | + [here](https://docs.sciml.ai/Catalyst/stable/inverse_problems/structural_identifiability/). |
53 | 157 |
|
54 |
| -- Update how compounds are created. E.g. use |
55 |
| -```julia |
56 |
| -@variables t C(t) O(t) |
57 |
| -@compound CO2 ~ C + 2O |
58 |
| -``` |
59 |
| -to create a compound species `CO2` that consists of `C` and 2 `O`. |
60 |
| -- Added documentation for chemistry related functionality (compound creation and reaction balancing). |
61 |
| -- Add a CatalystBifurcationKitExtension, permitting BifurcationKit's `BifurcationProblem`s to be created from Catalyst reaction networks. Example usage: |
62 |
| -```julia |
63 |
| -using Catalyst |
64 |
| -wilhelm_2009_model = @reaction_network begin |
65 |
| - k1, Y --> 2X |
66 |
| - k2, 2X --> X + Y |
67 |
| - k3, X + Y --> Y |
68 |
| - k4, X --> 0 |
69 |
| - k5, 0 --> X |
70 |
| -end |
| 158 | +#### Bifurcation analysis extension |
| 159 | +- Add a CatalystBifurcationKitExtension, permitting BifurcationKit's |
| 160 | + `BifurcationProblem`s to be created from Catalyst reaction networks. Example |
| 161 | + usage: |
| 162 | + ```julia |
| 163 | + using Catalyst |
| 164 | + wilhelm_2009_model = @reaction_network begin |
| 165 | + k1, Y --> 2X |
| 166 | + k2, 2X --> X + Y |
| 167 | + k3, X + Y --> Y |
| 168 | + k4, X --> 0 |
| 169 | + k5, 0 --> X |
| 170 | + end |
71 | 171 |
|
72 |
| -using BifurcationKit |
73 |
| -bif_par = :k1 |
74 |
| -u_guess = [:X => 5.0, :Y => 2.0] |
75 |
| -p_start = [:k1 => 4.0, :k2 => 1.0, :k3 => 1.0, :k4 => 1.5, :k5 => 1.25] |
76 |
| -plot_var = :X |
77 |
| -bprob = BifurcationProblem(wilhelm_2009_model, u_guess, p_start, bif_par; plot_var=plot_var) |
| 172 | + using BifurcationKit |
| 173 | + bif_par = :k1 |
| 174 | + u_guess = [:X => 5.0, :Y => 2.0] |
| 175 | + p_start = [:k1 => 4.0, :k2 => 1.0, :k3 => 1.0, :k4 => 1.5, :k5 => 1.25] |
| 176 | + plot_var = :X |
| 177 | + bprob = BifurcationProblem(wilhelm_2009_model, u_guess, p_start, bif_par; plot_var = plot_var) |
78 | 178 |
|
79 |
| -p_span = (2.0, 20.0) |
80 |
| -opts_br = ContinuationPar(p_min = p_span[1], p_max = p_span[2], max_steps=1000) |
| 179 | + p_span = (2.0, 20.0) |
| 180 | + opts_br = ContinuationPar(p_min = p_span[1], p_max = p_span[2], max_steps = 1000) |
81 | 181 |
|
82 |
| -bif_dia = bifurcationdiagram(bprob, PALC(), 2, (args...) -> opts_br; bothside=true) |
| 182 | + bif_dia = bifurcationdiagram(bprob, PALC(), 2, (args...) -> opts_br; bothside = true) |
83 | 183 |
|
84 |
| -using Plots |
85 |
| -plot(bif_dia; xguide="k1", yguide="X") |
86 |
| -``` |
87 |
| -- Automatically handles elimination of conservation laws for computing bifurcation diagrams. |
| 184 | + using Plots |
| 185 | + plot(bif_dia; xguide = "k1", guide = "X") |
| 186 | + ``` |
| 187 | +- Automatically handles elimination of conservation laws for computing |
| 188 | + bifurcation diagrams. |
88 | 189 | - Updated Bifurcation documentation with respect to this new feature.
|
89 |
| -- Added function `isautonomous` to check if a `ReactionSystem` is autonomous. |
90 |
| -- Added function `steady_state_stability` to compute stability for steady states. Example: |
91 |
| -```julia |
92 |
| -# Creates model. |
93 |
| -rn = @reaction_network begin |
94 |
| - (p,d), 0 <--> X |
95 |
| -end |
96 |
| -p = [:p => 1.0, :d => 0.5] |
97 |
| - |
98 |
| -# Finds (the trivial) steady state, and computes stability. |
99 |
| -steady_state = [2.0] |
100 |
| -steady_state_stability(steady_state, rn, p) |
101 |
| -``` |
102 |
| -Here, `steady_state_stability` take an optional argument `tol = 10*sqrt(eps())`, which is used to determine whether a eigenvalue real part is reliably less that 0. |
103 | 190 |
|
104 | 191 | ## Catalyst 13.5
|
105 | 192 | - Added a CatalystHomotopyContinuationExtension extension, which exports the `hc_steady_state` function if HomotopyContinuation is exported. `hc_steady_state` finds the steady states of a reaction system using the homotopy continuation method. This feature is only available for julia versions 1.9+. Example:
|
@@ -658,7 +745,7 @@ hc_steady_states(wilhelm_2009_model, ps)
|
658 | 745 | field has been changed (only when created through the `@reaction_network`
|
659 | 746 | macro). Previously they were ordered according to the order with which they
|
660 | 747 | appeared in the macro. Now they are ordered according the to order with which
|
661 |
| - they appeard after the `end` part. E.g. in |
| 748 | + they appeared after the `end` part. E.g. in |
662 | 749 | ```julia
|
663 | 750 | rn = @reaction_network begin
|
664 | 751 | (p,d), 0 <--> X
|
@@ -763,7 +850,7 @@ which gives
|
763 | 850 | 
|
764 | 851 |
|
765 | 852 | *2.* Support for units via ModelingToolkit and
|
766 |
| -[Uniftul.jl](https://github.com/PainterQubits/Unitful.jl) in directly constructed |
| 853 | +[Unitful.jl](https://github.com/PainterQubits/Unitful.jl) in directly constructed |
767 | 854 | `ReactionSystem`s:
|
768 | 855 | ```julia
|
769 | 856 | # ]add Unitful
|
|
0 commit comments