diff --git a/REQUIRE b/REQUIRE index 94237c0ffa..bd71762d07 100644 --- a/REQUIRE +++ b/REQUIRE @@ -1 +1,2 @@ julia 0.5 +DiffEqProblemLibrary diff --git a/docs/make.jl b/docs/make.jl index 39505a58bb..7c852f73cd 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -83,7 +83,7 @@ makedocs(modules=[DiffEqPDEBase,DiffEqProblemLibrary], "models/physical.md", "models/financial.md", "models/biological.md", - "models/eternal_modeling.md" + "models/external_modeling.md" ] ]) diff --git a/docs/src/features/callback_library.md b/docs/src/features/callback_library.md index 2ff584757e..2d631658cc 100644 --- a/docs/src/features/callback_library.md +++ b/docs/src/features/callback_library.md @@ -212,11 +212,11 @@ StepsizeLimiter(dtFE;safety_factor=9//10,max_step=false,cached_dtcache=0.0) solver is set to `adaptive=false`. - `cached_dtcache`: Should be set to match the type for time when not using Float64 values. - + ## SavingCallback The saving callback lets you define a function `save_func(t, u, integrator)` which -returns quantities of interest that shall be saved. +returns quantities of interest that shall be saved. ### Constructor @@ -227,11 +227,22 @@ SavingCallback(save_func, saved_values::SavedValues; tdir=1) ``` - `save_func(t, u, integrator)` returns the quantities which shall be saved. -- `saved_values::SavedValues` contains vectors `t::Vector{tType}`, - `saveval::Vector{savevalType}` of the saved quantities. Here, +- `saved_values::SavedValues` contains vectors `t::Vector{tType}`, + `saveval::Vector{savevalType}` of the saved quantities. Here, `save_func(t, u, integrator)::savevalType`. - `saveat` Mimicks `saveat` in `solve` for ODEs. - `save_everystep` Mimicks `save_everystep` in `solve` for ODEs. - `tdir` should be `sign(tspan[end]-tspan[1])`. It defaults to `1` and should be adapted if `tspan[1] > tspan[end]`. +## PeriodicCallback + +`PeriodicCallback` can be used when a function should be called periodically in terms of integration time (as opposed to wall time), i.e. at `t = tspan[1]`, `t = tspan[1] + Δt`, `t = tspan[1] + 2Δt`, and so on. This callback can, for example, be used to model a digital controller for an analog system, running at a fixed rate. + +### Constructor + +```julia +PeriodicCallback(f, Δt::Number; kwargs...) +``` + +where `f` is the function to be called periodically, `Δt` is the period, and `kwargs` are keyword arguments accepted by the `DiscreteCallback` constructor (see the [DiscreteCallback](@ref) section).