Skip to content

Commit

Permalink
DataFrame docs added
Browse files Browse the repository at this point in the history
  • Loading branch information
ivborissov committed May 12, 2024
1 parent 564c81c commit 4eb9ae6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/src/basics/solvers.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ One can also set relative and absolute tolerances (`reltol`, `abstol`) and other
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:
For many 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()`*
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`.
*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`.
14 changes: 14 additions & 0 deletions src/solution_interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,20 @@ function DataFrame(s::Simulation; vars=observables(s), parameters_output::Vector
return df
end

"""
DataFrame(s::Simulation;
vars=observables(s), parameters_output::Vector{Symbol}=Symbol[], iter::Union{Int,Nothing}=nothing)
Converts simulation results of type `SimResult`, `MCResult`, etc to `DataFrame`.
Example: `DataFrame(s)`
Arguments:
- `s` : simulation results of type [`SimResult`](@ref), [`MCResult`](@ref) or `Vector` containing them
- `parameters_output` : parameters provided as kwarg `parameters` to `sim` or `mc` functions, which should be included in `DataFrame`. Default is `empty`
- `iter` : `Int` iteration id, which should be included in `DataFrame`. Default is `nothing`
"""
function DataFrame(sr::SimResult; kwargs...)
df = DataFrame(sr.sim; kwargs...)

Expand Down

0 comments on commit 4eb9ae6

Please sign in to comment.