Skip to content

Commit

Permalink
solvers page upd
Browse files Browse the repository at this point in the history
  • Loading branch information
ivborissov committed May 10, 2024
1 parent fbedff3 commit 564c81c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ makedocs(
"basics/distributed.md",
"table-formats/scenario.md",
"table-formats/measurement.md",
"table-formats/parameters.md"
"table-formats/parameters.md",
"basics/solvers.md"
],
"Tutorial" => [ # methods
"tutorial/intro.md",
Expand Down
20 changes: 20 additions & 0 deletions docs/src/basics/solvers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Solver choice

### Page under development. Information will be updated

## ODE solver choice

`HetaSimulator.jl` relies on [DifferentialEquations.jl](https://docs.sciml.ai/DiffEqDocs/stable/) packages, which provide access to 300+ ODE solvers.
These solvers can be used in `HetaSimulator` simulation and parameters estimation functions (`sim`, `fit`, etc.), provided via `alg` keyword argument (For example, see [`sim`](@ref)).
One can also set relative and absolute tolerances (`reltol`, `abstol`) and other stepsize related settings via relevant keyword arguments. See [DiffEqDocs](https://docs.sciml.ai/DiffEqDocs/stable/basics/common_solver_opts/) for details.

If no solver is provided the default one `AutoTsit5(Rosenbrock23())` will be used with `reltol=1e-3` and `abstol=1e-6` for simulation problems and `reltol=1e-6` and `abstol=1e-8` for parameters estimation.

The following [DiffEq Docs page](https://docs.sciml.ai/DiffEqDocs/stable/solvers/ode_solve/) provides general advice on how to choose a solver suitable for your ODE system.
For most of ODE systems the following simplified guideline is sufficient:
1. If your system is small (~10 ODEs) go with the default solver
2. If the system is large and stiff choose `FBDF()` or `QNDF()`
3. If `FBDF()` fails to solve the system check the model and try it again :)
4. If `FBDF()` still fails to solve the system or the integration takes too long, try `CVODE_BDF()`*

* You should be caution with `CVODE_BDF()`. With many models it is the most fast solver, however the accuracy of the solution is often the tradeoff. You shouldn't use it with tolerances higher than ~ `reltol=1e-4` and `abstol=1e-7`.

0 comments on commit 564c81c

Please sign in to comment.