Skip to content

Commit 6a015f7

Browse files
authored
Overhaul DynamicalSystem, PR #24 from JuliaDynamics/dynamicalsystem
Create something like DiscreteFast or whatever, that uses the existing minimal implementation. This will be used by default if the user gives eom, state instead of DiscreteProblem. Auxilary functions, like e.g. set_parameters!. trajectory. We ditch both evolve and evolve!. Clearing up files (atm it is on NEW files to allow others to review easier) Reform all of famous_systems.jl Write proper documentation strings everywhere Make parallel_evolver. Remove DiffEqCallbacks dependency by making henon "not energy conserving" (and comment out the code for later use). This will only be implemented when #4 is solved. Write up new tests (almost done). Replace / reform old tests Update the rest files of the library for the new definitions. Make sure all tests pass AND THEN GGWP
2 parents 290079f + b982b05 commit 6a015f7

23 files changed

+1403
-1594
lines changed

CHANGELOG.md

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,24 @@
11
# v0.6
22
## Massively Breaking
3-
* Complete overhaul of Discrete Systems: all systems are now one, there is
4-
no longer `DDS` and `BigDDS`. Everything is `DDS`!
3+
* Complete overhaul of all of DynamicalSystems. More details
4+
are in the official documentation (because I would had to write 10 pages of changelog
5+
otherwise). The constructors also changed signature.
6+
* All `DynamicalSystem`s are now *immutable* and contain a problem,
7+
a jacobian and a jacobian matrix.
8+
* Advantage of Multiple dispatch is taken to distinguish between in-place,
9+
out of place, continuous, discrete, heaven, hell, whatever.
10+
* All internals use `integrator` and `step!`.
511
* `variational_integrator` renamed to `tangent_integrator`.
6-
* `DDS` is made up of 2 fundamental parts: a DiscreteProblem and a
7-
TangentEvolver.
12+
813
## Non-breaking
914
* Massive performance boost of up to 8x in system evolution of continuous systems.
10-
* `ParallelEvolver`
11-
* `TangentEvolver`
15+
* increased the interaction between DiffEq and DynamicalSystems.
16+
* A dedicated integrator for discrete systems that is super fast is now employed
17+
by default. It follows the same high level DiffEq interface but the implementation
18+
is totally internal.
19+
* Out-of-place continuous systems are allowed. All famous systems are actually
20+
out of place now.
21+
* `parallel_integrator` added.
1222

1323
# v0.5.0
1424

REQUIRE

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
julia 0.6
2-
OrdinaryDiffEq 3.0.1
3-
DiffEqBase 3.0.3
4-
DiffEqCallbacks 1.0.0
2+
OrdinaryDiffEq 3.1
3+
DiffEqBase 3.5
54
ForwardDiff 0.5
65
Requires 0.4.3
76
StaticArrays 0.5.0

benchmarks/integrator_stepping.jl

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
using DynamicalSystemsBase
2+
using Base.Test, StaticArrays
3+
using DynamicalSystemsBase: CDS, DDS
4+
using DynamicalSystemsBase.Systems: hoop, hoop_jac, hiip, hiip_jac
5+
using DynamicalSystemsBase.Systems: loop, loop_jac, liip, liip_jac
6+
using BenchmarkTools
7+
8+
u0 = [0, 10.0, 0]
9+
p = [10, 28, 8/3]
10+
u0h = zeros(2)
11+
ph = [1.4, 0.3]
12+
13+
FUNCTIONS = [liip, liip_jac, loop, loop_jac, hiip, hiip_jac, hoop, hoop_jac]
14+
INITCOD = [u0, u0h]
15+
PARAMS = [p, ph]
16+
17+
for i in 1:8
18+
println("Time to create & step! integrators, combination $i")
19+
sysindx = i < 5 ? 1 : 2
20+
if i < 5
21+
if isodd(i)
22+
ds = CDS(FUNCTIONS[i], INITCOD[sysindx], PARAMS[sysindx])
23+
else
24+
ds = CDS(FUNCTIONS[i-1], INITCOD[sysindx], PARAMS[sysindx], FUNCTIONS[i])
25+
end
26+
else
27+
if isodd(i)
28+
ds = DDS(FUNCTIONS[i], INITCOD[sysindx], PARAMS[sysindx])
29+
else
30+
ds = DDS(FUNCTIONS[i-1], INITCOD[sysindx], PARAMS[sysindx], FUNCTIONS[i])
31+
end
32+
end
33+
34+
integ = integrator(ds)
35+
println("normal")
36+
@time integ = integrator(ds)
37+
step!(integ)
38+
@time step!(integ)
39+
te = tangent_integrator(ds, orthonormal(3,3))
40+
println("tangent")
41+
@time te = tangent_integrator(ds, orthonormal(3,3))
42+
step!(te); step!(te)
43+
@time step!(te)
44+
te = parallel_integrator(ds, [INITCOD[sysindx], INITCOD[sysindx]])
45+
println("parallel")
46+
@time te = parallel_integrator(ds, [INITCOD[sysindx], INITCOD[sysindx]])
47+
step!(te); step!(te)
48+
@time step!(te)
49+
end

