Skip to content

Commit 2b00c02

Browse files
committed
Merge remote-tracking branch 'origin/master' into update_hodgkin_huxley_ex
2 parents c01db92 + d320f1a commit 2b00c02

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+706
-212
lines changed

.github/workflows/Documentation.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,17 @@ jobs:
1515
- uses: julia-actions/setup-julia@latest
1616
with:
1717
version: '1'
18+
- name: Install xvfb and OpenGL libraries
19+
run: sudo apt-get update && sudo apt-get install -y xorg-dev mesa-utils xvfb libgl1 freeglut3-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev
1820
- name: Install dependencies
1921
run: julia --project=docs/ -e 'ENV["JULIA_PKG_SERVER"] = ""; using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
2022
- name: Build and deploy
2123
env:
2224
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For authentication with GitHub Actions token
2325
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # For authentication with SSH deploy key
2426
GKSwstype: "100" # https://discourse.julialang.org/t/generation-of-documentation-fails-qt-qpa-xcb-could-not-connect-to-display/60988
25-
run: julia --project=docs/ --code-coverage=user docs/make.jl
27+
run: |
28+
DISPLAY=:0 xvfb-run -s '-screen 0 1024x768x24' julia --project=docs/ --code-coverage=user docs/make.jl
2629
- uses: julia-actions/julia-processcoverage@v1
2730
- uses: codecov/codecov-action@v4
2831
with:

HISTORY.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,31 @@
11
# Breaking updates and feature summaries across releases
22

33
## Catalyst unreleased (master branch)
4+
- Array symbolics support is more consistent with ModelingToolkit v9. Parameter arrays are no longer scalarized by Catalyst, while species and variables arrays still are (as in ModelingToolkit). As such, parameter arrays should now be specified as arrays in value mappings, i.e.
5+
```julia
6+
@parameters k[1:4]
7+
pmap = [k => rand(4)]
8+
```
9+
While one can still manually scalarize a parameter array, it is recommended *not* to do this as it has signifcant performance costs with ModelingToolkit v9.
10+
- The structural identifiability extension is currently disabled due to issues StructuralIdentifiability has with Julia 1.10.5 and 1.11.
11+
- A tutorial on making interactive plot displays using Makie has been added.
12+
13+
## Catalyst 14.4.1
14+
- Support for user-defined functions on the RHS when providing coupled equations
15+
for CRNs using the @equations macro. For example, the following now works:
16+
```julia
17+
using Catalyst
18+
f(A, t) = 2*A*t
19+
rn = @reaction_network begin
20+
@equations D(A) ~ f(A,t)
21+
end
22+
```
23+
Note that user-defined functions will not work on the LHS of equations.
24+
25+
## Catalyst 14.4
26+
- Symbolics 6 support.
27+
28+
429

530
## Catalyst 14.3
631
- Support for simulating stochastic chemical kinetics models with explicitly

Project.toml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "Catalyst"
22
uuid = "479239e8-5488-4da2-87a7-35f2df7eef83"
3-
version = "14.3.1"
3+
version = "14.4.1"
44

55
[deps]
66
Combinatorics = "861a8166-3701-5b0c-9a16-15d98fcdc6aa"
@@ -23,6 +23,7 @@ RuntimeGeneratedFunctions = "7e49a35a-f44a-4d26-94aa-eba1b4ca6b47"
2323
SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
2424
Setfield = "efcf1570-3423-57d1-acb7-fd33fddbac46"
2525
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
26+
SymbolicUtils = "d1185830-fcd6-423d-90d6-eec64667417b"
2627
Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"
2728
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
2829

@@ -31,14 +32,14 @@ BifurcationKit = "0f109fa4-8a5d-4b75-95aa-f515264e7665"
3132
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
3233
GraphMakie = "1ecd5474-83a3-4783-bb4f-06765db800d2"
3334
HomotopyContinuation = "f213a82b-91d6-5c5d-acf7-10f1c761b327"
34-
StructuralIdentifiability = "220ca800-aa68-49bb-acd8-6037fa93a544"
35+
# StructuralIdentifiability = "220ca800-aa68-49bb-acd8-6037fa93a544"
3536

