Skip to content

Commit d473d07

Browse files
committed
allwo convenience syntax for changing diffeq
1 parent 5c35fe9 commit d473d07

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "DynamicalSystemsBase"
22
uuid = "6e36e845-645a-534a-86f2-f5d4aa5a06b4"
33
repo = "https://github.com/JuliaDynamics/DynamicalSystemsBase.jl.git"
4-
version = "3.0.1"
4+
version = "3.0.2"
55

66
[deps]
77
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"

src/core_systems/continuous_time_ode.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ When initializing a `CoupledODEs`, you can specify the solver that will integrat
4646
`f` in time, along with any other integration options, using the `diffeq` keyword.
4747
For example you could use `diffeq = (abstol = 1e-9, reltol = 1e-9)`.
4848
If you want to specify a solver, do so by using the keyword `alg`, e.g.:
49-
`diffeq = (alg = Tsit5(), maxiters = 100000)`. This requires you to have been first
49+
`diffeq = (alg = Tsit5(), reltol = 1e-6)`. This requires you to have been first
5050
`using OrdinaryDiffEq` to access the solvers. The default `diffeq` is:
5151
5252
$(DynamicalSystemsBase.DEFAULT_DIFFEQ)
@@ -55,7 +55,8 @@ $(DynamicalSystemsBase.DEFAULT_DIFFEQ)
5555
](http://docs.juliadiffeq.org/latest/features/callback_functions.html), however the
5656
majority of downstream functions in DynamicalSystems.jl assume that `f` is differentiable.
5757
58-
The convenience constructor `CoupledODEs(prob::ODEProblem, diffeq)` is also available.
58+
The convenience constructor `CoupledODEs(prob::ODEProblem, diffeq)` and
59+
`CoupledODEs(ds::CoupledODEs, diffeq)` are also available.
5960
6061
Dev note: `CoupledODEs` is a light wrapper of `ODEIntegrator` from DifferentialEquations.jl.
6162
The integrator is available as the field `integ`, and the `ODEProblem` is `integ.sol.prob`.
@@ -83,6 +84,7 @@ function CoupledODEs(f, u0, p = SciMLBase.NullParameters(); t0 = 0, diffeq = DEF
8384
prob = ODEProblem{IIP}(f, s, (T(t0), T(Inf)), p)
8485
return CoupledODEs(prob, diffeq)
8586
end
87+
CoupledODEs(ds::CoupledODEs, diffeq) = CoupledODEs(ODEProblem(ds), diffeq)
8688
# Below `special_kwargs` is undocumented internal option for passing `internalnorm`
8789
function CoupledODEs(prob::ODEProblem, diffeq = DEFAULT_DIFFEQ; special_kwargs...)
8890
IIP = isinplace(prob)

0 commit comments

Comments
 (0)