Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas committed Oct 20, 2017
2 parents 3a31536 + 36f2b36 commit b4da20d
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 6 deletions.
1 change: 1 addition & 0 deletions REQUIRE
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
julia 0.5
DiffEqProblemLibrary
2 changes: 1 addition & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
])

Expand Down
12 changes: 12 additions & 0 deletions docs/src/basics/plot.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,18 @@ on high dimensional numbers (complex numbers) and other high dimensional plots.
See [the README](https://github.com/JuliaDiffEq/DimensionalPlotRecipes.jl) for
more details on the extra controls that exist.

### Timespan

A plotting timespan can be chosen by the `tspan` argument in `plot`. For example:

```julia
plot(sol,tspan=(0.0,40.0))
```

only plots between `t=0.0` and `t=40.0`. If `denseplot=true` these bounds will be respected
exactly. Otherwise the first point inside and last point inside the interval will be plotted,
i.e. no points outside the interval will be plotted.

### Example

```julia
Expand Down
19 changes: 15 additions & 4 deletions docs/src/features/callback_library.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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).
2 changes: 1 addition & 1 deletion docs/src/tutorials/bvp_example.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function bc3(residual, sol)
residual[1] = sol(pi/4)[1] + pi/2 # use the interpolation here, since indexing will be wrong for adaptive methods
residual[2] = sol(pi/2)[1] - pi/2
end
bvp3 = BVProblem(simplependulum, bc3, u₀, tspan)
bvp3 = BVProblem(simplependulum, bc3, u₀_2, tspan)
sol3 = solve(bvp3, Shooting(Vern7()))
```

Expand Down

0 comments on commit b4da20d

Please sign in to comment.