benchmarks/system_creation.jl

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
using DynamicalSystemsBase
2+
using Base.Test, StaticArrays
3+
using DynamicalSystemsBase: CDS, DDS
4+
using DynamicalSystemsBase.Systems: hoop, hoop_jac, hiip, hiip_jac
5+
using DynamicalSystemsBase.Systems: loop, loop_jac, liip, liip_jac
6+
7+
u0 = [0, 10.0, 0]
8+
p = [10, 28, 8/3]
9+
u0h = zeros(2)
10+
ph = [1.4, 0.3]
11+
12+
FUNCTIONS = [liip, liip_jac, loop, loop_jac, hiip, hiip_jac, hoop, hoop_jac]
13+
INITCOD = [u0, u0h]
14+
PARAMS = [p, ph]
15+
16+
#######################################################################################
17+
# TIMINGS #
18+
#######################################################################################
19+
println("\nStarting timings (using @time)..")
20+
21+
println("\nAutodiff CDS (create/jacobian):")
22+
println("IIP")
23+
@time lip = CDS(liip, u0, p)
24+
jacobian(lip); @time jacobian(lip)
25+
println("OOP")
26+
@time lop = CDS(loop, u0, p)
27+
jacobian(lop); @time jacobian(lop)
28+
29+
println("\n CDS (create/jacobian):")
30+
println("IIP")
31+
@time lipjac = CDS(liip, u0, p, liip_jac)
32+
jacobian(lipjac); @time jacobian(lipjac)
33+
println("OOP")
34+
@time lopjac = CDS(loop, u0, p, loop_jac)
35+
jacobian(lopjac); @time jacobian(lopjac)
36+
37+
println("\nAutodiff DDS (create/jacobian):")
38+
println("IIP")
39+
@time hip = DDS(hiip, u0h, ph)
40+
jacobian(hip); @time jacobian(hip)
41+
println("OOP")
42+
@time hop = DDS(hoop, u0h, ph)
43+
jacobian(hop); @time jacobian(hop)
44+
45+
println("\nDDS (create/jacobian):")
46+
println("IIP")
47+
@time hipjac = DDS(hiip, u0h, ph, hiip_jac)
48+
jacobian(hipjac); @time jacobian(hipjac)
49+
println("OOP")
50+
@time hopjac = DDS(hoop, u0h, ph, hoop_jac)
51+
jacobian(hopjac); @time jacobian(hopjac)

src/DynamicalSystemsBase.jl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,12 @@ include("dataset.jl")
1010
include("reconstruction.jl")
1111
include("various.jl")
1212

13-
include("discrete.jl")
14-
include("continuous.jl")
15-
include("famous_systems.jl")
13+
include("dynamicalsystem/dynamicalsystem.jl")
14+
include("dynamicalsystem/discrete.jl")
15+
include("dynamicalsystem/continuous.jl")
16+
include("dynamicalsystem/famous_systems.jl")
17+
18+
include("deprecations.jl")
1619

1720
export Systems
1821

0 commit comments

Comments
 (0)