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
If no solver argument is provided to `solve`, and the `OrdinaryDiffEqDefault` sub-library or top-level `OrdinaryDiffEq` library is installed, then one is automatically selected:
73
-
```@example
75
+
```@exampleode_simulation_performance_2
74
76
using OrdinaryDiffEqDefault
75
-
ode_simulation_performance_2solve(oprob)
77
+
solve(oprob)
76
78
nothing # hide
77
79
```
78
80
79
-
80
-
81
81
While the default choice is typically enough for most single simulations, if performance is important, it can be worthwhile exploring the available solvers to find one that is especially suited for the given problem. A complete list of possible ODE solvers, with advice on optimal selection, can be found [here](https://docs.sciml.ai/DiffEqDocs/stable/solvers/ode_solve/). This section will give some general advice.
82
82
83
83
The most important part of solver selection is to select one appropriate for [the problem's stiffness](@ref ode_simulation_performance_stiffness). Generally, the `Tsit5` solver is good for non-stiff problems, and `Rodas5P` for stiff problems. For large stiff problems (with many species), `FBDF` can be a good choice. We can illustrate the impact of these choices by simulating our birth-death process using the `Tsit5`, `Vern7` (an explicit solver yielding [low error in the solution](@ref ode_simulation_performance_error)), `Rodas5P`, and `FBDF` solvers (benchmarking their respective performance using [BenchmarkTools.jl](https://github.com/JuliaCI/BenchmarkTools.jl)):
@@ -111,7 +111,7 @@ By default, OrdinaryDiffEq computes the Jacobian using [*automatic differentiati
111
111
112
112
To use this option, simply set `jac = true` when constructing an `ODEProblem`:
113
113
```@example ode_simulation_performance_3
114
-
using Catalyst, OrdinaryDiffEq
114
+
using Catalyst, OrdinaryDiffEqDefault
115
115
116
116
brusselator = @reaction_network begin
117
117
A, ∅ --> X
@@ -179,7 +179,7 @@ Generally, the use of preconditioners is only recommended for advanced users who
179
179
## [Elimination of system conservation laws](@id ode_simulation_performance_conservation_laws)
180
180
Previously, we have described how Catalyst, when it generates ODEs, is able to [detect and eliminate conserved quantities](@ref conservation_laws). In certain cases, doing this can improve performance. E.g. in the following example we will eliminate the single conserved quantity in a [two-state model](@ref basic_CRN_library_two_states). This results in a differential algebraic equation with a single differential equation and a single algebraic equation (as opposed to two differential equations). However, as the algebraic equation is fully determined by the ODE solution, Catalyst moves it to be an observable and our new system therefore only contains one ODE that must be solved numerically. Conservation laws can be eliminated by providing the `remove_conserved = true` option to `ODEProblem`:
@@ -301,7 +301,7 @@ Which backend package you should use depends on your available hardware, with th
301
301
302
302
Next, we declare our model and `ODEProblem`. However, we make all values `Float64` (by appending `f0` to them) and all vectors static (by adding `@SVector` before their declaration, something which requires the [StaticArrays](https://github.com/JuliaArrays/StaticArrays.jl) package).
303
303
```@example ode_simulation_performance_5
304
-
using Catalyst, OrdinaryDiffEq, StaticArrays
304
+
using Catalyst, OrdinaryDiffEqDefault, StaticArrays
305
305
306
306
mm_model = @reaction_network begin
307
307
kB, S + E --> SE
@@ -311,7 +311,7 @@ mm_model = @reaction_network begin
311
311
end
312
312
@unpack S, E, SE, P, kB, kD, kP, d = mm_model
313
313
314
-
using OrdinaryDiffEq, Plots
314
+
using OrdinaryDiffEqDefault, Plots
315
315
u0 = @SVector [S => 1.0f0, E => 1.0f0, SE => 0.0f0, P => 0.0f0]
316
316
tspan = (0.0f0, 50.0f0)
317
317
p = @SVector [kB => 1.0f0, kD => 0.1f0, kP => 0.5f0, d => 0.1f0]
Copy file name to clipboardExpand all lines: docs/src/steady_state_functionality/dynamical_systems.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -93,6 +93,7 @@ Here, the largest exponent is positive, suggesting that the model is chaotic (or
93
93
94
94
Next, we consider the [Brusselator] model. First we simulate the model for two similar initial conditions, confirming that they converge to the same limit cycle:
0 commit comments