3637
[extensions]
3738
CatalystBifurcationKitExtension = "BifurcationKit"
3839
CatalystCairoMakieExtension = "CairoMakie"
3940
CatalystGraphMakieExtension = "GraphMakie"
4041
CatalystHomotopyContinuationExtension = "HomotopyContinuation"
41-
CatalystStructuralIdentifiabilityExtension = "StructuralIdentifiability"
42+
# CatalystStructuralIdentifiabilityExtension = "StructuralIdentifiability"
4243

4344
[compat]
4445
BifurcationKit = "0.3"
@@ -47,8 +48,8 @@ Combinatorics = "1.0.2"
4748
DataStructures = "0.18"
4849
DiffEqBase = "6.83.0"
4950
DocStringExtensions = "0.8, 0.9"
50-
DynamicPolynomials = "0.5"
51-
DynamicQuantities = "0.13.2"
51+
DynamicPolynomials = "0.5, 0.6"
52+
DynamicQuantities = "0.13.2, 1"
5253
GraphMakie = "0.5"
5354
Graphs = "1.4"
5455
HomotopyContinuation = "2.9"
@@ -63,8 +64,9 @@ Requires = "1.0"
6364
RuntimeGeneratedFunctions = "0.5.12"
6465
SciMLBase = "2.46"
6566
Setfield = "1"
66-
StructuralIdentifiability = "0.5.8"
67-
Symbolics = "5.30.1"
67+
# StructuralIdentifiability = "0.5.8"
68+
SymbolicUtils = "2.1.2, 3.3.0"
69+
Symbolics = "5.30.1, 6"
6870
Unitful = "1.12.4"
6971
julia = "1.10"
7072

@@ -90,9 +92,9 @@ StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
9092
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
9193
SteadyStateDiffEq = "9672c7b4-1e72-59bd-8a11-6ac3964bc41f"
9294
StochasticDiffEq = "789caeaf-c7a9-5a7d-9973-96adeb23e2a0"
93-
StructuralIdentifiability = "220ca800-aa68-49bb-acd8-6037fa93a544"
95+
# StructuralIdentifiability = "220ca800-aa68-49bb-acd8-6037fa93a544"
9496
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
9597
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
9698

9799
[targets]
98-
test = ["BifurcationKit", "CairoMakie", "DiffEqCallbacks", "DomainSets", "Graphviz_jll", "HomotopyContinuation", "Logging", "GraphMakie", "NonlinearSolve", "OrdinaryDiffEq", "Plots", "Random", "SafeTestsets", "SciMLBase", "SciMLNLSolve", "StableRNGs", "StaticArrays", "Statistics", "SteadyStateDiffEq", "StochasticDiffEq", "StructuralIdentifiability", "Test", "Unitful"]
100+
test = ["BifurcationKit", "CairoMakie", "DiffEqCallbacks", "DomainSets", "Graphviz_jll", "HomotopyContinuation", "Logging", "GraphMakie", "NonlinearSolve", "OrdinaryDiffEq", "Plots", "Random", "SafeTestsets", "SciMLBase", "SciMLNLSolve", "StableRNGs", "StaticArrays", "Statistics", "SteadyStateDiffEq", "StochasticDiffEq", "Test", "Unitful"]

docs/Project.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ DiffEqParamEstim = "1130ab10-4a5a-5621-a13d-e4788d82bd4c"
88
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
99
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
1010
DynamicalSystems = "61744808-ddfa-5f27-97ff-6e42cc95d634"
11+
GLMakie = "e9467ef8-e4e7-5192-8a1a-b1aee30e663a"
1112
GlobalSensitivity = "af5da776-676b-467e-8baf-acd8249e4f0f"
1213
GraphMakie = "1ecd5474-83a3-4783-bb4f-06765db800d2"
1314
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
@@ -73,4 +74,4 @@ StaticArrays = "1.9"
7374
SteadyStateDiffEq = "2.2"
7475
StochasticDiffEq = "6.65"
7576
StructuralIdentifiability = "0.5.8"
76-
Symbolics = "5.30.1"
77+
Symbolics = "5.30.1, 6"

docs/pages.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ pages = Any[
3333
"model_simulation/ode_simulation_performance.md",
3434
"model_simulation/sde_simulation_performance.md",
3535
"Model simulation examples" => Any[
36-
"model_simulation/examples/periodic_events_simulation.md"
36+
"model_simulation/examples/periodic_events_simulation.md",
37+
"model_simulation/examples/interactive_brusselator_simulation.md"
3738
]
3839
],
3940
"Steady state analysis" => Any[
@@ -47,7 +48,7 @@ pages = Any[
4748
"inverse_problems/optimization_ode_param_fitting.md",
4849
# "inverse_problems/petab_ode_param_fitting.md",
4950
"inverse_problems/behaviour_optimisation.md",
50-
"inverse_problems/structural_identifiability.md",
51+
# "inverse_problems/structural_identifiability.md",
5152
"inverse_problems/global_sensitivity_analysis.md",
5253
"Inverse problem examples" => Any[
5354
"inverse_problems/examples/ode_fitting_oscillation.md"
1.58 MB
Binary file not shown.

docs/src/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ etc).
4141
- Model steady states can be [computed through homotopy continuation](@ref homotopy_continuation) using [HomotopyContinuation.jl](https://github.com/JuliaHomotopyContinuation/HomotopyContinuation.jl) (which can find *all* steady states of systems with multiple ones), by [forward ODE simulations](@ref steady_state_solving_simulation) using [SteadyStateDiffEq.jl)](https://github.com/SciML/SteadyStateDiffEq.jl), or by [numerically solving steady-state nonlinear equations](@ref steady_state_solving_nonlinear) using [NonlinearSolve.jl](https://github.com/SciML/NonlinearSolve.jl).
4242
- [BifurcationKit.jl](https://github.com/bifurcationkit/BifurcationKit.jl) can be used to [compute bifurcation diagrams](@ref bifurcation_diagrams) of model steady states (including finding periodic orbits).
4343
- [DynamicalSystems.jl](https://github.com/JuliaDynamics/DynamicalSystems.jl) can be used to compute model [basins of attraction](@ref dynamical_systems_basins_of_attraction), [Lyapunov spectrums](@ref dynamical_systems_lyapunov_exponents), and other dynamical system properties.
44-
- [StructuralIdentifiability.jl](https://github.com/SciML/StructuralIdentifiability.jl) can be used to [perform structural identifiability analysis](@ref structural_identifiability).
44+
<!--- [StructuralIdentifiability.jl](https://github.com/SciML/StructuralIdentifiability.jl) can be used to perform structural identifiability analysis.-->
4545
- [Optimization.jl](https://github.com/SciML/Optimization.jl), [DiffEqParamEstim.jl](https://github.com/SciML/DiffEqParamEstim.jl), and [PEtab.jl](https://github.com/sebapersson/PEtab.jl) can all be used to [fit model parameters to data](https://sebapersson.github.io/PEtab.jl/stable/Define_in_julia/).
4646
- [GlobalSensitivity.jl](https://github.com/SciML/GlobalSensitivity.jl) can be used to perform [global sensitivity analysis](@ref global_sensitivity_analysis) of model behaviors.
4747
- [SciMLSensitivity.jl](https://github.com/SciML/SciMLSensitivity.jl) can be used to compute local sensitivities of functions containing forward model simulations.
@@ -233,4 +233,4 @@ versioninfo() # hide
233233
```
234234
```@raw html
235235
</details>
236-
```
236+
```

docs/src/inverse_problems/optimization_ode_param_fitting.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ plot!(fitted_sol; idxs = :P, label = "Fitted solution", linestyle = :dash, lw =
7878
```
7979

8080
!!! note
81-
Here, a good exercise is to check the resulting parameter set and note that, while it creates a good fit to the data, it does not actually correspond to the original parameter set. [Identifiability](@ref structural_identifiability) is a concept that studies how to deal with this problem.
81+
Here, a good exercise is to check the resulting parameter set and note that, while it creates a good fit to the data, it does not actually correspond to the original parameter set. Identifiability is a concept that studies how to deal with this problem.<!--NTS: re-add ref when identifiablity works again-->
8282

8383
Say that we instead would like to use the [Broyden–Fletcher–Goldfarb–Shannon](https://en.wikipedia.org/wiki/Broyden%E2%80%93Fletcher%E2%80%93Goldfarb%E2%80%93Shanno_algorithm) algorithm, as implemented by the [Optim.jl](https://github.com/JuliaNLSolvers/Optim.jl) package. In this case we would run:
8484
```@example diffeq_param_estim_1
@@ -187,4 +187,4 @@ If you use this functionality in your research, please cite the following paper
187187

188188
---
189189
## References
190-
[^1]: [Alejandro F. Villaverde, Dilan Pathirana, Fabian Fröhlich, Jan Hasenauer, Julio R. Banga, *A protocol for dynamic model calibration*, Briefings in Bioinformatics (2023).](https://academic.oup.com/bib/article/23/1/bbab387/6383562?login=false)
190+
[^1]: [Alejandro F. Villaverde, Dilan Pathirana, Fabian Fröhlich, Jan Hasenauer, Julio R. Banga, *A protocol for dynamic model calibration*, Briefings in Bioinformatics (2023).](https://academic.oup.com/bib/article/23/1/bbab387/6383562?login=false)

docs/src/model_creation/constraint_equations.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,26 @@ p = [k_on => 100.0, switch_time => 2.0, k_off => 10.0]
150150
```
151151
Simulating our model,
152152
```@example ceq3
153-
@named osys = ReactionSystem(rxs, t, [A, B], [k_on, k_off, switch_time]; discrete_events)
154-
osys = complete(osys)
153+
@named rs2 = ReactionSystem(rxs, t, [A, B], [k_on, k_off, switch_time]; discrete_events)
154+
rs2 = complete(rs2)
155155
156-
oprob = ODEProblem(osys, u0, tspan, p)
156+
oprob = ODEProblem(rs2, u0, tspan, p)
157157
sol = solve(oprob, Tsit5(); tstops = 2.0)
158158
plot(sol)
159159
```
160-
Note that for discrete events we need to set a stop time, `tstops`, so that the ODE solver can step exactly to the specific time of our event. For a detailed discussion on how to directly use the lower-level but more flexible DifferentialEquations.jl event/callback interface, see the [tutorial](https://docs.sciml.ai/Catalyst/stable/catalyst_applications/advanced_simulations/#Event-handling-using-callbacks) on event handling using callbacks.
160+
Note that for discrete events we need to set a stop time via `tstops` so that
161+
the ODE solver can step exactly to the specific time of our event. In the
162+
previous example we just manually set the numeric value of the parameter in the
163+
`tstops` kwarg to `solve`, however, it can often be convenient to instead get
164+
the value of the parameter from `oprob` and pass this numeric value. This helps
165+
ensure consistency between the value passed via `p` and/or symbolic defaults and
166+
what we pass as a `tstop` to `solve`. We can do this as
167+
```julia
168+
switch_time_val = oprob.ps[:switch_time]
169+
sol = solve(oprob, Tsit5(); tstops = switch_time_val)
170+
plot(sol)
171+
```
172+
For a detailed discussion on how to directly use the lower-level but more
173+
flexible DifferentialEquations.jl event/callback interface, see the
174+
[tutorial](https://docs.sciml.ai/Catalyst/stable/catalyst_applications/advanced_simulations/#Event-handling-using-callbacks)
175+
on event handling using callbacks.

docs/src/model_creation/dsl_advanced.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ Sometimes, one wishes to declare a large number of similar parameters or species
256256
using Catalyst # hide
257257
two_state_model = @reaction_network begin
258258
@parameters k[1:2]
259-
@species X(t)[1:2]
259+
@species (X(t))[1:2]
260260
(k[1],k[2]), X[1] <--> X[2]
261261
end
262262
```

0 commit comments

Comments
 (0)